Info
- Server list and join codes on ServiceHub
- Code in
ServiceHub/Lobby and ServiceHub/Probe
- Backend: Lobby API, live list in the console: Lobby
- Used by the networking server list, see Networking
Usage
LobbyService - the API
RegisterServerAsync, UpdateServerAsync, DisposeServerAsync
HeartbeatAsync
GetServerAsync, QueryServersAsync
RequestGuestPassAsync - pass for a player without an account, valid while the session lasts
ServiceHubServerListAdapter - connects the lobby to the server list
- A hosting server registers itself, sends heartbeats every 15 s (Heartbeat Interval, backend TTL 30 s by default) and gets a join code. A signed-in dedicated server sends its server token, which links the session to its credential in the console
ServerRecord.RegistrationState (None, Registering, Registered, Offline, Failed), shown by ServerRecordDisplay. Failed registrations retry with backoff, refused ones wait until the config changes
- Hosting works offline and with Lobby turned off for the app: the session is then found on the local network only and registers once the hub is back or Lobby is on
- Session players:
ServiceHubSessionPlayers sends the player list with each update (user id, or a guest pass for players without an account) for presence and streams
- With PurrNet
PurrTransport it also creates a relay room
- Clients query the lobby every 4 s while searching (Query Interval), a failed query keeps the last list. Queries pause while the hub is unreachable and go on as soon as it's back, see Connectivity
- Join by code:
CodeJoinRequest trims and uppercases the typed code, so lowercase input works
ProbeService.CheckPortAsync(port) - asks the backend if a port is reachable from outside, returns ProbeResult (reachable + public address)
Gotchas
- No app secret in
ServiceHubSettings: no search and no registration, only the ServiceHubManager error at load
- A host on PurrNet
LocalTransport skips registration with a warning
- Every
LobbyService call returns a service-off error without a request while Lobby is off for the app. A query that gets it clears the list, a host drops its join code
- The list shows at most Query Count servers (5 by default), the adapter doesn't page
- Lobby entries without an
InstanceID in their data are skipped. A direct endpoint is listed only with a public address and port. Without a public address the session is reachable only over the relay, and a relay room exists only with PurrTransport
- Heartbeats are
UpdateServerAsync calls (name, player count, players), not HeartbeatAsync. Players joining or leaving send one about 0.5 s later
- An entry the hub no longer knows (invalid secret, not found), or an update that throws after a full heartbeat interval without contact registers again
- Rejected registration (4xx other than 408 and 429): wrong app secret, server ID or secret, or data too large. It waits until the server ID, secret, name or public address in the server config changes
- Registration waits for the server login when a server secret is set, timeout 15 s (Register Timeout) because the first TLS handshake on a fresh dedicated server can be slow. Bypass Certificate Validation is a diagnostic switch, keep it off
- Quitting the app sends no dispose (requests don't run while quitting), the entry stays listed until the backend TTL. Stopping the server disposes it