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.

216 lines
4.7 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. // global system messages used by the GC. These are usually sent by
  5. // the GC Host so be very careful of versioning issues when you consider
  6. // changing them. Note that we never use types with undefined length
  7. // (like int). Always use an explicit type (like int32).
  8. //
  9. //=============================================================================
  10. #ifndef GCSYSTEMMSGS_H
  11. #define GCSYSTEMMSGS_H
  12. #ifdef _WIN32
  13. #pragma once
  14. #endif
  15. // Protobuf headers interfere with the valve min/max/malloc overrides. so we need to do all
  16. // this funky wrapping to make the include happy.
  17. #include <tier0/valve_minmax_off.h>
  18. #include "gcsystemmsgs.pb.h"
  19. #include <tier0/valve_minmax_on.h>
  20. namespace GCSDK
  21. {
  22. #pragma pack( push, 8 ) // this is a 8 instead of a 1 to maintain backward compatibility with Steam
  23. // generic zero-length message struct
  24. struct MsgGCEmpty_t
  25. {
  26. };
  27. // k_EGCMsgAchievementAwarded
  28. struct MsgGCAchievementAwarded_t
  29. {
  30. uint16 m_usStatID;
  31. uint8 m_ubBit;
  32. // var data:
  33. // string data: name of achievement earned
  34. };
  35. // k_EGCMsgConCommand
  36. struct MsgGCConCommand_t
  37. {
  38. // var data:
  39. // string: the command as typed into the console
  40. };
  41. // k_EGCMsgStartPlaying
  42. struct MsgGCStartPlaying_t
  43. {
  44. CSteamID m_steamID;
  45. CSteamID m_steamIDGS;
  46. uint32 m_unServerAddr;
  47. uint16 m_usServerPort;
  48. };
  49. // k_EGCMsgStartPlaying
  50. // k_EGCMsgStopGameserver
  51. struct MsgGCStopSession_t
  52. {
  53. CSteamID m_steamID;
  54. };
  55. // k_EGCMsgStartGameserver
  56. struct MsgGCStartGameserver_t
  57. {
  58. CSteamID m_steamID;
  59. uint32 m_unServerAddr;
  60. uint16 m_usServerPort;
  61. };
  62. // k_EGCMsgWGRequest
  63. struct MsgGCWGRequest_t
  64. {
  65. uint64 m_ulSteamID; //SteamID of auth'd WG user
  66. uint32 m_unPrivilege; // The EGCWebApiPrivilege value that the request was made with
  67. uint32 m_cubKeyValues; // length of the key values data blob in message (starts after string request name data)
  68. // var data -
  69. // request name
  70. // binary key values of web request
  71. };
  72. // k_EGCMsgWGResponse
  73. struct MsgGCWGResponse_t
  74. {
  75. bool m_bResult; // True if the request was successful
  76. uint32 m_cubKeyValues; // length of the key values data blob in message
  77. // var data -
  78. // binary key values of web response
  79. };
  80. // k_EGCMsgGetUserGameStatsSchemaResponse
  81. struct MsgGetUserGameStatsSchemaResponse_t
  82. {
  83. bool m_bSuccess; // True is the request was successful
  84. // var data -
  85. // binary key values containing the User Game Stats schema
  86. };
  87. // k_EGCMsgGetUserStats
  88. struct MsgGetUserStats_t
  89. {
  90. uint64 m_ulSteamID; // SteamID the stats are requested for
  91. uint16 m_cStatIDs; // A count of the number of statIDs requested
  92. // var data -
  93. // Array of m_cStatIDs 16-bit StatIDs
  94. };
  95. // k_EGCMsgGetUserStatsResponse
  96. struct MsgGetUserStatsResponse_t
  97. {
  98. uint64 m_ulSteamID; // SteamID the stats were requested for
  99. bool m_bSuccess; // True is the request was successful
  100. uint16 m_cStats; // Number of stats returned in the message
  101. // var data -
  102. // m_cStats instances of:
  103. // uint16 usStatID - Stat ID
  104. // uint32 unData - Stat value
  105. };
  106. // k_EGCMsgValidateSession
  107. struct MsgGCValidateSession_t
  108. {
  109. uint64 m_ulSteamID; // SteamID to validate
  110. };
  111. // k_EGCMsgValidateSessionResponse
  112. struct MsgGCValidateSessionResponse_t
  113. {
  114. uint64 m_ulSteamID;
  115. uint64 m_ulSteamIDGS;
  116. uint32 m_unServerAddr;
  117. uint16 m_usServerPort;
  118. bool m_bOnline;
  119. };
  120. // response to k_EGCMsgLookupAccountFromInput
  121. struct MsgGCLookupAccountResponse
  122. {
  123. uint64 m_ulSteamID;
  124. };
  125. // k_EGCMsgSendHTTPRequest
  126. struct MsgGCSendHTTPRequest_t
  127. {
  128. // Variable data:
  129. // - Serialized CHTTPRequest
  130. };
  131. // k_EGCMsgSendHTTPRequestResponse
  132. struct MsgGCSendHTTPRequestResponse_t
  133. {
  134. bool m_bCompleted;
  135. // Variable data:
  136. // - if m_bCompleted is true, Serialized CHTTPResponse
  137. };
  138. // k_EGCMsgRecordSupportAction
  139. struct MsgGCRecordSupportAction_t
  140. {
  141. uint32 m_unAccountID; // which account is affected (object)
  142. uint32 m_unActorID; // who made the change (subject)
  143. // Variable data:
  144. // - string - Custom data for the event
  145. // - string - A note with the reason for the change
  146. };
  147. // k_EGCMsgWebAPIRegisterInterfaces
  148. struct MsgGCWebAPIRegisterInterfaces_t
  149. {
  150. uint32 m_cInterfaces;
  151. // Variable data:
  152. // - KeyValues for interface - one per interface
  153. };
  154. // k_EGCMsgGetAccountDetails
  155. struct MsgGCGetAccountDetails_t
  156. {
  157. uint64 m_ulSteamID; // SteamID to validate
  158. };
  159. // Used by k_EGCMsgFindAccounts
  160. enum EAccountFindType
  161. {
  162. k_EFindAccountTypeInvalid = 0,
  163. k_EFindAccountTypeAccountName = 1,
  164. k_EFindAccountTypeEmail,
  165. k_EFindAccountTypePersonaName,
  166. k_EFindAccountTypeURL,
  167. k_EFindAccountTypeAllOnline,
  168. k_EFindAccountTypeAll,
  169. k_EFindClanTypeClanName,
  170. k_EFindClanTypeURL,
  171. k_EFindClanTypeOfficialURL,
  172. k_EFindClanTypeAppID,
  173. };
  174. } // namespace GCSDK
  175. #pragma pack( pop )
  176. #endif // GCSYSTEMMSGS_H