berconpy.protocol.PacketType

class berconpy.protocol.PacketType(value)

Bases: Enum

The type of packet received by the server.

Each Packet instance falls under one of these types and can be checked through the Packet.type property.

The value of this enum directly corresponds with the protocol specification.

Note

This type can also be inferred from the packet’s class as subclasses directly correspond to the message type they are representing in the protocol (a.k.a. typestates).

Attributes

LOGIN

Used for the login process initiated by the client.

COMMAND

Used for command/response exchanges between the client and server.

MESSAGE

Used for messages indicating activity on the server and acknowledgements by the client.

COMMAND = 1

Used for command/response exchanges between the client and server.

LOGIN = 0

Used for the login process initiated by the client.

MESSAGE = 2

Used for messages indicating activity on the server and acknowledgements by the client.