messages.impl module¶
Provides user message implementations.
- class messages.impl.SayText2Impl[source]¶
Bases:
UserMessageImpl
SayText2 implementation.
- static read_bitbuffer(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (BitBufferRead) – The buffer to read.
- Return type:
- static read_protobuf(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (ProtobufMessage) – The buffer to read.
- Return type:
- static write_bitbuffer(buffer, data)[source]¶
Write data to the given buffer.
- Parameters:
buffer (BitBufferWrite) – The buffer to write to.
data (UserMessageData) – User message data that should be written to the buffer.
- 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.ShowMenuImpl[source]¶
Bases:
UserMessageImpl
ShowMenu implementation.
- static read_bitbuffer(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (BitBufferRead) – The buffer to read.
- Return type:
- static read_protobuf(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (ProtobufMessage) – The buffer to read.
- Return type:
- static write_bitbuffer(buffer, data)[source]¶
Write data to the given buffer.
- Parameters:
buffer (BitBufferWrite) – The buffer to write to.
data (UserMessageData) – User message data that should be written to the buffer.
- 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.UserMessageData(**kwargs)[source]¶
Bases:
dict
A dict that keeps track whether it has been modified.
- class messages.impl.UserMessageImpl[source]¶
Bases:
object
Base class for user message implementations.
- classmethod read(buffer)[source]¶
A wrapper for
read_protobuf()
andread_bitbuffer()
.- Parameters:
buffer – The buffer to read.
- Return type:
- classmethod write(buffer, data)[source]¶
A wrapper for
write_protobuf()
andwrite_bitbuffer()
.- Parameters:
buffer – The buffer to write.
- Return type:
- static read_bitbuffer(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (BitBufferRead) – The buffer to read.
- Return type:
- static read_protobuf(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (ProtobufMessage) – The buffer to read.
- Return type:
- static write_bitbuffer(buffer, data)[source]¶
Write data to the given buffer.
- Parameters:
buffer (BitBufferWrite) – The buffer to write to.
data (UserMessageData) – User message data that should be written to the buffer.
- 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.VGUIMenuImpl[source]¶
Bases:
UserMessageImpl
VGUIMenu implementation.
- static read_bitbuffer(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (BitBufferRead) – The buffer to read.
- Return type:
- static read_protobuf(buffer)[source]¶
Read data from the given buffer.
- Parameters:
buffer (ProtobufMessage) – The buffer to read.
- Return type:
- static write_bitbuffer(buffer, data)[source]¶
Write data to the given buffer.
- Parameters:
buffer (BitBufferWrite) – The buffer to write to.
data (UserMessageData) – User message data that should be written to the buffer.
- 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.
- 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:
- messages.impl.implemented_usermessages = {4: <class 'messages.impl.SayText2Impl'>, 10: <class 'messages.impl.ShowMenuImpl'>, 13: <class 'messages.impl.VGUIMenuImpl'>}¶
A dictionary that contains all implemented user messages.