LootLocker
The BasicsGame SystemsContent ManagementPlayer Management
LootLocker
  • 📌The Basics
    • Getting Started
    • What is LootLocker?
    • Core Concepts
      • Players
      • Assets
      • Character Classes
      • API Types
      • Web Console
      • Stage & Live Environments
      • Glossary
    • Unity Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • Unreal Quick Start
      • Install & Configure the SDK
        • Older versions
      • Authenticate Your First Player
    • Godot Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • SDKs
    • Samples
      • Authentication Samples
      • Leaderboard Samples
      • Progression Samples
      • Player Samples
    • Launching Your Game
    • Support
      • Error Codes
      • Unreal Marketplace Plugin Support
  • 🎭Players
    • Overview
    • Authentication
      • How To
        • Guest Login
        • Steam
        • Apple
        • Apple Game Center
        • Google
        • Epic Games
        • PlayStation
        • Meta / Oculus
        • Xbox
        • Nintendo Switch
    • Files
      • How To
        • Manage Files in Web Console
        • Work with Files In-Game
    • Inventory
      • How To
        • Work with Player Inventory
    • Messages
      • How To
        • Configure Messages in Web Console
    • Names
      • How To
        • Work with Player Names
    • Player Manager
      • How To
        • Manage Players through Web Console
        • Manage Players In-Game
        • Use Player Operations
    • Unified Player Accounts
      • How To
        • Configure UPA in Web Console
        • Use Remote Login In-Game
        • Connect Identiy Provider to Player
        • External Provider Linking
        • Transition from Guest Login to Other Provider
        • Disconnect Identity Provider from Player
    • White Label Login
      • How To
        • Configure White Label Login
        • Create a New White Label User
        • Request User Verification
        • Handle Returning Users
        • Start a White Label Session
  • 🪙Commerce
    • Overview
    • Catalogs
      • How To
        • Configure Catalogs in LootLocker Console
        • List all Catalogs
        • Use Catalogs In-Game
        • Setup In-Game Store
    • Currencies
      • How To
        • Configure a Currency in Web Console
        • Use Currencies In-Game
    • DLC Management
      • How To
        • Configure DLC in Web Console
        • Use DLC In-Game
    • Entitlements
      • How To
        • Work with Entitlements In-Game
    • Real Money Purchases
      • How To
        • Configure In-App Purchase in Web Console
        • Make Purchases through Google Play Store
        • Make Purchases through Apple Store
        • Make Purchases through Steam Store
    • Virtual Purchases
    • Wallets
      • How To
        • Manage a Wallet in Web Console
        • Use Wallets In-Game
  • ⚔️Content
    • Overview
    • Assets
      • How To
        • Create & Configure an Asset
        • Organize & Search for Assets
        • Retrieve Assets In-Game
        • Set up Asset Storage Template
        • Check Grant Notifications
        • Set up a Game Config Asset
        • Create a Loot Box
        • Work with Loot Boxes In-Game
        • Create a Drop Table
        • Work with Drop Tables In-Game
        • Create a Rental Asset
        • Work with Rental Assets In-Game
    • User Generated Content (UGC)
      • How To
        • Create UGC In-Game
    • Twitch Drops
  • 🕹️Game Systems
    • Overview
    • Classes & Heroes
      • How To
        • Base Classes
        • Hero Classes
        • Implement Classes In-Game
        • Implement Heroes In-Game
    • Leaderboards
      • How To
        • Configure Leaderboard in Web Console
        • Use Player Leaderboards
        • Use Generic Leaderboards
        • Use Metadata to Store Additional Information
        • Use Scheduled Reset with Rewards
        • Use Leaderboards for Time Based Rankings
      • Leaderboard FAQ
      • GameMaker References
    • Feedback
      • How To
        • Manage Feedback Categories
        • Create Player Feedback
        • Create UGC Feedback
        • Create Game Feedback
        • View and Manage Feedback
    • Progressions
      • How To
        • Create a Progression
        • Game Progressions
        • Player Progressions
        • Class Progressions
        • Asset Instance Progressions
    • Triggers
      • How To
        • Setup a trigger in the Web Console
        • Invoke trigger from game
  • ⛓️Shared Systems
    • Overview
    • Metadata
      • How To
        • Add Metadata in Console
        • Fetch a Single Metadata In-Game
        • Fetch Metadata In-Game by Tags
        • Fetch Metadata In-Game from Multiple Sources
    • Notifications
      • How To
        • List Notifications and Mark as Read In-Game
  • 🗝️Admin
    • Settings
    • User Settings
    • Organization Settings
    • CORS Allowlist
  • ⭕️ Legacy
    • Deprecations
      • Unity SDK Deprecation Log
        • Version 2.1.5 - Migration to Open UPM
        • Version 2.0.0
      • Unreal SDK Deprecation Log
        • Version 4.0.0
        • Version 3.0.0
    • Legacy Storage
    • Legacy Triggers
      • Activate a trigger
      • Create a trigger
    • Legacy Progressions
      • Create a Progression System
      • Use a Progression System In-Game
