Difference between revisions of "Half-Life 1 Engine Messages"

From AlliedModders Wiki
Jump to: navigation, search
(SVC_FILETXFERFAILED)
m (SVC_SPAWNSTATICSOUND)
 
(38 intermediate revisions by 4 users not shown)
Line 63: Line 63:
  
 
= SVC_ADDANGLE =
 
= SVC_ADDANGLE =
 +
Add an angle on the yaw axis of the current client's view angle.<br>
 +
{{qnotice|When pev->fixangle is set to 2, this message is called with pev->avelocity[1] as a value.}}<br>
 +
{{qnotice|The value needs to be scaled by (65536  / 360).}}
  
Add an angle on the yaw axis of the current player's view angle.<br>
+
{{begin-hl1msg|SVC_ADDANGLE }}
{{qnotice|The value needs to be divided by ( 360 / 65536 ).}}<br>
+
{{hl1msg|short|AngleToAdd}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_CDTRACK =
 +
Plays a Half-Life music.<br>
 +
{{qnotice|Track number goes from 1 to 30.}}<br>
 +
{{qnotice|The music files are located in valve/media/.}}<br>
 +
{{qnotice|The ''LoopTrack'' param is unused but required.}}
  
{{begin-hl1msg|SVC_ADDANGLE }}
+
{{begin-hl1msg|SVC_CDTRACK }}
{{hl1msg|short|YawAngleToAdd / ( 360 / 65536 )}}
+
{{hl1msg|byte|Track}}
 +
{{hl1msg|byte|LoopTrack}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_CENTERPRINT =
 +
Sends a centered message.<br>
 +
 
 +
{{qnotice|Called from pfnClientPrintf with print_center as type.}}
 +
 
 +
{{begin-hl1msg|SVC_CENTERPRINT}}
 +
{{hl1msg|string|Message}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_CHOKE =
 
= SVC_CHOKE =
 +
Notify the client that some outgoing datagrams were not transmitted due to exceeding bandwidth rate limits.<br>
  
 
{{qnotice|This message has no arguments.}}<br>
 
{{qnotice|This message has no arguments.}}<br>
  
 
{{begin-hl1msg|SVC_CHOKE}}
 
{{begin-hl1msg|SVC_CHOKE}}
 +
{{end-hl1msg}}
 +
 +
= SVC_CLIENTDATA =
 +
Contains information about the client state at the time of last server frame.<br>
 +
Weapon data is also sent if the client is predicting weapon state changes.<br>
 +
{{qnotice|''DeltaUpdateMask'' determines the frame which should be taken as a source for delta compression.}}<br>
 +
{{qnotice|The length of ''WeaponIndex'' field is 5 on some outdated engines where MAX_WEAPON_DATA is set to 32.}}<br>
 +
{{qnotice|If ''HasDelta'' is set to 0, ''DeltaUpdateMask'' should not be sent, and the client will not inherit previous data from any frame.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
 +
 +
{{begin-hl1msg|SVC_CLIENTDATA}}
 +
{{hl1msg|1 bit|HasDelta}}
 +
{{hl1msg|8 bits|DeltaUpdateMask}}
 +
{{hl1msg|n bits|ClientData (delta-compressed clientdata_t)}}
 +
{{hl1msg|1 bit|HasWeaponData}}
 +
{{hl1msg|6 bits|WeaponIndex}}
 +
{{hl1msg|n bits|WeaponData (delta-compressed weapon_data_t)}}
 +
{{hl1msg|...|more weapon data if needed}}
 +
{{hl1msg|1 bit|0 (signifies the end of weapon data)}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_CROSSHAIRANGLE =
 
= SVC_CROSSHAIRANGLE =
 +
Adjusts the weapon's crosshair angle.<br>
 +
Basically, the weapon position on the player's view can have a different origin.
  
Adjusts the origin of player's weapons.<br>
+
{{qnotice|Called by pfnCrosshairAngle. So, the same as EngFunc_CrosshairAngle.}}<br>
{{qnotice|Pitch being the vertical axis and Yaw the horizontal one.}}<br>
+
{{qnotice|If you use the engine call, no need to scale by 5.}}<br>
{{qnotice|Value can go between -128 to 127.}}<br>
+
{{qnotice|Use 0 for both to get the default position.}}<br>
{{qnotice|Use 0 for both to get the default position.}}
 
  
 
{{begin-hl1msg|SVC_CROSSHAIRANGLE }}
 
{{begin-hl1msg|SVC_CROSSHAIRANGLE }}
{{hl1msg|char|Pitch}}
+
{{hl1msg|char|PitchAngle * 5}}
{{hl1msg|char|Yaw}}
+
{{hl1msg|char|YawAngle * 5}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_CUSTOMIZATION =
 +
Notifies the client that a new customization is avaliable for download.<br>
 +
 
 +
{{qnotice|Sent for all active clients every time a new player finishes uploading its custom resources.}}<br>
 +
{{qnotice|Also sent for this very client a number of times with information about the customizations of all other clients currently on the server.}}<br>
 +
{{qnotice|''MD5Hash'' is sent only if Flags has the RES_CUSTOM (4) bit set.}}<br>
 +
{{begin-hl1msg|SVC_CUSTOMIZATION}}
 +
{{hl1msg|byte|PlayerIndex}}
 +
{{hl1msg|byte|Type}}
 +
{{hl1msg|string|Name}}
 +
{{hl1msg|short|Index}}
 +
{{hl1msg|long|DownloadSize}}
 +
{{hl1msg|byte|Flags}}
 +
{{hl1msg|16 bytes|MD5Hash}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
Line 101: Line 159:
  
 
= SVC_DAMAGE =
 
= SVC_DAMAGE =
 +
{{qnotice|Deprecated.}}<br>
 +
{{qnotice|This message has no arguments.}}<br>
  
{{qnotice|Deprecated. }}<br>
+
{{begin-hl1msg|SVC_DAMAGE}}
 +
{{end-hl1msg}}
  
{{begin-hl1msg|SVC_DAMAGE}}
+
= SVC_DECALNAME =
 +
Allows to set, into the client's decals array and at specific position index (0->511), a decal name.<br>
 +
E.g: let's say you send a message to set a decal "{break" at index 200.<br>
 +
As result, when a message TE_ will be used to show a decal at index 200, we will see "{break".
 +
 
 +
{{qnotice|If there is already an existing decal at the provided index, it will be overwritten. }}<br>
 +
{{qnotice|It appears we can play only with decals from decals.wad. }}<br>
 +
 
 +
{{begin-hl1msg|SVC_DECALNAME}}
 +
{{hl1msg|byte|PositionIndex}}
 +
{{hl1msg|string|DecalName}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_DELTADESCRIPTION =
 +
Synchronizes client delta descriptions with server ones.
 +
 
 +
{{qnotice|The descriptions are parsed from "delta.lst" once on server startup.}}<br>
 +
{{qnotice|''Fields'' are delta-compressed too using the meta delta definition, which is identical both on the client and the server.}}<br>
 +
{{qnotice|This message has some of its arguments in bit-packed form.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_DELTADESCRIPTION}}
 +
{{hl1msg|string|Name}}
 +
{{hl1msg|16 bits|NumFields}}
 +
{{hl1msg|n bits|Fields (delta-compressed)}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_DELTAPACKETENTITIES =
 +
Contains information about the entity states, like origin, angles and such.<br>
 +
This is the basic means of sending entity updates to the client.
 +
 
 +
{{qnotice|''UpdateMask'' determines the frame which should be taken as a source for delta compression.}}<br>
 +
{{qnotice|Each entity can inherit itself in a number of ways:}}<br>
 +
{{qnotice|&nbsp;- from a "null" state (no delta);}}<br>
 +
{{qnotice|&nbsp;- from a previous entity in the message;}}<br>
 +
{{qnotice|&nbsp;- from a "best" calculated baseline;}}<br>
 +
{{qnotice|&nbsp;- from an instanced baseline set by the game library.}}<br>
 +
{{qnotice|''NoDelta'' means there would be no delta information following the header.}}<br>
 +
{{qnotice|Entity index can be short (6 bits) or long (11 bits). The short index is basically a difference between current and previous index.}}<br>
 +
{{qnotice|If difference is 1, no index would be sent.}}<br>
 +
{{qnotice|Compression is done using one of three encoders: entity_state_t, entity_state_player_t and custom_entity_state_t.}}<br>
 +
{{qnotice|"Best" baseline is a baseline with the least amount of fields that were changed, and as such, the lesser network traffic.}}<br>
 +
{{qnotice|This message has some of its arguments in bit-packed form.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_DELTAPACKETENTITIES}}
 +
{{hl1msg|short|NumberOfEntities}}
 +
{{hl1msg|byte|UpdateMask}}
 +
{{hl1msg|1 bit|NoDelta}}
 +
{{hl1msg|1 bit|HasIndexDiff}}
 +
{{hl1msg|] 6 bits|EntIndexDiff}}
 +
{{hl1msg|] or|}}
 +
{{hl1msg|] 11 bits|EntIndex}}
 +
{{hl1msg|1 bit|CustomDelta}}
 +
{{hl1msg|1 bit|HasInstancedBaseline}}
 +
{{hl1msg|] 6 bits|InstancedIndex}}
 +
{{hl1msg|1 bit|HasBestBaseline}}
 +
{{hl1msg|] 6 bits|BestIndex}}
 +
{{hl1msg|n bits|EntityState (delta-compressed)}}
 +
{{hl1msg|...|repeat for any entities need to be updated}}
 +
{{hl1msg|16 bits|0}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_DISCONNECT =
 
= SVC_DISCONNECT =
Disconnect player with given reason.
+
Disconnects a player with given reason.
  
 
{{begin-hl1msg|SVC_DISCONNECT}}
 
{{begin-hl1msg|SVC_DISCONNECT}}
Line 114: Line 235:
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
= SVC_INTERMISSION =
+
= SVC_EVENT =
Shows the intermission camera view
+
An event, defined by the game library, has recently occurred on the server.
 +
 
 +
{{qnotice|This message can be dropped if the client already has too much content in its unreliable buffer.}}<br>
 +
{{qnotice|Events can be precached using pfnPrecacheEvent routine.}}<br>
 +
{{qnotice|Events are queued and grouped together every frame, if there's any.}}<br>
 +
{{qnotice|EventArgs are always inherited from "null" event args.}}<br>
 +
{{qnotice|Only a max of 31 events can be queued and subsequently sent this way.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_EVENT}}
 +
{{hl1msg|5 bits|NumberOfEvents}}
 +
{{hl1msg|10 bits|EventIndex}}
 +
{{hl1msg|1 bit|HasEntsInPack}}
 +
{{hl1msg|] 11 bits|PacketIndex}}
 +
{{hl1msg|] 1 bit|HasEventArgs}}
 +
{{hl1msg|]  n bits|EventArgs (delta-compressed event_args_t)}}
 +
{{hl1msg|1 bit|HasFireTime}}
 +
{{hl1msg|] 16 bits|FireTime}}
 +
{{hl1msg|...|more events if needed}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_EVENT_RELIABLE =
 +
This message is simular to SVC_EVENT, but no queuing takes place, and the message can only hold one event.
  
{{qnotice|Intermission mode 1. }}<br>
+
{{qnotice|All events with FEV_RELIABLE flag set would be sent this way.}}<br>
 +
{{qnotice|The message would be fragmented and sent separately if it overflows the client network channel.}}<br>
 +
{{qnotice|EventArgs are always inherited from "null" event args.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
  
{{begin-hl1msg|SVC_INTERMISSION}}
+
{{begin-hl1msg|SVC_EVENT_RELIABLE}}
 +
{{hl1msg|10 bits|EventIndex}}
 +
{{hl1msg|n bits|EventArgs (delta-compressed event_args_t)}}
 +
{{hl1msg|1 bit|HasFireTime}}
 +
{{hl1msg|] 16 bits|FireTime}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_FILETXFERFAILED =
 
= SVC_FILETXFERFAILED =
  
Send a message to the client's console telling what file has failed to be transfered.<br>
+
Sends a message to the client's console telling what file has failed to be transfered.<br>
 
{{qnotice|The message type is : "Error: server failed to transmit file 'FileName'""}}
 
{{qnotice|The message type is : "Error: server failed to transmit file 'FileName'""}}
  
Line 139: Line 291:
 
{{begin-hl1msg|SVC_FINALE}}
 
{{begin-hl1msg|SVC_FINALE}}
 
{{hl1msg|string|Text}}
 
{{hl1msg|string|Text}}
{{end-hl1msg}}
 
 
= SVC_KILLEDMONSTER =
 
 
{{qnotice|Deprecated. }}<br>
 
 
{{begin-hl1msg|SVC_KILLEDMONSTER}}
 
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_FOUNDSECRET =
 
= SVC_FOUNDSECRET =
  
{{qnotice|Deprecated. }}<br>
+
{{qnotice|Deprecated.}}<br>
 +
{{qnotice|This message has no arguments.}}<br>
  
 
{{begin-hl1msg|SVC_FOUNDSECRET}}
 
{{begin-hl1msg|SVC_FOUNDSECRET}}
Line 166: Line 312:
 
{{begin-hl1msg|SVC_HLTV}}
 
{{begin-hl1msg|SVC_HLTV}}
 
{{hl1msg|byte|Mode}}
 
{{hl1msg|byte|Mode}}
 +
{{end-hl1msg}}
 +
 +
= SVC_INTERMISSION =
 +
Shows the intermission camera view
 +
 +
{{qnotice|Intermission mode 1. }}<br>
 +
{{qnotice|This message has no arguments.}}
 +
 +
{{begin-hl1msg|SVC_INTERMISSION}}
 +
{{end-hl1msg}}
 +
 +
= SVC_KILLEDMONSTER =
 +
 +
{{qnotice|Deprecated.}}<br>
 +
{{qnotice|This message has no arguments.}}<br>
 +
 +
{{begin-hl1msg|SVC_KILLEDMONSTER}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
Line 212: Line 375:
 
{{hl1msg|byte|index}}
 
{{hl1msg|byte|index}}
 
{{hl1msg|string|lightinfo}}
 
{{hl1msg|string|lightinfo}}
 +
{{end-hl1msg}}
 +
 +
= SVC_NEWMOVEVARS =
 +
Updates client's movevars.
 +
 +
{{qnotice|This message is sent on client's connect and when any change is detected between the current server movevars and server cvars values. }}<br>
 +
{{qnotice|If there is a change, the value of server cvars are copied into the server movevars, then the message is sent to all players using the server movevars. }}<br>
 +
 +
{{begin-hl1msg|SVC_NEWMOVEVARS}}
 +
{{hl1msg|float|Gravity}}
 +
{{hl1msg|float|StopSpeed}}
 +
{{hl1msg|float|MaxSpeed}}
 +
{{hl1msg|float|SpectatorMaxSpeed}}
 +
{{hl1msg|float|Accelerate}}
 +
{{hl1msg|float|AirAccelerate}}
 +
{{hl1msg|float|WaterAccelerate}}
 +
{{hl1msg|float|Friction}}
 +
{{hl1msg|float|EdgeFriction}}
 +
{{hl1msg|float|WaterFriction}}
 +
{{hl1msg|float|EntGravity}}
 +
{{hl1msg|float|Bounce}}
 +
{{hl1msg|float|StepSize}}
 +
{{hl1msg|float|MaxVelocity}}
 +
{{hl1msg|float|ZMax}}
 +
{{hl1msg|float|WaveHeigth}}
 +
{{hl1msg|byte|Footsteps}}
 +
{{hl1msg|float|RollAngle}}
 +
{{hl1msg|float|RollSpeed}}
 +
{{hl1msg|float|SkyColorRed}}
 +
{{hl1msg|float|SkyColorGreen}}
 +
{{hl1msg|float|SkyColorBlue}}
 +
{{hl1msg|float|SkyVecX}}
 +
{{hl1msg|float|SkyVecY}}
 +
{{hl1msg|float|SkyVecZ}}
 +
{{hl1msg|string|SkyName}}
 +
{{end-hl1msg}}
 +
 +
= SVC_NEWUSERMSG =
 +
Registers a new user message on the client.
 +
 +
{{qnotice|Sent every time a new message is registered on the server, but most games do this only once on the map change or server startup.}}<br>
 +
{{qnotice|''Name'' can be represented as an array of 4 "longs".}}<br>
 +
 +
{{begin-hl1msg|SVC_NEWUSERMSG}}
 +
{{hl1msg|byte|Index}}
 +
{{hl1msg|byte|Size}}
 +
{{hl1msg|16 bits|Name}}
 +
{{end-hl1msg}}
 +
 +
= SVC_NOP =
 +
Does absolutely nothing.
 +
 +
{{qnotice|Server pads outgoing messages with SVC_NOP if the total datagram size is lesser than 16.}}<br>
 +
{{qnotice|This message has no arguments.}}<br>
 +
 +
{{begin-hl1msg|SVC_NOP}}
 +
{{end-hl1msg}}
 +
 +
= SVC_PACKETENTITIES =
 +
Contains information about the entity states, like origin, angles and such.<br>
 +
This message is the same as SVC_DELTAPACKETENTITIES, only with UpdateMask field omitted.
 +
 +
{{qnotice|The delta compression still takes place, albeit from a "null" state.}}<br>
 +
{{qnotice|This message has some of its arguments in bit-packed form.}}<br>
 +
 +
{{begin-hl1msg|SVC_PACKETENTITIES}}
 +
{{hl1msg|short|NumberOfEntities}}
 +
{{hl1msg|...|see SVC_DELTAPACKETENTITIES}}
 +
{{hl1msg|16 bits|0}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 +
{{end-hl1msg}}
 +
 +
= SVC_PARTICLE =
 +
Shows a particle effect.
 +
 +
{{qnotice|Called from pfnParticleEffect. So, the same as EngFunc_ParticleEffect. }}<br>
 +
{{qnotice|The direction has to be a value between -128 to 127, after the scale operation. }}<br>
 +
{{qnotice|You don't need to scaled by 16 if you use the engine call. }}<br>
 +
{{qnotice|Color is an index from the palette attached at right. }}<br>
 +
 +
[[File:Palette.png|200px|thumb|right|Standard Quake1 palette]]
 +
 +
{{begin-hl1msg|SVC_PARTICLE}}
 +
{{hl1msg|coord|OriginX}}
 +
{{hl1msg|coord|OriginY}}
 +
{{hl1msg|coord|OriginZ}}
 +
{{hl1msg|char|DirectionX * 16}}
 +
{{hl1msg|char|DirectionY * 16}}
 +
{{hl1msg|char|DirectionZ * 16}}
 +
{{hl1msg|byte|Count}}
 +
{{hl1msg|byte|Color}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_PINGS =
 
= SVC_PINGS =
Contains ping, loss for several players.
+
Contains ping and loss values for a number of players.
  
{{qnotice|Flag is 1 - rest data contains PlayerID, Ping and Loss at least for 1 player. }}<br>
+
{{qnotice|Current server builds send this message every once in a frame, resulting in lots of unnecessary network overhead. This happens due to a bug in SV_ShouldUpdatePing routine; it can be observed by typing ''cl_messages'' in the console after some time playing on a server.}}<br>
{{qnotice|Flag is 0 - end of the message, skip remaining bits. }}<br>
+
{{qnotice|This message has its arguments in bit-packed form.}}<br>
{{qnotice| ... - Flag + PlayerID + Ping + Loss - N times. }}<br>
 
  
 
{{begin-hl1msg|SVC_PINGS}}
 
{{begin-hl1msg|SVC_PINGS}}
{{hl1msg|1 bit|Flag 1}}
+
{{hl1msg|1 bit|1}}
 
{{hl1msg|5 bits|PlayerID}}
 
{{hl1msg|5 bits|PlayerID}}
 
{{hl1msg|12 bits|Ping}}
 
{{hl1msg|12 bits|Ping}}
 
{{hl1msg|7 bits|Loss}}
 
{{hl1msg|7 bits|Loss}}
{{hl1msg|...|...}}
+
{{hl1msg|...|repeat for as many players as needed}}
{{hl1msg|1 bit|Flag 0}}
+
{{hl1msg|1 bit|0}}
{{hl1msg|n bits|Align to byte with zero bits}}
+
{{hl1msg|n bits|alignment to byte boundary}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_PRINT =
 +
Sends a message to the client's console. <br>
 +
 
 +
{{qnotice|Called from pfnClientPrintf with print_console or print_notify as type.}}
 +
 
 +
{{begin-hl1msg|SVC_PRINT}}
 +
{{hl1msg|string|Message}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_RESOURCELIST =
 +
This message contains all the resources provided by the server for clients to download. Consistency info can also be included.
 +
 
 +
{{qnotice|''MD5Hash'' is sent only if ''Flags'' has the RES_CUSTOM (4) bit set.}}<br>
 +
{{qnotice|Outgoing ''Flags'' field can only include RES_FATALIFMISSING and RES_WASMISSING.}}<br>
 +
{{qnotice|If ''ExtraInfo'' is empty, it is not sent, and ''HasExtraInfo'' must be equal to 0.}}<br>
 +
{{qnotice|Otherwise, ''ExtraInfo'' can include a FORCE_TYPE variable and allowed min/max size for models.}}<br>
 +
{{qnotice|Consistency info is not sent in any of these cases:}}<br>
 +
{{qnotice|&nbsp;- mp_consistency is set to 0;}}<br>
 +
{{qnotice|&nbsp;- the current game mode is singleplayer, or it is a listen server;}}<br>
 +
{{qnotice|&nbsp;- there were no calls to ForceUnmodified before sending the resource list;}}<br>
 +
{{qnotice|&nbsp;- the receiving client is a HLTV proxy.}}<br>
 +
{{qnotice|Every resource with RES_CHECKFILE would be included in consistency list.}}<br>
 +
{{qnotice|The consistency index can be short or long. Short index is a difference between current and last index.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_RESOURCELIST}}
 +
{{hl1msg|12 bits|NumResources}}
 +
{{hl1msg|4 bits|Type}}
 +
{{hl1msg|n bits|Name}}
 +
{{hl1msg|12 bits|Index}}
 +
{{hl1msg|24 bits|DownloadSize}}
 +
{{hl1msg|3 bits|Flags}}
 +
{{hl1msg|128 bits|MD5Hash}}
 +
{{hl1msg|1 bit|HasExtraInfo}}
 +
{{hl1msg|] 256 bits|ExtraInfo}}
 +
{{hl1msg|...|repeat for NumResources}}
 +
{{hl1msg|1 bit|HasConsistency}}
 +
{{hl1msg|] 1 bit|1}}
 +
{{hl1msg|] 1 bit|IsShortIndex}}
 +
{{hl1msg|]  5 bits|Index}}
 +
{{hl1msg|]  or|}}
 +
{{hl1msg|]  10 bits|Index}}
 +
{{hl1msg|] ...|repeat for all resources with RES_CHECKFILE flag set}}
 +
{{hl1msg|] 1 bit|0}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
Line 236: Line 536:
 
{{begin-hl1msg|SVC_RESOURCELOCATION}}
 
{{begin-hl1msg|SVC_RESOURCELOCATION}}
 
{{hl1msg|string|sv_downloadurl}}
 
{{hl1msg|string|sv_downloadurl}}
 +
{{end-hl1msg}}
 +
 +
= SVC_RESOURCEREQUEST =
 +
Allows the client to send its own resource list (CLC_RESOURCELIST).
 +
 +
{{begin-hl1msg|SVC_RESOURCEREQUEST}}
 +
{{hl1msg|long|SpawnCount}}
 +
{{hl1msg|long|0}}
 +
{{end-hl1msg}}
 +
 +
= SVC_RESTORE =
 +
Maintains a global transition table for the saved game.
 +
 +
{{qnotice|Sent only if a save file is being played, and a new client connects to the server.}}<br>
 +
{{qnotice|HLTV clients can't connect to a saved game, and subsequently they can't receive this message.}}<br>
 +
{{qnotice|SaveName is formatted like: "SAVE/(map name).HL2".}}<br>
 +
 +
{{begin-hl1msg|SVC_RESTORE}}
 +
{{hl1msg|string|SaveName}}
 +
{{hl1msg|byte|MapCount}}
 +
{{hl1msg|  string|MapName}}
 +
{{hl1msg|  ...|repeat for MapCount times}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_ROOMTYPE =
 
= SVC_ROOMTYPE =
Set client room_type cvar to provided value.
+
Sets client room_type cvar to provided value.
 +
 
 +
<pawn>0 = Normal (off)
 +
1 = Generic
 +
2 = Metal Small
 +
3 = Metal Medium
 +
4 = Metal Large
 +
5 = Tunnel Small
 +
6 = Tunnel Medium
 +
7 = Tunnel Large
 +
8 = Chamber Small
 +
9 = Chamber Medium
 +
10 = Chamber Large
 +
11 = Bright Small
 +
12 = Bright Medium
 +
13 = Bright Large
 +
14 = Water 1
 +
15 = Water 2
 +
16 = Water 3
 +
17 = Concrete Small
 +
18 = Concrete Medium
 +
19 = Concrete Large
 +
20 = Big 1
 +
21 = Big 2
 +
22 = Big 3
 +
23 = Cavern Small
 +
24 = Cavern Medium
 +
25 = Cavern Large
 +
26 = Weirdo 1
 +
27 = Weirdo 2
 +
28 = Weirdo 3</pawn>
  
 
{{begin-hl1msg|SVC_ROOMTYPE}}
 
{{begin-hl1msg|SVC_ROOMTYPE}}
Line 245: Line 597:
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
= SVC_STUFFTEXT =
+
= SVC_SENDCVARVALUE =
Executes command on player.
+
Request a cvar value from a connected client.
 +
 
 +
{{qnotice|This message is considered obsolete, since it provides no option to differentiate between various cvar queries.}}<br>
 +
{{qnotice|After the client has successfully responded, the server calls pfnCvarValue function in the game library.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_SENDCVARVALUE}}
 +
{{hl1msg|string|Name}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_SENDCVARVALUE2 =
 +
Request a cvar value from a connected client.
 +
 
 +
{{qnotice|RequestID is provided to be able to distinguish cvar queries between each other.}}<br>
 +
{{qnotice|After the client has successfully responded, the server calls pfnCvarValue2 function in the game library.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_SENDCVARVALUE2}}
 +
{{hl1msg|long|RequestID}}
 +
{{hl1msg|string|Name}}
 +
{{end-hl1msg}}
 +
 
 +
= SVC_SENDEXTRAINFO =
 +
Sends some extra information regarding the server.
  
{{qnotice|Works similar to client_cmd(index,const command[],any:...) }}<br>
+
{{qnotice|This message is sent at player's connection right after SVC_SERVERINFO.}}<br>
 +
{{qnotice|The sv_cheats cvar will be set on the client with the value provided.}}<br>
 +
{{qnotice|It appears ''FallbackDir'' is always null.}}<br>
  
{{begin-hl1msg|SVC_STUFFTEXT}}
+
{{begin-hl1msg|SVC_SENDEXTRAINFO}}
{{hl1msg|string|Command}}
+
{{hl1msg|string|FallbackDir}}
 +
{{hl1msg|byte|CanCheat}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
= SVC_TIMESCALE =
+
= SVC_SERVERINFO =
{{begin-hl1msg|SVC_TIMESCALE}}
+
Contains information about the server.
{{hl1msg|float|TimeScale}}
+
 
 +
{{qnotice|''SpawnCount'' is the number of times the server has changed its map.}}<br>
 +
{{qnotice|''MapFileName'' contains full map name relatively to the root directory, like ''maps/de_dust2.bsp''.}}<br>
 +
{{qnotice|Contents of "mapcyclefile" are copied into ''Mapcycle'' string, allowing up to 8 KB of data.}}<br>
 +
 
 +
{{begin-hl1msg|SVC_SERVERINFO}}
 +
{{hl1msg|long|Protocol}}
 +
{{hl1msg|long|SpawnCount}}
 +
{{hl1msg|long|MapCRC}}
 +
{{hl1msg|16 bytes|ClientDLLHash}}
 +
{{hl1msg|byte|MaxPlayers}}
 +
{{hl1msg|byte|PlayerIndex}}
 +
{{hl1msg|byte|IsDeathmatch}}
 +
{{hl1msg|string|GameDir}}
 +
{{hl1msg|string|Hostname}}
 +
{{hl1msg|string|MapFileName}}
 +
{{hl1msg|string|Mapcycle}}
 +
{{hl1msg|byte|0}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
= SVC_VOICEINIT =
+
= SVC_SETANGLE =
Sends sv_voicecodec and sv_voicequality cvars to client.
+
Update immediately the client's view angles.
  
{{qnotice|Codec name either voice_miles or voice_speex.}}<br>
+
{{qnotice|When pev->fixangle is set to a value other than 0 or 2, this message is sent with the current player's pev->v_angle values.}}<br>
{{qnotice|Quality 1 to 5.}}<br>
+
{{qnotice|This message is also sent during the client connection process, but with ''AngleRoll'' always set to 0.}}<br>
 +
{{qnotice|The provided angles need to be scaled by (65536 / 360).}}<br>
  
{{begin-hl1msg|SVC_VOICEINIT}}
+
{{begin-hl1msg|SVC_SETANGLE}}
{{hl1msg|string|CodecName}}
+
{{hl1msg|short|AnglePitch}}
{{hl1msg|byte|Quality}}
+
{{hl1msg|short|AngleYaw}}
 +
{{hl1msg|short|AngleRoll}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
Line 278: Line 673:
 
{{begin-hl1msg|SVC_SETPAUSE}}
 
{{begin-hl1msg|SVC_SETPAUSE}}
 
{{hl1msg|byte|IsPaused}}
 
{{hl1msg|byte|IsPaused}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SETVIEW =
 +
Attaches a player's view to an entity.
 +
 +
{{qnotice|Called from pfnSetView. The same as attach_view() native. }}<br>
 +
 +
{{begin-hl1msg|SVC_SETVIEW}}
 +
{{hl1msg|short|EntityIndex}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SIGNONNUM =
 +
Called just after client_putinserver. Signals the client that the server has marked it as "active".
 +
 +
{{begin-hl1msg|SVC_SIGNONNUM}}
 +
{{hl1msg|byte|1}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SOUND =
 +
Plays a sound file on the client.
 +
 +
{{qnotice|The sound index can be short or long. If the index can fit in a single byte, the short variant is used, otherwise SND_LONG_INDEX bit (4) is included in ''Flags'' and 16 bits would be used for ''SoundIndex'' variable.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
 +
 +
{{begin-hl1msg|SVC_SOUND}}
 +
{{hl1msg|9 bits|Flags}}
 +
{{hl1msg|8 bits|Volume * 255 (flags&1)}}
 +
{{hl1msg|8 bits|Attenuation * 64 (flags&2)}}
 +
{{hl1msg|3 bits|Channel}}
 +
{{hl1msg|11 bits|EntityIndex}}
 +
{{hl1msg|] 16 bits|SoundIndex (flags&4)}}
 +
{{hl1msg|] or|}}
 +
{{hl1msg|] 8 bits|SoundIndex !(flags&4)}}
 +
{{hl1msg|n bits|Origin}}
 +
{{hl1msg|8 bits|Pitch (flags&8)}}
 +
{{hl1msg|n bits|alignment to byte boundary}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SOUNDFADE =
 +
Updates client side sound fade.<br>
 +
It's used to modulate sound volume on the client.<br>
 +
Such functionality is part of a main function where the purpose would be to update sound subsystem and cd audio.
 +
 +
{{qnotice|EngFunc_FadeClientVolume sends that message to client.}}<br>
 +
 +
{{begin-hl1msg|SVC_SOUNDFADE}}
 +
{{hl1msg|byte|InitialPercent}}
 +
{{hl1msg|byte|HoldTime}}
 +
{{hl1msg|byte|FadeOutTime}}
 +
{{hl1msg|byte|FadeInTime}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SPAWNBASELINE =
 +
Creates a baseline for future referencing.
 +
 +
{{qnotice|This message can hold more than one baseline.}}<br>
 +
{{qnotice|Delta-compressed fields are inherited from a "null" value.}}<br>
 +
{{qnotice|Engine baselines are sent first; they are formed from all eligible entities at the moment of map startup.}}<br>
 +
{{qnotice|GameDLL baselines are sent after engine ones. They are formed at the same time, but a game library can manually define them in CreateInstancedBaseline calls.}}<br>
 +
{{qnotice|There is no limit how many baselines can be sent. However, only 63 game baselines can be created by a game library, and ''NumInstanced'' can only hold 6 bits.}}<br>
 +
{{qnotice|This message has its arguments in bit-packed form.}}<br>
 +
 +
{{begin-hl1msg|SVC_SPAWNBASELINE}}
 +
{{hl1msg|] 11 bits|EntityIndex}}
 +
{{hl1msg|] 2 bits|EntityType}}
 +
{{hl1msg|] n bits|EntityState (delta-compressed)}}
 +
{{hl1msg|] ...|repeat for every eligible entity}}
 +
{{hl1msg|16 bits|65535}}
 +
{{hl1msg|6 bits|NumInstanced}}
 +
{{hl1msg|] n bits|EntityState (delta-compressed)}}
 +
{{hl1msg|] ...|repeat for all instanced baselines}}
 +
{{end-hl1msg}}
 +
 +
= SVC_SPAWNSTATIC =
 +
Marks an entity as "static", so that it can be freed from server memory.
 +
 +
{{qnotice|''RenderAmt'', ''RenderColor'' and ''RenderFX'' are sent only if ''RenderMode'' does not equal to 0.}}<br>
 +
{{qnotice|''ColorMap'' and ''Skin'' fields are deprecated; they can be set to 0.}}<br>
 +
 +
{{begin-hl1msg|SVC_SPAWNSTATIC}}
 +
{{hl1msg|short|ModelIndex}}
 +
{{hl1msg|byte|Sequence}}
 +
{{hl1msg|byte|Frame}}
 +
{{hl1msg|short|ColorMap}}
 +
{{hl1msg|byte|Skin}}
 +
{{hl1msg|coord|OriginX}}
 +
{{hl1msg|angle|AngleX}}
 +
{{hl1msg|coord|OriginY}}
 +
{{hl1msg|angle|AngleY}}
 +
{{hl1msg|coord|OriginZ}}
 +
{{hl1msg|angle|AngleZ}}
 +
{{hl1msg|byte|RenderMode}}
 +
{{hl1msg|] byte|RenderAmt}}
 +
{{hl1msg|] byte|RenderColorR}}
 +
{{hl1msg|] byte|RenderColorG}}
 +
{{hl1msg|] byte|RenderColorB}}
 +
{{hl1msg|] byte|RenderFX}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_SPAWNSTATICSOUND =
 
= SVC_SPAWNSTATICSOUND =
 
 
Start playback of a sound, loaded into the static portion of the channel array.<br>
 
Start playback of a sound, loaded into the static portion of the channel array.<br>
 
This should be used for looping ambient sounds, looping sounds that should not non-creature sentences, and one-shot ambient streaming sounds.<br>  
 
This should be used for looping ambient sounds, looping sounds that should not non-creature sentences, and one-shot ambient streaming sounds.<br>  
 
It can also play 'regular' sounds one-shot, in case designers want to trigger regular game sounds.<br>
 
It can also play 'regular' sounds one-shot, in case designers want to trigger regular game sounds.<br>
 
The sound can be spawned either from a fixed position or from an entity.<br>
 
The sound can be spawned either from a fixed position or from an entity.<br>
{{qnotice|To use it on a fixed position, provide a valid origin and set EntityIndex with 0.}}<br>
+
 
{{qnotice|To use it from an entity, so position is updated, provide a valid EntityIndex and set Origin with a null vector.}}<br>
+
{{qnotice|To use it on a fixed position, provide a valid origin and set ''EntityIndex'' with 0.}}<br>
 +
{{qnotice|To use it from an entity, so position is updated, provide a valid ''EntityIndex'' and set ''Origin'' with a null vector.}}<br>
 
{{qnotice|To stop a sound with SVC_STOPSOUND, a valid EntityIndex is needed.}}<br>
 
{{qnotice|To stop a sound with SVC_STOPSOUND, a valid EntityIndex is needed.}}<br>
{{qnotice|Volume has to be scaled by 255 and Attenuation by 64.}}<br>
+
{{qnotice|''Volume'' has to be scaled by 255 and ''Attenuation'' by 64.}}<br>
 
{{qnotice|Use SND_SENTENCE (1<<4) as flag for sentence sounds. }}<br>
 
{{qnotice|Use SND_SENTENCE (1<<4) as flag for sentence sounds. }}<br>
 
{{qnotice|It can be sent to one player.}}<br>
 
{{qnotice|It can be sent to one player.}}<br>
Line 301: Line 793:
 
{{hl1msg|byte|Attenuation * 64}}
 
{{hl1msg|byte|Attenuation * 64}}
 
{{hl1msg|short|EntityIndex}}
 
{{hl1msg|short|EntityIndex}}
 +
{{hl1msg|byte|Pitch}}
 
{{hl1msg|byte|Flags}}
 
{{hl1msg|byte|Flags}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}
  
 
= SVC_STOPSOUND =
 
= SVC_STOPSOUND =
 
 
Stops an ambient sound.
 
Stops an ambient sound.
  
 
{{begin-hl1msg|SVC_STOPSOUND}}
 
{{begin-hl1msg|SVC_STOPSOUND}}
 
{{hl1msg|short|EntityIndex}}
 
{{hl1msg|short|EntityIndex}}
 +
{{end-hl1msg}}
 +
 +
= SVC_STUFFTEXT =
 +
Executes command on player.
 +
 +
{{qnotice|This message is sent by client_cmd(index,const command[],any:...) }}<br>
 +
 +
{{begin-hl1msg|SVC_STUFFTEXT}}
 +
{{hl1msg|string|Command}}
 +
{{end-hl1msg}}
 +
 +
= SVC_TEMPENTITY =
 +
Creates a [[Temp_Entity_Events_(Half-Life_1)|temp entity]].
 +
 +
{{begin-hl1msg|SVC_TEMPENTITY}}
 +
{{hl1msg|byte|[[Temp_Entity_Events_(Half-Life_1)|MessageIndex]]}}
 +
{{hl1msg|...|...}}
 +
{{end-hl1msg}}
 +
 +
= SVC_TIME =
 +
Notifies clients about the current server time.
 +
 +
{{qnotice|This message is sent every frame by the server.}}<br>
 +
 +
{{begin-hl1msg|SVC_TIME}}
 +
{{hl1msg|float|Time}}
 +
{{end-hl1msg}}
 +
 +
= SVC_TIMESCALE =
 +
 +
{{begin-hl1msg|SVC_TIMESCALE}}
 +
{{hl1msg|float|TimeScale}}
 +
{{end-hl1msg}}
 +
 +
= SVC_UPDATEUSERINFO =
 +
Contains information about a particular client.
 +
See following posts for more details : https://forums.alliedmods.net/showthread.php?p=1995516#post1995516
 +
 +
{{qnotice|This message is sent at a number of times:}}<br>
 +
{{qnotice|&nbsp;- at the moment of client activation (during the connection);}}<br>
 +
{{qnotice|&nbsp;- at the moment of disconnection with ClientUserInfo set to "";}}<br>
 +
{{qnotice|&nbsp;- using "fullupdate" command or having impulse #204 set in incoming move packets;}}<br>
 +
{{qnotice|&nbsp;- if the userinfo was changed, but only once per second for a single client.}}<br>
 +
 +
{{begin-hl1msg|SVC_UPDATEUSERINFO}}
 +
{{hl1msg|byte|ClientIndex}}
 +
{{hl1msg|long|ClientUserID}}
 +
{{hl1msg|string|ClientUserInfo}}
 +
{{hl1msg|16 bytes|ClientCDKeyHash}}
 +
{{end-hl1msg}}
 +
 +
= SVC_VERSION =
 +
Disconnects the client and sends a message to the console if the number passed doesn't match the current server protocol version.<br>
 +
 +
{{qnotice|Message type sent: "CL_Parse_Version: Server is protocol %i instead of %i\n".}}<br>
 +
{{qnotice|This message seems to be unused.}}<br>
 +
 +
{{begin-hl1msg|SVC_VERSION}}
 +
{{hl1msg|long|ProtocolVersion}}
 +
{{end-hl1msg}}
 +
 +
= SVC_VOICEDATA =
 +
Contains compressed voice data.
 +
 +
{{qnotice|Size can be no higher than 4096.}}<br>
 +
 +
{{begin-hl1msg|SVC_VOICEDATA}}
 +
{{hl1msg|byte|PlayerIndex}}
 +
{{hl1msg|short|Size}}
 +
{{hl1msg|"Size" bytes|Data}}
 +
{{end-hl1msg}}
 +
 +
= SVC_VOICEINIT =
 +
Sends sv_voicecodec and sv_voicequality cvars to client.
 +
 +
{{qnotice|Codec name either voice_miles or voice_speex.}}<br>
 +
{{qnotice|Quality 1 to 5.}}<br>
 +
 +
{{begin-hl1msg|SVC_VOICEINIT}}
 +
{{hl1msg|string|CodecName}}
 +
{{hl1msg|byte|Quality}}
 +
{{end-hl1msg}}
 +
 +
= SVC_WEAPONANIM =
 +
Plays a weapon sequence.
 +
 +
{{begin-hl1msg|SVC_WEAPONANIM}}
 +
{{hl1msg|byte|SequenceNumber}}
 +
{{hl1msg|byte|WeaponmodelBodygroup}}
 
{{end-hl1msg}}
 
{{end-hl1msg}}

Latest revision as of 23:03, 12 July 2022

//SVC_BAD                 0
SVC_NOP                   1
SVC_DISCONNECT            2
SVC_EVENT                 3
SVC_VERSION               4
SVC_SETVIEW               5
SVC_SOUND                 6
SVC_TIME                  7
SVC_PRINT                 8
SVC_STUFFTEXT             9
SVC_SETANGLE              10
SVC_SERVERINFO            11
SVC_LIGHTSTYLE            12
SVC_UPDATEUSERINFO        13
SVC_DELTADESCRIPTION      14
SVC_CLIENTDATA            15
SVC_STOPSOUND             16
SVC_PINGS                 17
SVC_PARTICLE              18
SVC_DAMAGE                19
SVC_SPAWNSTATIC           20
SVC_EVENT_RELIABLE        21
SVC_SPAWNBASELINE         22
SVC_TEMPENTITY            23
SVC_SETPAUSE              24
SVC_SIGNONNUM             25
SVC_CENTERPRINT           26
SVC_KILLEDMONSTER         27
SVC_FOUNDSECRET           28
SVC_SPAWNSTATICSOUND      29
SVC_INTERMISSION          30
SVC_FINALE                31
SVC_CDTRACK               32
SVC_RESTORE               33
SVC_CUTSCENE              34
SVC_WEAPONANIM            35
SVC_DECALNAME             36
SVC_ROOMTYPE              37
SVC_ADDANGLE              38
SVC_NEWUSERMSG            39
SVC_PACKETENTITIES        40
SVC_DELTAPACKETENTITIES   41
SVC_CHOKE                 42
SVC_RESOURCELIST          43
SVC_NEWMOVEVARS           44
SVC_RESOURCEREQUEST       45
SVC_CUSTOMIZATION         46
SVC_CROSSHAIRANGLE        47
SVC_SOUNDFADE             48
SVC_FILETXFERFAILED       49
SVC_HLTV                  50
SVC_DIRECTOR              51
SVC_VOICEINIT             52
SVC_VOICEDATA             53
SVC_SENDEXTRAINFO         54
SVC_TIMESCALE             55
SVC_RESOURCELOCATION      56
SVC_SENDCVARVALUE         57
SVC_SENDCVARVALUE2        58


SVC_ADDANGLE

Add an angle on the yaw axis of the current client's view angle.
Note: When pev->fixangle is set to 2, this message is called with pev->avelocity[1] as a value.
Note: The value needs to be scaled by (65536 / 360).

Name: SVC_ADDANGLE
Structure:
short AngleToAdd


SVC_CDTRACK

Plays a Half-Life music.
Note: Track number goes from 1 to 30.
Note: The music files are located in valve/media/.
Note: The LoopTrack param is unused but required.

Name: SVC_CDTRACK
Structure:
byte Track
byte LoopTrack


SVC_CENTERPRINT

Sends a centered message.

Note: Called from pfnClientPrintf with print_center as type.

Name: SVC_CENTERPRINT
Structure:
string Message


SVC_CHOKE

Notify the client that some outgoing datagrams were not transmitted due to exceeding bandwidth rate limits.

Note: This message has no arguments.

Name: SVC_CHOKE
Structure:


SVC_CLIENTDATA

Contains information about the client state at the time of last server frame.
Weapon data is also sent if the client is predicting weapon state changes.
Note: DeltaUpdateMask determines the frame which should be taken as a source for delta compression.
Note: The length of WeaponIndex field is 5 on some outdated engines where MAX_WEAPON_DATA is set to 32.
Note: If HasDelta is set to 0, DeltaUpdateMask should not be sent, and the client will not inherit previous data from any frame.
Note: This message has its arguments in bit-packed form.

Name: SVC_CLIENTDATA
Structure:
1 bit HasDelta
8 bits DeltaUpdateMask
n bits ClientData (delta-compressed clientdata_t)
1 bit HasWeaponData
6 bits WeaponIndex
n bits WeaponData (delta-compressed weapon_data_t)
... more weapon data if needed
1 bit 0 (signifies the end of weapon data)
n bits alignment to byte boundary


SVC_CROSSHAIRANGLE

Adjusts the weapon's crosshair angle.
Basically, the weapon position on the player's view can have a different origin.

Note: Called by pfnCrosshairAngle. So, the same as EngFunc_CrosshairAngle.
Note: If you use the engine call, no need to scale by 5.
Note: Use 0 for both to get the default position.

Name: SVC_CROSSHAIRANGLE
Structure:
char PitchAngle * 5
char YawAngle * 5


SVC_CUSTOMIZATION

Notifies the client that a new customization is avaliable for download.

Note: Sent for all active clients every time a new player finishes uploading its custom resources.
Note: Also sent for this very client a number of times with information about the customizations of all other clients currently on the server.
Note: MD5Hash is sent only if Flags has the RES_CUSTOM (4) bit set.

Name: SVC_CUSTOMIZATION
Structure:
byte PlayerIndex
byte Type
string Name
short Index
long DownloadSize
byte Flags
16 bytes MD5Hash


SVC_CUTSCENE

Shows the intermission camera view, and writes-out text passed in first parameter.

Note: Intermission mode 3.
Note: This text will keep showing on clients in future intermissions.

Name: SVC_CUTSCENE
Structure:
string Text


SVC_DAMAGE

Note: Deprecated.
Note: This message has no arguments.

Name: SVC_DAMAGE
Structure:


SVC_DECALNAME

Allows to set, into the client's decals array and at specific position index (0->511), a decal name.
E.g: let's say you send a message to set a decal "{break" at index 200.
As result, when a message TE_ will be used to show a decal at index 200, we will see "{break".

Note: If there is already an existing decal at the provided index, it will be overwritten.
Note: It appears we can play only with decals from decals.wad.

Name: SVC_DECALNAME
Structure:
byte PositionIndex
string DecalName


SVC_DELTADESCRIPTION

Synchronizes client delta descriptions with server ones.

Note: The descriptions are parsed from "delta.lst" once on server startup.
Note: Fields are delta-compressed too using the meta delta definition, which is identical both on the client and the server.
Note: This message has some of its arguments in bit-packed form.

Name: SVC_DELTADESCRIPTION
Structure:
string Name
16 bits NumFields
n bits Fields (delta-compressed)
n bits alignment to byte boundary


SVC_DELTAPACKETENTITIES

Contains information about the entity states, like origin, angles and such.
This is the basic means of sending entity updates to the client.

Note: UpdateMask determines the frame which should be taken as a source for delta compression.
Note: Each entity can inherit itself in a number of ways:
Note:  - from a "null" state (no delta);
Note:  - from a previous entity in the message;
Note:  - from a "best" calculated baseline;
Note:  - from an instanced baseline set by the game library.
Note: NoDelta means there would be no delta information following the header.
Note: Entity index can be short (6 bits) or long (11 bits). The short index is basically a difference between current and previous index.
Note: If difference is 1, no index would be sent.
Note: Compression is done using one of three encoders: entity_state_t, entity_state_player_t and custom_entity_state_t.
Note: "Best" baseline is a baseline with the least amount of fields that were changed, and as such, the lesser network traffic.
Note: This message has some of its arguments in bit-packed form.

Name: SVC_DELTAPACKETENTITIES
Structure:
short NumberOfEntities
byte UpdateMask
1 bit NoDelta
1 bit HasIndexDiff
] 6 bits EntIndexDiff
] or
] 11 bits EntIndex
1 bit CustomDelta
1 bit HasInstancedBaseline
] 6 bits InstancedIndex
1 bit HasBestBaseline
] 6 bits BestIndex
n bits EntityState (delta-compressed)
... repeat for any entities need to be updated
16 bits 0
n bits alignment to byte boundary


SVC_DISCONNECT

Disconnects a player with given reason.

Name: SVC_DISCONNECT
Structure:
string Reason


SVC_EVENT

An event, defined by the game library, has recently occurred on the server.

Note: This message can be dropped if the client already has too much content in its unreliable buffer.
Note: Events can be precached using pfnPrecacheEvent routine.
Note: Events are queued and grouped together every frame, if there's any.
Note: EventArgs are always inherited from "null" event args.
Note: Only a max of 31 events can be queued and subsequently sent this way.
Note: This message has its arguments in bit-packed form.

Name: SVC_EVENT
Structure:
5 bits NumberOfEvents
10 bits EventIndex
1 bit HasEntsInPack
] 11 bits PacketIndex
] 1 bit HasEventArgs
] n bits EventArgs (delta-compressed event_args_t)
1 bit HasFireTime
] 16 bits FireTime
... more events if needed
n bits alignment to byte boundary


SVC_EVENT_RELIABLE

This message is simular to SVC_EVENT, but no queuing takes place, and the message can only hold one event.

Note: All events with FEV_RELIABLE flag set would be sent this way.
Note: The message would be fragmented and sent separately if it overflows the client network channel.
Note: EventArgs are always inherited from "null" event args.
Note: This message has its arguments in bit-packed form.

Name: SVC_EVENT_RELIABLE
Structure:
10 bits EventIndex
n bits EventArgs (delta-compressed event_args_t)
1 bit HasFireTime
] 16 bits FireTime
n bits alignment to byte boundary


SVC_FILETXFERFAILED

Sends a message to the client's console telling what file has failed to be transfered.
Note: The message type is : "Error: server failed to transmit file 'FileName'""

Name: SVC_FILETXFERFAILED
Structure:
string FileName


SVC_FINALE

Shows the intermission camera view, and writes-out text passed in first parameter.

Note: Intermission mode 2.
Note: This text will keep showing on clients in future intermissions.

Name: SVC_FINALE
Structure:
string Text


SVC_FOUNDSECRET

Note: Deprecated.
Note: This message has no arguments.

Name: SVC_FOUNDSECRET
Structure:


SVC_HLTV

Tells client about current spectator mode.

As found in hltv.h:

#define HLTV_ACTIVE	0	// tells client that he's an spectator and will get director commands
#define HLTV_STATUS	1	// send status infos about proxy 
#define HLTV_LISTEN	2	// tell client to listen to a multicast stream
Name: SVC_HLTV
Structure:
byte Mode


SVC_INTERMISSION

Shows the intermission camera view

Note: Intermission mode 1.
Note: This message has no arguments.

Name: SVC_INTERMISSION
Structure:


SVC_KILLEDMONSTER

Note: Deprecated.
Note: This message has no arguments.

Name: SVC_KILLEDMONSTER
Structure:


SVC_LIGHTSTYLE

Setup light animation tables. 'a' is total darkness, 'z' is maxbright.

Note: Server send 64 lightstyles to client during client connect. Most of them has empty light info. All of them could be found in world.cpp

// 0 normal
LIGHT_STYLE(0, "m");
// 1 FLICKER (first variety)
LIGHT_STYLE(1, "mmnmmommommnonmmonqnmmo");	
// 2 SLOW STRONG PULSE
LIGHT_STYLE(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");	
// 3 CANDLE (first variety)
LIGHT_STYLE(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");	
// 4 FAST STROBE
LIGHT_STYLE(4, "mamamamamama");	
// 5 GENTLE PULSE 1
LIGHT_STYLE(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");	
// 6 FLICKER (second variety)
LIGHT_STYLE(6, "nmonqnmomnmomomno");	
// 7 CANDLE (second variety)
LIGHT_STYLE(7, "mmmaaaabcdefgmmmmaaaammmaamm");	
// 8 CANDLE (third variety)
LIGHT_STYLE(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");	
// 9 SLOW STROBE (fourth variety)
LIGHT_STYLE(9, "aaaaaaaazzzzzzzz");	
// 10 FLUORESCENT FLICKER
LIGHT_STYLE(10, "mmamammmmammamamaaamammma");
// 11 SLOW PULSE NOT FADE TO BLACK
LIGHT_STYLE(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");	
// 12 UNDERWATER LIGHT MUTATION
// this light only distorts the lightmap - no contribution
// is made to the brightness of affected surfaces
LIGHT_STYLE(12, "mmnnmmnnnmmnn");
 
// styles 32-62 are assigned by the light program for switchable lights
 
// 63 testing
LIGHT_STYLE(63, "a");
Name: SVC_LIGHTSTYLE
Structure:
byte index
string lightinfo


SVC_NEWMOVEVARS

Updates client's movevars.

Note: This message is sent on client's connect and when any change is detected between the current server movevars and server cvars values.
Note: If there is a change, the value of server cvars are copied into the server movevars, then the message is sent to all players using the server movevars.

Name: SVC_NEWMOVEVARS
Structure:
float Gravity
float StopSpeed
float MaxSpeed
float SpectatorMaxSpeed
float Accelerate
float AirAccelerate
float WaterAccelerate
float Friction
float EdgeFriction
float WaterFriction
float EntGravity
float Bounce
float StepSize
float MaxVelocity
float ZMax
float WaveHeigth
byte Footsteps
float RollAngle
float RollSpeed
float SkyColorRed
float SkyColorGreen
float SkyColorBlue
float SkyVecX
float SkyVecY
float SkyVecZ
string SkyName


SVC_NEWUSERMSG

Registers a new user message on the client.

Note: Sent every time a new message is registered on the server, but most games do this only once on the map change or server startup.
Note: Name can be represented as an array of 4 "longs".

Name: SVC_NEWUSERMSG
Structure:
byte Index
byte Size
16 bits Name


SVC_NOP

Does absolutely nothing.

Note: Server pads outgoing messages with SVC_NOP if the total datagram size is lesser than 16.
Note: This message has no arguments.

Name: SVC_NOP
Structure:


SVC_PACKETENTITIES

Contains information about the entity states, like origin, angles and such.
This message is the same as SVC_DELTAPACKETENTITIES, only with UpdateMask field omitted.

Note: The delta compression still takes place, albeit from a "null" state.
Note: This message has some of its arguments in bit-packed form.

Name: SVC_PACKETENTITIES
Structure:
short NumberOfEntities
... see SVC_DELTAPACKETENTITIES
16 bits 0
n bits alignment to byte boundary


SVC_PARTICLE

Shows a particle effect.

Note: Called from pfnParticleEffect. So, the same as EngFunc_ParticleEffect.
Note: The direction has to be a value between -128 to 127, after the scale operation.
Note: You don't need to scaled by 16 if you use the engine call.
Note: Color is an index from the palette attached at right.

Standard Quake1 palette
Name: SVC_PARTICLE
Structure:
coord OriginX
coord OriginY
coord OriginZ
char DirectionX * 16
char DirectionY * 16
char DirectionZ * 16
byte Count
byte Color


SVC_PINGS

Contains ping and loss values for a number of players.

Note: Current server builds send this message every once in a frame, resulting in lots of unnecessary network overhead. This happens due to a bug in SV_ShouldUpdatePing routine; it can be observed by typing cl_messages in the console after some time playing on a server.
Note: This message has its arguments in bit-packed form.

Name: SVC_PINGS
Structure:
1 bit 1
5 bits PlayerID
12 bits Ping
7 bits Loss
... repeat for as many players as needed
1 bit 0
n bits alignment to byte boundary


SVC_PRINT

Sends a message to the client's console.

Note: Called from pfnClientPrintf with print_console or print_notify as type.

Name: SVC_PRINT
Structure:
string Message


SVC_RESOURCELIST

This message contains all the resources provided by the server for clients to download. Consistency info can also be included.

Note: MD5Hash is sent only if Flags has the RES_CUSTOM (4) bit set.
Note: Outgoing Flags field can only include RES_FATALIFMISSING and RES_WASMISSING.
Note: If ExtraInfo is empty, it is not sent, and HasExtraInfo must be equal to 0.
Note: Otherwise, ExtraInfo can include a FORCE_TYPE variable and allowed min/max size for models.
Note: Consistency info is not sent in any of these cases:
Note:  - mp_consistency is set to 0;
Note:  - the current game mode is singleplayer, or it is a listen server;
Note:  - there were no calls to ForceUnmodified before sending the resource list;
Note:  - the receiving client is a HLTV proxy.
Note: Every resource with RES_CHECKFILE would be included in consistency list.
Note: The consistency index can be short or long. Short index is a difference between current and last index.
Note: This message has its arguments in bit-packed form.

Name: SVC_RESOURCELIST
Structure:
12 bits NumResources
4 bits Type
n bits Name
12 bits Index
24 bits DownloadSize
3 bits Flags
128 bits MD5Hash
1 bit HasExtraInfo
] 256 bits ExtraInfo
... repeat for NumResources
1 bit HasConsistency
] 1 bit 1
] 1 bit IsShortIndex
] 5 bits Index
] or
] 10 bits Index
] ... repeat for all resources with RES_CHECKFILE flag set
] 1 bit 0
n bits alignment to byte boundary


SVC_RESOURCELOCATION

This message sends sv_downloadurl to client.

Name: SVC_RESOURCELOCATION
Structure:
string sv_downloadurl


SVC_RESOURCEREQUEST

Allows the client to send its own resource list (CLC_RESOURCELIST).

Name: SVC_RESOURCEREQUEST
Structure:
long SpawnCount
long 0


SVC_RESTORE

Maintains a global transition table for the saved game.

Note: Sent only if a save file is being played, and a new client connects to the server.
Note: HLTV clients can't connect to a saved game, and subsequently they can't receive this message.
Note: SaveName is formatted like: "SAVE/(map name).HL2".

Name: SVC_RESTORE
Structure:
string SaveName
byte MapCount
string MapName
... repeat for MapCount times


SVC_ROOMTYPE

Sets client room_type cvar to provided value.

0 = Normal (off)
1 = Generic
2 = Metal Small
3 = Metal Medium
4 = Metal Large
5 = Tunnel Small
6 = Tunnel Medium
7 = Tunnel Large
8 = Chamber Small
9 = Chamber Medium
10 = Chamber Large
11 = Bright Small
12 = Bright Medium
13 = Bright Large
14 = Water 1
15 = Water 2
16 = Water 3
17 = Concrete Small
18 = Concrete Medium
19 = Concrete Large
20 = Big 1
21 = Big 2
22 = Big 3
23 = Cavern Small
24 = Cavern Medium
25 = Cavern Large
26 = Weirdo 1
27 = Weirdo 2
28 = Weirdo 3
Name: SVC_ROOMTYPE
Structure:
short Value


SVC_SENDCVARVALUE

Request a cvar value from a connected client.

Note: This message is considered obsolete, since it provides no option to differentiate between various cvar queries.
Note: After the client has successfully responded, the server calls pfnCvarValue function in the game library.

Name: SVC_SENDCVARVALUE
Structure:
string Name


SVC_SENDCVARVALUE2

Request a cvar value from a connected client.

Note: RequestID is provided to be able to distinguish cvar queries between each other.
Note: After the client has successfully responded, the server calls pfnCvarValue2 function in the game library.

Name: SVC_SENDCVARVALUE2
Structure:
long RequestID
string Name


SVC_SENDEXTRAINFO

Sends some extra information regarding the server.

Note: This message is sent at player's connection right after SVC_SERVERINFO.
Note: The sv_cheats cvar will be set on the client with the value provided.
Note: It appears FallbackDir is always null.

Name: SVC_SENDEXTRAINFO
Structure:
string FallbackDir
byte CanCheat


SVC_SERVERINFO

Contains information about the server.

Note: SpawnCount is the number of times the server has changed its map.
Note: MapFileName contains full map name relatively to the root directory, like maps/de_dust2.bsp.
Note: Contents of "mapcyclefile" are copied into Mapcycle string, allowing up to 8 KB of data.

Name: SVC_SERVERINFO
Structure:
long Protocol
long SpawnCount
long MapCRC
16 bytes ClientDLLHash
byte MaxPlayers
byte PlayerIndex
byte IsDeathmatch
string GameDir
string Hostname
string MapFileName
string Mapcycle
byte 0


SVC_SETANGLE

Update immediately the client's view angles.

Note: When pev->fixangle is set to a value other than 0 or 2, this message is sent with the current player's pev->v_angle values.
Note: This message is also sent during the client connection process, but with AngleRoll always set to 0.
Note: The provided angles need to be scaled by (65536 / 360).

Name: SVC_SETANGLE
Structure:
short AnglePitch
short AngleYaw
short AngleRoll


SVC_SETPAUSE

Puts client to a pause.

Note: If server is not paused, commands and packets from client are still sent, that means that client still can shoot/buy/etc...
Note: IsPaused: 1 - for pause, 0 - for unpause.

Name: SVC_SETPAUSE
Structure:
byte IsPaused


SVC_SETVIEW

Attaches a player's view to an entity.

Note: Called from pfnSetView. The same as attach_view() native.

Name: SVC_SETVIEW
Structure:
short EntityIndex


SVC_SIGNONNUM

Called just after client_putinserver. Signals the client that the server has marked it as "active".

Name: SVC_SIGNONNUM
Structure:
byte 1


SVC_SOUND

Plays a sound file on the client.

Note: The sound index can be short or long. If the index can fit in a single byte, the short variant is used, otherwise SND_LONG_INDEX bit (4) is included in Flags and 16 bits would be used for SoundIndex variable.
Note: This message has its arguments in bit-packed form.

Name: SVC_SOUND
Structure:
9 bits Flags
8 bits Volume * 255 (flags&1)
8 bits Attenuation * 64 (flags&2)
3 bits Channel
11 bits EntityIndex
] 16 bits SoundIndex (flags&4)
] or
] 8 bits SoundIndex !(flags&4)
n bits Origin
8 bits Pitch (flags&8)
n bits alignment to byte boundary


SVC_SOUNDFADE

Updates client side sound fade.
It's used to modulate sound volume on the client.
Such functionality is part of a main function where the purpose would be to update sound subsystem and cd audio.

Note: EngFunc_FadeClientVolume sends that message to client.

Name: SVC_SOUNDFADE
Structure:
byte InitialPercent
byte HoldTime
byte FadeOutTime
byte FadeInTime


SVC_SPAWNBASELINE

Creates a baseline for future referencing.

Note: This message can hold more than one baseline.
Note: Delta-compressed fields are inherited from a "null" value.
Note: Engine baselines are sent first; they are formed from all eligible entities at the moment of map startup.
Note: GameDLL baselines are sent after engine ones. They are formed at the same time, but a game library can manually define them in CreateInstancedBaseline calls.
Note: There is no limit how many baselines can be sent. However, only 63 game baselines can be created by a game library, and NumInstanced can only hold 6 bits.
Note: This message has its arguments in bit-packed form.

Name: SVC_SPAWNBASELINE
Structure:
] 11 bits EntityIndex
] 2 bits EntityType
] n bits EntityState (delta-compressed)
] ... repeat for every eligible entity
16 bits 65535
6 bits NumInstanced
] n bits EntityState (delta-compressed)
] ... repeat for all instanced baselines


