Access
Connect cross-platform accounts & identity management
AccelByte offers a session browser feature to store your game session data. This browser supports P2P sessions to store game clients and a Dedicated Server to store game server sessions. Both P2P and Dedicated Server sessions use REST API for the game client and server.
P2P sessions are generated by a game client and act as a session host. P2P entries contain game client session data which are stored in the session browser. When the lobby is disconnected, the P2P entries are removed from the server. If the lobby connection is reconnected by the host, past P2P entries will not be listed in the server browser and must be recreated in the session browser.
A Dedicated Server session is a session generated by the server that is managed by Armada.
Permissions are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage the Session Browser.
Usage | Resource | Action |
Create Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Create |
Retrieve List of Game Sessions | ADMIN:NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Read |
Retrieve Game Session by Session ID | ADMIN:NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Read |
Update Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Update |
Delete Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Delete |
Join Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Read |
Register Player to Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Update |
Unregister Player to Session | NAMESPACE:{namespace}:SESSIONBROWSER:SESSION | Update |
Get Recent Player Data | NAMESPACE:{namespace}:SESSIONBROWSER:RECENTPLAYER | Read |
Permissions work slightly differently depending on whether they are assigned to IAM Clients or on Roles assigned to users. For more information, see AccelByte’s Authentication and Authorization documentation.
You can call the session browser from the Game Client using the following function:
FApiClientPtr ApiClient { FMultiRegistry::GetApiClient() };
ApiClient->SessionBrowser
You can call the session browser from the Dedicated Server using the following function:
FServerApiClientPtr ServerApiClient{ FMultiRegistry::GetServerApiClient() };
ServerApiClient->ServerSessionBrowser
Call the CreateGameSession() function to create a new session. Make sure you specify the EAccelByteSessionType parameter as dedicated if you want to create a Dedicated Server session, or p2p to create a P2P session.
Call the SessionBrowser.GetGameSessions() function to retrieve a list of active game sessions. Make sure you specify the EAccelByteSessionType parameter as dedicated if you want to retrieve a list of Dedicated Server sessions, or p2p to list P2P sessions.
Call the SessionBrowser.GetGameSessions() function to retrieve a specific game session. Make sure you specify the EAccelByteSessionType parameter as dedicated if you want to retrieve a Dedicated Server session, or p2p to list P2P sessions.
Call the UpdateGameSession() function to keep the ongoing session’s player count updated in real-time.
Call the RemoveGameSession() function to delete a session.
Call the JoinSession() function to join a known session. This method requires a session ID and password (if the session has a password). This function will return network data such as IP and Port that can be used to connect to a game host.
When the game host detects that a player has joined a session, the RegisterPlayer() function will be called to update the session data with the new player.
When the game host detects that a player has left a session, the UnegisterPlayer() function will be called to remove the player from the session data.
Call the GeRecentPlayer() function to retrieve information such as userID and displayName from recently encountered players.
Before using the Session Browser service, you must initialize your server-side SDK to be authorized to perform create, read, update, and delete actions.
To start using the Session Browser service from the Golang SDK, you must initialize the SDK by completing the following steps:
Create your OAuth Client and assign the necessary permissions to access the Achievement service.
Initialize the service using the following function:
sessionService := &sessionbrowser.SessionService{
Client: factory.NewSessionBrowserClient(&repository.ConfigRepositoryImpl{}),
TokenRepository: &repository.TokenRepositoryImpl{},
}
Once you have successfully completed this initialization, you can use the Golang SDK to create, read, update, and delete Session Browsers from your serverless app.
To start using the Session Browser service from the Python SDK, you must initialize the SDK by completing the following steps:
Once you have successfully completed this initialization, you can use the Python SDK to create, read, update, and delete Session Browsers from your serverless app.
Before using the Session Browser service, you will need to set some permissions. Use the following .NET namespaces:
using AccelByte.Sdk.Api.Sessionbrowser.Model;
using AccelByte.Sdk.Api.Sessionbrowser.Operation;
using AccelByte.Sdk.Api.Sessionbrowser.Wrapper;
Before using the Session Browser service, you will need to set some permissions. Initialize the Session wrapper from the Session Browser service using the following code:
Session wSBSession = new Session(sdk);
Once completed, you can use the SDK to create, read, update, or delete sessions.
Use the following function to create a session (opens new window):
Use the following function to delete a session (opens new window) using the session ID:
Use the following function to retrieve a session (opens new window) using the session ID:
Use the following function to update a session (opens new window). You can update a game session when you need to update the maximum number of players or number of current players in a session.