Unreal SDK APIs

APIs #

This document outlines API calls and responses for each LootLocker.

Responses #

Standard Response #

Every response inherits from the LootLockerResponse.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
``` cpp
    struct FLootLockerResponse
    {
        GENERATED_BODY()
        public:
        UPROPERTY(BlueprintReadWrite, EditAnywhere)
        bool success;
        UPROPERTY(BlueprintReadWrite, EditAnywhere)
        bool ServerCallHasError;
        UPROPERTY(BlueprintReadWrite, EditAnywhere)
        int ServerCallStatusCode;
        UPROPERTY(BlueprintReadWrite, EditAnywhere)
        FString FullTextFromServer;
        UPROPERTY(BlueprintReadWrite, EditAnywhere)
        FString ServerError;
    };
```

In any response coming from the callbacks of all LootLocker methods, you get the response above. You can get the raw text from “FullTextFromServer”.

Example Response #

We have a class for each response. The response class contains all the variables from the JSON response of the API request. You can see this when checking out the examples that come with the SDK and comparing them with the API JSON response expected.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
```json
    // Example json
    {
        "success": true,
        "payload": [
            {
                "key": "user.answer",
                "value": "42"
            }
        ]
    }
```
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
```cpp
//Response Class

USTRUCT(BlueprintType)
struct FPersistentStorageItem {
    GENERATED_BODY()
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    FString key;
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    FString value;
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    bool is_public;
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    int order;
};

USTRUCT(BlueprintType)
struct FPersistentStorageItemsResponse : public FLootLockerResponse
{
    GENERATED_BODY()
    UPROPERTY(BlueprintReadWrite, EditAnywhere)
    TArray<FPersistentStorageItem> items;
    public:
    FPersistentStorageItemsResponse()
    {}
};
```

SDK Configuration #

V1.0.0

If you want to modify the LootLockerConfig by code, you can do this by calling “ULootLockerConfig::SetLootLockerSettings”. This method requires you to pass in your LootLockerGameKey, Platform, Game Version, Development mode and AllowTokenRefresh.

V1.0.1

  1. Navigate to Edit/Project Settings.

  2. Scroll down on the left panel until the plugins sections of the project settings.

  3. Click on LootLockerSDK.

  4. Modify the LootLockerGameKey, Platform, Game Version, Development mode and AllowTokenRefresh (Set to true if you want the LootLockerSDK to attempt to refresh the token if it expires).

Authentication #

API Reference: https://docs.lootlocker.io/game-api/#authentication

Authentication With Steam #

API Reference: https://docs.lootlocker.io/game-api/#player-verification

Using LootLocker with Steam requires “ULootLockerSDKManager::VerifyPlayer” to be the very first call made. After a successful response from this call, you can follow up with the “ULootLockerSDKManager::StartSession” call.

One of the variables required by ULootLockerSDKManager::VerifyPlayer call is the “SteamIdentityToken” or “Steam Session Ticket”. You can retrieve this using the sample code found below, but first you have to follow the instructions found here. These instructions tell you how to enable the online subsystems of the Unreal Engine. You can also check out the “DemoAuthentication” class in our demo project.

If you prefer videos, you can follow the guide found here.

Note: You can not test authentication with steam in the editor, you need to package your game before it can connect to steam.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
```cpp
IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
FString IdentityToken = OnlineSub->GetIdentityInterface()->GetAuthToken(0);
ULootLockerSDKManager::VerifyPlayer(IdentityToken, FLootLockerDefaultAuthenticationResponse::CreateUObject(this, &ADemoAuthentication::OnVerifyPlayerCompleted));
   
   void ADemoAuthentication::OnVerifyPlayerCompleted(FAuthenticationDefaultResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPlayer Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPlayer Failed"));
    }
}
```

```cpp
void ADemoAuthentication::DemoVerifyPlayer()
{
    ULootLockerSDKManager::VerifyPlayer(IdentityToken, FLootLockerDefaultAuthenticationResponse::CreateUObject(this, &ADemoAuthentication::OnVerifyPlayerCompleted));
}

void ADemoAuthentication::OnVerifyPlayerCompleted(FAuthenticationDefaultResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPlayer Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPlayer Failed"));
    }
}
```

Session/Authentication Request #

API Reference: https://docs.lootlocker.io/game-api/#authentication-request

For non-steam games, your first call should be “ULootLockerSDKManager::StartSession”. This call only requires you to send a “PlayerId”. This can be any string you use to identify your players. You should note that you are responsible for keeping this persistent since this is the only way LockerLocker can identify your players.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
//Example Method
void ADemoAuthentication::DemoStartSession()
{
    ULootLockerSDKManager::StartSession(PlayerId, FLootLockerSessionResponse::CreateUObject(this, &ADemoAuthentication::OnStartSessionCompleted));
}

