Usercmd

From Valve Developer Community
Revision as of 09:20, 2 April 2008 by TomEdwards (talk | contribs) (→‎Code locations: more info; plus that SVN link is horribly outdated)
Jump to navigation Jump to search

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.

  1. Input packaged in client/c_baseplayer.cpp and client/c_basehlplayer.cpp - look for CreateMove()
  2. Class definition and data serialisation in shared/usercmd.cpp
  3. Unpacking performed in server/player_command.cpp

See also