kxg.multiplayer.MessageSerializer

class kxg.multiplayer.MessageSerializer(world)[source]

Bases: object

Pickle messages before they are sent over the network, and unpickle them when they are received. Tokens that have been added to the world are serialized using their ID, then replaced with the corresponding token from the remote world when the message is deserialized.

Public Methods:

__init__(world)

Initialize self.

pack(message)

unpack(packet)

__init__(world)[source]

Initialize self. See help(type(self)) for accurate signature.

pack(message)[source]
unpack(packet)[source]