|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Public Member Functions | |
| __init__ (self, data) | |
| read_bit (self) | |
| read_bits (self, count) | |
| read_bytes (self, count) | |
| read_byte (self) | |
| read_short (self) | |
| read_long (self) | |
| read_float (self) | |
| read_string (self) | |
| read_value (self, bits) | |
| read_angle16 (self) | |
| read_small_float (self, int_bits, bias) | |
Public Attributes | |
| data = data | |
| int | readcount = 0 |
| int | bit = 0 |
Protected Member Functions | |
| _need (self, count) | |
Mirrors the server's msg_t reads: a bit read that starts a new byte takes the next unread byte, and byte reads continue after the last byte taken, so bits and bytes interleave as MSG_WriteBit and MSG_WriteByte wrote them.
| cod2snap.MsgReader.__init__ | ( | self, | |
| data ) |
|
protected |
| cod2snap.MsgReader.read_angle16 | ( | self | ) |
| cod2snap.MsgReader.read_bit | ( | self | ) |
| cod2snap.MsgReader.read_bits | ( | self, | |
| count ) |
| cod2snap.MsgReader.read_byte | ( | self | ) |
| cod2snap.MsgReader.read_bytes | ( | self, | |
| count ) |
| cod2snap.MsgReader.read_float | ( | self | ) |
| cod2snap.MsgReader.read_long | ( | self | ) |
| cod2snap.MsgReader.read_short | ( | self | ) |
Unsigned, as MSG_ReadShort returns it.
| cod2snap.MsgReader.read_small_float | ( | self, | |
| int_bits, | |||
| bias ) |
A float either as a biased integer (int_bits low bits, then a byte) or, after a 1 bit, as its 4 bytes.
| cod2snap.MsgReader.read_string | ( | self | ) |
| cod2snap.MsgReader.read_value | ( | self, | |
| bits ) |
MSG_ReadValue: the low bits & 7 as bits, the rest as whole bytes; a negative count means a signed value.
| int cod2snap.MsgReader.bit = 0 |
| cod2snap.MsgReader.data = data |
| cod2snap.MsgReader.readcount = 0 |