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.

345 lines
7.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. // Game Coordinator for the item system. Note that we never use types
  5. // with undefined length (like int). Always use an explicit type
  6. // (like int32).
  7. //
  8. //=============================================================================
  9. #ifndef ITEM_GCMESSAGES_H
  10. #define ITEM_GCMESSAGES_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "econ_gcmessages.pb.h"
  15. #pragma pack( push, 1 )
  16. // generic zero-length message struct
  17. struct MsgGCEmpty_t
  18. {
  19. };
  20. // k_EMsgGCSetItemPosition
  21. struct MsgGCSetItemPosition_t
  22. {
  23. uint64 m_unItemID;
  24. uint32 m_unNewPosition;
  25. };
  26. // k_EMsgGCCraft
  27. struct MsgGCCraft_t
  28. {
  29. int16 m_nRecipeDefIndex;
  30. uint16 m_nItemCount;
  31. // list of m_nItemCount uint64 item IDs
  32. };
  33. // k_EMsgGCDelete
  34. struct MsgGCDelete_t
  35. {
  36. uint64 m_unItemID;
  37. };
  38. // k_EMsgGCCraftResponse
  39. struct MsgGCStandardResponse_t
  40. {
  41. int16 m_nResponseIndex;
  42. uint32 m_eResponse;
  43. };
  44. // k_EMsgGCVerifyCacheSubscription
  45. struct MsgGCVerifyCacheSubscription_t
  46. {
  47. uint64 m_ulSteamID;
  48. };
  49. // k_EMsgGCNameItem
  50. struct MsgGCNameItem_t
  51. {
  52. uint64 m_unToolItemID; // the Nametag item
  53. uint64 m_unSubjectItemID; // the item to be renamed
  54. bool m_bDescription;
  55. // Varchar: Item name
  56. };
  57. // k_EMsgGCNameBaseItem
  58. struct MsgGCNameBaseItem_t
  59. {
  60. uint64 m_unToolItemID; // the Nametag item
  61. uint32 m_unBaseItemDefinitionID; // the base item definition to be renamed
  62. bool m_bDescription;
  63. // Varchar: Item name
  64. };
  65. // k_EMsgGCUnlockCrate
  66. struct MsgGCUnlockCrate_t
  67. {
  68. uint64 m_unToolItemID; // the crate key
  69. uint64 m_unSubjectItemID; // the crate to be decoded
  70. };
  71. // k_EMsgGCPaintItem
  72. struct MsgGCPaintItem_t
  73. {
  74. uint64 m_unToolItemID; // the Paint Can item
  75. uint64 m_unSubjectItemID; // the item to be painted
  76. };
  77. // k_EMsgGCGiftWrapItem
  78. struct MsgGCGiftWrapItem_t
  79. {
  80. uint64 m_unToolItemID; // the Gift Wrap item
  81. uint64 m_unSubjectItemID; // the item to be wrapped
  82. };
  83. // k_EMsgGCDeliverGift
  84. struct MsgGCDeliverGift_t
  85. {
  86. uint64 m_unGiftID;
  87. uint64 m_ulGiverSteamID;
  88. uint64 m_ulTargetSteamID;
  89. };
  90. // k_EMsgGCUnwrapGiftRequest
  91. struct MsgGCUnwrapGiftRequest_t
  92. {
  93. uint64 m_unItemID;
  94. };
  95. // k_EMsgGCMOTDRequest
  96. struct MsgGCMOTDRequest_t
  97. {
  98. RTime32 m_nLastMOTDRequest; // Time at which the client last asked for MOTDs. GC will send back all MOTDs posted since.
  99. int16 m_eLanguage;
  100. };
  101. // k_EMsgGCMOTDRequestResponse
  102. struct MsgGCMOTDRequestResponse_t
  103. {
  104. int16 m_nEntries;
  105. };
  106. // k_EMsgGCCustomizeItemTexture
  107. struct MsgGCCustomizeItemTexture_t
  108. {
  109. uint64 m_unToolItemID; // the tool
  110. uint64 m_unSubjectItemID; // the item wants the texture
  111. uint64 m_unImageUGCHandle; // cloud ID of image file (UGCHandle_t)
  112. };
  113. // k_EMsgGCSetItemStyle
  114. struct MsgGCSetItemStyle_t
  115. {
  116. uint64 m_unItemID;
  117. uint8 m_iStyle;
  118. };
  119. // k_EMsgGCItemPreviewCheckStatus
  120. struct MsgGCCheckItemPreviewStatus_t
  121. {
  122. uint32 m_unItemDefIndex;
  123. };
  124. // k_EMsgGCItemPreviewCheckStatusResponse
  125. struct MsgGCItemPreviewCheckStatusResponse_t
  126. {
  127. uint32 m_unItemDefIndex;
  128. uint32 m_eResponse;
  129. RTime32 m_timePreviewTime;
  130. };
  131. // k_EMsgGCItemPreviewRequest
  132. struct MsgGCItemPreviewRequest_t
  133. {
  134. uint32 m_unItemDefIndex;
  135. };
  136. // k_EMsgGCItemPreviewRequestResponse
  137. struct MsgGCItemPreviewRequestResponse_t
  138. {
  139. uint32 m_unItemDefIndex;
  140. uint32 m_eResponse;
  141. };
  142. // k_EMsgGCItemPreviewExpire
  143. struct MsgGCItemPreviewExpire_t
  144. {
  145. };
  146. // k_EMsgGCItemPreviewExpireNotification
  147. struct MsgGCItemPreviewExpireNotification_t
  148. {
  149. uint32 m_unItemDefIndex;
  150. };
  151. //-----------------------------------------------------------------------------
  152. // k_EMsgGCUseItemResponse
  153. enum EGCMsgUseItemResponse
  154. {
  155. k_EGCMsgUseItemResponse_ItemUsed = 0,
  156. k_EGCMsgUseItemResponse_GiftNoOtherPlayers = 1,
  157. k_EGCMsgUseItemResponse_ServerError = 2,
  158. k_EGCMsgUseItemResponse_MiniGameAlreadyStarted = 3,
  159. k_EGCMsgUseItemResponse_ItemUsed_ItemsGranted = 4,
  160. k_EGCMsgUseItemResponse_CannotBeUsedByAccount = 5,
  161. k_EGCMsgUseItemResponse_ForceSizeInt = 0x7FFFFFFF
  162. };
  163. // k_EMsgGCUseItemResponse
  164. struct MsgGCUseItemResponse_t
  165. {
  166. uint32 m_eResponse;
  167. };
  168. // k_EMsgGCSpawnItem
  169. struct MsgGCSpawnItem_t
  170. {
  171. uint64 m_ulInitiatorSteamID;
  172. uint32 m_unItemDefinitionID;
  173. // other data dynamically added:
  174. // string of initiator name
  175. };
  176. // k_EMsgGCRespawnPostLoadoutChange
  177. struct MsgGCRespawnPostLoadoutChange_t
  178. {
  179. uint64 m_ulInitiatorSteamID;
  180. };
  181. // k_EMsgGCRemoveItemName
  182. struct MsgGCRemoveItemName_t
  183. {
  184. uint64 m_unItemID;
  185. bool m_bDescription;
  186. };
  187. //-----------------------------------------------------------------------------
  188. // Trading
  189. // k_EMsgGCTrading_InitiateTradeRequest
  190. struct MsgGCTrading_InitiateTradeRequest_t
  191. {
  192. uint32 m_unTradeRequestID;
  193. uint64 m_ulOtherSteamID;
  194. // @note player A's name as string when sent to party B
  195. };
  196. enum EGCMsgInitiateTradeResponse
  197. {
  198. k_EGCMsgInitiateTradeResponse_Accepted = 0,
  199. k_EGCMsgInitiateTradeResponse_Declined = 1,
  200. k_EGCMsgInitiateTradeResponse_VAC_Banned_Initiator = 2,
  201. k_EGCMsgInitiateTradeResponse_VAC_Banned_Target = 3,
  202. k_EGCMsgInitiateTradeResponse_Target_Already_Trading = 4,
  203. k_EGCMsgInitiateTradeResponse_Disabled = 5,
  204. k_EGCMsgInitiateTradeResponse_NotLoggedIn = 6,
  205. k_EGCMsgInitiateTradeResponse_Cancel = 7,
  206. k_EGCMsgInitiateTradeResponse_TooSoon = 8,
  207. k_EGCMsgInitiateTradeResponse_TooSoonPenalty = 9,
  208. k_EGCMsgInitiateTradeResponse_Trade_Banned_Initiator = 10,
  209. k_EGCMsgInitiateTradeResponse_Trade_Banned_Target = 11,
  210. k_EGCMsgInitiateTradeResponse_Free_Account_Initiator_DEPRECATED = 12, // free accounts can initiate trades now
  211. k_EGCMsgInitiateTradeResponse_Shared_Account_Initiator= 13,
  212. k_EGCMsgInitiateTradeResponse_Service_Unavailable = 14,
  213. k_EGCMsgInitiateTradeResponse_Target_Blocked = 15,
  214. k_EGCMsgInitiateTradeResponse_NeedVerifiedEmail = 16,
  215. k_EGCMsgInitiateTradeResponse_NeedSteamGuard = 17,
  216. k_EGCMsgInitiateTradeResponse_SteamGuardDuration = 18,
  217. k_EGCMsgInitiateTradeResponse_TheyCannotTrade = 19,
  218. k_EGCMsgInitiateTradeResponse_Recent_Password_Reset = 20,
  219. k_EGCMsgInitiateTradeResponse_Using_New_Device = 21,
  220. k_EGCMsgInitiateTradeResponse_Sent_Invalid_Cookie = 22,
  221. k_EGCMsgInitiateTradeResponse_Count,
  222. k_EGCMsgInitiateTradeResponse_ForceSizeInt = 0x7FFFFFFF
  223. };
  224. // k_EMsgGCTrading_InitiateTradeResponse
  225. struct MsgGCTrading_InitiateTradeResponse_t
  226. {
  227. uint32 m_eResponse;
  228. uint32 m_unTradeRequestID;
  229. };
  230. // k_EMsgGCTrading_StartSession
  231. struct MsgGCTrading_StartSession_t
  232. {
  233. uint32 m_unSessionVersion;
  234. uint64 m_ulSteamIDPartyA;
  235. uint64 m_ulSteamIDPartyB;
  236. // @note strings from player names will be added to the message
  237. };
  238. // k_EMsgGCTrading_CancelSession
  239. struct MsgGCTrading_CancelSession_t
  240. {
  241. };
  242. // k_EMsgGCUsedClaimCodeItem
  243. struct MsgGCUsedClaimCodeItem_t
  244. {
  245. // string of URL
  246. };
  247. //-----------------------------------------------------------------------------
  248. // ServerBrowser messages
  249. enum EGCMsgServerBrowser
  250. {
  251. k_EGCMsgServerBrowser_FromServerBrowser = 0,
  252. k_EGCMsgServerBrowser_FromAutoAskDialog = 1,
  253. };
  254. // k_EMsgGCServerBrowser_FavoriteServer
  255. // k_EMsgGCServerBrowser_BlacklistServer
  256. struct MsgGCServerBrowser_Server_t
  257. {
  258. uint32 m_unIP;
  259. int m_usPort;
  260. uint8 m_ubSource; // 0=serverbrowser, 1=auto-ask dialog
  261. };
  262. //-----------------------------------------------------------------------------
  263. // Public facing loot lists.
  264. // k_EMsgGC_RevolvingLootList
  265. struct MsgGC_RevolvingLootList_t
  266. {
  267. uint8 m_usListID; // Id of this list.
  268. // Var Data:
  269. // Serialized Lootlist KV
  270. };
  271. // k_EMsgGCLookupAccount
  272. struct MsgGCLookupAccount_t
  273. {
  274. uint16 m_uiFindType;
  275. // Var Data
  276. // string containing Persona / URL / etc
  277. };
  278. // k_EMsgGCLookupAccountName
  279. struct MsgGCLookupAccountName_t
  280. {
  281. uint32 m_unAccountID;
  282. };
  283. // k_EMsgGCLookupAccountNameResponse
  284. struct MsgGCLookupAccountNameResponse_t
  285. {
  286. uint32 m_unAccountID;
  287. // string containing persona name
  288. };
  289. #pragma pack( pop )
  290. #endif