SVC_SPAWNSTATIC

Marks an entity as "static", so that it can be freed from server memory.

Note: RenderAmt, RenderColor and RenderFX are sent only if RenderMode does not equal to 0.
Note: ColorMap and Skin fields are deprecated; they can be set to 0.

Name: SVC_SPAWNSTATIC
Structure:
short ModelIndex
byte Sequence
byte Frame
short ColorMap
byte Skin
coord OriginX
angle AngleX
coord OriginY
angle AngleY
coord OriginZ
angle AngleZ
byte RenderMode
] byte RenderAmt
] byte RenderColorR
] byte RenderColorG
] byte RenderColorB
] byte RenderFX


SVC_SPAWNSTATICSOUND

Start playback of a sound, loaded into the static portion of the channel array.
This should be used for looping ambient sounds, looping sounds that should not non-creature sentences, and one-shot ambient streaming sounds.
It can also play 'regular' sounds one-shot, in case designers want to trigger regular game sounds.
The sound can be spawned either from a fixed position or from an entity.

Note: To use it on a fixed position, provide a valid origin and set EntityIndex with 0.
Note: To use it from an entity, so position is updated, provide a valid EntityIndex and set Origin with a null vector.
Note: To stop a sound with SVC_STOPSOUND, a valid EntityIndex is needed.
Note: Volume has to be scaled by 255 and Attenuation by 64.
Note: Use SND_SENTENCE (1<<4) as flag for sentence sounds.
Note: It can be sent to one player.

