Counter Strike : Global Offensive Source Code
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.

290 lines
8.8 KiB

  1. //====== Copyright (C), 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. namespace GCSDK
  16. {
  17. #pragma pack( push, 8 ) // this is a 8 instead of a 1 to maintain backward compatibility with Steam
  18. enum EGCSystemMsg
  19. {
  20. k_EGCMsgInvalid = 0,
  21. k_EGCMsgMulti = 1,
  22. k_EGCMsgGenericReply = 10,
  23. k_EGCMsgSystemBase = 50,
  24. k_EGCMsgAchievementAwarded = 51,
  25. k_EGCMsgConCommand = 52, // A command from the GC's admin console
  26. k_EGCMsgStartPlaying = 53,
  27. k_EGCMsgStopPlaying = 54,
  28. k_EGCMsgStartGameserver = 55,
  29. k_EGCMsgStopGameserver = 56,
  30. k_EGCMsgWGRequest = 57,
  31. k_EGCMsgWGResponse = 58,
  32. k_EGCMsgGetUserGameStatsSchema = 59, // Gets the user game stats schema for the app
  33. k_EGCMsgGetUserGameStatsSchemaResponse = 60,
  34. k_EGCMsgGetUserStatsDEPRECATED = 61, // Gets user game stats for a user
  35. k_EGCMsgGetUserStatsResponse = 62,
  36. k_EGCMsgAppInfoUpdated = 63, // Message sent to the GC when there has been an AppInfo update
  37. k_EGCMsgValidateSession = 64, // Message sent by the GC when it wants to make sure a session exists
  38. k_EGCMsgValidateSessionResponse = 65, // Message sent to the GC in response to ValidateSession
  39. k_EGCMsgLookupAccountFromInput = 66, // Sent by the GC to lookup user. Reply is k_EGCMsgGenericReply
  40. k_EGCMsgSendHTTPRequest = 67, // Message sent by the GC to do a generic HTTP request
  41. k_EGCMsgSendHTTPRequestResponse = 68, // Response back to the GC with the results of the HTTP request
  42. k_EGCMsgPreTestSetup = 69, // Reset the GC database (usually for testing purposes)
  43. k_EGCMsgRecordSupportAction = 70, // Logs a support action
  44. k_EGCMsgGetAccountDetails = 71, // Requests the details for an account
  45. k_EGCMsgSendInterAppMessage = 72, // Sends a message to another app's GC
  46. k_EGCMsgReceiveInterAppMessage = 73, // Receives a message from another app's GC
  47. k_EGCMsgFindAccounts = 74, // queries the AMs for accounts by name
  48. k_EGCMsgPostAlert = 75, // posts an alert to Steam
  49. k_EGCMsgGetLicenses = 76, // asks Steam for the user's licenses
  50. k_EGCMsgGetUserStats = 77, // Gets user game stats for a user
  51. k_EGCMsgGetCommands = 78, // request for a list of commands from a gc console
  52. k_EGCMsgGetCommandsResponse = 79, // response with a list of commands for a gc console
  53. k_EGCMsgAddFreeLicense = 80, // request for for Steam to add a license to the specified free package
  54. k_EGCMsgAddFreeLicenseResponse = 81, // response with the result of the attempt to add a free license
  55. k_EGCMsgGetIPLocation = 82, // Get geolocation data for a specific IP
  56. k_EGCMsgGetIPLocationResponse = 83, // Geolocation response
  57. k_EGCMsgSystemStatsSchema = 84, // Message sent by the GC specifying what its stats schema is
  58. k_EGCMsgGetSystemStats = 85, // Message sent to the GC requesting its stats
  59. k_EGCMsgGetSystemStatsResponse = 86, // Message sent by the GC with its stats
  60. k_EGCMsgSendEmail = 87, // Sent by the GC to send an email to a user
  61. k_EGCMsgSendEmailResponse = 88, // Response with the result of the send request
  62. k_EGCMsgGetEmailTemplate = 89, // Sent to the GC to request an email template
  63. k_EGCMsgGetEmailTemplateResponse = 90, // Get email template response
  64. // web API calls
  65. k_EGCMsgWebAPIBase = 100,
  66. k_EGCMsgWebAPIRegisterInterfaces = k_EGCMsgWebAPIBase + 1, // sent once at startup to register APIs
  67. k_EGCMsgWebAPIJobRequest = k_EGCMsgWebAPIBase + 2, // sent when an actual request is made
  68. k_EGCMsgWebAPIRegistrationRequested = k_EGCMsgWebAPIBase + 3, // sent by the GC Host when it learns a web API server has started
  69. // Memcached
  70. k_EGCMsgMemCachedBase = 200, // Get key(s) from memcached
  71. k_EGCMsgMemCachedGet = k_EGCMsgMemCachedBase, // Get key(s) from memcached
  72. k_EGCMsgMemCachedGetResponse = k_EGCMsgMemCachedBase + 1, // Retrieved keys
  73. k_EGCMsgMemCachedSet = k_EGCMsgMemCachedBase + 2, // Set key(s) into memcached
  74. k_EGCMsgMemCachedDelete = k_EGCMsgMemCachedBase + 3, // Delete key(s) from memcached
  75. };
  76. // generic zero-length message struct
  77. struct MsgGCEmpty_t
  78. {
  79. };
  80. // k_EGCMsgAchievementAwarded
  81. struct MsgGCAchievementAwarded_t
  82. {
  83. uint16 m_usStatID;
  84. uint8 m_ubBit;
  85. // var data:
  86. // string data: name of achievement earned
  87. };
  88. // k_EGCMsgConCommand
  89. struct MsgGCConCommand_t
  90. {
  91. // var data:
  92. // string: the command as typed into the console
  93. };
  94. // k_EGCMsgStartPlaying
  95. struct MsgGCStartPlaying_t
  96. {
  97. CSteamID m_steamID;
  98. CSteamID m_steamIDGS;
  99. uint32 m_unServerAddr;
  100. uint16 m_usServerPort;
  101. };
  102. // k_EGCMsgStartPlaying
  103. // k_EGCMsgStopGameserver
  104. struct MsgGCStopSession_t
  105. {
  106. CSteamID m_steamID;
  107. };
  108. // k_EGCMsgStartGameserver
  109. struct MsgGCStartGameserver_t
  110. {
  111. CSteamID m_steamID;
  112. uint32 m_unServerAddr;
  113. uint16 m_usServerPort;
  114. };
  115. // k_EGCMsgWGRequest
  116. struct MsgGCWGRequest_t
  117. {
  118. uint64 m_ulSteamID; //SteamID of auth'd WG user
  119. uint32 m_unPrivilege; // The EGCWebApiPrivilege value that the request was made with
  120. uint32 m_cubKeyValues; // length of the key values data blob in message (starts after string request name data)
  121. // var data -
  122. // request name
  123. // binary key values of web request
  124. };
  125. // k_EGCMsgWGResponse
  126. struct MsgGCWGResponse_t
  127. {
  128. bool m_bResult; // True if the request was successful
  129. uint32 m_cubKeyValues; // length of the key values data blob in message
  130. // var data -
  131. // binary key values of web response
  132. };
  133. // k_EGCMsgGetUserGameStatsSchemaResponse
  134. struct MsgGetUserGameStatsSchemaResponse_t
  135. {
  136. bool m_bSuccess; // True is the request was successful
  137. // var data -
  138. // binary key values containing the User Game Stats schema
  139. };
  140. // k_EGCMsgGetUserStats
  141. struct MsgGetUserStats_t
  142. {
  143. uint64 m_ulSteamID; // SteamID the stats are requested for
  144. uint16 m_cStatIDs; // A count of the number of statIDs requested
  145. // var data -
  146. // Array of m_cStatIDs 16-bit StatIDs
  147. };
  148. // k_EGCMsgGetUserStatsResponse
  149. struct MsgGetUserStatsResponse_t
  150. {
  151. uint64 m_ulSteamID; // SteamID the stats were requested for
  152. bool m_bSuccess; // True is the request was successful
  153. uint16 m_cStats; // Number of stats returned in the message
  154. // var data -
  155. // m_cStats instances of:
  156. // uint16 usStatID - Stat ID
  157. // uint32 unData - Stat value
  158. };
  159. // k_EGCMsgValidateSession
  160. struct MsgGCValidateSession_t
  161. {
  162. uint64 m_ulSteamID; // SteamID to validate
  163. };
  164. // k_EGCMsgValidateSessionResponse
  165. struct MsgGCValidateSessionResponse_t
  166. {
  167. uint64 m_ulSteamID;
  168. uint64 m_ulSteamIDGS;
  169. uint32 m_unServerAddr;
  170. uint16 m_usServerPort;
  171. bool m_bOnline;
  172. };
  173. // response to k_EGCMsgLookupAccountFromInput
  174. struct MsgGCLookupAccountResponse
  175. {
  176. uint64 m_ulSteamID;
  177. };
  178. // k_EGCMsgSendHTTPRequest
  179. struct MsgGCSendHTTPRequest_t
  180. {
  181. // Variable data:
  182. // - Serialized CHTTPRequest
  183. };
  184. // k_EGCMsgSendHTTPRequestResponse
  185. struct MsgGCSendHTTPRequestResponse_t
  186. {
  187. bool m_bCompleted;
  188. // Variable data:
  189. // - if m_bCompleted is true, Serialized CHTTPResponse
  190. };
  191. // k_EGCMsgRecordSupportAction
  192. struct MsgGCRecordSupportAction_t
  193. {
  194. uint32 m_unAccountID; // which account is affected (object)
  195. uint32 m_unActorID; // who made the change (subject)
  196. // Variable data:
  197. // - string - Custom data for the event
  198. // - string - A note with the reason for the change
  199. };
  200. // k_EGCMsgWebAPIRegisterInterfaces
  201. struct MsgGCWebAPIRegisterInterfaces_t
  202. {
  203. uint32 m_cInterfaces;
  204. // Variable data:
  205. // - KeyValues for interface - one per interface
  206. };
  207. // k_EGCMsgGetAccountDetails
  208. struct MsgGCGetAccountDetails_t
  209. {
  210. uint64 m_ulSteamID; // SteamID to validate
  211. };
  212. // k_EGCMsgSendInterAppMessage
  213. // k_EGCMsgReceiveInterAppMessage
  214. struct MsgGCInterAppMessage_t
  215. {
  216. AppId_t m_unAppID;
  217. // Variable data:
  218. // The message to send. Both GCs need to agree on the protocol
  219. };
  220. // Used by k_EGCMsgFindAccounts
  221. enum EAccountFindType
  222. {
  223. k_EFindAccountTypeInvalid = 0,
  224. k_EFindAccountTypeAccountName = 1,
  225. k_EFindAccountTypeEmail,
  226. k_EFindAccountTypePersonaName,
  227. k_EFindAccountTypeURL,
  228. k_EFindAccountTypeAllOnline,
  229. k_EFindAccountTypeAll,
  230. k_EFindClanTypeClanName,
  231. k_EFindClanTypeURL,
  232. k_EFindClanTypeOfficialURL,
  233. k_EFindClanTypeAppID,
  234. };
  235. extern void InitGCSystemMessageTypes();
  236. } // namespace GCSDK
  237. #pragma pack( pop )
  238. #endif // GCSYSTEMMSGS_H