From a74bbf86b12bd2fbde765cf12a4669a6b3c1f458 Mon Sep 17 00:00:00 2001 From: Erik Bylund Date: Thu, 5 Mar 2026 11:02:26 +0100 Subject: [PATCH] fix: Add context id as filter to asset listing endpoint --- Runtime/Game/LootLockerSDKManager.cs | 15 +++++++++------ Runtime/Game/Requests/AssetRequest.cs | 10 ++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Runtime/Game/LootLockerSDKManager.cs b/Runtime/Game/LootLockerSDKManager.cs index d4e7fe50..80ef20d5 100644 --- a/Runtime/Game/LootLockerSDKManager.cs +++ b/Runtime/Game/LootLockerSDKManager.cs @@ -5312,14 +5312,15 @@ public static void GetContext(Action onComplete, stri /// A Dictionary of custom filters to use when retrieving assets /// Only get assets created by a specific player /// Optional : Execute the request for the specified player. If not supplied, the default player will be used. - public static void GetAssetsOriginal(int assetCount, Action onComplete, int? idOfLastAsset = null, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null) + /// Only get assets for a specific context + public static void GetAssetsOriginal(int assetCount, Action onComplete, int? idOfLastAsset = null, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0) { if (!CheckInitialized(false, forPlayerWithUlid)) { onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError(forPlayerWithUlid)); return; } - LootLockerAPIManager.GetAssetsOriginal(forPlayerWithUlid, onComplete, assetCount, idOfLastAsset, filter, includeUGC, assetFilters, UGCCreatorPlayerID); + LootLockerAPIManager.GetAssetsOriginal(forPlayerWithUlid, onComplete, assetCount, idOfLastAsset, filter, includeUGC, assetFilters, UGCCreatorPlayerID, contextID); } /// @@ -5332,7 +5333,8 @@ public static void GetAssetsOriginal(int assetCount, ActionA Dictionary of custom filters to use when retrieving assets /// Only get assets created by a specific player /// Optional : Execute the request for the specified player. If not supplied, the default player will be used. - public static void GetAssetListWithCount(int assetCount, Action onComplete, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null) + /// Only get assets for a specific context + public static void GetAssetListWithCount(int assetCount, Action onComplete, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0) { if (!CheckInitialized(false, forPlayerWithUlid)) { @@ -5348,7 +5350,7 @@ public static void GetAssetListWithCount(int assetCount, Action @@ -5361,7 +5363,8 @@ public static void GetAssetListWithCount(int assetCount, ActionA Dictionary of custom filters to use when retrieving assets /// Only get assets created by a specific player /// Optional : Execute the request for the specified player. If not supplied, the default player will be used. - public static void GetAssetNextList(int assetCount, Action onComplete, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null) + /// Only get assets for a specific context + public static void GetAssetNextList(int assetCount, Action onComplete, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0) { if (!CheckInitialized(false, forPlayerWithUlid)) { @@ -5377,7 +5380,7 @@ public static void GetAssetNextList(int assetCount, Action diff --git a/Runtime/Game/Requests/AssetRequest.cs b/Runtime/Game/Requests/AssetRequest.cs index b431d291..07703a27 100644 --- a/Runtime/Game/Requests/AssetRequest.cs +++ b/Runtime/Game/Requests/AssetRequest.cs @@ -399,7 +399,7 @@ public static void GetContext(string forPlayerWithUlid, Action onComplete, int assetCount, int? idOfLastAsset = null, List filter = null, bool includeUGC = false, Dictionary assetFilters = null, - int UGCCreatorPlayerID = 0) + int UGCCreatorPlayerID = 0, int contextId = 0) { EndPointClass endPoint = LootLockerEndPoints.gettingAssetListWithCount; string getVariable = endPoint.WithPathParameter(assetCount); @@ -435,7 +435,7 @@ public static void GetAssetsOriginal(string forPlayerWithUlid, Action 0) { KeyValuePair keys = assetFilters.First(); filterString = $"{keys.Key}={keys.Value}"; @@ -451,6 +451,12 @@ public static void GetAssetsOriginal(string forPlayerWithUlid, Action 0) + { + tempEndpoint = $"&context_id={contextId}"; + getVariable += tempEndpoint; + } + LootLockerServerRequest.CallAPI(forPlayerWithUlid, getVariable, endPoint.httpMethod, null, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); }); }