Replication server assignment
Native UDP clients ask the Game API for a Buddy replication server, then send spatial traffic to the host and port it returns. Browser clients use the GraphQL UDP proxy instead and never call this assignment path.
See the GraphQL schema reference for
ServerStatus, ServerVersionInfo, and GameClientBootstrap.
serverWithLeastClients (authenticated)
This is the Buddy picker. It is not a listing of Game API hosts.
- The API chooses a ready replication server for your app's datacenter.
- It registers your UDP session on that server. You still wait about 1.5 seconds before the first UDP send — see Authenticate and assign.
- If no server is eligible, the call fails; retry after a short delay.
Requires a valid app-scoped token as the Bearer. An identity session token is rejected and no session is registered.
query {
serverWithLeastClients {
serverId
ip4
ip6
clientPort
status
clients
}
}
Use the returned address and clientPort for UDP. Sign packets with the
same app-scoped token — HMAC. If the server asks
you to move (COMMAND_RECONNECT), call serverWithLeastClients again —
Operations.
If the call lands on a datacenter that does not hold your app, handle
WRONG_DATACENTER by reconnecting to extensions.gameApiUrl. See
Datacenters and endpoint routing.
Version and client bootstrap
versionInfo reports the API build and the minimum client version. Use it
to gate features or prompt for an upgrade.
query {
versionInfo {
serverVersion
minimumClientVersion
}
}
gameClientBootstrap(appId) is the usual first Game API read after you
mint an app token. It returns spatial limits, realtime protocol details,
versionInfo, and the gameApiUrl / gameApiWsUrl / discoveryUrl
for this app. Call it against those URLs for later gameplay. Copy-paste
example: Example operations.