Troubleshooting
Having trouble with multi user support in LootLocker? Here are some common issues and solutions.
Common Issues
1. API calls return data for the wrong user
Solution: Always specify the ULID when making API calls in a multi user context. If you do not, the SDK will use the default user, which may not be what you expect.
2. Session not found or invalid
Solution: First make sure that the request is for the expected player and not a previous and expired session. Next ensure the player has been authenticated and their session is active. If you manually manage sessions (e.g., on a server), make sure you have called
StartSessionManual
with the correct data.
3. Removing a user does not clear their data
Solution: Use the SDK's end session methods to properly remove a user's session and data. See the End Sessions and Clean State guide.
4. Unexpected default user
Solution: If you switch profiles, remember that the default user changes. Always specify ULID for clarity.
Debugging
How to check which is the current default user
To check which player is currently the default player is a simple operation but can be crucial for when you're debugging your game.
LootLockerSDKManager.GetDefaultPlayerUlid();
How to check which player a request was executed for
To check which player a request (any LootLocker request) was executed for is a simple operation but can be crucial for you when you're debugging your game. The below example shows how to get this data from the response to getting progression data. But all responses to all LootLocker methods holds this crucial context object which contains the player ulid the request was executed for.
var progression_key = "replace_with_your_key";
var executeRequestForPlayerWithUlid = "replace_with_your_player_ulid";
LootLockerSDKManager.GetProgression(progression_key, response =>
{
if (!response.success)
{
Debug.LogWarning($"Getting progression data for {progression_key} failed: {response.errorData}"
+ $"\n request was executed for player with ulid {response.requestContext.player_ulid}"
+ $" and was expected to be executed for player with ulid {executeRequestForPlayerWithUlid}");
}
}, executeRequestForPlayerWithUlid);
Best Practices
Always specify ULID in multi user scenarios.
Clean up sessions for users who log out or leave, unless you know that you want to keep them for added functionality like profile switching.
In server contexts, manage session tokens and player data carefully.
Need More Help?
If you encounter issues not covered here, reach out in our community Discord.
Last updated