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:
Name | Description |
---|---|
| The Entity Id |
| The value of the entity, |
| The capacity of the entity |
| Whether the entity is protected by TC |
| When the protection by TC will expire |
| 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:
Name | Description |
---|---|
| The |
| The |
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:
Name | Description |
---|---|
| The message that was sent |
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:
Removing ListenersLast updated