Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
4.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This file defines all of our over-the-wire net protocols for the
  4. // Game Coordinator for Team Fortress. Note that we never use types
  5. // with undefined length (like int). Always use an explicit type
  6. // (like int32).
  7. //
  8. //=============================================================================
  9. #ifndef TF_GCMESSAGES_H
  10. #define TF_GCMESSAGES_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "language.h"
  15. #include "gcsdk/gcsystemmsgs.h"
  16. // Protobuf headers interfere with the valve min/max/malloc overrides. so we need to do all
  17. // this funky wrapping to make the include happy.
  18. #include <tier0/valve_minmax_off.h>
  19. #include "tf_gcmessages.pb.h"
  20. #ifdef GC
  21. #include "tf_gcmessages_interserver.pb.h" // These should not be exposed to clients/servers
  22. #endif // #ifdef GC
  23. #include <tier0/valve_minmax_on.h>
  24. #pragma pack( push, 1 )
  25. //-----------------------------------------------------------------------------
  26. // Type IDs for TF GC classes. These are part of the client-GC protocol and
  27. // should not change if it can be helped
  28. //-----------------------------------------------------------------------------
  29. enum EGCTFProtoObjectTypes
  30. {
  31. k_EProtoObjectTypesGameBase = 2000,
  32. // k_EProtoObjectHeroStandings = k_EProtoObjectTypesGameBase + 1,
  33. // k_EProtoObjectGameAccountClient = k_EProtoObjectTypesGameBase + 2,
  34. k_EProtoObjectTFParty = k_EProtoObjectTypesGameBase + 3,
  35. k_EProtoObjectTFGameServerLobby = k_EProtoObjectTypesGameBase + 4,
  36. // k_EProtoObjectBetaParticipation = k_EProtoObjectTypesGameBase + 5,
  37. k_EProtoObjectTFPartyInvite = k_EProtoObjectTypesGameBase + 6,
  38. k_EProtoObjectTFRatingData = k_EProtoObjectTypesGameBase + 7,
  39. };
  40. //=============================================================================
  41. // Duel
  42. // k_EMsgGC_Duel_Request
  43. struct MsgGC_Duel_Request_t
  44. {
  45. uint64 m_ulInitiatorSteamID;
  46. uint64 m_ulTargetSteamID;
  47. uint8 m_usAsPlayerClass;
  48. };
  49. // k_EMsgGC_Duel_Response
  50. struct MsgGC_Duel_Response_t
  51. {
  52. uint64 m_ulInitiatorSteamID;
  53. uint64 m_ulTargetSteamID;
  54. bool m_bAccepted;
  55. uint8 m_usAsPlayerClass;
  56. };
  57. // k_EMsgGC_Duel_Results
  58. struct MsgGC_Duel_Results_t
  59. {
  60. uint64 m_ulInitiatorSteamID;
  61. uint64 m_ulTargetSteamID;
  62. uint64 m_ulWinnerSteamID;
  63. uint16 m_usScoreInitiator;
  64. uint16 m_usScoreTarget;
  65. uint8 m_usEndReason;
  66. };
  67. // k_EMsgGC_Duel_Status
  68. enum EGCDuelStatus
  69. {
  70. kDuel_Status_Invalid = -1,
  71. kDuel_Status_AlreadyInDuel_Inititator,
  72. kDuel_Status_AlreadyInDuel_Target,
  73. kDuel_Status_DuelBanned_Initiator,
  74. kDuel_Status_DuelBanned_Target,
  75. kDuel_Status_MissingSession, // could be gameserver session or target client session
  76. kDuel_Status_Cancelled,
  77. };
  78. struct MsgGC_Duel_Status_t
  79. {
  80. uint8 m_usStatus;
  81. uint64 m_ulInitiatorSteamID;
  82. uint64 m_ulTargetSteamID;
  83. };
  84. //=============================================================================
  85. // k_EMsgGC_MM_RequestMatch
  86. struct MsgGC_MM_RequestMatch_t
  87. {
  88. uint32 m_unRequiredGameServerFlags;
  89. // string with map name
  90. };
  91. // k_EMsgGC_MM_RequestMatchResponse
  92. struct MsgGC_MM_RequestMatchResponse_t
  93. {
  94. bool m_bServerFound;
  95. uint32 m_iServerAddress;
  96. uint16 m_iServerPort;
  97. };
  98. // k_EMsgGC_MM_ReserveSpot
  99. struct MsgGC_MM_ReserveSpot_t
  100. {
  101. uint64 m_ulSteamID;
  102. };
  103. // k_EMsgGC_MM_LoadMap
  104. struct MsgGC_MM_LoadMap_t
  105. {
  106. // string with map name
  107. };
  108. struct MsgGCChatMessage_t
  109. {
  110. // string sChannelName
  111. // string sPersonaName
  112. int32 m_cMsgLen;
  113. // binary message
  114. };
  115. //=============================================================================
  116. // do not re-order, stored in DB
  117. enum
  118. {
  119. kVoteKickBanPlayerReason_Other,
  120. kVoteKickBanPlayerReason_Cheating,
  121. kVoteKickBanPlayerReason_Idle,
  122. kVoteKickBanPlayerReason_Scamming,
  123. };
  124. uint32 GetKickBanPlayerReason( const char *pReasonString );
  125. //=============================================================================
  126. #pragma pack( pop )
  127. // Normal:
  128. #define MATCHMAKING_SPEWLEVEL4 4
  129. #define MATCHMAKING_SPEWLEVEL3 4
  130. #define MATCHMAKING_SPEWLEVEL2 2
  131. // Use these defines to crank up the spew level
  132. //#define MATCHMAKING_SPEWLEVEL4 1
  133. //#define MATCHMAKING_SPEWLEVEL3 1
  134. //#define MATCHMAKING_SPEWLEVEL2 1
  135. #endif