Powered by GitBook
On this page
  1. ⭕️ Legacy

Legacy Storage

PreviousVersion 3.0.0NextLegacy Triggers

Last updated 5 months ago

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

LootLockerSDKManager.GetEntirePersistentStorage((response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully retrieved player storage: " + response.payload.Length);
    } else
    {
        Debug.Log("Error getting player storage");
    }
});
curl -X GET "https://api.lootlocker.io/game/v1/player/storage" \
  -H "x-session-token: your_token_here"

Example response:

{
  "success": true,
  "payload": [
    {
      "key": "user.answer",
      "value": "42",
      "is_public": false
    }
  ]
}

Retrieve Single Storage Value From Game

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");
    }
});
curl -X GET "https://api.lootlocker.io/game/v1/player/storage?key=user.something" \
  -H "x-session-token: your_token_here"

Example response:

{
  "success": true,
  "payload": {
    "key": "user.answer",
    "value": "42",
    "is_public": false
  }
}

Update Player Storage

To update a single value for a key

LootLockerSDKManager.UpdateOrCreateKeyValue("some-key", "some new value", (getPersistentStoragResponse) =>
{
    if (getPersistentStoragResponse.success)
    {
        Debug.Log("Successfully updated player storage");
    }
    else
    {
        Debug.Log("Error updating player storage");
    }
});
curl -X POST "https://api.lootlocker.io/game/v1/player/storage" \
  -H "x-session-token: your_token_here" \
  -H "Content-Type: application/json" \
  -d '
[
  {
    "key": "totalDeaths",
    "value": "124",
    "is_public": true,
    "order": 1
  }
]'

To update or create multiple keys at the same time

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");
    }
});
curl -X POST "https://api.lootlocker.io/game/v1/player/storage" \
  -H "x-session-token: your_token_here" \
  -H "Content-Type: application/json" \
  -d '
[
  {
    "key": "totalDeaths",
    "value": "124",
    "is_public": true,
    "order": 1
  },
  {
    "key": "animal",
    "value": "Sheep",
    "order": 2
  }
]'

Remove Player Storage Item

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");
    }
});
curl -X DELETE "https://api.lootlocker.io/game/v1/player/storage?key=fruit" \
  -H "x-session-token: your_token_here"

Get Other Players Public Storage

For this you need the public UID of the other player.

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");
    }
});

Get by Player ID

curl -X GET "https://api.lootlocker.io/game/v1/player/1234/storage" \
  -H "x-session-token: your_token_here"

Get by Player Public UID

curl -X GET "https://api.lootlocker.io/game/v1/player/A1B2C3D4/storage" \
  -H "x-session-token: your_token_here"

Example response:

{
  "success": true,
  "payload": [
    {
      "key": "user.answer",
      "value": "42",
      "is_public": true
    }
  ]
}
Blueprint example of retrieving entire player storage
Blueprint example of retrieving a single storage value
Blueprint example of updating a single value
Blueprint example of creating or updating multiple keys
Blueprint example of deleting key
Blueprint example of deleting key