eolib.protocol

EO protocol data structures.

class ProtocolEnumMeta[source]

Bases: EnumType

Enum metaclass that preserves unrecognized values as synthetic enum members.

exception SerializationError[source]

Bases: Exception

Represents an error in serializing a protocol data structure.

__init__(message)[source]

Constructs a SerializationError with the specified error message.

Parameters:

message (str) – The error message.

class AdminLevel[source]

Bases: IntEnum

The admin level of a player

Player = 0
Spy = 1
LightGuide = 2
Guardian = 3
GameMaster = 4
HighGameMaster = 5
class Coords[source]

Bases: object

Map coordinates

__init__(*, x, y)[source]

Create a new instance of Coords.

Parameters:
  • x (int) – (Value range is 0-252.)

  • y (int) – (Value range is 0-252.)

property byte_size: int

The size of the data that this was deserialized from.

property x: int

The x field.

property y: int

The y field.

static serialize(writer, data) None[source]

Serializes an instance of Coords to the provided EoWriter.

Parameters:
  • writer (EoWriter) – The writer that the data will be serialized to.

  • data (Coords) – The data to serialize.

static deserialize(reader) Coords[source]

Deserializes an instance of Coords from the provided EoReader.

Parameters:

reader (EoReader) – The writer that the data will be serialized to.

Returns:

The data to serialize.

class Direction[source]

Bases: IntEnum

The direction a player or NPC is facing

Down = 0
Left = 1
Up = 2
Right = 3
class Emote[source]

Bases: IntEnum

Emote that can be played over a player’s head

Happy = 1
Depressed = 2
Sad = 3
Angry = 4
Confused = 5
Surprised = 6
Hearts = 7
Moon = 8
Suicidal = 9
Embarrassed = 10
Drunk = 11
Trade = 12
LevelUp = 13
Playful = 14
class Gender[source]

Bases: IntEnum

The gender of a player

Female = 0
Male = 1