eolib.packet¶
Utilities for EO packets.
- class PacketSequencer[source]¶
Bases:
objectA class for generating packet sequences.
- __init__(start)[source]¶
Constructs a new PacketSequencer with the provided SequenceStart.
- Parameters:
start (
SequenceStart) – The sequence start.
- next_sequence() int[source]¶
Returns the next sequence value, updating the sequence counter in the process.
Note
This is not a monotonic operation. The sequence counter increases from 0 to 9 before looping back around to 0.
- Returns:
The next sequence value.
- set_sequence_start(start) None[source]¶
Sets the sequence start, also known as the “starting counter ID”.
Note
This does not reset the sequence counter.
- Parameters:
start (
SequenceStart) – The new sequence start.
- class SequenceStart[source]¶
Bases:
ABCA value sent by the server to update the client’s sequence start, also known as the ‘starting counter ID’.
- static zero() SequenceStart[source]¶
Returns an instance of SequenceStart with a value of 0.
- Returns:
An instance of SequenceStart.
- class AccountReplySequenceStart[source]¶
Bases:
objectA class representing the sequence start value sent with the
ACCOUNT_REPLYserver packet.- __init__(value)[source]¶
Creates a
SimpleSequenceStartfrom an integer value.- Parameters:
value (
int) – The sequence start value.
- static from_value(value) AccountReplySequenceStart[source]¶
Creates an instance of AccountReplySequenceStart from the value sent with the ACCOUNT_REPLY server packet.
- Parameters:
value (
int) – The sequence start value sent with the ACCOUNT_REPLY server packet.- Returns:
An instance of AccountReplySequenceStart.
- static generate() AccountReplySequenceStart[source]¶
Generates an instance of AccountReplySequenceStart with a random value in the range 0-240.
- Returns:
An instance of AccountReplySequenceStart.
- class InitSequenceStart[source]¶
Bases:
objectA class representing the sequence start value sent with the
INIT_INITserver packet.- __init__(value, seq1, seq2)[source]¶
Creates a
SimpleSequenceStartfrom an integer value.- Parameters:
value (
int) – The sequence start value.
- static from_init_values(seq1, seq2) InitSequenceStart[source]¶
Creates an instance of InitSequenceStart from the values sent with the INIT_INIT server packet.
- static generate() InitSequenceStart[source]¶
Generates an instance of InitSequenceStart with a random value in the range 0-1757.
- Returns:
An instance of InitSequenceStart.
- class PingSequenceStart[source]¶
Bases:
objectA class representing the sequence start value sent with the
CONNECTION_PLAYERserver packet.- __init__(value, seq1, seq2)[source]¶
Creates a
SimpleSequenceStartfrom an integer value.- Parameters:
value (
int) – The sequence start value.
- static from_ping_values(seq1, seq2) PingSequenceStart[source]¶
Creates an instance of PingSequenceStart from the values sent with the CONNECTION_PLAYER server packet.
- static generate() PingSequenceStart[source]¶
Generates an instance of PingSequenceStart with a random value in the range 0-1757.
- Returns:
An instance of PingSequenceStart.