berconpy.ServerMessagePacket

class berconpy.ServerMessagePacket(sequence, message)

The packet sent to share a message to the client.

Parameters:
  • sequence (int) – The sequence number identifying the message.

  • message (str) – The contents contained in the message.

Methods

assert_checksum(checksum)

Asserts that the packet has a given checksum.

from_bytes(data[, from_client])

Constructs a packet from the given data.

Attributes

data

checksum

The CRC32 checksum included in the header.

index

The zero-based index of the packet associated with a COMMAND server response.

login_success

A boolean indicating if the server authenticated the client.

message

The message that was sent to the client/server.

sequence

The sequence number of the COMMAND or MESSAGE packet.

total

The total number of packets associated with a COMMAND server response.

type

The packet's type defined in the protocol.

property index: None

The zero-based index of the packet associated with a COMMAND server response.

If a sub-header is not provided with the response, this defaults to 0.

property login_success: None

A boolean indicating if the server authenticated the client.

property message: str

The message that was sent to the client/server.

This will always be an ASCII-compatible string.

For LOGIN, this would be the password sent to the server. For COMMAND, this would be the command string sent to the server. For MESSAGE, this would be the message sent to the client.

property sequence: int

The sequence number of the COMMAND or MESSAGE packet.

property total: None

The total number of packets associated with a COMMAND server response.

If a sub-header is not provided with the response, this defaults to 1.