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.

601 lines
14 KiB

  1. //====== Copyright (c) 2013, Valve Corporation, All rights reserved. ========//
  2. //
  3. // Redistribution and use in source and binary forms, with or without
  4. // modification, are permitted provided that the following conditions are met:
  5. //
  6. // Redistributions of source code must retain the above copyright notice, this
  7. // list of conditions and the following disclaimer.
  8. // Redistributions in binary form must reproduce the above copyright notice,
  9. // this list of conditions and the following disclaimer in the documentation
  10. // and/or other materials provided with the distribution.
  11. //
  12. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  13. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  14. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  15. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  16. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  17. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  18. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  19. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  20. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  21. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  22. // THE POSSIBILITY OF SUCH DAMAGE.
  23. //===========================================================================//
  24. //
  25. // Purpose: The file defines our Google Protocol Buffers which are used in over
  26. // the wire messages for the Source engine.
  27. //
  28. //=============================================================================
  29. // We care more about speed than code size
  30. option optimize_for = SPEED;
  31. // We don't use the service generation functionality
  32. option cc_generic_services = false;
  33. //
  34. // STYLE NOTES:
  35. //
  36. // Use CamelCase CMsgMyMessageName style names for messages.
  37. //
  38. // Use lowercase _ delimited names like my_steam_id for field names, this is non-standard for Steam,
  39. // but plays nice with the Google formatted code generation.
  40. //
  41. // Try not to use required fields ever. Only do so if you are really really sure you'll never want them removed.
  42. // Optional should be preffered as it will make versioning easier and cleaner in the future if someone refactors
  43. // your message and wants to remove or rename fields.
  44. //
  45. // Use fixed64 for JobId_t, GID_t, or SteamID. This is appropriate for any field that is normally
  46. // going to be larger than 2^56. Otherwise use int64 for 64 bit values that are frequently smaller
  47. // than 2^56 as it will safe space on the wire in those cases.
  48. //
  49. // Similar to fixed64, use fixed32 for RTime32 or other 32 bit values that are frequently larger than
  50. // 2^28. It will safe space in those cases, otherwise use int32 which will safe space for smaller values.
  51. // An exception to this rule for RTime32 is if the value will frequently be zero rather than set to an actual
  52. // time.
  53. //
  54. import "google/protobuf/descriptor.proto";
  55. // for CMsgVector, etc.
  56. import "netmessages.proto";
  57. import "cstrike15_gcmessages.proto";
  58. //=============================================================================
  59. // CStrike15 User Messages
  60. //=============================================================================
  61. enum ECstrike15UserMessages
  62. {
  63. CS_UM_VGUIMenu = 1;
  64. CS_UM_Geiger = 2;
  65. CS_UM_Train = 3;
  66. CS_UM_HudText = 4;
  67. CS_UM_SayText = 5;
  68. CS_UM_SayText2 = 6;
  69. CS_UM_TextMsg = 7;
  70. CS_UM_HudMsg = 8;
  71. CS_UM_ResetHud = 9;
  72. CS_UM_GameTitle = 10;
  73. CS_UM_Shake = 12;
  74. CS_UM_Fade = 13; // fade HUD in/out
  75. CS_UM_Rumble = 14;
  76. CS_UM_CloseCaption = 15;
  77. CS_UM_CloseCaptionDirect = 16;
  78. CS_UM_SendAudio = 17;
  79. CS_UM_RawAudio = 18;
  80. CS_UM_VoiceMask = 19;
  81. CS_UM_RequestState = 20;
  82. CS_UM_Damage = 21;
  83. CS_UM_RadioText = 22;
  84. CS_UM_HintText = 23;
  85. CS_UM_KeyHintText = 24;
  86. CS_UM_ProcessSpottedEntityUpdate = 25;
  87. CS_UM_ReloadEffect = 26;
  88. CS_UM_AdjustMoney = 27;
  89. CS_UM_UpdateTeamMoney = 28;
  90. CS_UM_StopSpectatorMode = 29;
  91. CS_UM_KillCam = 30;
  92. CS_UM_DesiredTimescale = 31;
  93. CS_UM_CurrentTimescale = 32;
  94. CS_UM_AchievementEvent = 33;
  95. CS_UM_MatchEndConditions = 34;
  96. CS_UM_DisconnectToLobby = 35;
  97. CS_UM_PlayerStatsUpdate = 36;
  98. CS_UM_DisplayInventory = 37;
  99. CS_UM_WarmupHasEnded = 38;
  100. CS_UM_ClientInfo = 39;
  101. CS_UM_XRankGet = 40; // Get ELO Rank Value from Client
  102. CS_UM_XRankUpd = 41; // Update ELO Rank Value on Client
  103. CS_UM_CallVoteFailed = 45;
  104. CS_UM_VoteStart = 46;
  105. CS_UM_VotePass = 47;
  106. CS_UM_VoteFailed = 48;
  107. CS_UM_VoteSetup = 49;
  108. CS_UM_ServerRankRevealAll = 50;
  109. CS_UM_SendLastKillerDamageToClient = 51;
  110. CS_UM_ServerRankUpdate = 52;
  111. CS_UM_ItemPickup = 53;
  112. CS_UM_ShowMenu = 54; // show hud menu
  113. CS_UM_BarTime = 55; // For the C4 progress bar.
  114. CS_UM_AmmoDenied = 56;
  115. CS_UM_MarkAchievement = 57;
  116. CS_UM_MatchStatsUpdate = 58;
  117. CS_UM_ItemDrop = 59;
  118. CS_UM_GlowPropTurnOff = 60;
  119. CS_UM_SendPlayerItemDrops = 61;
  120. CS_UM_RoundBackupFilenames = 62;
  121. CS_UM_SendPlayerItemFound = 63;
  122. CS_UM_ReportHit = 64;
  123. CS_UM_XpUpdate = 65;
  124. CS_UM_QuestProgress = 66; // Send notification to user when quest progress was made.
  125. CS_UM_ScoreLeaderboardData = 67; // Game server broadcasting match end scoreboard and leaderboard data
  126. CS_UM_PlayerDecalDigitalSignature = 68; // Game server can ask client to provide a digital signature for decal data
  127. }
  128. //=============================================================================
  129. message CCSUsrMsg_VGUIMenu
  130. {
  131. optional string name = 1;
  132. optional bool show = 2;
  133. message Subkey
  134. {
  135. optional string name = 1;
  136. optional string str = 2;
  137. }
  138. repeated Subkey subkeys = 3;
  139. }
  140. message CCSUsrMsg_Geiger
  141. {
  142. optional int32 range = 1;
  143. }
  144. message CCSUsrMsg_Train
  145. {
  146. optional int32 train = 1;
  147. }
  148. message CCSUsrMsg_HudText
  149. {
  150. optional string text = 1;
  151. }
  152. message CCSUsrMsg_SayText
  153. {
  154. optional int32 ent_idx = 1;
  155. optional string text = 2;
  156. optional bool chat = 3;
  157. optional bool textallchat = 4;
  158. }
  159. message CCSUsrMsg_SayText2
  160. {
  161. optional int32 ent_idx = 1;
  162. optional bool chat = 2;
  163. optional string msg_name = 3;
  164. repeated string params = 4;
  165. optional bool textallchat = 5;
  166. }
  167. message CCSUsrMsg_TextMsg
  168. {
  169. optional int32 msg_dst = 1;
  170. repeated string params = 3;
  171. }
  172. message CCSUsrMsg_HudMsg
  173. {
  174. optional int32 channel = 1;
  175. optional CMsgVector2D pos = 2;
  176. optional CMsgRGBA clr1 = 3;
  177. optional CMsgRGBA clr2 = 4;
  178. optional int32 effect = 5;
  179. optional float fade_in_time = 6;
  180. optional float fade_out_time = 7;
  181. optional float hold_time = 9;
  182. optional float fx_time = 10;
  183. optional string text = 11;
  184. }
  185. message CCSUsrMsg_Shake
  186. {
  187. optional int32 command = 1;
  188. optional float local_amplitude = 2;
  189. optional float frequency = 3;
  190. optional float duration = 4;
  191. }
  192. message CCSUsrMsg_Fade
  193. {
  194. optional int32 duration = 1;
  195. optional int32 hold_time = 2;
  196. optional int32 flags = 3; // fade type (in / out)
  197. optional CMsgRGBA clr = 4;
  198. }
  199. message CCSUsrMsg_Rumble
  200. {
  201. optional int32 index = 1;
  202. optional int32 data = 2;
  203. optional int32 flags = 3;
  204. }
  205. message CCSUsrMsg_CloseCaption
  206. {
  207. optional uint32 hash = 1;
  208. optional int32 duration = 2;
  209. optional bool from_player = 3;
  210. }
  211. message CCSUsrMsg_CloseCaptionDirect
  212. {
  213. optional uint32 hash = 1;
  214. optional int32 duration = 2;
  215. optional bool from_player = 3;
  216. }
  217. message CCSUsrMsg_SendAudio
  218. {
  219. optional string radio_sound = 1;
  220. }
  221. message CCSUsrMsg_RawAudio
  222. {
  223. optional int32 pitch = 1;
  224. optional int32 entidx = 2;
  225. optional float duration = 3;
  226. optional string voice_filename = 4;
  227. }
  228. message CCSUsrMsg_VoiceMask
  229. {
  230. message PlayerMask
  231. {
  232. optional int32 game_rules_mask = 1;
  233. optional int32 ban_masks = 2;
  234. }
  235. repeated PlayerMask player_masks = 1;
  236. optional bool player_mod_enable = 2;
  237. }
  238. message CCSUsrMsg_Damage
  239. {
  240. optional int32 amount = 1;
  241. optional CMsgVector inflictor_world_pos = 2;
  242. optional int32 victim_entindex = 3;
  243. }
  244. message CCSUsrMsg_RadioText
  245. {
  246. optional int32 msg_dst = 1;
  247. optional int32 client = 2;
  248. optional string msg_name = 3;
  249. repeated string params = 4;
  250. }
  251. message CCSUsrMsg_HintText
  252. {
  253. optional string text = 1;
  254. }
  255. message CCSUsrMsg_KeyHintText
  256. {
  257. repeated string hints = 1;
  258. }
  259. // gurjeets - Message below is slightly bigger in size than the non-protobuf version,
  260. // by around 8 bits.
  261. message CCSUsrMsg_ProcessSpottedEntityUpdate
  262. {
  263. optional bool new_update = 1;
  264. message SpottedEntityUpdate
  265. {
  266. optional int32 entity_idx = 1;
  267. optional int32 class_id = 2;
  268. optional int32 origin_x = 3;
  269. optional int32 origin_y = 4;
  270. optional int32 origin_z = 5;
  271. optional int32 angle_y = 6;
  272. optional bool defuser = 7;
  273. optional bool player_has_defuser = 8;
  274. optional bool player_has_c4 = 9;
  275. }
  276. repeated SpottedEntityUpdate entity_updates = 2;
  277. }
  278. message CCSUsrMsg_SendPlayerItemDrops
  279. {
  280. repeated CEconItemPreviewDataBlock entity_updates = 1;
  281. }
  282. message CCSUsrMsg_SendPlayerItemFound
  283. {
  284. optional CEconItemPreviewDataBlock iteminfo = 1;
  285. optional int32 entindex = 2;
  286. }
  287. message CCSUsrMsg_ReloadEffect
  288. {
  289. optional int32 entidx = 1;
  290. optional int32 actanim = 2;
  291. optional float origin_x = 3;
  292. optional float origin_y = 4;
  293. optional float origin_z = 5;
  294. }
  295. message CCSUsrMsg_AdjustMoney
  296. {
  297. optional int32 amount = 1;
  298. }
  299. // This code allowed us to measure discrepency between client and server bullet hits.
  300. // It became obsolete when we started using a separate seed for client and server
  301. // to eliminate 'rage' hacks.
  302. //
  303. message CCSUsrMsg_ReportHit
  304. {
  305. optional float pos_x = 1;
  306. optional float pos_y = 2;
  307. optional float timestamp = 4;
  308. optional float pos_z = 3;
  309. }
  310. message CCSUsrMsg_KillCam
  311. {
  312. optional int32 obs_mode = 1;
  313. optional int32 first_target = 2;
  314. optional int32 second_target = 3;
  315. }
  316. message CCSUsrMsg_DesiredTimescale
  317. {
  318. optional float desired_timescale = 1;
  319. optional float duration_realtime_sec = 2;
  320. optional int32 interpolator_type = 3;
  321. optional float start_blend_time = 4;
  322. }
  323. message CCSUsrMsg_CurrentTimescale
  324. {
  325. optional float cur_timescale = 1;
  326. }
  327. message CCSUsrMsg_AchievementEvent
  328. {
  329. optional int32 achievement = 1;
  330. optional int32 count = 2;
  331. optional int32 user_id = 3;
  332. }
  333. message CCSUsrMsg_MatchEndConditions
  334. {
  335. optional int32 fraglimit = 1;
  336. optional int32 mp_maxrounds = 2;
  337. optional int32 mp_winlimit = 3;
  338. optional int32 mp_timelimit = 4;
  339. }
  340. message CCSUsrMsg_PlayerStatsUpdate
  341. {
  342. optional int32 version = 1;
  343. message Stat
  344. {
  345. optional int32 idx = 1;
  346. optional int32 delta = 2;
  347. }
  348. repeated Stat stats = 4;
  349. optional int32 user_id = 5;
  350. optional int32 crc = 6;
  351. }
  352. message CCSUsrMsg_DisplayInventory
  353. {
  354. optional bool display = 1;
  355. optional int32 user_id = 2;
  356. }
  357. message CCSUsrMsg_QuestProgress
  358. {
  359. optional uint32 quest_id = 1;
  360. optional uint32 normal_points = 2;
  361. optional uint32 bonus_points = 3;
  362. optional bool is_event_quest = 4;
  363. }
  364. message CCSUsrMsg_ScoreLeaderboardData
  365. {
  366. optional ScoreLeaderboardData data = 1;
  367. }
  368. message CCSUsrMsg_PlayerDecalDigitalSignature
  369. {
  370. optional PlayerDecalDigitalSignature data = 1;
  371. }
  372. message CCSUsrMsg_XRankGet
  373. {
  374. optional int32 mode_idx = 1;
  375. optional int32 controller = 2;
  376. }
  377. message CCSUsrMsg_XRankUpd
  378. {
  379. optional int32 mode_idx = 1;
  380. optional int32 controller = 2;
  381. optional int32 ranking = 3;
  382. }
  383. message CCSUsrMsg_CallVoteFailed
  384. {
  385. optional int32 reason = 1;
  386. optional int32 time = 2;
  387. }
  388. message CCSUsrMsg_VoteStart
  389. {
  390. optional int32 team = 1;
  391. optional int32 ent_idx = 2;
  392. optional int32 vote_type = 3;
  393. optional string disp_str = 4;
  394. optional string details_str = 5;
  395. optional string other_team_str = 6;
  396. optional bool is_yes_no_vote = 7;
  397. }
  398. message CCSUsrMsg_VotePass
  399. {
  400. optional int32 team = 1;
  401. optional int32 vote_type = 2;
  402. optional string disp_str= 3;
  403. optional string details_str = 4;
  404. }
  405. message CCSUsrMsg_VoteFailed
  406. {
  407. optional int32 team = 1;
  408. optional int32 reason = 2;
  409. }
  410. message CCSUsrMsg_VoteSetup
  411. {
  412. repeated string potential_issues = 1;
  413. }
  414. message CCSUsrMsg_SendLastKillerDamageToClient
  415. {
  416. optional int32 num_hits_given = 1;
  417. optional int32 damage_given = 2;
  418. optional int32 num_hits_taken = 3;
  419. optional int32 damage_taken = 4;
  420. }
  421. message CCSUsrMsg_ServerRankUpdate
  422. {
  423. message RankUpdate
  424. {
  425. optional int32 account_id = 1;
  426. optional int32 rank_old = 2;
  427. optional int32 rank_new = 3;
  428. optional int32 num_wins = 4;
  429. optional float rank_change = 5;
  430. }
  431. repeated RankUpdate rank_update = 1;
  432. }
  433. message CCSUsrMsg_XpUpdate
  434. {
  435. optional CMsgGCCstrike15_v2_GC2ServerNotifyXPRewarded data = 1;
  436. }
  437. message CCSUsrMsg_ItemPickup
  438. {
  439. optional string item = 1;
  440. }
  441. message CCSUsrMsg_ShowMenu
  442. {
  443. optional int32 bits_valid_slots = 1;
  444. optional int32 display_time = 2;
  445. optional string menu_string = 3;
  446. }
  447. message CCSUsrMsg_BarTime
  448. {
  449. optional string time = 1;
  450. }
  451. message CCSUsrMsg_AmmoDenied
  452. {
  453. optional int32 ammoIdx = 1;
  454. }
  455. message CCSUsrMsg_MarkAchievement
  456. {
  457. optional string achievement = 1;
  458. }
  459. message CCSUsrMsg_MatchStatsUpdate
  460. {
  461. optional string update = 1;
  462. }
  463. message CCSUsrMsg_ItemDrop
  464. {
  465. optional int64 itemid = 1;
  466. optional bool death = 2;
  467. }
  468. message CCSUsrMsg_GlowPropTurnOff
  469. {
  470. optional int32 entidx = 1;
  471. }
  472. message CCSUsrMsg_RoundBackupFilenames
  473. {
  474. optional int32 count = 1;
  475. optional int32 index = 2;
  476. optional string filename = 3;
  477. optional string nicename = 4;
  478. }
  479. //=============================================================================
  480. // Messages where the data seems to be irrelevant
  481. //=============================================================================
  482. message CCSUsrMsg_ResetHud
  483. {
  484. optional bool reset = 1;
  485. }
  486. message CCSUsrMsg_GameTitle
  487. {
  488. optional int32 dummy = 1;
  489. }
  490. message CCSUsrMsg_RequestState
  491. {
  492. optional int32 dummy = 1;
  493. }
  494. message CCSUsrMsg_StopSpectatorMode
  495. {
  496. optional int32 dummy = 1;
  497. }
  498. message CCSUsrMsg_DisconnectToLobby
  499. {
  500. optional int32 dummy = 1;
  501. }
  502. message CCSUsrMsg_WarmupHasEnded
  503. {
  504. optional int32 dummy = 1;
  505. }
  506. message CCSUsrMsg_ClientInfo
  507. {
  508. optional int32 dummy = 1;
  509. }
  510. message CCSUsrMsg_ServerRankRevealAll
  511. {
  512. optional int32 seconds_till_shutdown = 1;
  513. }