//Example callback method
void ADemoAuthentication::OnStartSessionCompleted(FAuthenticationResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnStartSession Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnStartSession Failed"));
    }
}
```

Remember you need to have your appropriate header files with the methods declared.

Ending A Session #

API Reference: https://docs.lootlocker.io/game-api/#ending-a-session

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAuthentication::DemoEndSession()
{
    ULootLockerSDKManager::EndSession(PlayerId, FLootLockerDefaultAuthenticationResponse::CreateUObject(this, &ADemoAuthentication::OnEndSessionCompleted));
}

void ADemoAuthentication::OnEndSessionCompleted(FAuthenticationDefaultResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnEndSession Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnEndSession Failed"));
    }
}
```

Player #

API Reference: https://docs.lootlocker.io/game-api/#characters

Get Player Info #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoGetPlayerInfo()
{
    ULootLockerSDKManager::GetPlayerInfo(FLootLockerPlayerInformationResponse::CreateUObject(this, &ADemoPlayers::OnGetPlayerInfoCompleted));
}

void ADemoPlayers::OnGetPlayerInfoCompleted(FPlayerInfoResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Get Inventory List #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoGetInventory()
{
    ULootLockerSDKManager::GetInventory(FLootLockerInventoryResponse::CreateUObject(this, &ADemoPlayers::OnGetInventoryCompleted));
}

void ADemoPlayers::OnGetInventoryCompleted(FInventoryResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetInventory Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetInventory Failed"));
    }
}
```

Get Currency Balance #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::GetCurrencyBalance()
{
    ULootLockerSDKManager::GetCurrencyBalance(FPBalanceResponse::CreateUObject(this, &ADemoPlayers::OnGetCurrencyBalance));
}

void ADemoPlayers::OnGetCurrencyBalance(FBalanceResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Submit XP #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoSubmitXp()
{
    ULootLockerSDKManager::SubmitXP(points, FLootLockerSubmitXpResponse::CreateUObject(this, &ADemoPlayers::OnSubmitXpCompleted));
}

void ADemoPlayers::OnSubmitXpCompleted(FSubmitXpResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnSubmitXp Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnSubmitXp Failed"));
    }
}
```

Get Other Players XP And Level #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoGetOtherPlayerInfo()
{
    ULootLockerSDKManager::GetOtherPlayerInfo(getRequests, FLootLockerPlayerInformationResponse::CreateUObject(this, &ADemoPlayers::OnGetOtherPlayerInfoCompleted));
}

void ADemoPlayers::OnGetOtherPlayerInfoCompleted(FPlayerInfoResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetOtherPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetOtherPlayerInfo Failed"));
    }
}
```

Player Asset Notifications #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoCheckPlayerAssetNotification()
{
    ULootLockerSDKManager::CheckPlayerAssetActivationNotification(FLootLockerAssetNotificationResponse::CreateUObject(this, &ADemoPlayers::OnCheckPlayerAssetNotificationCompleted));
}

void ADemoPlayers::OnCheckPlayerAssetNotificationCompleted(FPlayerAssetNotificationResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCheckPlayerAssetNotification Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCheckPlayerAssetNotification Failed"));
    }
}
```

Player Asset Deactivation Notifications #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::DemoCheckPlayerAssetDeactivationNotification()
{
    ULootLockerSDKManager::CheckPlayerAssetDeactivationNotification(FLootLockerAssetNotificationResponse::CreateUObject(this, &ADemoPlayers::OnCheckPlayerAssetDeactivationNotificationCompleted));
}

void ADemoPlayers::OnCheckPlayerAssetDeactivationNotificationCompleted(FPlayerAssetNotificationResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCheckPlayerAssetDeactivationNotification Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCheckPlayerAssetDeactivationNotification Failed"));
    }
}
```

Initiate DLC Migration #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::InitiateDLCMigration()
{
    ULootLockerSDKManager::InitiateDLCMigration(FResponseCallback::CreateUObject(this, &ADemoPlayers::OnInitiateDlcMigration));
}

void ADemoPlayers::OnInitiateDlcMigration(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Get DLCs Migrated #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::GetDLCsMigration()
{
    ULootLockerSDKManager::GetDLCsMigration(FPDlcResponse::CreateUObject(this, &ADemoPlayers::OnGotDlcMigration));
}

void ADemoPlayers::OnGotDlcMigration(FDlcResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Set Profile Private #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPlayers::SetProfilePrivate()
{
    ULootLockerSDKManager::SetProfilePrivate(FResponseCallback::CreateUObject(this, &ADemoPlayers::OnProfileSetPrivate));
}

void ADemoPlayers::OnProfileSetPrivate(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Set Profile Public #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
```cpp
void ADemoPlayers::SetProfilePublic()
{
    ULootLockerSDKManager::SetProfilePublic(FResponseCallback::CreateUObject(this, &ADemoPlayers::OnProfileSetPublic));
}


