Economy In-game Implementation

Get Player Wallet

Get Player Wallet by Holder ID

string holderUlid; //holderUlid can be found in the start Session calls as response.player_ulid
LootLocker.LootLockerEnums.LootLockerWalletHolderTypes player = LootLocker.LootLockerEnums.LootLockerWalletHolderTypes.player;
LootLockerSDKManager.GetWalletByHolderId(holderUlid, player, (response) =>
{
    if(!response.success)
    {
        //If wallet is not found, it will automatically create one on the holder.
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }

});

To see what data gets returned, please refer to our Reference Documentation.

Get Character Wallet by Holder ID

string holderUlid; //holderUlid can be found in the start Session calls as response.player_ulid
LootLocker.LootLockerEnums.LootLockerWalletHolderTypes character = LootLocker.LootLockerEnums.LootLockerWalletHolderTypes.character;
LootLockerSDKManager.GetWalletByHolderId(holderUlid, character, (response) =>
{
    if(!response.success)
    {
        //If wallet is not found, it will automatically create one on the holder.
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }

});

To see what data gets returned, please refer to our Reference Documentation.

Get Wallet by Wallet ID

string WalletID = "";
LootLockerSDKManager.GetWalletByWalletId(walletID, (response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }
            
});

To see what data gets returned, please refer to our Reference Documentation.

Currency

List currencies

LootLockerSDKManager.ListCurrencies((response) =>
{
    if (!response.success)
    {
         Debug.Log("error: " + response.errorData.message);
         Debug.Log("request ID: " + response.errorData.request_id);
         return;
     }
     
});

To see what data gets returned, please refer to our Reference Documentation.

Get Currency Denominations

string currencyID = "";

LootLockerSDKManager.GetCurrencyDenominationsByCode(currencyID, (response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }
    
});

To see what data gets returned, please refer to our Reference Documentation.

Credits

Give Credit to Wallet

string WalletID = "";
string currencyID = "";
string amount = "100";
LootLockerSDKManager.CreditBalanceToWallet(walletID, currencyID, amount, (response) =>
{
    if(!response.success)
     {
         Debug.Log("error: " + response.errorData.message);
         Debug.Log("request ID: " + response.errorData.request_id);
         return;
    }
    
});

To see what data gets returned, please refer to our Reference Documentation.

Debit Credits from Wallet

string WalletID = "";
string currencyID = "";
string amount = "100";
LootLockerSDKManager.DebitBalanceToWallet(walletID, currencyID, amount, (response) =>
{
    if(!response.success)
     {
         Debug.Log("error: " + response.errorData.message);
         Debug.Log("request ID: " + response.errorData.request_id);
         return;
     }

});

To see what data gets returned, please refer to our Reference Documentation.

List Balances in Wallet

string walletID = "";
LootLockerSDKManager.ListBalancesInWallet(walletID, (response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }
            
});

To see what data gets returned, please refer to our Reference Documentation.

Catalogs

List Catalogs

LootLockerSDKManager.ListCatalogs((response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }

});

To see what data gets returned, please refer to our Reference Documentation.

List Catalog Items

LootLockerSDKManager.ListCatalogItems(catalogKey, 10, "", (response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }
    
});

To see what data gets returned, please refer to our Reference Documentation.

Buy Catalog Items

string walletID = "";
LootLockerCatalogItemAndQuantityPair[] items = { };

LootLockerSDKManager.LootLockerPurchaseCatalogItems(walletID, items, (response) =>
{
    if(!response.success)
    {
        Debug.Log("error: " + response.errorData.message);
        Debug.Log("request ID: " + response.errorData.request_id);
        return;
    }

});

To see what data gets returned, please refer to our Reference Documentation.

Last updated