The Lobby service, not to be confused with a waiting room experience, acts as the main hub for player activity. The Lobby provides a continuous connection between your game and players.
The Lobby service also acts as the entry point for the game client to interact with the Friends and Presence services. This includes retrieving a player's friends list, checking the presence state of other players, and ensuring a player has only one active connection to the Lobby.
It is important to understand the key concepts used in the design of the Lobby service.
A player is required to be logged into the Lobby, in order to access our multiplayer services so it's critical that a stable connection is maintained. There are several safeguards built into the service to ensure a game client is connected at all times.
- Automatic Reconnecting: when a player is disconnected from the Lobby unexpectedly, the game client will no longer receive responses from the service. In this situation, the AccelByte SDK is designed to attempt to reestablish the connection on the player's behalf.
- Token Refreshing: when a player first logs in, they will be assigned an access token with a specified valid timeframe. The service is designed to automatically generate a new token, on behalf of the player, when the previous token expires.
- Connection Pinging: if a connection becomes inactive, the service is designed to send a ping to the game client, to notify the client that the connection is still active.
AGS uses a WebSocket architecture to ensure reliable, real-time data transfer to deliver notifications to a game client. This architecture allows the Lobby to keep in sync with the game server, and our other services.
Lobby Entitlement Check
Entitlement checks are used by various services to ensure connected players have the necessary permission to access gated content, such as downloadable content (DLC). This concept is also extended to the Lobby service, to provide an extra layer of security to your game, by preventing players from connecting unless they have specified entitlements in their account.
To learn more about entitlements, and how to configure them, refer to Entitlements.
Lobby Rate Limit
You can define rate limits to help ensure the Lobby service isn't overwhelmed by requests submitted by a game client. This is controlled by setting how many requests (a "Burst Limit") a game client can make, within a specified amount of time (the "Duration Limit"). If the rate is breached, any additional requests from that game client will be blocked, until the duration limit is met.
Single Point of Presence
To prevent users from logging in with multiple devices, you can manage the connection close delegate once connected to the Lobby service. This allows you to disconnect older sessions with the 4000: Multiple session login detected error, effectively identifying instances where a user is logged in from multiple devices.
The Lobby service is designed to enforce Single Point of Presence (SPOP) for players, which ensures they are logged into the service on one device or platform at a time. When a player attempts to login to the Lobby, the service will check the player's user account, including linked platform accounts, to determine if there is already a connection for the account. If there is, the service will force the existing connection to logout, before completing the new login request.
To learn more about user accounts and account linking, refer to Accounts.