Leave
Departure notification of a player from an instance, sent to the other participants.
The Leave message is an automatic notification sent to the players of an instance when another player leaves it.
It keeps the list of present players synchronized and reports the circumstances of the departure.
Priority
High - This message has a high priority to preserve the consistency of the instance state.
The Leave message is automatic and sent by the server. Clients cannot send it directly.
Server → Client Notification
Payload Format
[instance_id: byte]
[quit_type: byte]
[player_id: ushort]
(ModerationAction ? [moderator_id: ushort] [reason?: string])Detailed Structure
| Type | Name | Description |
|---|---|---|
| byte | InstanceID | ID of the instance concerned |
| byte | QuitType | Departure type (filtered according to privileges) |
| ushort | PlayerID | ID of the player who leaves |
| ushort | ModeratorID | ID of the moderator (on moderation action) |
| string | Reason | Reason (on moderation action, if provided) |
Quit Types
| Value | Name | Description |
|---|---|---|
| 0x00 | Normal | Voluntary departure of the player |
| 0x01 | Timeout | Disconnection by timeout |
| 0x02 | ModerationKick | Kick by a moderator |
| 0x03 | VoteKick | Kick by player vote |
| 0x04 | ConfigurationError | Configuration error |
| 0x05 | UnknownError | Unknown error |
Notification Example - Normal Departure
[0x05] // InstanceID = 5
[0x00] // QuitType = Normal
[0x00, 0x03] // PlayerID = 3Notification Example - Moderator Kick
[0x05] // InstanceID = 5
[0x02] // QuitType = ModerationKick
[0x00, 0x03] // PlayerID = 3
[0x00, 0x01] // ModeratorID = 1
[0x0D, "Toxic behavior"] // Reason = "Toxic behavior"Notification Example - Timeout
[0x02] // InstanceID = 2
[0x01] // QuitType = Timeout
[0x00, 0x07] // PlayerID = 7Notification Example - Vote Kick
[0x01] // InstanceID = 1
[0x03] // QuitType = VoteKick
[0x00, 0x05] // PlayerID = 5
[0xFF, 0xFF] // ModeratorID = System (65535)
[0x0A, "Vote passed"] // Reason = "Vote passed"Notification Filtering
According to Privileges
The content of the Leave message is filtered according to the privileges of the recipient:
Normal Players
- Receive the real departure type
- See the moderation information if applicable
- Have no access to sensitive details
Privileged Players
- Always receive
QuitType.Normalto preserve confidentiality - Do not see the kick reasons of other privileged players
- Maintain a neutral public image
Initiating Moderator
- Receives the real type with all the details
- Sees their own action confirmed
- Full access to the information of the action
Moderation Actions
For the ModerationKick and VoteKick types, additional information is included:
| Information | Description | Condition |
|---|---|---|
| ModeratorID | ID of the moderator or of the system | Always present |
| Reason | Reason for the action | If provided during the action |
Processing
Client Side
- Reception: Automatic message from the server
- Validation: Instance ID check
- Local update: Removal of the player from the list
- User interface: Display of the notification according to the type
- Cleanup: Removal of the data associated with the player
Server Side
- Trigger: On a Quit or a disconnection
- Filtering: Application of the privilege rules
- Distribution: Sending to all the players concerned
- Logging: Recording of the event
Special Behaviors
Selective Distribution
The Leave message is only sent to players with the PlayerStatus.Ready status in the same instance.
Automatic Cleanup
Receiving a Leave message automatically triggers:
- Removal of the player's transform data
- Cleanup of the avatar data
- Update of the user interface
- Release of the associated resources
Disconnection Handling
On an abrupt disconnection of a client, the server automatically generates a Leave message with the appropriate type (Timeout or UnknownError).
Integration with Other Messages
Relation with Quit
The Leave message is the notification resulting from a successfully processed Quit message.
Relation with Enter
When a new player uses Enter, they do not receive historical Leave messages, only the current state via Join.
State Synchronization
Leave messages guarantee that all clients keep a consistent view of the players present in the instance.
Error Handling
Invalid Instance
If the instance ID in the Leave message matches no local instance, the message is silently ignored.
Nonexistent Player
If the PlayerID matches no locally known player, the message is processed normally (the player may have been added after the client connected).
Corrupted Data
On malformed data, the client must ignore the message and keep its current state.
Usage Examples
User Interface
"PlayerName123 has left the instance"
"PlayerName456 was kicked by ModeratorABC: Toxic behavior"
"PlayerName789 timed out"
"PlayerNameXYZ was vote-kicked: Vote passed"Resource Cleanup
On receiving a Leave, the client must:
- Remove the player from all active lists
- Stop rendering their avatar
- Remove their position/animation data
- Update the instance counters
- Notify the user interface