Dev's NoxDev's Nox
Relay Protocol

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

TypeNameDescription
byteInstanceIDID of the instance concerned
byteQuitTypeDeparture type (filtered according to privileges)
ushortPlayerIDID of the player who leaves
ushortModeratorIDID of the moderator (on moderation action)
stringReasonReason (on moderation action, if provided)

Quit Types

ValueNameDescription
0x00NormalVoluntary departure of the player
0x01TimeoutDisconnection by timeout
0x02ModerationKickKick by a moderator
0x03VoteKickKick by player vote
0x04ConfigurationErrorConfiguration error
0x05UnknownErrorUnknown error

Notification Example - Normal Departure

[0x05]                          // InstanceID = 5
[0x00]                          // QuitType = Normal
[0x00, 0x03]                    // PlayerID = 3

Notification 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 = 7

Notification 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.Normal to 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:

InformationDescriptionCondition
ModeratorIDID of the moderator or of the systemAlways present
ReasonReason for the actionIf provided during the action

Processing

Client Side

  1. Reception: Automatic message from the server
  2. Validation: Instance ID check
  3. Local update: Removal of the player from the list
  4. User interface: Display of the notification according to the type
  5. Cleanup: Removal of the data associated with the player

Server Side

  1. Trigger: On a Quit or a disconnection
  2. Filtering: Application of the privilege rules
  3. Distribution: Sending to all the players concerned
  4. 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:

  1. Remove the player from all active lists
  2. Stop rendering their avatar
  3. Remove their position/animation data
  4. Update the instance counters
  5. Notify the user interface

On this page