messages.impl module

Provides user message implementations.

class messages.impl.UserMessageData(**kwargs)[source]

Bases: dict

A dict that keeps track whether it has been modified.

__init__(**kwargs)[source]
has_been_changed()[source]

Return whether the data has been changed.

Return type:bool
class messages.impl.UserMessageImpl[source]

Bases: object

Base class for user message implementations.

classmethod read(buffer)[source]

A wrapper for read_protobuf() and read_bitbuffer().

Parameters:buffer – The buffer to read.
Return type:UserMessageData
static read_bitbuffer(buffer)[source]

Read data from the given buffer.

Parameters:buffer (BitBufferRead) – The buffer to read.
Return type:UserMessageData
static read_protobuf(buffer)[source]

Read data from the given buffer.

Parameters:buffer (ProtobufMessage) – The buffer to read.
Return type:UserMessageData
classmethod write(buffer, data)[source]

A wrapper for write_protobuf() and write_bitbuffer().

Parameters:buffer – The buffer to write.
Return type:UserMessageData
static write_bitbuffer(buffer, data)[source]

Write data to the given buffer.

Parameters:
static write_protobuf(buffer, data)[source]

Write data to the given buffer.

Parameters:
  • buffer (ProtobufMessage) – The buffer to write to.
  • data (UserMessageData) – User message data that should be written to the buffer.
class messages.impl.SayText2Impl[source]

Bases: messages.impl.UserMessageImpl

SayText2 implementation.

static read_bitbuffer(buffer)[source]
static read_protobuf(buffer)[source]
static write_bitbuffer(buffer, data)[source]
static write_protobuf(buffer, data)[source]
class messages.impl.ShowMenuImpl[source]

Bases: messages.impl.UserMessageImpl

ShowMenu implementation.

static read_bitbuffer(buffer)[source]
static read_protobuf(buffer)[source]
static write_bitbuffer(buffer, data)[source]
static write_protobuf(buffer, data)[source]
class messages.impl.VGUIMenuImpl[source]

Bases: messages.impl.UserMessageImpl

VGUIMenu implementation.

static read_bitbuffer(buffer)[source]
static read_protobuf(buffer)[source]
static write_bitbuffer(buffer, data)[source]
static write_protobuf(buffer, data)[source]
messages.impl.get_user_message_impl(msg_index)[source]

Return the user message implementation for the given message index.

Parameters:msg_index (int) – The index of the user message.
Raises:NotImplementedError – Raised if the given user message is not implemented.
Return type:UserMessageImpl