Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Runtime/Game/LootLockerSDKManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5312,14 +5312,15 @@ public static void GetContext(Action<LootLockerContextResponse> onComplete, stri
/// <param name="assetFilters">A Dictionary<string, string> of custom filters to use when retrieving assets</param>
/// <param name="UGCCreatorPlayerID">Only get assets created by a specific player</param>
/// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
public static void GetAssetsOriginal(int assetCount, Action<LootLockerAssetResponse> onComplete, int? idOfLastAsset = null, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null)
/// <param name="contextID">Only get assets for a specific context</param>
public static void GetAssetsOriginal(int assetCount, Action<LootLockerAssetResponse> onComplete, int? idOfLastAsset = null, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0)
{
if (!CheckInitialized(false, forPlayerWithUlid))
{
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerAssetResponse>(forPlayerWithUlid));
return;
}
LootLockerAPIManager.GetAssetsOriginal(forPlayerWithUlid, onComplete, assetCount, idOfLastAsset, filter, includeUGC, assetFilters, UGCCreatorPlayerID);
LootLockerAPIManager.GetAssetsOriginal(forPlayerWithUlid, onComplete, assetCount, idOfLastAsset, filter, includeUGC, assetFilters, UGCCreatorPlayerID, contextID);
}

/// <summary>
Expand All @@ -5332,7 +5333,8 @@ public static void GetAssetsOriginal(int assetCount, Action<LootLockerAssetRespo
/// <param name="assetFilters">A Dictionary<string, string> of custom filters to use when retrieving assets</param>
/// <param name="UGCCreatorPlayerID">Only get assets created by a specific player</param>
/// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
public static void GetAssetListWithCount(int assetCount, Action<LootLockerAssetResponse> onComplete, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null)
/// <param name="contextID">Only get assets for a specific context</param>
public static void GetAssetListWithCount(int assetCount, Action<LootLockerAssetResponse> onComplete, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0)
{
if (!CheckInitialized(false, forPlayerWithUlid))
{
Expand All @@ -5348,7 +5350,7 @@ public static void GetAssetListWithCount(int assetCount, Action<LootLockerAssetR
}

onComplete?.Invoke(response);
}, assetCount, null, filter, includeUGC, assetFilters, UGCCreatorPlayerID);
}, assetCount, null, filter, includeUGC, assetFilters, UGCCreatorPlayerID, contextID);
}

/// <summary>
Expand All @@ -5361,7 +5363,8 @@ public static void GetAssetListWithCount(int assetCount, Action<LootLockerAssetR
/// <param name="assetFilters">A Dictionary<string, string> of custom filters to use when retrieving assets</param>
/// <param name="UGCCreatorPlayerID">Only get assets created by a specific player</param>
/// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
public static void GetAssetNextList(int assetCount, Action<LootLockerAssetResponse> onComplete, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null)
/// <param name="contextID">Only get assets for a specific context</param>
public static void GetAssetNextList(int assetCount, Action<LootLockerAssetResponse> onComplete, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null, int UGCCreatorPlayerID = 0, string forPlayerWithUlid = null, int contextID = 0)
{
if (!CheckInitialized(false, forPlayerWithUlid))
{
Expand All @@ -5377,7 +5380,7 @@ public static void GetAssetNextList(int assetCount, Action<LootLockerAssetRespon
LootLockerAssetRequest.lastId = response.assets.Last()?.id != null ? response.assets.Last().id : 0;
}
onComplete?.Invoke(response);
}, assetCount, LootLockerAssetRequest.lastId, filter, includeUGC, assetFilters, UGCCreatorPlayerID);
}, assetCount, LootLockerAssetRequest.lastId, filter, includeUGC, assetFilters, UGCCreatorPlayerID, contextID);
}

/// <summary>
Expand Down
10 changes: 8 additions & 2 deletions Runtime/Game/Requests/AssetRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public static void GetContext(string forPlayerWithUlid, Action<LootLockerContext
}

public static void GetAssetsOriginal(string forPlayerWithUlid, Action<LootLockerAssetResponse> onComplete, int assetCount, int? idOfLastAsset = null, List<LootLocker.LootLockerEnums.AssetFilter> filter = null, bool includeUGC = false, Dictionary<string, string> assetFilters = null,
int UGCCreatorPlayerID = 0)
int UGCCreatorPlayerID = 0, int contextId = 0)
{
EndPointClass endPoint = LootLockerEndPoints.gettingAssetListWithCount;
string getVariable = endPoint.WithPathParameter(assetCount);
Expand Down Expand Up @@ -435,7 +435,7 @@ public static void GetAssetsOriginal(string forPlayerWithUlid, Action<LootLocker
getVariable += tempEndpoint;
}

if (assetFilters != null)
if (assetFilters != null && assetFilters.Count > 0)
{
KeyValuePair<string, string> keys = assetFilters.First();
filterString = $"{keys.Key}={keys.Value}";
Expand All @@ -451,6 +451,12 @@ public static void GetAssetsOriginal(string forPlayerWithUlid, Action<LootLocker
getVariable += tempEndpoint;
}

if (contextId > 0)
{
tempEndpoint = $"&context_id={contextId}";
getVariable += tempEndpoint;
}

LootLockerServerRequest.CallAPI(forPlayerWithUlid, getVariable, endPoint.httpMethod, null, onComplete: (serverResponse) => { LootLockerResponse.Deserialize(onComplete, serverResponse); });
}

Expand Down
Loading