Name: SVC_SPAWNSTATICSOUND
Structure:
coord OriginX
coord OriginY
coord OriginZ
short SoundIndex
byte Volume * 255
byte Attenuation * 64
short EntityIndex
byte Pitch
byte Flags


SVC_STOPSOUND

Stops an ambient sound.

Name: SVC_STOPSOUND
Structure:
short EntityIndex


SVC_STUFFTEXT

Executes command on player.

Note: This message is sent by client_cmd(index,const command[],any:...)

Name: SVC_STUFFTEXT
Structure:
string Command


SVC_TEMPENTITY

Creates a temp entity.

Name: SVC_TEMPENTITY
Structure:
byte MessageIndex
... ...


SVC_TIME

Notifies clients about the current server time.

Note: This message is sent every frame by the server.

Name: SVC_TIME
Structure:
float Time


SVC_TIMESCALE

Name: SVC_TIMESCALE
Structure:
float TimeScale


SVC_UPDATEUSERINFO

Contains information about a particular client. See following posts for more details : https://forums.alliedmods.net/showthread.php?p=1995516#post1995516

Note: This message is sent at a number of times:
Note:  - at the moment of client activation (during the connection);
Note:  - at the moment of disconnection with ClientUserInfo set to "";
Note:  - using "fullupdate" command or having impulse #204 set in incoming move packets;
Note:  - if the userinfo was changed, but only once per second for a single client.

Name: SVC_UPDATEUSERINFO
Structure:
byte ClientIndex
long ClientUserID
string ClientUserInfo
16 bytes ClientCDKeyHash


SVC_VERSION

Disconnects the client and sends a message to the console if the number passed doesn't match the current server protocol version.

Note: Message type sent: "CL_Parse_Version: Server is protocol %i instead of %i\n".
Note: This message seems to be unused.

Name: SVC_VERSION
Structure:
long ProtocolVersion


SVC_VOICEDATA

Contains compressed voice data.

Note: Size can be no higher than 4096.

Name: SVC_VOICEDATA
Structure:
byte PlayerIndex
short Size
"Size" bytes Data


SVC_VOICEINIT

Sends sv_voicecodec and sv_voicequality cvars to client.

Note: Codec name either voice_miles or voice_speex.
Note: Quality 1 to 5.

Name: SVC_VOICEINIT
Structure:
string CodecName
byte Quality


SVC_WEAPONANIM

Plays a weapon sequence.

Name: SVC_WEAPONANIM
Structure:
byte SequenceNumber
byte WeaponmodelBodygroup