Introduction to Lobby
Overview
AccelByte Gaming Services (AGS) Lobby acts as the main hub for player activity and provides a continuous connection between your game and players.
AGS Lobby also acts as the entry point for the game client for interactions with AGS Friends and Presence including retrieving a player's friends list, checking the presence state of other players, and ensuring a player has only one active connection to Lobby.
Key concepts
It is important to understand the key concepts used in the design of AGS Lobby.
Lobby connection
A player is required to be logged into Lobby in order to access the multiplayer services of AGS, 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 Lobby unexpectedly, the game client will no longer receive a responses from the service. In this situation, the AGS Game 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 time frame. 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 Lobby to remain in sync with the game server and other services in AGS.
Lobby entitlement check
Entitlement checks are used by various services to ensure connected players have the necessary permissions to access gated content, such as downloadable content (DLC). This concept is also extended to Lobby to provide an extra layer of security to your game by preventing players from connecting unless they have the specified entitlements on 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 Lobby 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 a player is connected to Lobby. 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.
Lobby is designed to enforce Single Point of Presence (SPOP) for players to ensure they are logged into the service on one device or platform at a time. When a player attempts to log in to 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.