eolib.protocol.net

EO network protocol data structures.

class Packet[source]

Bases: ABC

Object representation of a packet in the EO network protocol.

abstractmethod static family() PacketFamily[source]

Returns the packet family associated with this packet.

Returns:

The packet family associated with this packet.

abstractmethod static action() PacketAction[source]

Returns the packet action associated with this packet.

Returns:

The packet action associated with this packet.

abstractmethod write(writer) None[source]

Serializes and writes this packet to the provided EoWriter.

Parameters:

writer (EoWriter) – the writer that this packet will be written to.

class CharItem[source]

Bases: object

An item reference with a 1-byte amount. Used for craft ingredients.

__init__(*, id, amount)[source]

Create a new instance of CharItem.

Parameters:
  • id (int) – (Value range is 0-64008.)

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

property byte_size: int

The size of the data that this was deserialized from.

property id: int

The id field.

property amount: int

The amount field.

static serialize(writer, data) None[source]

Serializes an instance of CharItem to the provided EoWriter.

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

  • data (CharItem) – The data to serialize.

static deserialize(reader) CharItem[source]

Deserializes an instance of CharItem from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.

class Item[source]

Bases: object

An item reference with a 4-byte amount

__init__(*, id, amount)[source]

Create a new instance of Item.

Parameters:
  • id (int) – (Value range is 0-64008.)

  • amount (int) – (Value range is 0-4097152080.)

property byte_size: int

The size of the data that this was deserialized from.

property id: int

The id field.

property amount: int

The amount field.

static serialize(writer, data) None[source]

Serializes an instance of Item to the provided EoWriter.

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

  • data (Item) – The data to serialize.

static deserialize(reader) Item[source]

Deserializes an instance of Item from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.

class PacketAction[source]

Bases: IntEnum

The specific action that a packet performs. Part of the unique packet ID.

Request = 1
Accept = 2
Reply = 3
Remove = 4
Agree = 5
Create = 6
Add = 7
Player = 8
Take = 9
Use = 10
Buy = 11
Sell = 12
Open = 13
Close = 14
Msg = 15
Spec = 16
Admin = 17
List = 18
Tell = 20
Report = 21
Announce = 22
Server = 23
Drop = 24
Junk = 25
Obtain = 26
Get = 27
Kick = 28
Rank = 29
TargetSelf = 30
TargetOther = 31
TargetGroup = 33
Dialog = 34
Ping = 240
Pong = 241
Net242 = 242
Net243 = 243
Net244 = 244
Error = 250
Init = 255
class PacketFamily[source]

Bases: IntEnum

The type of operation that a packet performs. Part of the unique packet ID.

Connection = 1
Account = 2
Character = 3
Login = 4
Welcome = 5
Walk = 6
Face = 7
Chair = 8
Emote = 9
Attack = 11
Spell = 12
Shop = 13
Item = 14
StatSkill = 16
Global = 17
Talk = 18
Warp = 19
Jukebox = 21
Players = 22
Avatar = 23
Party = 24
Refresh = 25
Npc = 26
PlayerRange = 27
NpcRange = 28
Range = 29
Paperdoll = 30
Effect = 31
Trade = 32
Chest = 33
Door = 34
Message = 35
Bank = 36
Locker = 37
Barber = 38
Guild = 39
Music = 40
Sit = 41
Recover = 42
Board = 43
Cast = 44
Arena = 45
Priest = 46
Marriage = 47
AdminInteract = 48
Citizen = 49
Quest = 50
Book = 51
Error = 250
Init = 255
class PartyRequestType[source]

Bases: IntEnum

Whether a player is requesting to join a party, or inviting someone to join theirs

Join = 0
Invite = 1
class QuestPage[source]

Bases: IntEnum

A page in the Quest menu

Progress = 1
History = 2
class Spell[source]

Bases: object

A spell known by the player

__init__(*, id, level)[source]

Create a new instance of Spell.

Parameters:
  • id (int) – (Value range is 0-64008.)

  • level (int) – (Value range is 0-64008.)

property byte_size: int

The size of the data that this was deserialized from.

property id: int

The id field.

property level: int

The level field.

static serialize(writer, data) None[source]

Serializes an instance of Spell to the provided EoWriter.

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

  • data (Spell) – The data to serialize.

static deserialize(reader) Spell[source]

Deserializes an instance of Spell from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.

class ThreeItem[source]

Bases: object

An item reference with a 3-byte amount. Used for shops, lockers, and various item transfers.

__init__(*, id, amount)[source]

Create a new instance of ThreeItem.

Parameters:
  • id (int) – (Value range is 0-64008.)

  • amount (int) – (Value range is 0-16194276.)

property byte_size: int

The size of the data that this was deserialized from.

property id: int

The id field.

property amount: int

The amount field.

static serialize(writer, data) None[source]

Serializes an instance of ThreeItem to the provided EoWriter.

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

  • data (ThreeItem) – The data to serialize.

static deserialize(reader) ThreeItem[source]

Deserializes an instance of ThreeItem from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.

class Version[source]

Bases: object

Client version

__init__(*, major, minor, patch)[source]

Create a new instance of Version.

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

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

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

property byte_size: int

The size of the data that this was deserialized from.

property major: int

The major field.

property minor: int

The minor field.

property patch: int

The patch field.

static serialize(writer, data) None[source]

Serializes an instance of Version to the provided EoWriter.

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

  • data (Version) – The data to serialize.

static deserialize(reader) Version[source]

Deserializes an instance of Version from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.

class Weight[source]

Bases: object

Current carry weight and maximum carry capacity of a player

__init__(*, current, max)[source]

Create a new instance of Weight.

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

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

property byte_size: int

The size of the data that this was deserialized from.

property current: int

The current field.

property max: int

The max field.

static serialize(writer, data) None[source]

Serializes an instance of Weight to the provided EoWriter.

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

  • data (Weight) – The data to serialize.

static deserialize(reader) Weight[source]

Deserializes an instance of Weight from the provided EoReader.

Parameters:

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

Returns:

The data to serialize.