Manual Login
White label login works a little differently than other platforms in the sense that we first have to create a white label login session, which is then used to create a game session.
When the player is logged in, the SDK will save the token, so you don't have to send it to
StartWhiteLabelSession
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks the login button.
string email = "[email protected]";
string password = "password here";
bool rememberMe = true;
LootLockerSDKManager.WhiteLabelLogin(email, password, rememberMe, response =>
{
if (!response.success)
{
Debug.Log("error while logging in");
return;
}
string token = response.SessionToken;
// Start game session here
});
Above is an example of how to implement White Label login using blueprints in Unreal Engine. For an example you can copy and paste into your editor, look here.
You need to exchange the
TriggerWhiteLabelLogin
event for whatever event you want to use to trigger the login flow.Remove the nodes
Replace: Input
with the email and password input from the user input in your game.We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success.
After creating a session token we can register a game session. When the session has been registered you can use other LootLocker features in your game.
Unity
Unreal
// Remember to use the LootLocker namespace in the top of your file.
using LootLocker.Requests;
// This code should be placed in a handler when user clicks login button.
LootLockerSDKManager.StartWhiteLabelSession((response) =>
{
if (!response.success)
{
Debug.Log("error starting LootLocker session");
return;
}
Debug.Log("session started successfully");
});
Above is an example of how to implement starting a game session from a White Label login using blueprints in Unreal Engine. For an example you can copy and paste into your editor, look here.
You need to exchange the
TriggerWhiteLabelStartGameSession
event for whatever event you want to use to trigger the login flow.We recommend branching the completed events on the success flag, and if you do this you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success.
For subsequent calls to different LootLocker methods you will want to create variables from the Player Id and Player Identifier outputs.
Congratulations - you have now started using LootLocker in your game! Next up we suggest you look at our feature set, and decide which ones you want to use in your game.
Last modified 7mo ago