void ADemoPlayers::OnProfileSetPublic(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerInfo Failed"));
    }
}
```

Character #

API Reference: https://docs.lootlocker.io/game-api/#characters

Character Loadouts #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoCharacters::GetCharacterLoadout()
{
    ULootLockerSDKManager::GetCharacterLoadout(FLootLockerCharacterLoadoutResponse::CreateUObject(this, &ADemoCharacters::OnGetCharacterLoadoutCompleted));
}

void ADemoCharacters::OnGetCharacterLoadoutCompleted(FCharacterLoadoutResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCharacterLoadout Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCharacterLoadout Failed"));
    }
}
```

Update Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoCharacters::UpdateCharacter()
{
    ULootLockerSDKManager::UpdateCharacter(IsDefault,CharacterName,FLootLockerCharacterLoadoutResponse::CreateUObject(this, &ADemoCharacters::OnUpdatedCharacterLoadoutCompleted));
}

void ADemoCharacters::OnUpdatedCharacterLoadoutCompleted(FCharacterLoadoutResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCharacterLoadout Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCharacterLoadout Failed"));
    }
}
```

Equip Asset to Default Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 assetInstanceId;

void ADemoCharacters::EquipAssetToDefaultCharacter()
{
ULootLockerSDKManager::EquipAssetToDefaultCharacter(assetInstanceId, FLootLockerCharacterDefaultResponse::CreateUObject(this, &ADemoCharacters::OnEquipAssetToDefaultCharacterCompleted));
}

void ADemoCharacters::OnEquipAssetToDefaultCharacterCompleted(FLootLockerResponse Response)
{
if (Response.success)
{
UE_LOG(LogTemp, Verbose, TEXT("OnEquipAssetToDefaultCharacter Success"));
}
else
{
UE_LOG(LogTemp, Verbose, TEXT("OnEquipAssetToDefaultCharacter Failed"));
}
}
```

Equip Asset to Character By Id #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
```cpp
//Declared and assigned in header file
int32 AssetId;
int32 AssetVariationId;
int32 CharacterId;

void ADemoCharacters::EquipAssetToCharacterById()
{
ULootLockerSDKManager::EquipAssetToCharacterById(CharacterId, AssetId, AssetVariationId, FLootLockerCharacterDefaultResponse::CreateUObject(this, &ADemoCharacters::OnEquipAssetToCharacterByIdCompleted));
}

void ADemoCharacters::OnEquipAssetToCharacterByIdCompleted(FLootLockerResponse Response)
{
if (Response.success)
{
UE_LOG(LogTemp, Verbose, TEXT("OnEquipAssetToCharacterById Success"));
}
else
{
UE_LOG(LogTemp, Verbose, TEXT("OnEquipAssetToCharacterById Failed"));
}
}
```

Unequip Asset to Default Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 InstanceId;

void ADemoCharacters::UnEquipAssetToDefaultCharacter()
{
    ULootLockerSDKManager::UnEquipAssetToDefaultCharacter(InstanceId, FLootLockerCharacterDefaultResponse::CreateUObject(this, &ADemoCharacters::OnUnEquipAssetToDefaultCharacterCompleted));
}

void ADemoCharacters::OnUnEquipAssetToDefaultCharacterCompleted(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUnEquipAssetToDefaultCharacterCompleted Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUnEquipAssetToDefaultCharacter Failed"));
    }
}
```

Unequip Asset To Character By Id #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
```cpp
int32 AssetId;
int32 CharacterId;

void ADemoCharacters::UnEquipAssetToCharacterById()
{
    ULootLockerSDKManager::UnEquipAssetToCharacterById(CharacterId, AssetId, AssetVariationId, FLootLockerCharacterDefaultResponse::CreateUObject(this, &ADemoCharacters::OnUnEquipAssetToCharacterByIdCompleted));
}

void ADemoCharacters::OnUnEquipAssetToCharacterByIdCompleted(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUnEquipAssetToCharacterById Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUnEquipAssetToCharacterById Failed"));
    }
}
```

Get Current Loadout to Default Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoCharacters::GetCurrentLoadoutToDefaultCharacter()
{
    ULootLockerSDKManager::GetCurrentLoadoutToDefaultCharacter(FLootLockerCharacterLoadoutResponse::CreateUObject(this, &ADemoCharacters::OnGetCurrentLoadoutToDefaultCharacterCompleted));
}

void ADemoCharacters::OnGetCurrentLoadoutToDefaultCharacterCompleted(FCharacterLoadoutResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCurrentLoadoutToDefaultCharacter Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetCurrentLoadoutToDefaultCharacter Failed"));
    }
}
```

Get Other Players Loadout to Default Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 OtherPlayerId;

void ADemoCharacters::GetOtherPlayersCurrentLoadoutToDefaultCharacter()
{
    ULootLockerSDKManager::GetOtherPlayersCurrentLoadoutToDefaultCharacter(OtherPlayerId, FLootLockerCharacterLoadoutResponse::CreateUObject(this, &ADemoCharacters::OnGetOtherPlayersCurrentLoadoutToDefaultCharacterCompleted));
}

