End Sessions and Manage State
How it Works
How to Sign Your Player Out
// The ulid that you want to end the session for
// In a multi user context it is vital to make sure that you're ending
// the session for the correct player.
string playerUlid = "player_ulid_here";
// Remember to provide the shouldClearLocalState parameter as true
// to clear the local state of the player.
bool bShouldClearLocalState = true;
LootLockerSDKManager.EndSession(endSessionResponse =>
{
if (endSessionResponse.success)
{
Log("Session ended successfully");
}
else
{
// Handle errors
Log("Failed to end session, local state not cleared: " + endSessionResponse.errorData);
}
}, bShouldClearLocalState, playerUlid);// The ulid that you want to end the session for
// In a multi user context it is vital to make sure that you're ending
// the session for the correct player.
FString playerUlid = "player_ulid_here";
// EndSession will clear the local state for you
ULootLockerSDKManager::EndSession(FLootLockerDefaultDelegate::CreateLambda([=](const FLootLockerResponse& endSessionResponse)
{
if (endSessionResponse.success)
{
UE_LOG(<LogCategory>, Warning, TEXT("Session ended successfully"));
}
else
{
UE_LOG(<LogCategory>, Warning, TEXT("Failed to end session: %s"), *endSessionResponse.ErrorData.Message);
}
}), playerUlid);How to Manually Clear Player State
For a Specific Player

For Everyone

For Everyone Except a Specific Player

How to Manage Active vs Inactive Players
For a Specific Player

For Everyone

For Everyone Except a Specific Player

Last updated
Was this helpful?

