Player Storage
Player storage allows you to store key/value data on the player. Storage items can be private or public, making possible
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.

Unity
LootLockerSDKManager.GetEntirePersistentStorage((response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved player storage: " + response.payload.Length);
} else
{
Debug.Log("Error getting player storage");
}
});
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");
}
});
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");
}
});
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");
}
});
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");
}
});
Last modified 3mo ago