void ADemoCharacters::OnGetOtherPlayersCurrentLoadoutToDefaultCharacterCompleted(FCharacterLoadoutResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetOtherPlayersCurrentLoadoutToDefaultCharacter Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetOtherPlayersCurrentLoadoutToDefaultCharacter Failed"));
    }
}
```

Get Equippable Contexts to Default Character #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoCharacters::GetEquipableContextsToDefaultCharacter()
{
    ULootLockerSDKManager::GetEquipableContextsToDefaultCharacter(FContextDelegate::CreateUObject(this, &ADemoCharacters::OnGetEquipableContextsToDefaultCharacterCompleted));
}

void ADemoCharacters::OnGetEquipableContextsToDefaultCharacterCompleted(FGetContextResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEquipableContextsToDefaultCharacter Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEquipableContextsToDefaultCharacter Failed"));
    }
}
```

Get Equippable Contexts by Chararacter #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
Int32 OtherPlayerId;

void ADemoCharacters::GetEquipableContextsByCharacterId()
{
    ULootLockerSDKManager::GetEquipableContextsByCharacterId(OtherPlayerId, FContextDelegate::CreateUObject(this, &ADemoCharacters::OnGetEquipableContextsByCharacterIdCompleted));
}

void ADemoCharacters::OnGetEquipableContextsByCharacterIdCompleted(FGetContextResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEquipableContextsByCharacterId Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEquipableContextsByCharacterId Failed"));
    }
}
```

Persistent Player Storage #

API Reference: https://docs.lootlocker.io/game-api/#persistent-player-storage

Get Entire Persistent Storage #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPersistentStorage::DemoGetEntirePersistentStorage()
{
    ULootLockerSDKManager::GetEntirePersistentStorage(FPersistentStorageItemsResponseDelegate::CreateUObject(this, &ADemoPersistentStorage::OnGetEntirePersistentStorageCompleted));
}

void ADemoPersistentStorage::OnGetEntirePersistentStorageCompleted(FPersistentStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEntirePersistentStorage Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetEntirePersistentStorage Failed"));
    }
}
```

Get a Single Key From Persistent Storage #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
FString Key;

void ADemoPersistentStorage::DemoGetItemFromPersistentStorage()
{
    ULootLockerSDKManager::GetItemFromPersistentStorage(Key, FPersistentStorageItemResponseDelegate::CreateUObject(this, &ADemoPersistentStorage::OnGetItemFromPersistentStorageCompleted));
}

void ADemoPersistentStorage::OnGetItemFromPersistentStorageCompleted(FPersistentStorageItemResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetItemFromPersistentStorage Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetItemFromPersistentStorage Failed"));
    }
}
```

Updating / Creating Key/Value Pairs #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
TArray<FPersistentStorageItem> Items;

void ADemoPersistentStorage::DemoAddItemsToPersistentStorage()
{
    ULootLockerSDKManager::AddItemsToPersistentStorage(Items, FPersistentStorageItemsResponseDelegate::CreateUObject(this, &ADemoPersistentStorage::OnAddItemsToPersistentStorageCompleted));
}

void ADemoPersistentStorage::OnAddItemsToPersistentStorageCompleted(FPersistentStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddItemsToPersistentStorage Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddItemsToPersistentStorage Failed"));
    }
}
```

Deleting a Key/Value Pair #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
FString Key;

void ADemoPersistentStorage::DemoDeleteItemFromPersistentStorage()
{
    ULootLockerSDKManager::DeleteItemFromPersistentStorage(Key, FPersistentStorageItemsResponseDelegate::CreateUObject(this, &ADemoPersistentStorage::OnDeleteItemFromPersistentStorageCompleted));
}

void ADemoPersistentStorage::OnDeleteItemFromPersistentStorageCompleted(FPersistentStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnDeleteItemFromPersistentStorage Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnDeleteItemFromPersistentStorage Failed"));
    }
}
```

Getting other players public Storage #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoPersistentStorage::DemoGetPlayerPersistentStorage()
{
    ULootLockerSDKManager::GetPlayerPersistentStorage(PlayerId, FPersistentStorageItemsResponseDelegate::CreateUObject(this, &ADemoPersistentStorage::OnGetPlayerPersistentStorageCompleted));
}

void ADemoPersistentStorage::OnGetPlayerPersistentStorageCompleted(FPersistentStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerPersistentStorage Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetPlayerPersistentStorage Failed"));
    }
}
```

Asset #

API Reference: https://docs.lootlocker.io/game-api/#asset

Getting Contexts #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAssets::DemoGetContexts()
{
    ULootLockerSDKManager::GetContexts(FContextDelegate::CreateUObject(this, &ADemoAssets::OnGetContextsCompleted));
}

void ADemoAssets::OnGetContextsCompleted(FGetContextResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetContexts Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetContexts Failed"));
    }
}
```

Getting Asset List #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAssets::DemoGetAssets()
{
    ULootLockerSDKManager::GetAssets(FAssetsResponseDelegate::CreateUObject(this, &ADemoAssets::OnGetAssetsCompleted), StartFromIndex, ItemsCount, AssetFilter, IncludeUGC);
}

void ADemoAssets::OnGetAssetsCompleted(FGetAssetsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssets Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssets Failed"));
    }
}
```

