OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
cod2snap.ServerState Class Reference

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)

Detailed Description

What a client keeps between server messages: configstrings, entity
baselines and the reliable server commands received so far.

Constructor & Destructor Documentation

◆ __init__()

cod2snap.ServerState.__init__ ( self)

Member Function Documentation

◆ _read_gamestate()

cod2snap.ServerState._read_gamestate ( self,
r )
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.

◆ _read_snapshot()

cod2snap.ServerState._read_snapshot ( self,
r,
plus = False )
protected

◆ parse()

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.

Member Data Documentation

◆ baselines

dict cod2snap.ServerState.baselines = {}

◆ checksum_feed

int cod2snap.ServerState.checksum_feed = None

◆ client_num

cod2snap.ServerState.client_num = None

◆ command_sequence

cod2snap.ServerState.command_sequence = 0

◆ commands

dict cod2snap.ServerState.commands = {0: ''}

◆ configstrings

dict cod2snap.ServerState.configstrings = {}

◆ gamestate_count

int cod2snap.ServerState.gamestate_count = 0

The documentation for this class was generated from the following file: