Difference between revisions of "Counter-Strike: Global Offensive UserMessages"

From AlliedModders Wiki
Jump to: navigation, search
(Note about client crashes)
m (Add stock UnsignedFixed16ToFloat())
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
 
Counter-Strike: Global Offensive uses Google's [[Protobuf|Protocol Buffers]] instead of Valve's traditional UserMessages.
 
Counter-Strike: Global Offensive uses Google's [[Protobuf|Protocol Buffers]] instead of Valve's traditional UserMessages.
  
The data on this page was read from [http://hg.alliedmods.net/hl2sdks/hl2sdk-csgo/file/tip/public/game/shared/csgo/protobuf/cstrike15_usermessages.proto cstrike15_usermessages.proto]. The initial versions of these files were provided by Valve and updated by the AlliedModders staff.
+
The data on this page was read from [https://github.com/SteamDatabase/GameTracking-CSGO/blob/master/Protobufs/cstrike15_usermessages.proto].
 +
The initial versions of these files were provided by Valve and updated by the AlliedModders staff.
  
 
<pre>//====== Copyright (c) 2013, Valve Corporation, All rights reserved. ========//
 
<pre>//====== Copyright (c) 2013, Valve Corporation, All rights reserved. ========//
Line 35: Line 35:
 
== VGUIMenu ==
 
== VGUIMenu ==
  
{{begin-hl2msg|SubKey|string}}
+
{{begin-hl2msg|VGUIMenu.SubKey|string}}
 
{{hl2msg|string|name|}}
 
{{hl2msg|string|name|}}
 
{{hl2msg|string|str|}}
 
{{hl2msg|string|str|}}
Line 43: Line 43:
 
{{hl2msg|string|name|}}
 
{{hl2msg|string|name|}}
 
{{hl2msg|bool|show|}}
 
{{hl2msg|bool|show|}}
{{hl2msg|repeated SubKey|subkeys|}}
+
{{hl2msg|repeated VGUIMenu.SubKey|subkeys|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 74: Line 74:
  
 
== SayText2 ==
 
== SayText2 ==
 +
 
{{qnotice|As of this writing, params requires four empty strings or it will crash the client}}
 
{{qnotice|As of this writing, params requires four empty strings or it will crash the client}}
 
 
{{begin-hl2msg|SayText2|string}}
 
{{begin-hl2msg|SayText2|string}}
 
{{hl2msg|int32|ent_idx|}}
 
{{hl2msg|int32|ent_idx|}}
Line 112: Line 112:
 
{{hl2msg|float|local_amplitude|}}
 
{{hl2msg|float|local_amplitude|}}
 
{{hl2msg|float|frequency|}}
 
{{hl2msg|float|frequency|}}
{{hl2msg|float|duration|}}
+
{{hl2msg|float|duration|Time to shake (In seconds)}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
 +
 +
'''Shake.Command:'''
 +
 +
<sourcepawn>
 +
#define SHAKE_START            (0) // Starts the screen shake for all players within the radius
 +
#define SHAKE_STOP            (1) // Stops the screen shake for all players within the radius
 +
#define SHAKE_AMPLITUDE        (2) // Modifies the amplitude of an active screen shake for all players within the radius
 +
#define SHAKE_FREQUENCY        (3) // Modifies the frequency of an active screen shake for all players within the radius
 +
#define SHAKE_START_RUMBLEONLY (4) // Starts a shake effect that only rumbles the controller, no screen effect
 +
#define SHAKE_START_NORUMBLE  (5) // Starts a shake that does NOT rumble the controller
 +
</sourcepawn>
  
 
== Fade ==
 
== Fade ==
{{qnotice|fade HUD in/out}}
 
  
 
{{begin-hl2msg|Fade|string}}
 
{{begin-hl2msg|Fade|string}}
{{hl2msg|int32|duration|}}
+
{{hl2msg|int32|duration|Time to fade in/out (In seconds)}}
{{hl2msg|int32|hold_time|}}
+
{{hl2msg|int32|hold_time|Time to hold the faded in/out state (In seconds)}}
{{hl2msg|int32|flags|fade type (in / out)}}
+
{{hl2msg|int32|flags|}}
 
{{hl2msg|CMsgRGBA|clr|}}
 
{{hl2msg|CMsgRGBA|clr|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
 +
 +
'''Fade.Duration:'''
 +
 +
Even if a 32 bits integer is requested, the value must be in [https://en.wikipedia.org/wiki/Q_(number_format) Q7.9 format] !
 +
 +
'''Fade.HoldTime:'''
 +
 +
Even if a 32 bits integer is requested, the value must be in [https://en.wikipedia.org/wiki/Q_(number_format) Q7.9 format] !
 +
 +
'''Fade.Flags:'''
 +
 +
<sourcepawn>
 +
#define FFADE_IN      (0x0001) // Fade in
 +
#define FFADE_OUT      (0x0002) // Fade out
 +
#define FFADE_MODULATE (0x0004) // Modulate (Don't blend)
 +
#define FFADE_STAYOUT  (0x0008) // Ignores the duration, stays faded out until a new fade message is received
 +
#define FFADE_PURGE    (0x0010) // Purges all other fades, replacing them with this one
 +
</sourcepawn>
 +
 +
'''Stocks:'''
 +
 +
<sourcepawn>
 +
#define CSGO_SCREENFADE_FRACTIONAL_BITS (9)
 +
 +
// ----------------------------------------------------------------
 +
// Convert a float to an unsigned fixed 16 bits
 +
// ----------------------------------------------------------------
 +
stock int FloatToUnsignedFixed16(float input, int nb_fractional_bits)
 +
{
 +
    int output = RoundFloat(input * (1 << nb_fractional_bits));
 +
 +
    if (output < 0)    output = 0;
 +
    if (output > 65535) output = 65535;
 +
 +
    return output;
 +
}
 +
 +
// ----------------------------------------------------------------
 +
// Convert an unsigned fixed 16 bits to a float
 +
// ----------------------------------------------------------------
 +
stock float UnsignedFixed16ToFloat(int input, int nb_fractional_bits)
 +
{
 +
    if (input < 0)    input = 0;
 +
    if (input > 65535) input = 65535;
 +
 +
    return (float(input) / (1 << nb_fractional_bits));
 +
}
 +
 +
// ----------------------------------------------------------------
 +
// Fade the screen of a client
 +
// ----------------------------------------------------------------
 +
stock void CSGO_ScreenFadeClient(int clientIndex, float duration, float holdTime, int flags, int color[4])
 +
{
 +
    Protobuf message = UserMessageToProtobuf(StartMessageOne("Fade", clientIndex, USERMSG_RELIABLE));
 +
 +
    message.SetInt  ("duration",  FloatToUnsignedFixed16(duration, CSGO_SCREENFADE_FRACTIONAL_BITS));
 +
    message.SetInt  ("hold_time", FloatToUnsignedFixed16(holdTime, CSGO_SCREENFADE_FRACTIONAL_BITS));
 +
    message.SetInt  ("flags",    flags);
 +
    message.SetColor("clr",      color);
 +
 +
    EndMessage();
 +
}
 +
</sourcepawn>
  
 
== Rumble ==
 
== Rumble ==
Line 132: Line 205:
 
{{hl2msg|int32|flags|}}
 
{{hl2msg|int32|flags|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
 +
 +
'''Rumble.Index:'''
 +
 +
<sourcepawn>
 +
#define RUMBLE_INVALID                  (-1)
 +
#define RUMBLE_STOP_ALL                (0) // Cease all current rumbling effects.
 +
#define RUMBLE_PISTOL                  (1)
 +
#define RUMBLE_357                      (2)
 +
#define RUMBLE_SMG1                    (3)
 +
#define RUMBLE_AR2                      (4)
 +
#define RUMBLE_SHOTGUN_SINGLE          (5)
 +
#define RUMBLE_SHOTGUN_DOUBLE          (6)
 +
#define RUMBLE_AR2_ALT_FIRE            (7)
 +
#define RUMBLE_RPG_MISSILE              (8)
 +
#define RUMBLE_CROWBAR_SWING            (9)
 +
#define RUMBLE_AIRBOAT_GUN              (10)
 +
#define RUMBLE_JEEP_ENGINE_LOOP        (11)
 +
#define RUMBLE_FLAT_LEFT                (12)
 +
#define RUMBLE_FLAT_RIGHT              (13)
 +
#define RUMBLE_FLAT_BOTH                (14)
 +
#define RUMBLE_DMG_LOW                  (15)
 +
#define RUMBLE_DMG_MED                  (16)
 +
#define RUMBLE_DMG_HIGH                (17)
 +
#define RUMBLE_FALL_LONG                (18)
 +
#define RUMBLE_FALL_SHORT              (19)
 +
#define RUMBLE_PHYSCANNON_OPEN          (20)
 +
#define RUMBLE_PHYSCANNON_PUNT          (21)
 +
#define RUMBLE_PHYSCANNON_LOW          (22)
 +
#define RUMBLE_PHYSCANNON_MEDIUM        (23)
 +
#define RUMBLE_PHYSCANNON_HIGH          (24)
 +
#define RUMBLE_PORTALGUN_LEFT          (25)
 +
#define RUMBLE_PORTALGUN_RIGHT          (26)
 +
#define RUMBLE_PORTAL_PLACEMENT_FAILURE (27)
 +
</sourcepawn>
 +
 +
'''Rumble.Flags:'''
 +
 +
<sourcepawn>
 +
#define RUMBLE_FLAGS_NONE            (0x0000)
 +
#define RUMBLE_FLAG_STOP            (0x0001) // Stop any instance of this type of effect that's already playing
 +
#define RUMBLE_FLAG_LOOP            (0x0002) // Make this effect loop
 +
#define RUMBLE_FLAG_RESTART          (0x0004) // If this effect is already playing, restart it
 +
#define RUMBLE_FLAG_UPDATE_SCALE    (0x0008) // Apply DATA to this effect if already playing, but don't restart
 +
#define RUMBLE_FLAG_ONLYONE          (0x0010) // Don't play this effect if it is already playing
 +
#define RUMBLE_FLAG_RANDOM_AMPLITUDE (0x0020) // Amplitude scale will be randomly chosen (Between 10% and 100%)
 +
#define RUMBLE_FLAG_INITIAL_SCALE    (0x0040) // Data is the initial scale to start this effect (* 100)
 +
</sourcepawn>
  
 
== CloseCaption ==
 
== CloseCaption ==
Line 139: Line 259:
 
{{hl2msg|int32|duration|}}
 
{{hl2msg|int32|duration|}}
 
{{hl2msg|bool|from_player|}}
 
{{hl2msg|bool|from_player|}}
 +
{{hl2msg|string|cctoken|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 166: Line 287:
 
== VoiceMask ==
 
== VoiceMask ==
  
{{begin-hl2msg|PlayerMask|string}}
+
{{begin-hl2msg|VoiceMask.PlayerMask|string}}
 
{{hl2msg|int32|game_rules_mask|}}
 
{{hl2msg|int32|game_rules_mask|}}
 
{{hl2msg|int32|ban_masks|}}
 
{{hl2msg|int32|ban_masks|}}
Line 172: Line 293:
  
 
{{begin-hl2msg|VoiceMask|string}}
 
{{begin-hl2msg|VoiceMask|string}}
{{hl2msg|repeated PlayerMask|player_masks|}}
+
{{hl2msg|repeated VoiceMask.PlayerMask|player_masks|}}
 
{{hl2msg|bool|player_mod_enable|}}
 
{{hl2msg|bool|player_mod_enable|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
Line 181: Line 302:
 
{{hl2msg|int32|amount|}}
 
{{hl2msg|int32|amount|}}
 
{{hl2msg|CMsgVector|inflictor_world_pos|}}
 
{{hl2msg|CMsgVector|inflictor_world_pos|}}
 +
{{hl2msg|int32|victim_entindex|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 205: Line 327:
  
 
== ProcessSpottedEntityUpdate ==
 
== ProcessSpottedEntityUpdate ==
 +
 
{{qnotice|gurjeets - Message below is slightly bigger in size than the non-protobuf version, by around 8 bits. }}
 
{{qnotice|gurjeets - Message below is slightly bigger in size than the non-protobuf version, by around 8 bits. }}
{{begin-hl2msg|SpottedEntityUpdate|string}}
+
{{begin-hl2msg|ProcessSpottedEntityUpdate.SpottedEntityUpdate|string}}
 
{{hl2msg|int32|entity_idx|}}
 
{{hl2msg|int32|entity_idx|}}
 
{{hl2msg|int32|class_id|}}
 
{{hl2msg|int32|class_id|}}
Line 219: Line 342:
  
 
{{begin-hl2msg|ProcessSpottedEntityUpdate|string}}
 
{{begin-hl2msg|ProcessSpottedEntityUpdate|string}}
{{hl2msg|repeated SpottedEntityUpdate|entity_updates|}}
+
{{hl2msg|bool|new_update|}}
 +
{{hl2msg|repeated ProcessSpottedEntityUpdate.SpottedEntityUpdate|entity_updates|}}
 +
{{end-hl2msg}}
 +
 
 +
== SendPlayerItemDrops ==
 +
 
 +
{{begin-hl2msg|SendPlayerItemDrops|string}}
 +
{{hl2msg|repeated ?|entity_updates|}}
 +
{{end-hl2msg}}
 +
 
 +
== SendPlayerItemFound ==
 +
 
 +
{{begin-hl2msg|SendPlayerItemFound|string}}
 +
{{hl2msg|?|iteminfo|}}
 +
{{hl2msg|int32|entindex|}}
 +
{{end-hl2msg}}
 +
 
 +
== RetakeUpdatePlayerCardList ==
 +
 
 +
{{begin-hl2msg|RetakeUpdatePlayerCardList|string}}
 +
{{hl2msg|bool|defuse_kit|}}
 +
{{hl2msg|repeated int32|round_idx|}}
 +
{{hl2msg|repeated int32|loadout_idx|}}
 +
{{hl2msg|repeated int32|card_idx|}}
 +
{{hl2msg|repeated int32|type_idx|}}
 +
{{hl2msg|int32|mvp_boost_round_idx|}}
 +
{{hl2msg|int32|mvp_boost_loadout_idx|}}
 +
{{hl2msg|int32|mvp_boost_card_idx|}}
 +
{{hl2msg|int32|mvp_boost_extra_utility|}}
 +
{{end-hl2msg}}
 +
 
 +
== RetakeUpdatePlayerCardSelection ==
 +
 
 +
{{begin-hl2msg|RetakeUpdatePlayerCardSelection|string}}
 +
{{hl2msg|int32|round_idx|}}
 +
{{hl2msg|int32|loadout_idx|}}
 +
{{hl2msg|int32|card_idx|}}
 +
{{hl2msg|int32|type_idx|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 226: Line 386:
 
{{begin-hl2msg|ReloadEffect|string}}
 
{{begin-hl2msg|ReloadEffect|string}}
 
{{hl2msg|int32|entidx|}}
 
{{hl2msg|int32|entidx|}}
 +
{{hl2msg|int32|actanim|}}
 +
{{hl2msg|float|origin_x|}}
 +
{{hl2msg|float|origin_y|}}
 +
{{hl2msg|float|origin_z|}}
 +
{{end-hl2msg}}
 +
 +
== WeaponSound ==
 +
 +
{{begin-hl2msg|WeaponSound|string}}
 +
{{hl2msg|int32|entidx|}}
 +
{{hl2msg|float|origin_x|}}
 +
{{hl2msg|float|origin_y|}}
 +
{{hl2msg|float|origin_z|}}
 +
{{hl2msg|string|sound|}}
 +
{{hl2msg|float|timestamp|}}
 +
{{end-hl2msg}}
 +
 +
== UpdateScreenHealthBar ==
 +
 +
{{begin-hl2msg|UpdateScreenHealthBar|string}}
 +
{{hl2msg|int32|entidx|}}
 +
{{hl2msg|float|healthratio_old|}}
 +
{{hl2msg|float|healthratio_new|}}
 +
{{hl2msg|int32|style|}}
 +
{{end-hl2msg}}
 +
 +
== EntityOutlineHighlight ==
 +
 +
{{begin-hl2msg|EntityOutlineHighlight|string}}
 +
{{hl2msg|int32|entidx|}}
 +
{{hl2msg|bool|removehighlight|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 232: Line 423:
 
{{begin-hl2msg|AdjustMoney|string}}
 
{{begin-hl2msg|AdjustMoney|string}}
 
{{hl2msg|int32|amount|}}
 
{{hl2msg|int32|amount|}}
 +
{{end-hl2msg}}
 +
 +
== ReportHit ==
 +
 +
{{begin-hl2msg|ReportHit|string}}
 +
{{hl2msg|float|pos_x|}}
 +
{{hl2msg|float|pos_y|}}
 +
{{hl2msg|float|pos_z|}}
 +
{{hl2msg|float|timestamp|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 276: Line 476:
 
== PlayerStatsUpdate ==
 
== PlayerStatsUpdate ==
  
{{begin-hl2msg|Stat|string}}
+
{{begin-hl2msg|PlayerStatsUpdate.Stat|string}}
 
{{hl2msg|int32|idx|}}
 
{{hl2msg|int32|idx|}}
 
{{hl2msg|int32|delta|}}
 
{{hl2msg|int32|delta|}}
Line 283: Line 483:
 
{{begin-hl2msg|PlayerStatsUpdate|string}}
 
{{begin-hl2msg|PlayerStatsUpdate|string}}
 
{{hl2msg|int32|version|}}
 
{{hl2msg|int32|version|}}
{{hl2msg|int32|official_server|}}
+
{{hl2msg|repeated PlayerStatsUpdate.Stat|stats|}}
{{hl2msg|repeated Stat|stats|}}
 
 
{{hl2msg|int32|user_id|}}
 
{{hl2msg|int32|user_id|}}
 
{{hl2msg|int32|crc|}}
 
{{hl2msg|int32|crc|}}
Line 294: Line 493:
 
{{hl2msg|bool|display|}}
 
{{hl2msg|bool|display|}}
 
{{hl2msg|int32|user_id|}}
 
{{hl2msg|int32|user_id|}}
 +
{{end-hl2msg}}
 +
 +
== QuestProgress ==
 +
 +
{{begin-hl2msg|QuestProgress|string}}
 +
{{hl2msg|uint32|quest_id|}}
 +
{{hl2msg|uint32|normal_points|}}
 +
{{hl2msg|uint32|bonus_points|}}
 +
{{hl2msg|bool|is_event_quest|}}
 +
{{end-hl2msg}}
 +
 +
== ScoreLeaderboardData ==
 +
 +
{{begin-hl2msg|ScoreLeaderboardData|string}}
 +
{{hl2msg|?|data|}}
 +
{{end-hl2msg}}
 +
 +
== PlayerDecalDigitalSignature ==
 +
 +
{{begin-hl2msg|PlayerDecalDigitalSignature|string}}
 +
{{hl2msg|?|data|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
 
== XRankGet ==
 
== XRankGet ==
 +
 
{{qnotice|Get ELO Rank Value from Client}}
 
{{qnotice|Get ELO Rank Value from Client}}
 
 
{{begin-hl2msg|XRankGet|string}}
 
{{begin-hl2msg|XRankGet|string}}
 
{{hl2msg|int32|mode_idx|}}
 
{{hl2msg|int32|mode_idx|}}
Line 305: Line 525:
  
 
== XRankUpd ==
 
== XRankUpd ==
 +
 
{{qnotice|Update ELO Rank Value on Client}}
 
{{qnotice|Update ELO Rank Value on Client}}
 
 
{{begin-hl2msg|XRankUpd|string}}
 
{{begin-hl2msg|XRankUpd|string}}
 
{{hl2msg|int32|mode_idx|}}
 
{{hl2msg|int32|mode_idx|}}
Line 330: Line 550:
 
{{hl2msg|string|other_team_str|}}
 
{{hl2msg|string|other_team_str|}}
 
{{hl2msg|bool|is_yes_no_vote|}}
 
{{hl2msg|bool|is_yes_no_vote|}}
 +
{{hl2msg|int32|entidx_target|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 365: Line 586:
 
== ServerRankUpdate ==
 
== ServerRankUpdate ==
  
{{begin-hl2msg|RankUpdate|string}}
+
{{begin-hl2msg|ServerRankUpdate.RankUpdate|string}}
 
{{hl2msg|int32|account_id|}}
 
{{hl2msg|int32|account_id|}}
 
{{hl2msg|int32|rank_old|}}
 
{{hl2msg|int32|rank_old|}}
Line 371: Line 592:
 
{{hl2msg|int32|num_wins|}}
 
{{hl2msg|int32|num_wins|}}
 
{{hl2msg|float|rank_change|}}
 
{{hl2msg|float|rank_change|}}
 +
{{hl2msg|int32|rank_type_id|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
 
{{begin-hl2msg|ServerRankUpdate|string}}
 
{{begin-hl2msg|ServerRankUpdate|string}}
{{hl2msg|repeated RankUpdate|rank_update|}}
+
{{hl2msg|repeated ServerRankUpdate.RankUpdate|rank_update|}}
 +
{{end-hl2msg}}
 +
 
 +
== XpUpdate ==
 +
 
 +
{{begin-hl2msg|XpUpdate|string}}
 +
{{hl2msg|?|data|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
Line 384: Line 612:
  
 
== ShowMenu ==
 
== ShowMenu ==
 +
 
{{qnotice|show hud menu}}
 
{{qnotice|show hud menu}}
 
 
{{begin-hl2msg|ShowMenu|string}}
 
{{begin-hl2msg|ShowMenu|string}}
 
{{hl2msg|int32|bits_valid_slots|}}
 
{{hl2msg|int32|bits_valid_slots|}}
Line 393: Line 621:
  
 
== BarTime ==
 
== BarTime ==
{{qnotice|For the C4 progress bar.}}
 
  
 +
{{qnotice|For the C4 progress bar}}
 
{{begin-hl2msg|BarTime|string}}
 
{{begin-hl2msg|BarTime|string}}
 
{{hl2msg|string|time|}}
 
{{hl2msg|string|time|}}
Line 430: Line 658:
 
{{end-hl2msg}}
 
{{end-hl2msg}}
  
{{qnotice|Messages where the data seems to e irrelevant}}
+
== RoundBackupFilenames ==
 +
 
 +
{{begin-hl2msg|RoundBackupFilenames|string}}
 +
{{hl2msg|int32|count|}}
 +
{{hl2msg|int32|index|}}
 +
{{hl2msg|string|filename|}}
 +
{{hl2msg|string|nicename|}}
 +
{{end-hl2msg}}
 +
 
 +
== SSUI ==
 +
 
 +
{{begin-hl2msg|SSUI|string}}
 +
{{hl2msg|bool|show|}}
 +
{{hl2msg|float|start_time|}}
 +
{{hl2msg|float|end_time|}}
 +
{{end-hl2msg}}
 +
 
 +
== SurvivalStats ==
 +
 
 +
{{begin-hl2msg|SurvivalStats.Fact|string}}
 +
{{hl2msg|int32|type|}}
 +
{{hl2msg|int32|display|}}
 +
{{hl2msg|int32|value|}}
 +
{{hl2msg|float|interestingness|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|SurvivalStats.Placement|string}}
 +
{{hl2msg|uint64|xuid|}}
 +
{{hl2msg|int32|teamnumber|}}
 +
{{hl2msg|int32|placement|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|SurvivalStats.Damage|string}}
 +
{{hl2msg|uint64|xuid|}}
 +
{{hl2msg|int32|to|}}
 +
{{hl2msg|int32|to_hits|}}
 +
{{hl2msg|int32|from|}}
 +
{{hl2msg|int32|from_hits|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|SurvivalStats|string}}
 +
{{hl2msg|uint64|xuid|}}
 +
{{hl2msg|repeated SurvivalStats.Fact|facts|}}
 +
{{hl2msg|repeated SurvivalStats.Placement|users|}}
 +
{{hl2msg|repeated SurvivalStats.Damage|damages|}}
 +
{{hl2msg|int32|ticknumber|}}
 +
{{end-hl2msg}}
 +
 
 +
== EndOfMatchAllPlayersData ==
 +
 
 +
{{begin-hl2msg|EndOfMatchAllPlayersData.Accolade|string}}
 +
{{hl2msg|int32|eaccolade|}}
 +
{{hl2msg|float|value|}}
 +
{{hl2msg|int32|position|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|EndOfMatchAllPlayersData.PlayerData|string}}
 +
{{hl2msg|int32|entindex|}}
 +
{{hl2msg|uint64|xuid|}}
 +
{{hl2msg|string|name|}}
 +
{{hl2msg|int32|teamnumber|}}
 +
{{hl2msg|EndOfMatchAllPlayersData.Accolade|nomination|}}
 +
{{hl2msg|repeated ?|items|}}
 +
{{hl2msg|int32|playercolor|}}
 +
{{hl2msg|bool|isbot|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|EndOfMatchAllPlayersData|string}}
 +
{{hl2msg|repeated EndOfMatchAllPlayersData.PlayerData|allplayerdata|}}
 +
{{hl2msg|int32|scene|}}
 +
{{end-hl2msg}}
 +
 
 +
== RoundImpactScoreData ==
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData.RisEvent.Victim|string}}
 +
{{hl2msg|int32|team_number|}}
 +
{{hl2msg|int32|entindex|}}
 +
{{hl2msg|uint64|xuid|}}
 +
{{hl2msg|int32|color|}}
 +
{{hl2msg|bool|is_bot|}}
 +
{{hl2msg|bool|is_dead|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData.RisEvent.Objective|string}}
 +
{{hl2msg|int32|type|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData.RisEvent.Damage|string}}
 +
{{hl2msg|int32|target_entindex|}}
 +
{{hl2msg|uint64|target_xuid|}}
 +
{{hl2msg|int32|health_removed|}}
 +
{{hl2msg|int32|num_hits|}}
 +
{{hl2msg|int32|return_health_removed|}}
 +
{{hl2msg|int32|num_return_hits|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData.RisEvent|string}}
 +
{{hl2msg|float|timestamp|}}
 +
{{hl2msg|int32|terrorist_odds|}}
 +
{{hl2msg|int32|ct_alive|}}
 +
{{hl2msg|int32|t_alive|}}
 +
{{hl2msg|RoundImpactScoreData.RisEvent.Victim|victim_data|}}
 +
{{hl2msg|RoundImpactScoreData.RisEvent.Objective|objective_data|}}
 +
{{hl2msg|repeated RoundImpactScoreData.RisEvent.Damage|all_damage_data|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData.InitialConditions|string}}
 +
{{hl2msg|int32|ct_equip_value|}}
 +
{{hl2msg|int32|t_equip_value|}}
 +
{{hl2msg|int32|terrorist_odds|}}
 +
{{end-hl2msg}}
 +
 
 +
{{begin-hl2msg|RoundImpactScoreData|string}}
 +
{{hl2msg|RoundImpactScoreData.InitialConditions|init_conditions|}}
 +
{{hl2msg|repeated RoundImpactScoreData.RisEvent|all_ris_event_data|}}
 +
{{end-hl2msg}}
 +
 
 +
== CurrentRoundOdds ==
 +
 
 +
{{begin-hl2msg|CurrentRoundOdds|string}}
 +
{{hl2msg|int32|odds|}}
 +
{{end-hl2msg}}
 +
 
 +
== DeepStats ==
 +
 
 +
{{begin-hl2msg|DeepStats|string}}
 +
{{hl2msg|?|stats|}}
 +
{{end-hl2msg}}
  
 
== ResetHud ==
 
== ResetHud ==
Line 477: Line 832:
  
 
{{begin-hl2msg|ServerRankRevealAll|string}}
 
{{begin-hl2msg|ServerRankRevealAll|string}}
{{hl2msg|int32|dummy|}}
+
{{hl2msg|int32|seconds_till_shutdown|}}
 +
{{hl2msg|?|reservation|}}
 
{{end-hl2msg}}
 
{{end-hl2msg}}
 
== UpdateTeamMoney ==
 
{{qnotice|This UserMessage no longer exists }}
 

Latest revision as of 07:06, 20 December 2020

Counter-Strike: Global Offensive uses Google's Protocol Buffers instead of Valve's traditional UserMessages.

The data on this page was read from [1]. The initial versions of these files were provided by Valve and updated by the AlliedModders staff.

//====== Copyright (c) 2013, Valve Corporation, All rights reserved. ========//
//
// Redistribution and use in source and binary forms, with or without 
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, 
// this list of conditions and the following disclaimer in the documentation 
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
// THE POSSIBILITY OF SUCH DAMAGE.
//===========================================================================//
//
// Purpose: The file defines our Google Protocol Buffers which are used in over 
// the wire messages for the Source engine.
//
//=============================================================================

VGUIMenu

Name: VGUIMenu.SubKey
Structure:
string name
string str


Name: VGUIMenu
Structure:
string name
bool show
repeated VGUIMenu.SubKey subkeys


Geiger

Name: Geiger
Structure:
int32 range


Train

Name: Train
Structure:
int32 train


HudText

Name: HudText
Structure:
string text


SayText

Name: SayText
Structure:
int32 ent_idx
string text
bool chat
bool textallchat


SayText2

Note: As of this writing, params requires four empty strings or it will crash the client

Name: SayText2
Structure:
int32 ent_idx
bool chat
string msg_name
repeated string params
bool textallchat


TextMsg

Name: TextMsg
Structure:
int32 msg_dst
repeated string params


HudMsg

Name: HudMsg
Structure:
int32 channel
CMsgVector2D pos
CMsgRGBA clr1
CMsgRGBA clr2
int32 effect
float fade_in_time
float fade_out_time
float hold_time
float fx_time
string text


Shake

Name: Shake
Structure:
int32 command
float local_amplitude
float frequency
float duration Time to shake (In seconds)


Shake.Command:

#define SHAKE_START            (0) // Starts the screen shake for all players within the radius
#define SHAKE_STOP             (1) // Stops the screen shake for all players within the radius
#define SHAKE_AMPLITUDE        (2) // Modifies the amplitude of an active screen shake for all players within the radius
#define SHAKE_FREQUENCY        (3) // Modifies the frequency of an active screen shake for all players within the radius
#define SHAKE_START_RUMBLEONLY (4) // Starts a shake effect that only rumbles the controller, no screen effect
#define SHAKE_START_NORUMBLE   (5) // Starts a shake that does NOT rumble the controller

Fade

Name: Fade
Structure:
int32 duration Time to fade in/out (In seconds)
int32 hold_time Time to hold the faded in/out state (In seconds)
int32 flags
CMsgRGBA clr


Fade.Duration:

Even if a 32 bits integer is requested, the value must be in Q7.9 format !

Fade.HoldTime:

Even if a 32 bits integer is requested, the value must be in Q7.9 format !

Fade.Flags:

#define FFADE_IN       (0x0001) // Fade in
#define FFADE_OUT      (0x0002) // Fade out
#define FFADE_MODULATE (0x0004) // Modulate (Don't blend)
#define FFADE_STAYOUT  (0x0008) // Ignores the duration, stays faded out until a new fade message is received
#define FFADE_PURGE    (0x0010) // Purges all other fades, replacing them with this one

Stocks:

#define CSGO_SCREENFADE_FRACTIONAL_BITS (9)
 
// ----------------------------------------------------------------
// Convert a float to an unsigned fixed 16 bits
// ----------------------------------------------------------------
stock int FloatToUnsignedFixed16(float input, int nb_fractional_bits)
{
    int output = RoundFloat(input * (1 << nb_fractional_bits));
 
    if (output < 0)     output = 0;
    if (output > 65535) output = 65535;
 
    return output;
}
 
// ----------------------------------------------------------------
// Convert an unsigned fixed 16 bits to a float
// ----------------------------------------------------------------
stock float UnsignedFixed16ToFloat(int input, int nb_fractional_bits)
{
    if (input < 0)     input = 0;
    if (input > 65535) input = 65535;
 
    return (float(input) / (1 << nb_fractional_bits));
}
 
// ----------------------------------------------------------------
// Fade the screen of a client
// ----------------------------------------------------------------
stock void CSGO_ScreenFadeClient(int clientIndex, float duration, float holdTime, int flags, int color[4])
{
    Protobuf message = UserMessageToProtobuf(StartMessageOne("Fade", clientIndex, USERMSG_RELIABLE));
 
    message.SetInt  ("duration",  FloatToUnsignedFixed16(duration, CSGO_SCREENFADE_FRACTIONAL_BITS));
    message.SetInt  ("hold_time", FloatToUnsignedFixed16(holdTime, CSGO_SCREENFADE_FRACTIONAL_BITS));
    message.SetInt  ("flags",     flags);
    message.SetColor("clr",       color);
 
    EndMessage();
}

Rumble

Name: Rumble
Structure:
int32 index
int32 data
int32 flags


Rumble.Index:

#define RUMBLE_INVALID                  (-1)
#define RUMBLE_STOP_ALL                 (0) // Cease all current rumbling effects.
#define RUMBLE_PISTOL                   (1)
#define RUMBLE_357                      (2)
#define RUMBLE_SMG1                     (3)
#define RUMBLE_AR2                      (4)
#define RUMBLE_SHOTGUN_SINGLE           (5)
#define RUMBLE_SHOTGUN_DOUBLE           (6)
#define RUMBLE_AR2_ALT_FIRE             (7)
#define RUMBLE_RPG_MISSILE              (8)
#define RUMBLE_CROWBAR_SWING            (9)
#define RUMBLE_AIRBOAT_GUN              (10)
#define RUMBLE_JEEP_ENGINE_LOOP         (11)
#define RUMBLE_FLAT_LEFT                (12)
#define RUMBLE_FLAT_RIGHT               (13)
#define RUMBLE_FLAT_BOTH                (14)
#define RUMBLE_DMG_LOW                  (15)
#define RUMBLE_DMG_MED                  (16)
#define RUMBLE_DMG_HIGH                 (17)
#define RUMBLE_FALL_LONG                (18)
#define RUMBLE_FALL_SHORT               (19)
#define RUMBLE_PHYSCANNON_OPEN          (20)
#define RUMBLE_PHYSCANNON_PUNT          (21)
#define RUMBLE_PHYSCANNON_LOW           (22)
#define RUMBLE_PHYSCANNON_MEDIUM        (23)
#define RUMBLE_PHYSCANNON_HIGH          (24)
#define RUMBLE_PORTALGUN_LEFT           (25)
#define RUMBLE_PORTALGUN_RIGHT          (26)
#define RUMBLE_PORTAL_PLACEMENT_FAILURE (27)

Rumble.Flags:

#define RUMBLE_FLAGS_NONE            (0x0000)
#define RUMBLE_FLAG_STOP             (0x0001) // Stop any instance of this type of effect that's already playing
#define RUMBLE_FLAG_LOOP             (0x0002) // Make this effect loop
#define RUMBLE_FLAG_RESTART          (0x0004) // If this effect is already playing, restart it
#define RUMBLE_FLAG_UPDATE_SCALE     (0x0008) // Apply DATA to this effect if already playing, but don't restart
#define RUMBLE_FLAG_ONLYONE          (0x0010) // Don't play this effect if it is already playing
#define RUMBLE_FLAG_RANDOM_AMPLITUDE (0x0020) // Amplitude scale will be randomly chosen (Between 10% and 100%)
#define RUMBLE_FLAG_INITIAL_SCALE    (0x0040) // Data is the initial scale to start this effect (* 100)

CloseCaption

Name: CloseCaption
Structure:
uint32 hash
int32 duration
bool from_player
string cctoken


CloseCaptionDirect

Name: CloseCaptionDirect
Structure:
uint32 hash
int32 duration
bool from_player


SendAudio

Name: SendAudio
Structure:
string radio_sound


RawAudio

Name: RawAudio
Structure:
int32 pitch
int32 ent_index
float duration
string voice_filename


VoiceMask

Name: VoiceMask.PlayerMask
Structure:
int32 game_rules_mask
int32 ban_masks


Name: VoiceMask
Structure:
repeated VoiceMask.PlayerMask player_masks
bool player_mod_enable


Damage

Name: Damage
Structure:
int32 amount
CMsgVector inflictor_world_pos
int32 victim_entindex


RadioText

Name: RadioText
Structure:
int32 msg_dst
int32 client
string msg_name
repeated string params


HintText

Name: HintText
Structure:
string text


KeyHintText

Name: KeyHintText
Structure:
string hints


ProcessSpottedEntityUpdate

Note: gurjeets - Message below is slightly bigger in size than the non-protobuf version, by around 8 bits.

Name: ProcessSpottedEntityUpdate.SpottedEntityUpdate
Structure:
int32 entity_idx
int32 class_id
int32 origin_x
int32 origin_y
int32 origin_z
int32 angle_y
bool defuser
bool player_has_defuser
bool player_has_c4


Name: ProcessSpottedEntityUpdate
Structure:
bool new_update
repeated ProcessSpottedEntityUpdate.SpottedEntityUpdate entity_updates


SendPlayerItemDrops

Name: SendPlayerItemDrops
Structure:
repeated ? entity_updates


SendPlayerItemFound

Name: SendPlayerItemFound
Structure:
? iteminfo
int32 entindex


RetakeUpdatePlayerCardList

Name: RetakeUpdatePlayerCardList
Structure:
bool defuse_kit
repeated int32 round_idx
repeated int32 loadout_idx
repeated int32 card_idx
repeated int32 type_idx
int32 mvp_boost_round_idx
int32 mvp_boost_loadout_idx
int32 mvp_boost_card_idx
int32 mvp_boost_extra_utility


RetakeUpdatePlayerCardSelection

Name: RetakeUpdatePlayerCardSelection
Structure:
int32 round_idx
int32 loadout_idx
int32 card_idx
int32 type_idx


ReloadEffect

Name: ReloadEffect
Structure:
int32 entidx
int32 actanim
float origin_x
float origin_y
float origin_z


WeaponSound

Name: WeaponSound
Structure:
int32 entidx
float origin_x
float origin_y
float origin_z
string sound
float timestamp


UpdateScreenHealthBar

Name: UpdateScreenHealthBar
Structure:
int32 entidx
float healthratio_old
float healthratio_new
int32 style


EntityOutlineHighlight

Name: EntityOutlineHighlight
Structure:
int32 entidx
bool removehighlight


AdjustMoney

Name: AdjustMoney
Structure:
int32 amount


ReportHit

Name: ReportHit
Structure:
float pos_x
float pos_y
float pos_z
float timestamp


KillCam

Name: KillCam
Structure:
int32 obs_mode
int32 first_target
int32 second_target


DesiredTimescale

Name: DesiredTimescale
Structure:
float desired_timescale
float duration_realtime_sec
int32 interpolator_type
float start_blend_time


CurrentTimescale

Name: CurrentTimescale
Structure:
float cur_timescale


AchievementEvent

Name: AchievementEvent
Structure:
int32 achievement
int32 count
int32 user_id


MatchEndConditions

Name: MatchEndConditions
Structure:
int32 fraglimit
int32 mp_maxrounds
int32 mp_winlimit
int32 mp_timelimit


PlayerStatsUpdate

Name: PlayerStatsUpdate.Stat
Structure:
int32 idx
int32 delta


Name: PlayerStatsUpdate
Structure:
int32 version
repeated PlayerStatsUpdate.Stat stats
int32 user_id
int32 crc


DisplayInventory

Name: DisplayInventory
Structure:
bool display
int32 user_id


QuestProgress

Name: QuestProgress
Structure:
uint32 quest_id
uint32 normal_points
uint32 bonus_points
bool is_event_quest


ScoreLeaderboardData

Name: ScoreLeaderboardData
Structure:
? data


PlayerDecalDigitalSignature

Name: PlayerDecalDigitalSignature
Structure:
? data


XRankGet

Note: Get ELO Rank Value from Client

Name: XRankGet
Structure:
int32 mode_idx
int32 controller


XRankUpd

Note: Update ELO Rank Value on Client

Name: XRankUpd
Structure:
int32 mode_idx
int32 controller
int32 ranking


CallVoteFailed

Name: CallVoteFailed
Structure:
int32 reason
int32 time


VoteStart

Name: VoteStart
Structure:
int32 team
int32 ent_idx
int32 vote_type
string disp_str
string details_str
string other_team_str
bool is_yes_no_vote
int32 entidx_target


VotePass

Name: VotePass
Structure:
int32 team
int32 vote_type
string disp_str
string details_str


VoteFailed

Name: VoteFailed
Structure:
int32 team
int32 reason


VoteSetup

Name: VoteSetup
Structure:
repeated string potential_issues


SendLastKillerDamageToClient

Name: SendLastKillerDamageToClient
Structure:
int32 num_hits_given
int32 damage_given
int32 num_hits_taken
int32 damage_taken


ServerRankUpdate

Name: ServerRankUpdate.RankUpdate
Structure:
int32 account_id
int32 rank_old
int32 rank_new
int32 num_wins
float rank_change
int32 rank_type_id


Name: ServerRankUpdate
Structure:
repeated ServerRankUpdate.RankUpdate rank_update


XpUpdate

Name: XpUpdate
Structure:
? data


ItemPickup

Name: ItemPickup
Structure:
string item


ShowMenu

Note: show hud menu

Name: ShowMenu
Structure:
int32 bits_valid_slots
int32 display_time
string menu_string


BarTime

Note: For the C4 progress bar

Name: BarTime
Structure:
string time


AmmoDenied

Name: AmmoDenied
Structure:
int32 ammoIdx


MarkAchievement

Name: MarkAchievement
Structure:
string achievement


MatchStatsUpdate

Name: MatchStatsUpdate
Structure:
string update


ItemDrop

Name: ItemDrop
Structure:
int64 itemid
bool death


GlowPropTurnOff

Name: GlowPropTurnOff
Structure:
int32 entidx


RoundBackupFilenames

Name: RoundBackupFilenames
Structure:
int32 count
int32 index
string filename
string nicename


SSUI

Name: SSUI
Structure:
bool show
float start_time
float end_time


SurvivalStats

Name: SurvivalStats.Fact
Structure:
int32 type
int32 display
int32 value
float interestingness


Name: SurvivalStats.Placement
Structure:
uint64 xuid
int32 teamnumber
int32 placement


Name: SurvivalStats.Damage
Structure:
uint64 xuid
int32 to
int32 to_hits
int32 from
int32 from_hits


Name: SurvivalStats
Structure:
uint64 xuid
repeated SurvivalStats.Fact facts
repeated SurvivalStats.Placement users
repeated SurvivalStats.Damage damages
int32 ticknumber


EndOfMatchAllPlayersData

Name: EndOfMatchAllPlayersData.Accolade
Structure:
int32 eaccolade
float value
int32 position


Name: EndOfMatchAllPlayersData.PlayerData
Structure:
int32 entindex
uint64 xuid
string name
int32 teamnumber
EndOfMatchAllPlayersData.Accolade nomination
repeated ? items
int32 playercolor
bool isbot


Name: EndOfMatchAllPlayersData
Structure:
repeated EndOfMatchAllPlayersData.PlayerData allplayerdata
int32 scene


RoundImpactScoreData

Name: RoundImpactScoreData.RisEvent.Victim
Structure:
int32 team_number
int32 entindex
uint64 xuid
int32 color
bool is_bot
bool is_dead


Name: RoundImpactScoreData.RisEvent.Objective
Structure:
int32 type


Name: RoundImpactScoreData.RisEvent.Damage
Structure:
int32 target_entindex
uint64 target_xuid
int32 health_removed
int32 num_hits
int32 return_health_removed
int32 num_return_hits


Name: RoundImpactScoreData.RisEvent
Structure:
float timestamp
int32 terrorist_odds
int32 ct_alive
int32 t_alive
RoundImpactScoreData.RisEvent.Victim victim_data
RoundImpactScoreData.RisEvent.Objective objective_data
repeated RoundImpactScoreData.RisEvent.Damage all_damage_data


Name: RoundImpactScoreData.InitialConditions
Structure:
int32 ct_equip_value
int32 t_equip_value
int32 terrorist_odds


Name: RoundImpactScoreData
Structure:
RoundImpactScoreData.InitialConditions init_conditions
repeated RoundImpactScoreData.RisEvent all_ris_event_data


CurrentRoundOdds

Name: CurrentRoundOdds
Structure:
int32 odds


DeepStats

Name: DeepStats
Structure:
? stats


ResetHud

Name: ResetHud
Structure:
bool reset


GameTitle

Name: GameTitle
Structure:
int32 dummy


RequestState

Name: RequestState
Structure:
int32 dummy


StopSpectatorMode

Name: StopSpectatorMode
Structure:
int32 dummy


DisconnectToLobby

Name: DisconnectToLobby
Structure:
int32 dummy


WarmupHasEnded

Name: WarmupHasEnded
Structure:
int32 dummy


ClientInfo

Name: ClientInfo
Structure:
int32 dummy


ServerRankRevealAll

Name: ServerRankRevealAll
Structure:
int32 seconds_till_shutdown
? reservation