Skip to content

Commit 0340f0c

Browse files
JohannesLootkirre-bylund
authored andcommitted
Update/create public key/values
1 parent d967478 commit 0340f0c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,25 @@ public static void UpdateOrCreateKeyValue(string key, string value, Action<LootL
23522352
LootLockerAPIManager.UpdateOrCreateKeyValue(data, onComplete);
23532353
}
23542354

2355+
/// <summary>
2356+
/// Update or create a key/value pair in the player storage for the currently active player.
2357+
/// </summary>
2358+
/// <param name="key">Name of the key</param>
2359+
/// <param name="value">Value of the key</param>
2360+
/// <param name="isPublic">Is the key public?</param>
2361+
/// <param name="onComplete">onComplete Action for handling the response of type LootLockerGetPersistentStoragResponse</param>
2362+
public static void UpdateOrCreateKeyValue(string key, string value, bool isPublic, Action<LootLockerGetPersistentStoragResponse> onComplete)
2363+
{
2364+
if (!CheckInitialized())
2365+
{
2366+
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerGetPersistentStoragResponse>());
2367+
return;
2368+
}
2369+
LootLockerGetPersistentStorageRequest data = new LootLockerGetPersistentStorageRequest();
2370+
data.AddToPayload(new LootLockerPayload { key = key, value = value, is_public = isPublic });
2371+
LootLockerAPIManager.UpdateOrCreateKeyValue(data, onComplete);
2372+
}
2373+
23552374
/// <summary>
23562375
/// Update or create multiple key/value pairs in the player storage for the currently active player.
23572376
/// </summary>

0 commit comments

Comments
 (0)