Getting Asset Information For One or More Assets #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 AssetIds;

void ADemoAssets::DemoGetAssetsByIds()
{
    ULootLockerSDKManager::GetAssetsByIds(AssetIds, FAssetsResponseDelegate::CreateUObject(this, &ADemoAssets::OnGetAssetsByIdsCompleted));
}

void ADemoAssets::OnGetAssetsByIdsCompleted(FGetAssetsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssetsByIds Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssetsByIds Failed"));
    }
}
```

Listing Favourite Assets #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAssets::DemoGetFavouriteAssetIndices()
{
    ULootLockerSDKManager::GetFavouriteAssetIndices(FGetFavouriteAssetIndicesResponseDelegate::CreateUObject(this, &ADemoAssets::OnGetFavouriteAssetIndicesCompleted));
}

void ADemoAssets::OnGetFavouriteAssetIndicesCompleted(FGetFavouriteAssetIndicesResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetFavouriteAssetIndices Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetFavouriteAssetIndices Failed"));
    }
}
```

Adding Favourite Assets #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
```cpp
int32 AssetId;

void ADemoAssets::DemoAddAssetToFavourites()
{
    ULootLockerSDKManager::AddAssetToFavourites(AssetId, FGetFavouriteAssetIndicesResponseDelegate::CreateUObject(this, &ADemoAssets::OnAddAssetToFavouritesCompleted));
}
void ADemoAssets::OnAddAssetToFavouritesCompleted(FGetFavouriteAssetIndicesResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddAssetToFavourites Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddAssetToFavourites Failed"));
    }
}
```

Removing Favourite Assets #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 AssetId;

void ADemoAssets::DemoRemoveAssetFromFavourites()
{
    ULootLockerSDKManager::RemoveAssetFromFavourites(AssetId, FGetFavouriteAssetIndicesResponseDelegate::CreateUObject(this, &ADemoAssets::OnRemoveAssetFromFavouritesCompleted));
}

void ADemoAssets::OnRemoveAssetFromFavouritesCompleted(FGetFavouriteAssetIndicesResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnRemoveAssetFromFavourites Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnRemoveAssetFromFavourites Failed"));
    }
}
```

Asset Instances #

API Reference: https://docs.lootlocker.io/game-api/#asset-instances

Getting All Key Value Pairs #

1

Getting All Key Value Pairs to an Instance #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
```cpp
int32 AssetInstanceId;
int32 StorageItemId;

