Usercmd: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (recat)
No edit summary
Line 1: Line 1:
'''Usercmd''' (user command) is the player's input, for example the current keys pressed and current viewangle, which is sent to the server. By default it's sent 30 times per second ([[cl_cmdrate]]). It uses booleans to tell the server whether or not a specific variable has changed; if there has been no change, it doesn't send the new data.
'''Usercmd''' (user command) is the player's input, for example the current keys pressed and current viewangle, which is sent to the server. By default it's sent 30 times per second ([[cl_cmdrate]]). It uses booleans to tell the server whether or not a specific variable has changed; if there has been no change, it doesn't send the new data.


In code it's defined in [http://svn.alliedmods.net/viewvc.cgi/hl2sdk/game_shared/usercmd.cpp?revision=324&root=sourcemm&view=markup&pathrev=324 usercmd.cpp].
== Code locations ==
 
These need confirming.
 
*Definition, client processing and serialisation in [http://svn.alliedmods.net/viewvc.cgi/hl2sdk/game_shared/usercmd.cpp?revision=324&root=sourcemm&view=markup&pathrev=324 <code>usercmd.cpp</code>].
*Server processing performed in <code>server/player_command.cpp</code>.


== See also ==
== See also ==

Revision as of 08:26, 1 April 2008

Usercmd (user command) is the player's input, for example the current keys pressed and current viewangle, which is sent to the server. By default it's sent 30 times per second (cl_cmdrate). It uses booleans to tell the server whether or not a specific variable has changed; if there has been no change, it doesn't send the new data.

Code locations

These need confirming.

  • Definition, client processing and serialisation in usercmd.cpp.
  • Server processing performed in server/player_command.cpp.

See also