Events Overview
Socket Events are called whenever a specific action / event happens. There are currently 4 possible types of event that you could listen for:
Chat Event
Entity Event
Team Event
Protobuf Event
These will be called by the socket when the respective events occur. Here are some example usages:
Entity Event
The entity_event
decorator takes an extra parameter of the entity id that you are listening for changes to. The EntityEvent
object holds information on the entity:
entity_id
The Entity Id
value
The value of the entity, boolean
capacity
The capacity of the entity
has_protection
Whether the entity is protected by TC
protection_expiry
When the protection by TC will expire
items
The items that the entity contains
Team Event
This event is typically called when the team changes, e.g. a player leaves or joins. The team_event
decorator will pass a TeamEvent
object as a parameter with the following information:
player_info
The player_id
of the changed information
team_info
Chat Event
This event is called when a message is sent to the team chat. It will give you a ChatEvent
object when called with this information:
message
Protobuf Event
This event is called when protobuf is received over the websocket connection. This is for monitoring only. You are given the raw bytes of the message as a parameter.
Removing
To remove any listener see:
Last updated
Was this helpful?