|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Public Member Functions | |
| __init__ (self) | |
| parse (self, data) | |
Public Attributes | |
| dict | configstrings = {} |
| dict | baselines = {} |
| int | command_sequence = 0 |
| dict | commands = {0: ''} |
| client_num = None | |
| int | checksum_feed = None |
| int | gamestate_count = 0 |
Protected Member Functions | |
| _read_gamestate (self, r) | |
| _read_snapshot (self, r, plus=False) | |
What a client keeps between server messages: configstrings, entity baselines and the reliable server commands received so far.
| cod2snap.ServerState.__init__ | ( | self | ) |
|
protected |
svc_gamestate: the reliable sequence (commands up to it came just before, in the same message), configstrings, baselines, then the client number and checksum feed after an svc_EOF.
|
protected |
| cod2snap.ServerState.parse | ( | self, | |
| data ) |
Parses one decoded, decompressed server message (without the 4-byte header). Returns a dict with 'commands' (the new server commands, in order), 'snapshot' (or None), 'gamestate' (bool), 'downloads' and 'clean': True when the message ended exactly on its svc_EOF. A message that fails to parse sets 'error' instead.
| dict cod2snap.ServerState.baselines = {} |
| int cod2snap.ServerState.checksum_feed = None |
| cod2snap.ServerState.client_num = None |
| cod2snap.ServerState.command_sequence = 0 |
| dict cod2snap.ServerState.commands = {0: ''} |
| dict cod2snap.ServerState.configstrings = {} |
| int cod2snap.ServerState.gamestate_count = 0 |