Authenticating Players with Unity #
When you are first starting out with LootLocker, the service’s feature set might seem a bit daunting at first. This page hopes to serve as a guide on how to get started, and help you understand how API calls are made and handled.
Player Verification #
Depending on the platforms your game will run on, we might require that the players verify their identity before you can register a session with LootLocker.
We currently require “Player Verification” on Steam and PSN. Verifying a Player requires that you get a token from the First Party Platform, that is then sent to LootLocker for verification with that First Party Platform. This lets LootLocker know to expect a new Session Registration request from this user.
Verifying a Player with Steam #
To verify a Player for Authentication with Steam, you first need to obtain an Auth Session Ticket from the Steam SDK by issuing a call to
Steam’s documentation for more information on Session Tickets.
Here’s a small snippet that should help you achieve that:
Once you have that ticket, and it’s turned into a string of hexadecimal numbers, the next step is to call the
VerifyID function on the LootLocker SDK
Once you have successfully verified your Session Ticket, you are ready to register the players session with LootLocker. You do not need to store the result of this call anywhere. LootLocker knows to expect a Game Session call in the next 5 minutes.
Authenticating with LootLocker #
Now that we have successfully verified the Session Ticket with LootLocker, we are ready to register a Game Session. This call will return a lot of data that you can use to display to the Player or make more calls to LootLocker during this session.
You have 5 minutes to register a Game Session after a successful Player Verification response before you need to start over with a new Player Verification.
SteamId64 is obtained by calling
This snippet will start a Game Session with LootLocker
success boolean used in the snippet above, we also return a host of other data, such as the player’s ID, if they’ve been seen before etc. If you want to dive deeper into this
SessionResponse, you can find the
code for the SDK on GitHub.
What Now? #
Next up, we suggest you look at our feature set, and decide which ones you want to use.
If you want to store your players inventories with LootLocker (this allows us to enable a lot more features, such as granting assets to players on level up, when completing a mission, etc) a great next step is to read up on the Asset Manager.