void ADemoAssetInstances::DemoGetAllKeyValuePairsToAnInstanceForAssetInstance()
{
    ULootLockerSDKManager::GetAllKeyValuePairsToAnInstanceForAssetInstance(AssetInstanceId, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnGetAllKeyValuePairsToAnInstanceForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnGetAllKeyValuePairsToAnInstanceForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("GetAllKeyValuePairsToAnInstanceForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("GetAllKeyValuePairsToAnInstanceForAssetInstance Failed"));
    }
}
```

Getting A Key Value Pair By Id #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAssetInstances::DemoGetAKeyValuePairByIdForAssetInstance()
{
    ULootLockerSDKManager::GetAKeyValuePairByIdForAssetInstance(AssetInstanceId, StorageItemId, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnGetAKeyValuePairByIdForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnGetAKeyValuePairByIdForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("GetAKeyValuePairByIdForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("GetAKeyValuePairByIdForAssetInstance Failed"));
    }
}
```

Creating A Key Value Pair #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoAssetInstances::DemoCreateAKeyValuePairForAssetInstance()
{
    ULootLockerSDKManager::CreateAKeyValuePairForAssetInstance(AssetInstanceId, Item, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnCreateAKeyValuePairForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnCreateAKeyValuePairForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("CreateAKeyValuePairForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("CreateAKeyValuePairForAssetInstance Failed"));
    }
}
```

Updating One Or More Key Value Pairs #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
```cpp
TArray<FAssetInstanceStorageItem> Items;
int32 AssetInstanceId;

void ADemoAssetInstances::DemoUpdateOneOrMoreKeyValuePairForAssetInstance()
{
    ULootLockerSDKManager::UpdateOneOrMoreKeyValuePairForAssetInstance(AssetInstanceId, Items, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnUpdateOneOrMoreKeyValuePairForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnUpdateOneOrMoreKeyValuePairForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("UpdateOneOrMoreKeyValuePairForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("UpdateOneOrMoreKeyValuePairForAssetInstance Failed"));
    }
}
```

Updating A Key Value Pair By Id #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
```cpp
int32 AssetInstanceId;

FAssetInstanceStorageItem Item;

void ADemoAssetInstances::DemoUpdateAKeyValuePairByIdForAssetInstance()
{
    ULootLockerSDKManager::UpdateAKeyValuePairByIdForAssetInstance(AssetInstanceId, StorageItemId, Item, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnUpdateAKeyValuePairByIdForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnUpdateAKeyValuePairByIdForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("UpdateAKeyValuePairByIdForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("UpdateAKeyValuePairByIdForAssetInstance Failed"));
    }
}
```

Delete A Key Value Pair #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
```cpp
int32 AssetInstanceId;

Int32 StorageItemId;
void ADemoAssetInstances::DemoDeleteAKeyValuePairByIdForAssetInstance()
{
    ULootLockerSDKManager::DeleteAKeyValuePairByIdForAssetInstance(AssetInstanceId, StorageItemId, FAssetInstanceStorageItemsResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnDeleteAKeyValuePairByIdForAssetInstanceCompleted));
}

void ADemoAssetInstances::OnDeleteAKeyValuePairByIdForAssetInstanceCompleted(FAssetInstanceStorageItemsResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("DeleteAKeyValuePairByIdForAssetInstance Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("DeleteAKeyValuePairByIdForAssetInstance Failed"));
    }
}
```

Inspect a Loot Box #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 AssetInstanceId;

void ADemoAssetInstances::DemoInspectLootBox()
{
    ULootLockerSDKManager::InspectLootBox(AssetInstanceId, FLootBoxContentResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnInspectLootBoxCompleted));
}

void ADemoAssetInstances::OnInspectLootBoxCompleted(FLootBoxContentResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnInspectLootBox Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnInspectLootBox Failed"));
    }
}
```

Open a Loot Box #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 AssetInstanceId;

void ADemoAssetInstances::DemoOpenLootBox()
{
    ULootLockerSDKManager::OpenLootBox(AssetInstanceId, FOpenLootBoxResponseDelegate::CreateUObject(this, &ADemoAssetInstances::OnOpenLootBoxCompleted));
}

void ADemoAssetInstances::OnOpenLootBoxCompleted(FOpenLootBoxResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnOpenLootBox Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnOpenLootBox Failed"));
    }
}
```

User Generated Content #

API Reference: https://docs.lootlocker.io/game-api/#user-generated-content

Creating an Asset Candidate #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
FAssetCandidate AsssetCandidate;

void ADemoUserGeneratedContent::DemoCreateAssetCandidate()
{
    ULootLockerSDKManager::CreateAssetCandidate(AsssetCandidate, FCreateAssetCandidateResponseDelegate::CreateUObject(this, &ADemoUserGeneratedContent::OnCreateAssetCandidateCompleted));
}

void ADemoUserGeneratedContent::OnCreateAssetCandidateCompleted(FCreateAssetCandidateResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCreateAssetCandidate Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnCreateAssetCandidate Failed"));
    }
}
```

Updating an Asset Candidate #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
Int32 AssetCandidateId;
FAssetCandidate  AsssetCandidate
void ADemoUserGeneratedContent::DemoUpdateAssetCandidate()
{
    ULootLockerSDKManager::UpdateAssetCandidate(AssetCandidateId, AsssetCandidate, FAssetCandidateResponseDelegate::CreateUObject(this, &ADemoUserGeneratedContent::OnUpdateAssetCandidateCompleted));
}

void ADemoUserGeneratedContent::OnUpdateAssetCandidateCompleted(FAssetCandidateResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUpdateAssetCandidate Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnUpdateAssetCandidate Failed"));
    }
}
```

Deleting an Asset Candidate #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int32 AssetCandidateId;

void ADemoUserGeneratedContent::DemoDeleteAssetCandidate()
{
    ULootLockerSDKManager::DeleteAssetCandidate(AssetCandidateId, FResponseCallback::CreateUObject(this, &ADemoUserGeneratedContent::OnDeleteAssetCandidateCompleted));
}

void ADemoUserGeneratedContent::OnDeleteAssetCandidateCompleted(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnDeleteAssetCandidate Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnDeleteAssetCandidate Failed"));
    }
}
```

Listing Asset Candidates #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
```cpp
void ADemoUserGeneratedContent::DemoGetAllAssetCandidates()
{
    ULootLockerSDKManager::GetAllAssetCandidates(FAssetCandidatesResponseDelegate::CreateUObject(this, &ADemoUserGeneratedContent::OnGetAllAssetCandidatesCompleted));
}

void ADemoUserGeneratedContent::OnGetAllAssetCandidatesCompleted(FAssetCandidatesResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAllAssetCandidates Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAllAssetCandidates Failed"));
    }
}
```

Get Asset Candidate #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
Int32 AssetCandidateId;

void ADemoUserGeneratedContent::DemoGetAssetCandidate()
{
    ULootLockerSDKManager::GetAssetCandidate(AssetCandidateId, FAssetCandidateResponseDelegate::CreateUObject(this, &ADemoUserGeneratedContent::OnGetAssetCandidateCompleted));
}

void ADemoUserGeneratedContent::OnGetAssetCandidateCompleted(FAssetCandidateResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssetCandidate Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnGetAssetCandidate Failed"));
    }
}
```

Adding Files to Asset Candidates #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
```cpp
FString FilePath;
FString AssetCandidateId;
EAssetFilePurpose FilePurpose;

