Server.json file
Documentation for Server.json file
Read time 1 minuteLast updated a day ago
To use the Clanforge allocation system, you must enable a method to dynamically specify the file within your server ID directory that has the allocation UUID supplied by your matchmaker along with other configuration variables. This file is the
server.json
server.json
The{ "AllocationUUID": "$$allocated_uuid$$" }
server.json
The allocation UUID variable changes with each session, so you’ll need to monitor it for changes. To detect changes within the server.json file, you can set up an event trigger that detects file changes or a process to check the file for changes at a regular interval. It’s best practice to use an event trigger because the interval check causes unnecessary resource usage. Refer to Monitor allocation UUID changes.{ "AllocationUUID": "$$allocated_uuid$$", "SessionAuth": "$$session_auth$$", "ConnectionIP": "$$ip$$", "ConnectionPort": "$$port$$" }
Monitor allocation UUID changes
Each game server instance must detect its allocation UUID by monitoring the value of the$$allocation_uuid$$
Detect an allocation
The$$allocation_uuid$$
- When you allocate a server instance, the value updates to the current allocation UUID.
- When you deallocate a server instance, the value updates to contain an empty string.
Note: The server start and server stop actions don't impact the allocation status of the server instance or the allocation UUID.
Detect configuration variable values
Each game server build should monitor theserver.json
server.json
inotify
CLOSE_WRITE
CLOSE_WRITE
inotify
MODIFY titanping.json OPEN titanping.json OPEN titanping.json CLOSE_NOWRITE,CLOSE titanping.json MODIFY titanping.json CLOSE_WRITE,CLOSE titanping.json OPEN titanping.json ACCESS titanping.json CLOSE_NOWRITE,CLOSE titanping.json