Client message format

From ioquake3 wiki

Jump to: navigation, search

At its basic level, a client message consists of the server ID, the sequence number of the last server netchan message received, the ID of the last server command received, a list of client commands, and optional movement data. Since there can be a variable number of client commands and the movement data is optional, these operations start with an 8-bit identifier code to disambiguate between them. The end of the list is identified with a special EOF code.

Contents

Structures

top-level format

Template:FormatTable


client-command

Template:FormatTable


move

Template:FormatTable


move-no-delta

Template:FormatTable


user-commands

Template:FormatTable User command values are doubly-encoded with a key that is different than the key used to encode the entire netchan message. Also, unlike the netchan message encoding, the values are encoded before they are compressed. This second key is generated by xor'ing the netchan message key with the time value. See = and = for details.

comments

One interesting effect of encoding the user command values is that because they are encoded before they are compressed, it potentially degrades the compressibility of the values. If, however, the values are effectively random numbers to begin with, then they aren't very compressible anyway, so encoding them wouldn't hurt much.

One suspects that user command encoding is a remnant of legacy code. It seems as if user commands alone were encoded in earlier versions of the code. Later versions may have then encoded the entire message after compression, but left this existing code in place.

See also

Personal tools