Overview
Server hosts register their game servers with the API, and players use the server browser to discover and join available servers. The API handles server validation, mod compatibility checking, and real-time server status updates.Most endpoints require authentication. Server registration and updates require the server to be owned by the authenticated user.
Core Methods
GetServers
Retrieve a list of all public servers. Endpoint:ServerBrowserServer.GetServers
Request:
Empty request object
Array of public server objects with current status, player counts, maps, and mods
source/API/internal/rpc/server_browser.go:282-303
GetServer
Retrieve detailed information about a specific server by ID. Endpoint:ServerBrowserServer.GetServer
Request:
Server ID to retrieve
Detailed server information including configuration, current map, players, and mods
NOT_FOUND- Server with the specified ID does not existINTERNAL- Failed to retrieve server from database
source/API/internal/rpc/server_browser.go:305-317
RegisterServer
Register a new game server with the server browser. Endpoint:ServerBrowserServer.RegisterServer
Request:
Server name (max 32 characters, profanity filtered)
Server description (max 128 characters, profanity filtered)
Maximum number of players (1-64)
Optional server password for private servers
Server region (NA_WEST, NA_EAST, EU_WEST, EU_CENTRAL, ASIA, OCEANIA)
List of required mods with name and hash
Server tags for filtering
Unique server ID
JWT token for server updates and authentication
- Server name and description are checked for profanity
- Name must be 1-32 characters
- Description must not exceed 128 characters
- Max players must be between 1 and 64
- User cannot have more than 10 active servers
UpdateServer
Update an existing server’s status, players, and current map. Endpoint:ServerBrowserServer.UpdateServer
Request:
Server ID to update
Current number of players
List of connected players with names and IDs
Current map and game mode information
Next map in rotation
CanJoinServer
Validate whether a player can join a server based on mod compatibility and server status. Endpoint:ServerBrowserServer.CanJoinServer
Request:
Server ID to validate
Player’s installed mods
Whether the player can join the server
Reason for denial if can_join is false
Mods required by the server that the player doesn’t have
- Checks if server exists and is not full
- Validates mod compatibility (all required mods must be installed)
- Returns list of missing mods for download
Mod Management
CheckModImages
Check which mod images need to be uploaded for proper server display. Endpoint:ServerBrowserServer.CheckModImages
Request:
List of mods with names and hashes to check
Array of mod hashes that don’t have images uploaded
UploadModImages
Upload preview images for mods to display in the server browser. Endpoint:ServerBrowserServer.UploadModImages
Request:
Array of mod images with hash and base64-encoded image data
- Images must be valid base64-encoded data
- Supports jpg, jpeg, png, webp formats
- Images are stored in S3/R2 for serving
Real-Time Updates
Server status updates are published to WebSocket clients for real-time server browser updates. Updates include:- Player count changes
- Map rotations
- Server online/offline status
- New servers registered
Background Tasks
Stale Server Cleanup
A background process runs every 10 seconds to remove stale servers:- Servers that haven’t sent an update in 40 seconds are marked as stale
- Stale servers are automatically removed from the browser
- This ensures the browser only shows active servers
source/API/internal/rpc/server_browser.go:39-80
Error Codes
INTERNAL- Database or internal server errorNOT_FOUND- Server ID not foundPERMISSION_DENIED- User doesn’t own the serverINVALID_ARGUMENT- Validation failed (profanity, invalid values)
Integration
Server Host Flow
- Register Server: Call
RegisterServer()with server details - Store Token: Save the returned JWT token for updates
- Send Updates: Call
UpdateServer()every 30 seconds with current status - Handle Shutdown: Server is automatically removed after 40 seconds without updates
Player Join Flow
- List Servers: Call
GetServers()to get all available servers - Filter/Search: Apply client-side filtering based on region, game mode, etc.
- Validate Join: Call
CanJoinServer()to check mod compatibility - Download Mods: If missing mods, prompt user to download
- Join Server: Connect to server using returned connection details
Related APIs
Server Management
Player management and moderation
VoIP
Voice chat integration for servers
Implementation Notes
- Server IDs are UUID v4 strings
- Servers are stored in MongoDB with real-time indexing
- WebSocket connections receive real-time updates via RabbitMQ
- Map images are fetched from S3/R2 CDN based on mod hashes
- Profanity filtering uses the go-away library