void ADemoUserGeneratedContent::DemoAddFileToAssetCandidate()
{
    ULootLockerSDKManager::AddFileToAssetCandidate(AssetCandidateId, FilePath, FilePurpose, FResponseCallback::CreateUObject(this, &ADemoUserGeneratedContent::OnAddFileToAssetCandidateCompleted));
}

void ADemoUserGeneratedContent::OnAddFileToAssetCandidateCompleted(FLootLockerResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddFileToAssetCandidate Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnAddFileToAssetCandidate Failed"));
    }
}
```

Removing Files from an Asset Candidate #

1
2
3
4
5
6
7
8
9
```cpp
int AssetCandidateId;
int FileId;

void ADemoUserGeneratedContent::DemoDeleteFileFromAssetCandidate()
{
    ULootLockerSDKManager::DeleteFileFromAssetCandidate(AssetCandidateId, FileId, FResponseCallback::CreateUObject(this, &ADemoUserGeneratedContent::OnDeleteFileFromAssetCandidateCompleted));
}
```

Purchasing #

API Reference: https://docs.lootlocker.io/game-api/#purchasing

Purchase Call #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
TArray<FAssetPurchaseData> PurchaseData;

void ADemoPurchases::DemoPurchaseAssets()
{
    ULootLockerSDKManager::PurchaseAssets(PurchaseData, FPurchaseResponseDelegate::CreateUObject(this, &ADemoPurchases::OnPurchaseAssetsCompleted));
}

void ADemoPurchases::OnPurchaseAssetsCompleted(FPurchaseResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPurchaseAssets Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPurchaseAssets Failed"));
    }
}
```

iOS In-App Purchases #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
TArray<FVerifyPurchaseIosData> IosPurchaseData;

void ADemoPurchases::DemoPurchaseAssetsIOS()
{
    ULootLockerSDKManager::PurchaseAssetsIOS(IosPurchaseData, FPurchaseResponseDelegate::CreateUObject(this, &ADemoPurchases::OnVerifyPurchaseIosCompleted));
}

void ADemoPurchases::OnPurchaseAssetsIOSCompleted(FPurchaseResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPurchaseIos Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnVerifyPurchaseIos Failed"));
    }
}
```

Android In-App Purchases #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
TArray<FAndroidAssetPurchaseData> AndroidPurchaseData;

void ADemoPurchases::DemoPurchaseAssetsAndroid()
{
    ULootLockerSDKManager::PurchaseAssetsAndroid(AndroidPurchaseData, FPurchaseResponseDelegate::CreateUObject(this, &ADemoPurchases::OnPurchaseAssetsAndroidCompleted));
}

void ADemoPurchases::OnPurchaseAssetsAndroidCompleted(FPurchaseResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPurchaseAssetsAndroid Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPurchaseAssetsAndroid Failed"));
    }
}
```

Polling Order Status #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
Int PurchaseId;

void ADemoPurchases::DemoPollingOrderStatus()
{
    ULootLockerSDKManager::PollingOrderStatus(PurchaseId, FPurchaseStatusResponseDelegate::CreateUObject(this, &ADemoPurchases::OnPollingStatusCompleted));
}

void ADemoPurchases::OnPollingStatusCompleted(FPurchaseStatusResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPollPurchaseStatus Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnPollPurchaseStatus Failed"));
    }
}
```

Activating A Rental Asset #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
```cpp
int AssetId;

void ADemoPurchases::DemoActivateRentalAsset()
{
    ULootLockerSDKManager::ActivateRentalAsset(AssetId, FActivateRentalAssetResponseDelegate::CreateUObject(this, &ADemoPurchases::OnActivateRentalAssetCompleted));
}

void ADemoPurchases::OnActivateRentalAssetCompleted(FActivateRentalAssetResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnActivateRentalAsset Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnActivateRentalAsset Failed"));
    }
}
```

Trigger Events #

API Reference: https://docs.lootlocker.io/game-api/#trigger-events

Triggering an Event #

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
```cpp
FTriggerEvent Event;

void ADemoTriggerEvents::DemoTriggerEvent()
{
    ULootLockerSDKManager::TriggerEvent(Event, FTriggerEventResponseDelegate::CreateUObject(this, &ADemoTriggerEvents::OnTriggerEventCompleted));
}

