Lobby
Overview
AccelByte Cloud's Lobby service provides continuous connection between your game and players by using WebSocket. WebSocket ensures reliable, real-time data transfer by allowing two-way communication between the server and clients. Since the Lobby serves as the main hub of your game, it is related to many of our other services, including:
- Presence enables players to see what other players are doing in real-time. This feature is critical in online multiplayer games, because player interactions rely on knowing which players are available.
- Party is used as the basis for multiplayer matchmaking. Parties can be integrated with other services such as Presence, Friends, and Chat, for a more engaging and fun multiplayer experience.
- Friends lets players connect and interact with each other. AccelByte supports both in-game friends and platform level friends. In-game friends can chat and play together within a game, whereas platform level friends allow players of different games to interact with each other on your web platform.
- Chat enables real-time text based communication in-game. We support global, party, and individual chat.
- Matchmaking Daemon is responsible for matching multiple players based on the selected matchmaking channel configurations.
Manage the Lobby in the Admin Portal
Configure the Lobby
In the Admin Portal, open your game namespace, go to the Game Management section, and click on the Lobby Configuration menu on the left-hand side.
On the Lobby Configuration page, you can configure your game's Lobby by adjusting the settings below.
Lobby Concurrent User (CCU)
Lobby Concurrent User (CCU) shows the total number of active players. This value is refreshed once every minute.
Configuration
This section includes general Lobby settings.
- Keep Player's Activity determines whether a player's activity data is kept after they disconnect from the Lobby. Toggle this option On to save the player's activity upon disconnection.
- Cancel Match on Disconnect determines what happens to a player's match when that player disconnects. Toggle this option On if you want the matchmaking request to be canceled if a player disconnects, or Off if you want the matchmaking request to remain active even when the player has been disconnected.
- Ready Consent Timeout (Sec) determines how long a player has to confirm that they're ready to start the match, in seconds. If the player doesn't confirm that they're ready before the timeout, their matchmaking request will be canceled. The default value is 20 seconds.
- Max Player in the Lobby determines the maximum number of players that can join the Lobby at any one time. The default value is -1, which means that an unlimited number of players can join the Lobby.
Party Configuration
This section contains Cloud Party settings.
- Max. Party Member determines how many players can join a party.
- Auto Kick on Disconnect determines what happens to a player's party membership if they are disconnected from the game. If this setting is toggled Off, players will not be removed from their party when they are disconnected. If this setting is toggled On, the player will be removed from their party if they are disconnected.
- Auto Kick Delay Time is used to add a delay before a player is kicked from their party upon being disconnected from the game. To add a delay, toggle this setting On and type the desired delay time (in seconds). If the delay time is set to 0, the player will be removed from their party immediately when they are disconnected.
NOTE
These settings also apply to party leaders. If the party leader is removed from their party, the player that has been in the party longest will be automatically promoted to party leader.
Chat Rate Limit
This section contains Cloud Chat settings. The Chat Rate Limit Duration and Chat Rate Limit Burst settings work together to limit how many messages players can send in the chat, to prevent spamming.
- Chat is used to enable or disable the chat feature in your game. This setting is enabled by default.
- Chat Rate Limit Duration (ms) is the amount of time (in milliseconds) that is used to determine when messages are considered spam. This setting works with the Chat Rate Limit Burst setting.
- Chat Rate Limit Burst is the number of messages that a player can send within a given time period before they receive an error. This setting works with the Chat Rate Limit Duration setting.
When combined, these two settings determine a rate of messages per unit of time. For example, if the Chat Rate Limit Duration is 1,000 milliseconds and the Chat Rate Limit Burst is 3, then 3 messages per 1,000 milliseconds (1 second) is the rate at which sent messages are considered spam by the Lobby service. This means that chat messages that are sent at a rate of less than 3 messages per second will be sent normally and not considered spam.
Entitlement Check
This section contains Cloud Entitlements settings.
- Entitlement Check determines whether the backend will check if a player has the necessary entitlements before they are granted access to the Lobby. This can be used as an additional layer of security to prevent players from accessing games if they have obtained access to a Client ID and Client Secret that allows them to access your game, even if they haven't purchased it.
- Item Name determines which item will be used in the Entitlement Check.
Lobby Service Rate Limit
These settings work together to determine how many requests a player can make to the Lobby service before an error is returned.
- Duration Limit (ms) determines the duration (in milliseconds) in which requests made to the Lobby service may return an error. This setting works with the Burst Limit setting.
- Burst Limit determines the number of requests that can be made to the Lobby service within a given time. This setting works with the Duration Limit setting.
When combined, these two settings determine a rate of requests per unit of time. For example, if the Duration Limit is 1,000 milliseconds and the Burst Limit is 3, then 3 requests per 1,000 milliseconds (or per second) is the minimum rate at which requests sent to the Lobby will be considered spam by the Lobby service. This means that requests that are made at a rate of less than 3 per second will be handled normally and not considered spam.
Export Lobby Configuration
In the Admin Portal open the desired game namespace, then go to the Game Management section and open the Lobby Configuration menu.
On the Lobby Configuration page, click Export/Import Configuration in the top-right corner of the page, then click Export Lobby Configuration.
The lobby configuration of the selected game namespace will be downloaded to your computer in JSON format.
Import Lobby Configuration
In the Admin Portal open the desired game namespace, then go to the Game Management section and open the Lobby Configuration menu.
On the Lobby Configuration page, click Export/Import Configuration in the top-right corner of the page, then click Import Lobby Configuration.
The Import Lobby Configuration form appears. Click Select JSON File to browse for the lobby configuration you want to import, then click the Import button.
The selected lobby configuration will be imported.
Implement the Lobby using the Client SDKs
Connect to Lobby
You can connect the AccelByte Lobby service to your game by using the command below:
- Unreal Engine
- Unity
AccelByte::FRegistry::Lobby.Connect();
AccelBytePlugin.GetLobby().Connect();
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetConnectSuccessDelegate(AccelByte::Api::Lobby::ConnectSuccess.CreateLambda([]()
{
// Do something If ConnectSuccessDelegate has been successful
}));
FRegistry::Lobby.SetConnectFailedDelegate(AccelByte::Api::Lobby::ConnectError.CreateLambda([]()
{
// Do something if ConnectFailedDelegate has been successful
}));
FRegistry::Lobby.SetConnectionClosedDelegate(AccelByte::Api::Lobby::ConnectionClosed.CreateLambda([]()
{
// Do something if ConnectionClosedDelegate has been successful
}));
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().Connected += () =>
{
// Do something if Lobby Connected
};
AccelBytePlugin.GetLobby().Disconnected += error =>
{
// Do something if Lobby Disconnected
Debug.Log($"Lobby Disconnected, Error Code: {(int) error}");
};