|
11 | 11 | using Newtonsoft.Json.Linq;
|
12 | 12 | #else
|
13 | 13 | using LLlibs.ZeroDepJson;
|
| 14 | +using Ionic.Zlib; |
| 15 | +using System.Net; |
14 | 16 | #endif
|
15 | 17 | #if UNITY_EDITOR
|
16 | 18 | using UnityEditor;
|
@@ -5537,6 +5539,67 @@ public static void ListCatalogItems(string catalogKey, int count, string after,
|
5537 | 5539 | }
|
5538 | 5540 | #endregion
|
5539 | 5541 |
|
| 5542 | + #region Entitlements |
| 5543 | + /// <summary> |
| 5544 | + /// List this player's historical entitlements |
| 5545 | + /// Use this to retrieve information on entitlements the player has received regardless of their origin (for example as an effect of progression, purchases, or leaderboard rewards) |
| 5546 | + /// </summary> |
| 5547 | + /// <param name="count">Optional: Amount of historical entries to fetch</param> |
| 5548 | + /// <param name="after">Optional: Used for pagination, this is the cursor to start getting entries from. Use null or use an overload without the parameter to get entries from the beginning. Use the cursor from a previous call to get the next count of entries in the list.</param> |
| 5549 | + /// <param name="onComplete">onComplete Action for handling the response</param> |
| 5550 | + public static void ListEntitlements(int count, string after, Action<LootLockerEntitlementHistoryResponse> onComplete) |
| 5551 | + { |
| 5552 | + if (!CheckInitialized()) |
| 5553 | + { |
| 5554 | + onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerEntitlementHistoryResponse>()); |
| 5555 | + return; |
| 5556 | + } |
| 5557 | + |
| 5558 | + string endpoint = LootLockerEndPoints.listEntitlementHistory.endPoint; |
| 5559 | + |
| 5560 | + if(count > 0 || !string.IsNullOrEmpty(after)) |
| 5561 | + endpoint += endpoint.Contains("?") ? "&" : "?"; |
| 5562 | + if (count > 0) |
| 5563 | + endpoint += $"count={count}&"; |
| 5564 | + if (!string.IsNullOrEmpty(after)) |
| 5565 | + endpoint += $"after={after}&"; |
| 5566 | + |
| 5567 | + LootLockerServerRequest.CallAPI(endpoint, LootLockerEndPoints.listEntitlementHistory.httpMethod, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); }); |
| 5568 | + } |
| 5569 | + |
| 5570 | + /// <summary> |
| 5571 | + /// List this player's historical entitlements |
| 5572 | + /// Use this to retrieve information on entitlements the player has received regardless of their origin (for example as an effect of progression, purchases, or leaderboard rewards) |
| 5573 | + /// </summary> |
| 5574 | + /// <param name="count">Optional: Amount of historical entries to fetch</param> |
| 5575 | + /// <param name="onComplete">onComplete Action for handling the response</param> |
| 5576 | + public static void ListEntitlements(int count, Action<LootLockerEntitlementHistoryResponse> onComplete) |
| 5577 | + { |
| 5578 | + ListEntitlements(count, null, onComplete); |
| 5579 | + } |
| 5580 | + |
| 5581 | + /// <summary> |
| 5582 | + /// List this player's historical entitlements |
| 5583 | + /// Use this to retrieve information on entitlements the player has received regardless of their origin (for example as an effect of progression, purchases, or leaderboard rewards) |
| 5584 | + /// </summary> |
| 5585 | + /// <param name="after">Optional: Used for pagination, this is the cursor to start getting entries from. Use null or use an overload without the parameter to get entries from the beginning. Use the cursor from a previous call to get the next count of entries in the list.</param> |
| 5586 | + /// <param name="onComplete">onComplete Action for handling the response</param> |
| 5587 | + public static void ListEntitlements(string after, Action<LootLockerEntitlementHistoryResponse> onComplete) |
| 5588 | + { |
| 5589 | + ListEntitlements(-1, after, onComplete); |
| 5590 | + } |
| 5591 | + |
| 5592 | + /// <summary> |
| 5593 | + /// List this player's historical entitlements |
| 5594 | + /// Use this to retrieve information on entitlements the player has received regardless of their origin (for example as an effect of progression, purchases, or leaderboard rewards) |
| 5595 | + /// </summary> |
| 5596 | + /// <param name="onComplete">onComplete Action for handling the response</param> |
| 5597 | + public static void ListEntitlements(Action<LootLockerEntitlementHistoryResponse> onComplete) |
| 5598 | + { |
| 5599 | + ListEntitlements(-1, null, onComplete); |
| 5600 | + } |
| 5601 | + #endregion |
| 5602 | + |
5540 | 5603 | #region Misc
|
5541 | 5604 |
|
5542 | 5605 | /// <summary>
|
@@ -5573,12 +5636,4 @@ public static Platforms GetLastActivePlatform()
|
5573 | 5636 |
|
5574 | 5637 | #endregion
|
5575 | 5638 | }
|
5576 |
| - |
5577 |
| - public class ResponseError |
5578 |
| - { |
5579 |
| - public bool success { get; set; } |
5580 |
| - public string error { get; set; } |
5581 |
| - public string[] messages { get; set; } |
5582 |
| - public string error_id { get; set; } |
5583 |
| - } |
5584 | 5639 | }
|
0 commit comments