void ADemoTriggerEvents::OnTriggerEventCompleted(FTriggerEventResponse Response)
{
    if (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnTriggerEvent Success"));
    }
    else
    {
        UE_LOG(LogTemp, Verbose, TEXT("OnTriggerEvent Failed"));
    }
}
```

### Get Triggered Event

<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-cpp" data-lang="cpp"><span style="color:#960050;background-color:#1e0010">```</span>cpp
<span style="color:#66d9ef">void</span> ADemoTriggerEvents<span style="color:#f92672">::</span>DemoGetTriggeredEvents()
{
    ULootLockerSDKManager<span style="color:#f92672">::</span>GetTriggeredEvents(FTriggersResponseDelegate<span style="color:#f92672">::</span>CreateUObject(<span style="color:#66d9ef">this</span>, <span style="color:#f92672">&amp;</span>ADemoTriggerEvents<span style="color:#f92672">::</span>OnGetTriggeredEventsCompleted));
}

<span style="color:#66d9ef">void</span> ADemoTriggerEvents<span style="color:#f92672">::</span>OnGetTriggeredEventsCompleted(FTriggersResponse Response)
{
    <span style="color:#66d9ef">if</span> (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetTriggeredEvents Success&#34;</span>));
    }
    <span style="color:#66d9ef">else</span>
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetTriggeredEvents Failed&#34;</span>));
    }
}
<span style="color:#960050;background-color:#1e0010">```</span>
</code></pre></td></tr></table>
</div>
</div>

## Collectables

API Reference: [https://docs.lootlocker.io/game-api/#collectables](https://docs.lootlocker.io/game-api/#collectables "https://docs.lootlocker.io/game-api/#collectables")

### Getting Collectables

<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-cpp" data-lang="cpp"><span style="color:#960050;background-color:#1e0010">```</span>cpp
<span style="color:#66d9ef">void</span> ADemoCollectables<span style="color:#f92672">::</span>DemoGetAllCollectables()
{
    ULootLockerSDKManager<span style="color:#f92672">::</span>GetAllCollectables(FCollectablesResponseDelegate<span style="color:#f92672">::</span>CreateUObject(<span style="color:#66d9ef">this</span>, <span style="color:#f92672">&amp;</span>ADemoCollectables<span style="color:#f92672">::</span>OnGetAllCollectablesCompleted));
}

<span style="color:#66d9ef">void</span> ADemoCollectables<span style="color:#f92672">::</span>OnGetAllCollectablesCompleted(FCollectablesResponse Response)
{
    <span style="color:#66d9ef">if</span> (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetAllCollectables Success&#34;</span>));
    }
    <span style="color:#66d9ef">else</span>
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetAllCollectables Failed&#34;</span>));
    }
}
<span style="color:#960050;background-color:#1e0010">```</span>
</code></pre></td></tr></table>
</div>
</div>

### Collecting an Item

<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-cpp" data-lang="cpp"><span style="color:#960050;background-color:#1e0010">```</span>cpp
FCollectItemPayload Item;

<span style="color:#66d9ef">void</span> ADemoCollectables<span style="color:#f92672">::</span>DemoCollectItem()
{
    ULootLockerSDKManager<span style="color:#f92672">::</span>CollectItem(Item, FCollectablesResponseDelegate<span style="color:#f92672">::</span>CreateUObject(<span style="color:#66d9ef">this</span>, <span style="color:#f92672">&amp;</span>ADemoCollectables<span style="color:#f92672">::</span>OnCollectItemCompleted));
}

<span style="color:#66d9ef">void</span> ADemoCollectables<span style="color:#f92672">::</span>OnCollectItemCompleted(FCollectablesResponse Response)
{
    <span style="color:#66d9ef">if</span> (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnCollectItem Success&#34;</span>));
    }
    <span style="color:#66d9ef">else</span>
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnCollectItem Failed&#34;</span>));
    }
}
<span style="color:#960050;background-color:#1e0010">```</span>
</code></pre></td></tr></table>
</div>
</div>

## Messages

API Reference: [https://docs.lootlocker.io/game-api/#messages](https://docs.lootlocker.io/game-api/#messages "https://docs.lootlocker.io/game-api/#messages")

### Get Messages

<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">
<table style="border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-cpp" data-lang="cpp"><span style="color:#960050;background-color:#1e0010">```</span>cpp
<span style="color:#66d9ef">void</span> ADemoMessages<span style="color:#f92672">::</span>DemoGetMessages()
{
    ULootLockerSDKManager<span style="color:#f92672">::</span>GetMessages(FMessagesResponseDelegate<span style="color:#f92672">::</span>CreateUObject(<span style="color:#66d9ef">this</span>, <span style="color:#f92672">&amp;</span>ADemoMessages<span style="color:#f92672">::</span>OnGetMessagesCompleted));
}

<span style="color:#66d9ef">void</span> ADemoMessages<span style="color:#f92672">::</span>OnGetMessagesCompleted(FMessagesResponse Response)
{
    <span style="color:#66d9ef">if</span> (Response.success)
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetMessages Success&#34;</span>));
    }
    <span style="color:#66d9ef">else</span>
    {
        UE_LOG(LogTemp, Verbose, TEXT(<span style="color:#e6db74">&#34;OnGetMessages Failed&#34;</span>));
    }
}
<span style="color:#960050;background-color:#1e0010">```</span>
</code></pre></td></tr></table>
</div>
</div>