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.

492 lines
12 KiB

  1. //====== Copyright 1996-2010, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: The file defines our Google Protocol Buffers which are used in over
  4. // the wire messages between servers as well as between the TF GC and TF gameservers
  5. // and clients.
  6. //
  7. //=============================================================================
  8. // We care more about speed than code size
  9. option optimize_for = SPEED;
  10. // We don't use the service generation functionality
  11. option cc_generic_services = false;
  12. //
  13. // STYLE NOTES:
  14. //
  15. // Use CamelCase CMsgMyMessageName style names for messages.
  16. //
  17. // Use lowercase _ delimited names like my_steam_id for field names, this is non-standard for Steam,
  18. // but plays nice with the Google formatted code generation.
  19. //
  20. // Try not to use required fields ever. Only do so if you are really really sure you'll never want them removed.
  21. // Optional should be preffered as it will make versioning easier and cleaner in the future if someone refactors
  22. // your message and wants to remove or rename fields.
  23. //
  24. // Use fixed64 for JobId_t, GID_t, or SteamID. This is appropriate for any field that is normally
  25. // going to be larger than 2^56. Otherwise use int64 for 64 bit values that are frequently smaller
  26. // than 2^56 as it will safe space on the wire in those cases.
  27. //
  28. // Similar to fixed64, use fixed32 for RTime32 or other 32 bit values that are frequently larger than
  29. // 2^28. It will save space in those cases, otherwise use int32 which will safe space for smaller values.
  30. // An exception to this rule for RTime32 is if the value will frequently be zero rather than set to an actual
  31. // time.
  32. //
  33. import "steammessages_ps3.proto";
  34. // Shared objects
  35. //
  36. // CSOPartyInvite - sent from the GC to possible new party member
  37. //
  38. message CSOPartyInvite
  39. {
  40. optional uint64 group_id = 1;
  41. optional fixed64 sender_id = 2;
  42. optional string sender_name = 3;
  43. };
  44. // Sent from the GC to possible new lobby member
  45. //
  46. message CSOLobbyInvite
  47. {
  48. optional uint64 group_id = 1;
  49. optional fixed64 sender_id = 2;
  50. optional string sender_name = 3;
  51. // TODO: Game mode, etc.
  52. };
  53. //
  54. // CMsgSystemBroadcast
  55. //
  56. message CMsgSystemBroadcast
  57. {
  58. optional string message = 1; // the message to display on the client
  59. };
  60. //
  61. // CMsgInviteToParty - sent from party leader to the GC
  62. //
  63. message CMsgInviteToParty
  64. {
  65. optional fixed64 steam_id = 1;
  66. };
  67. //
  68. // CMsgInvitationCreated - sent from GC to the party leader
  69. //
  70. message CMsgInvitationCreated
  71. {
  72. optional uint64 group_id = 1;
  73. optional fixed64 steam_id = 2;
  74. };
  75. //
  76. // CMsgPartyInviteResponse - sent from client to GC when accepting/rejecting a CMsgPartyInvite
  77. //
  78. message CMsgPartyInviteResponse
  79. {
  80. optional uint64 party_id = 1;
  81. optional bool accept = 2;
  82. };
  83. //
  84. // CMsgKickFromParty - sent from party leader to the GC
  85. //
  86. message CMsgKickFromParty
  87. {
  88. optional fixed64 steam_id = 1;
  89. };
  90. //
  91. // CMsgLeaveParty - sent from party member to the GC
  92. //
  93. message CMsgLeaveParty
  94. {
  95. };
  96. //
  97. // CMsgGameServerInfo - server address information
  98. //
  99. message CMsgGameServerInfo
  100. {
  101. optional fixed32 server_public_ip_addr = 1;
  102. optional fixed32 server_private_ip_addr = 2;
  103. optional uint32 server_port = 3;
  104. optional uint32 server_tv_port = 4;
  105. optional string server_key = 5;
  106. optional bool server_hibernation = 6;
  107. enum ServerType
  108. {
  109. UNSPECIFIED = 0; // We haven't received the type yet
  110. GAME = 1; // Game server
  111. PROXY = 2; // Source TV proxy relay
  112. CONTROLLER = 3; // Game server/proxy controller/spawner
  113. }
  114. optional ServerType server_type = 7 [ default = UNSPECIFIED ];
  115. optional uint32 server_region = 8; // Region value that matches regions.txt in the GC
  116. };
  117. //
  118. // CMsgServerAvailable - send from a dedicated server to the GC to indicate availability
  119. //
  120. message CMsgServerAvailable
  121. {
  122. };
  123. //
  124. // Used by CEconGameAccountClient
  125. //
  126. message CSOEconGameAccountClient
  127. {
  128. optional uint32 additional_backpack_slots = 1 [ default = 0 ]; // the number of backpack slots this user has on top of DEFAULT_NUM_BACKPACK_SLOTS
  129. optional bool trial_account = 2 [ default = false ];
  130. optional bool eligible_for_online_play = 3 [ default = true ];
  131. optional bool need_to_choose_most_helpful_friend = 4;
  132. optional bool in_coaches_list = 5;
  133. optional fixed32 trade_ban_expiration = 6;
  134. optional fixed32 duel_ban_expiration = 7;
  135. optional uint32 preview_item_def = 8 [ default = 0 ];
  136. };
  137. //
  138. // Used by CEconCraftingRecipe
  139. //
  140. message CSOItemCriteriaCondition
  141. {
  142. optional int32 op = 1;
  143. optional string field = 2;
  144. optional bool required = 3;
  145. optional float float_value = 4;
  146. optional string string_value = 5;
  147. }
  148. message CSOItemCriteria
  149. {
  150. optional uint32 item_level = 1;
  151. optional int32 item_quality = 2;
  152. optional bool item_level_set = 3;
  153. optional bool item_quality_set = 4;
  154. optional uint32 initial_inventory = 5;
  155. optional uint32 initial_quantity = 6;
  156. optional bool forced_quality_match = 7;
  157. optional bool ignore_enabled_flag = 8;
  158. repeated CSOItemCriteriaCondition conditions = 9;
  159. };
  160. message CSOItemRecipe
  161. {
  162. optional uint32 def_index = 1;
  163. optional string name = 2;
  164. optional string n_a = 3;
  165. optional string desc_inputs = 4;
  166. optional string desc_outputs = 5;
  167. optional string di_a = 6;
  168. optional string di_b = 7;
  169. optional string di_c = 8;
  170. optional string do_a = 9;
  171. optional string do_b = 10;
  172. optional string do_c = 11;
  173. optional bool requires_all_same_class = 12;
  174. optional bool requires_all_same_slot = 13;
  175. optional int32 class_usage_for_output = 14;
  176. optional int32 slot_usage_for_output = 15;
  177. optional int32 set_for_output = 16;
  178. repeated CSOItemCriteria input_items_criteria = 20;
  179. repeated CSOItemCriteria output_items_criteria = 21;
  180. repeated uint32 input_item_dupe_counts = 22;
  181. };
  182. //
  183. // k_EMsgGCDev_NewItemRequest
  184. //
  185. message CMsgDevNewItemRequest
  186. {
  187. //using fixed64 since steamids have lots of entropy in their bits
  188. optional fixed64 receiver = 1;
  189. optional CSOItemCriteria criteria = 2;
  190. };
  191. //
  192. // k_EMsgGCIncrementKillCountAttribute
  193. //
  194. message CMsgIncrementKillCountAttribute
  195. {
  196. optional uint64 killer_steam_id = 1;
  197. optional uint64 victim_steam_id = 2;
  198. optional uint64 item_id = 3;
  199. optional uint32 event_type = 4;
  200. };
  201. //
  202. // Used by CEconItem
  203. //
  204. message CSOEconItemAttribute
  205. {
  206. optional uint32 def_index = 1;
  207. optional uint32 value = 2;
  208. }
  209. message CSOEconItemEquipped
  210. {
  211. optional uint32 new_class = 1;
  212. optional uint32 new_slot = 2;
  213. }
  214. message CSOEconItem
  215. {
  216. optional uint64 id = 1;
  217. optional uint32 account_id = 2;
  218. optional uint32 inventory = 3;
  219. optional uint32 def_index = 4;
  220. optional uint32 quantity = 5;
  221. optional uint32 level = 6;
  222. optional uint32 quality = 7;
  223. optional uint32 flags = 8 [ default = 0 ];
  224. optional uint32 origin = 9;
  225. optional string custom_name = 10;
  226. optional string custom_desc = 11;
  227. repeated CSOEconItemAttribute attribute = 12;
  228. optional CSOEconItem interior_item = 13;
  229. optional bool in_use = 14 [ default = false ];
  230. optional uint32 style = 15 [default = 0 ];
  231. optional uint64 original_id = 16 [ default = 0 ];
  232. optional bool contains_equipped_state = 17;
  233. repeated CSOEconItemEquipped equipped_state = 18;
  234. }
  235. //
  236. // k_EMsgGCAdjustItemEquippedState
  237. //
  238. message CMsgAdjustItemEquippedState
  239. {
  240. optional uint64 item_id = 1;
  241. optional uint32 new_class = 2;
  242. optional uint32 new_slot = 3; // will be -1 if not equipped on this class any longer
  243. }
  244. //
  245. // k_EMsgGCSortItems
  246. //
  247. message CMsgSortItems
  248. {
  249. optional uint32 sort_type = 1;
  250. }
  251. //
  252. // Used by CEconClaimCode
  253. //
  254. message CSOEconClaimCode
  255. {
  256. optional uint32 account_id = 1;
  257. optional uint32 code_type = 2;
  258. optional uint32 time_acquired = 3;
  259. optional string code = 4;
  260. }
  261. //
  262. // k_EMsgGCStoreGetUserData
  263. //
  264. message CMsgStoreGetUserData
  265. {
  266. optional fixed32 price_sheet_version = 1;
  267. }
  268. //
  269. // k_EMsgGCStoreGetUserDataResponse
  270. //
  271. message CMsgStoreGetUserDataResponse
  272. {
  273. optional int32 result = 1; // Result of the call
  274. optional int32 currency = 2; // Currency to display to the user
  275. optional string country = 3; // Country the purchase is being made from (Send back in k_EMsgGCStorePurchaseInit)
  276. optional fixed32 price_sheet_version = 4; // Version of the current price sheet on the GC
  277. // experiments
  278. optional uint64 experiment_data = 5 [ default = 0 ]; // top 32 bits = experiment id, bottom 32 bits = experiment group number
  279. optional int32 featured_item_idx = 6;
  280. optional bool show_hat_descriptions = 7 [ default = true ];
  281. // Serialized KV representing the price sheet menu
  282. optional bytes price_sheet = 8;
  283. optional int32 default_item_sort = 9 [ default = 0 ];
  284. // popular items by def
  285. repeated uint32 popular_items = 10;
  286. };
  287. //
  288. // k_EMsgGCUpdateItemSchema
  289. //
  290. message CMsgUpdateItemSchema
  291. {
  292. optional bytes items_game = 1; // actual contents of items_game.txt (only used on dev)
  293. optional fixed32 item_schema_version = 2; // Version of the items_game.txt we're using
  294. optional string items_game_url = 3; // HTTP URL where they can use to fetch the one we're using, if theirs is out of date and we don't send the contents
  295. };
  296. //
  297. // k_EMsgGCRequestItemSchemaData
  298. //
  299. message CMsgRequestItemSchemaData
  300. {
  301. };
  302. // sent from the GC to a client telling him about a GC error
  303. message CMsgGCError
  304. {
  305. optional string error_text = 1;
  306. };
  307. //
  308. // k_EMsgGCRequestInventoryRefresh
  309. //
  310. message CMsgRequestInventoryRefresh
  311. {
  312. };
  313. //
  314. // k_EMsgGCConvarUpdated
  315. //
  316. message CMsgConVarValue
  317. {
  318. optional string name = 1;
  319. optional string value = 2;
  320. };
  321. //
  322. // k_EMsgGCReplicateConVars
  323. //
  324. message CMsgReplicateConVars
  325. {
  326. repeated CMsgConVarValue convars = 1;
  327. };
  328. //
  329. // k_EMsgGCUseItemRequest
  330. //
  331. message CMsgUseItem
  332. {
  333. optional uint64 item_id = 1;
  334. optional fixed64 target_steam_id = 2; // 64-bit field left over from original message
  335. repeated uint32 gift__potential_targets = 3;
  336. optional uint32 duel__class_lock = 4;
  337. };
  338. //
  339. // k_EMsgGCReplay_UploadedToYouTube
  340. //
  341. message CMsgReplayUploadedToYouTube
  342. {
  343. optional string youtube_url = 1;
  344. optional string youtube_account_name = 2;
  345. optional uint64 session_id = 3;
  346. };
  347. //
  348. // k_EMsgGCItemAcknowledged
  349. //
  350. message CMsgItemAcknowledged
  351. {
  352. optional uint32 account_id = 1;
  353. optional uint32 inventory = 2;
  354. optional uint32 def_index = 3;
  355. optional uint32 quality = 4;
  356. };
  357. //
  358. // CMsgSelectItemPresetForClass
  359. //
  360. message CMsgSelectItemPresetForClass
  361. {
  362. optional uint32 class_index = 2;
  363. optional uint32 preset_index = 3;
  364. };
  365. //
  366. // CSOSelectedItemPreset
  367. //
  368. message CSOSelectedItemPreset
  369. {
  370. optional uint32 account_id = 1 [ (key_field) = true ];
  371. optional uint32 class_index = 2 [ (key_field) = true ];
  372. optional uint32 preset_index = 3;
  373. };
  374. //
  375. // CSOCommunityMapItem
  376. //
  377. message CSOItemCommunityMap
  378. {
  379. optional uint32 mapID = 1;
  380. optional uint32 mapAuthorID = 2;
  381. optional string mapName = 3;
  382. optional string mapFilename = 4;
  383. optional fixed64 mapUGCHandle = 5;
  384. optional fixed64 mapUGCThumbHandle = 6;
  385. optional uint32 mapVersion = 7;
  386. optional fixed32 mapCreateDate = 8;
  387. optional uint32 mapVoteUp = 9;
  388. optional uint32 mapVoteDown = 10;
  389. optional uint32 mapDownloads = 11;
  390. optional uint32 userVoteStatus = 12;
  391. optional bool userCompleted = 13;
  392. optional fixed32 userDownloadTimestamp=14;
  393. };
  394. //
  395. // CMsgPlaytestReportDemo
  396. //
  397. message CMsgPlaytestReportDemo
  398. {
  399. optional fixed64 author_id = 1;
  400. optional fixed64 ugc_handle = 2;
  401. optional fixed64 map_id = 3;
  402. };
  403. //
  404. // CMsgPlaytestRetrieveDemoHandles
  405. //
  406. message CMsgPlaytestRetrieveDemoHandles
  407. {
  408. optional fixed64 author_id = 1;
  409. };
  410. //
  411. // CMsgPlaytestRetrieveDemoHandlesResponse
  412. //
  413. message CMsgPlaytestRetrieveDemoHandlesResponse
  414. {
  415. optional fixed64 author_id = 1;
  416. repeated fixed64 ugc_handle = 2;
  417. repeated fixed64 map_id = 3;
  418. };
  419. //
  420. // CMsgPlaytestRemoveDemo
  421. //
  422. message CMsgPlaytestRemoveDemo
  423. {
  424. optional fixed64 author_id = 1;
  425. optional fixed64 ugc_handle = 2;
  426. };