C++ SDK — Regions

Regions

A game is pinned to exactly one node — its players, rooms and leaderboards exist only there. Resolve the node once, then point every call at it; a key presented on the wrong node answers 421 with a home_api_url hint.

Regions::discover
static DiscoverResponse discover(Client& client)

GET /api/discover.php — every enabled node plus the server's geo hint. No auth needed.

Example Usage:

auto d = Regions::discover(client);
Regions::resolveGame
static GameNodeResponse resolveGame(Client& client, const std::string& apiKey)

POST /api/discover.php with the key in X-Api-Token (never in a URL) — returns the game's pinned node.

Example Usage:

auto r = Regions::resolveGame(client, apiKey);
Client home(apiKey, "", r.node.api_url);