Dev's NoxDev's Nox
Relay Protocol

ServerConfig

Configuration of the parameters of an instance by privileged users.

The ServerConfig message allows privileged users to modify the configuration parameters of an instance in real time.

It manages the performance, the capacity, the security and the behaviors of the instance.

Priority

Normal - This message has a normal priority because it does not directly affect connectivity.

The ServerConfig message requires high privileges. Only instance owners and master moderators can modify the configuration.


Client → Server Request

Payload Format

[instance_id: byte]
[config_flags: byte]
(Tps ? [tps: byte])
(Threshold ? [threshold: float])
(Capacity ? [capacity: ushort])
(Password ? [password: string])
(Flags ? [instance_flags: uint])

Detailed Structure

TypeNameDescription
byteInstanceIDID of the instance to configure
byteConfigFlagsFlags indicating which parameters to modify
byteTPSNew refresh rate (conditional)
floatThresholdNew latency threshold (conditional)
ushortCapacityNew maximum capacity (conditional)
stringPasswordNew password (conditional)
uintInstanceFlagsNew instance flags (conditional)

Server Config Flags

ValueNameDescription
0x00NoneRequest for the current configuration
0x01TpsModify the refresh rate
0x02ThresholdModify the latency threshold
0x04CapacityModify the maximum capacity
0x08PasswordModify the password
0x10FlagsModify the instance flags

Common Combinations

ValueNameDescription
0x03PerformanceTPS + Threshold
0x05BasicTPS + Capacity
0x18SecurityPassword + Flags
0x1FAllAll the parameters

Instance Flags

ValueNameDescription
0x01IsPublicInstance publicly visible
0x02UsePasswordPassword protection required
0x04UseWhitelistOnly authorized users can join
0x08AuthorizeBotAllows bot connections
0x10AllowOverloadAllows exceeding the maximum capacity

Request Example - Query

[0x05]                          // InstanceID = 5
[0x00]                          // ConfigFlags = None (info request)

Request Example - Modify TPS

[0x05]                          // InstanceID = 5
[0x01]                          // ConfigFlags = Tps
[0x3C]                          // TPS = 60

Request Example - Modify Performance

[0x03]                          // InstanceID = 3
[0x03]                          // ConfigFlags = Performance (Tps | Threshold)
[0x1E]                          // TPS = 30
[0x42, 0x48, 0x00, 0x00]        // Threshold = 0.001f

Request Example - Full Security

[0x01]                          // InstanceID = 1
[0x18]                          // ConfigFlags = Security (Password | Flags)
[0x0A, "secret123"]             // Password = "secret123"
[0x00, 0x00, 0x00, 0x07]        // InstanceFlags = IsPublic | UsePassword | UseWhitelist

Server → Client Response

Payload Format

[instance_id: byte]
[result: byte]
(result in [Change, Success] ? (
    [config_flags: byte]
    (Tps in config_flags ? [tps: byte])
    (Threshold in config_flags ? [threshold: float])
    (Capacity in config_flags ? [capacity: ushort])
    (Password in config_flags ? [has_password: byte])
    (Flags in config_flags ? [instance_flags: uint])
))
(Failure == result ? [reason?: string])

Detailed Structure

TypeNameDescription
byteInstanceIDID of the instance concerned
byteResultResult code of the operation
byteConfigFlagsFlags of the parameters included in the response
byteTPSCurrent/custom refresh rate
floatThresholdCurrent/custom latency threshold
ushortCapacityMaximum capacity of the instance
byteHasPasswordIndicates whether a password is configured (1/0)
uintInstanceFlagsCurrent instance flags
stringReasonReason for the failure (if applicable)

Server Config Results

ValueNameDescription
0x00SuccessConfiguration updated successfully
0x01FailureUpdate failed
0x02ChangeConfiguration change notification

Response Example - Success

[0x05]                          // InstanceID = 5
[0x00]                          // Result = Success
[0x01]                          // ConfigFlags = Tps
[0x3C]                          // TPS = 60

Response Example - Full Configuration

[0x03]                          // InstanceID = 3
[0x02]                          // Result = Change
[0x1F]                          // ConfigFlags = All
[0x3C]                          // TPS = 60
[0x42, 0x48, 0x00, 0x00]        // Threshold = 0.0001f
[0x00, 0x20]                    // Capacity = 32
[0x01]                          // HasPassword = true
[0x00, 0x00, 0x00, 0x03]        // InstanceFlags = IsPublic | UsePassword

Response Example - Failure

[0x05]                          // InstanceID = 5
[0x01]                          // Result = Failure
[0x11, "Permission denied"]     // Reason = "Permission denied"

Processing

Server Side

  1. Instance validation: Check that the instance exists
  2. Presence validation: Ensure that the client is in the instance
  3. Privilege check: Verification of the HasHighPrivilege rights
  4. Flag processing: Application of the modifications according to the flags
  5. Data validation: Check of the parameter consistency
  6. Broadcast: Sending of the notifications to the other players
  7. Response: Confirmation to the initiating client

Client Side

  1. Data preparation: Assembly of the parameters to modify
  2. Conditional sending: Inclusion of the modified data only
  3. Response processing: Update of the interface according to the result
  4. Notification handling: Reception of the changes from other players

Special Behaviors

Configuration Query

If ConfigFlags = None, the server returns the current configuration of the instance with the All flag.

Custom Parameters

Players may have custom parameters (TPS/Threshold) that take priority over the instance ones.

Automatic Broadcast

Any modification is automatically broadcast to all the players of the instance via the Change type.

Password Protection

The password is never returned in the responses, only a HasPassword indicator.


Permission Validation

Required Privileges

Only players with HasHighPrivilege can modify the configuration:

  • InstanceOwner: Owner of the instance
  • MasterModerator: Master moderator

Automatic Rejection

Modification attempts without the appropriate privileges return Failure with "Permission denied".


Automatic Notifications

Change Notifications

When a parameter is modified, all the other players of the instance receive a ServerConfig message with:

  • Result = Change
  • ConfigFlags indicating the modified parameters
  • New parameter values

Notification Example

If a player modifies the TPS, all the others receive:

[0x05]                          // InstanceID = 5
[0x02]                          // Result = Change
[0x01]                          // ConfigFlags = Tps
[0x3C]                          // TPS = 60

Integration with Other Messages

Relation with Enter

The Enter response includes the current TPS and Threshold parameters of the instance.

Relation with Instance Flags

Flag modifications directly affect the Enter behavior:

  • UsePassword: Enabling/disabling the protection
  • UseWhitelist: Whitelist access control
  • AuthorizeBot: Permission for bot connections

Error Handling

Instance Errors

  • "Instance not found": The specified instance does not exist
  • "You are not in instance": The client is not in the instance

Permission Errors

  • "Permission denied": Insufficient privileges to modify the configuration

Data Errors

  • "No valid configuration flags provided": No valid flag provided in the request

Usage Examples

Administration Interface

"Instance TPS updated to 60"
"Instance capacity changed to 32 players"
"Password protection enabled"
"Bot connections now allowed"

Performance Optimization

Moderators can adjust in real time:

  • TPS for network performance
  • Threshold for latency tolerance
  • Capacity according to activity

Security Management

Dynamic configuration of:

  • Temporary passwords
  • Whitelists according to events
  • Protection against malicious bots

On this page