OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
hit_location_test.Shooter Class Reference
Inheritance diagram for hit_location_test.Shooter:
cod2client.Client

Public Attributes

int presses = getattr(self, 'presses', 0) + 1
Public Attributes inherited from cod2client.Client
tuple addr = (host, port)
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 qport = random.randint(1, 0xffff)
list redirects = []
int protocol = 0
int challenge = 0
int outgoing_sequence = 0
int incoming_sequence = 0
int command_sequence = 0
str last_command = ''
dict sent_commands = {0: ''}
 state = cod2snap.ServerState()
int parsed = 0
int parsed_clean = 0
list parse_errors = []
 fragment_sequence = None
 fragment_buffer = bytearray()
int server_time = 1000
int messages_received = 0
list voice_packets = []
 server_id = None
list pending_commands = []
 connect_reply = line

Static Public Attributes

int weapon = 0
bool firing = False
bool attack = False
float pitch = 0.0
bool walking = False
bool melee = False
int frag_commands = 0

Protected Member Functions

 _parse (self, sequence, data)
 _write_move (self, payload, forward)
Protected Member Functions inherited from cod2client.Client
 _oob (self, text, reply)
 _fragment_start (self, value=None)
 _transmit (self, message)
 _process (self, packet)
 _voice (self, data)
 _decode (self, sequence, data)
 _acknowledged (self)
 _send (self, server_id, payload)
 _write_commands (self, payload, texts)
 _keep_moving (self, seconds, forward=True)

Additional Inherited Members

Public Member Functions inherited from cod2client.Client
 __init__ (self, port, host='127.0.0.1', timeout=3.0)
 close (self)
 connect (self, protocol, name, plus=123, extra=None)
 receive (self, seconds)
 client_num (self)
 checksum_feed (self)
 commands (self, server_id, texts)
 command (self, server_id, text)
 resend (self, server_id, first)
 download (self, server_id, name, seconds=2.0)
 request_gamestate (self, server_id, seconds=5.0)
 enter_game (self, server_id, seconds=2.0)
 read_frames (self, seconds, forward=True)

Detailed Description

A minimal client that sends the full usercmd, the one with the weapon
and the pitch; it stands still unless walking (forward), and while firing
it presses the attack button on every other command, or the melee one for
6 commands out of 12; the frag grenade button it holds for frag_commands.

Member Function Documentation

◆ _parse()

hit_location_test.Shooter._parse ( self,
sequence,
data )
protected
Decodes and parses one server message; see cod2snap.ServerState.parse.

Reimplemented from cod2client.Client.

◆ _write_move()

hit_location_test.Shooter._write_move ( self,
payload,
forward )
protected
One usercmd as MSG_ReadDeltaUsercmdKey reads it against the default
command: absolute server time, then changed fields XORed with the key.

Reimplemented from cod2client.Client.

Member Data Documentation

◆ attack

bool hit_location_test.Shooter.attack = False
static

◆ firing

bool hit_location_test.Shooter.firing = False
static

◆ frag_commands

int hit_location_test.Shooter.frag_commands = 0
static

◆ melee

bool hit_location_test.Shooter.melee = False
static

◆ pitch

float hit_location_test.Shooter.pitch = 0.0
static

◆ presses

int hit_location_test.Shooter.presses = getattr(self, 'presses', 0) + 1

◆ walking

bool hit_location_test.Shooter.walking = False
static

◆ weapon

int hit_location_test.Shooter.weapon = 0
static

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