Skip to main content

Retrieve a List of Game Sessions

Last updated on

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.

int32 indexOffset {0};
int32 itemLimit {20};

ApiClient->SessionBrowser.GetGameSessions(EAccelByteSessionType::p2p, "TestGameMode", THandler<FAccelByteModelsSessionBrowserGetResult>::CreateLambda([](const FAccelByteModelsSessionBrowserGetResult& Result)
{
// On Operation success, result is stored in Result.Sessions array
}), FErrorHandler::CreateLambda([](const int32 Code, const FString& Message)
{
// Operation failed
}), indexOffset, itemLimit);