Player Storage
Player storage allows you to store key/value data on the player. Storage items can be private or public, making possible

Retrieve Player Storage

To view Player storage in the web console, go to the player and select the storage tab. From here it's possible to view and edit the data for the player.

Retrieve Entire Player Storage From Game

Unity
LootLockerSDKManager.GetEntirePersistentStorage((response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved player storage: " + response.payload.Length);
} else
{
Debug.Log("Error getting player storage");
}
});

Retrieve Single Storage Value From Game

Unity
string key = "some-key";
LootLockerSDKManager.GetSingleKeyPersistentStorage(key, (response) =>
{
if (response.success)
{
if (response.payload != null)
{
Debug.Log("Successfully retrieved player storage with value: " + response.payload.value);
} else
{
Debug.Log("Item with key " + key + " does not exist");
}
} else
{
Debug.Log("Error getting player storage");
}
});

Update Player Storage

To update a single value for a key
Unity
LootLockerSDKManager.UpdateOrCreateKeyValue("some-key", "some new value", (getPersistentStoragResponse) =>
{
if (getPersistentStoragResponse.success)
{
Debug.Log("Successfully updated player storage");
}
else
{
Debug.Log("Error updating player storage");
}
});
To update or create multiple keys at the same time
Unity
LootLockerGetPersistentStorageRequest data = new LootLockerGetPersistentStorageRequest();
data.AddToPayload(new LootLockerPayload { key = "some-key", value = "Some new value" });
data.AddToPayload(new LootLockerPayload { key = "some-other-key", value = "Some other new value" });
LootLockerSDKManager.UpdateOrCreateKeyValue(data, (getPersistentStoragResponse) =>
{
if (getPersistentStoragResponse.success)
{
Debug.Log("Successfully updated player storage");
}
else
{
Debug.Log("Error updating player storage");
}
});

Remove Player Storage Item

For this you need the public UID of the other player.
Unity
LootLockerSDKManager.DeleteKeyValue("some-key", (getPersistentStoragResponse) =>
{
if (getPersistentStoragResponse.success)
{
Debug.Log("Successfully removed key from player storage");
}
else
{
Debug.Log("Error removing key from player storage");
}
});

Get Other Players Public Storage

Unity
LootLockerSDKManager.GetOtherPlayersPublicKeyValuePairs("92AR9254", (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved storage for other player " + response.payload.Length);
}
else
{
Debug.Log("Error retrieving storage for other player");
}
});
Copy link
On this page
Retrieve Player Storage
Update Player Storage
Remove Player Storage Item
Get Other Players Public Storage