Skip to content
1 change: 1 addition & 0 deletions Runtime/Client/LootLockerEndPoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ public class LootLockerEndPoints
[Header("Metadata")]
public static EndPointClass listMetadata = new EndPointClass("metadata/source/{0}/id/{1}", LootLockerHTTPMethod.GET);
public static EndPointClass getMultisourceMetadata = new EndPointClass("metadata/multisource", LootLockerHTTPMethod.POST);
public static EndPointClass metadataOperations = new EndPointClass("metadata", LootLockerHTTPMethod.POST);

// Notifications
[Header("Notifications")]
Expand Down
52 changes: 39 additions & 13 deletions Runtime/Game/LootLockerSDKManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public static bool CheckInitialized(bool skipSessionCheck = false)
LootLockerConfig.current.token = "";
LootLockerConfig.current.refreshToken = "";
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = null;
if (!Init())
{
return false;
Expand Down Expand Up @@ -210,6 +211,7 @@ public static void StartPlaystationNetworkSession(string psnOnlineId, Action<Loo
{
CurrentPlatform.Reset();
}
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete(response);
});
}
Expand Down Expand Up @@ -238,6 +240,7 @@ public static void StartAndroidSession(string deviceId, Action<LootLockerSession
{
CurrentPlatform.Reset();
}
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete(response);
});
}
Expand Down Expand Up @@ -266,6 +269,7 @@ public static void StartAmazonLunaSession(string amazonLunaGuid, Action<LootLock
{
CurrentPlatform.Reset();
}
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete(response);
});
}
Expand Down Expand Up @@ -761,6 +765,7 @@ public static void StartMetaSession(string user_id, string nonce, Action<LootLoc
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.refreshToken = response.refresh_token;
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -806,6 +811,7 @@ public static void RefreshMetaSession(string refresh_token, Action<LootLockerMet
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.refreshToken = response.refresh_token;
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -851,6 +857,7 @@ public static void ClearLocalSession()

LootLockerConfig.current.token = "";
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = null;
LootLockerConfig.current.refreshToken = "";
}
#endregion
Expand Down Expand Up @@ -5801,7 +5808,7 @@ public static void GetEntitlement(string entitlementId, Action<LootLockerSingleE
/// </summary>
/// <param name="Source"> The source type for which to request metadata</param>
/// <param name="SourceID"> The specific source id for which to request metadata</param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void ListMetadata(LootLockerMetadataSources Source, string SourceID, Action<LootLockerListMetadataResponse> onComplete, bool IgnoreFiles = false)
{
Expand All @@ -5815,7 +5822,7 @@ public static void ListMetadata(LootLockerMetadataSources Source, string SourceI
/// <param name="SourceID"> The specific source id for which to request metadata</param>
/// <param name="Page"> Used together with PerPage to apply pagination to this request. Page designates which "page" of items to fetch</param>
/// <param name="PerPage"> Used together with Page to apply pagination to this request.PerPage designates how many items are considered a "page"</param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void ListMetadata(LootLockerMetadataSources Source, string SourceID, int Page, int PerPage, Action<LootLockerListMetadataResponse> onComplete, bool IgnoreFiles = false)
{
Expand All @@ -5828,7 +5835,7 @@ public static void ListMetadata(LootLockerMetadataSources Source, string SourceI
/// <param name="Source"> The source type for which to request metadata</param>
/// <param name="SourceID"> The specific source id for which to request metadata</param>
/// <param name="Tags"> The tags that the requested metadata should have, only metadata matching *all of* the given tags will be returned </param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void ListMetadataWithTags(LootLockerMetadataSources Source, string SourceID, string[] Tags, Action<LootLockerListMetadataResponse> onComplete, bool IgnoreFiles = false)
{
Expand All @@ -5843,7 +5850,7 @@ public static void ListMetadataWithTags(LootLockerMetadataSources Source, string
/// <param name="Tags"> The tags that the requested metadata should have, only metadata matching *all of* the given tags will be returned </param>
/// <param name="Page"> Used together with PerPage to apply pagination to this request.Page designates which "page" of items to fetch</param>
/// <param name="PerPage"> Used together with Page to apply pagination to this request.PerPage designates how many items are considered a "page"</param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void ListMetadataWithTags(LootLockerMetadataSources Source, string SourceID, string[] Tags, int Page, int PerPage, Action<LootLockerListMetadataResponse> onComplete, bool IgnoreFiles = false)
{
Expand All @@ -5860,9 +5867,9 @@ public static void ListMetadataWithTags(LootLockerMetadataSources Source, string
/// Get Metadata for the specified source with the given key
/// </summary>
/// <param name="Source"> The source type for which to request metadata</param>
/// <param name="SourceID"> The specific source id for which to request metadata</param>
/// <param name="SourceID"> The specific source id for which to request metadata, note that if the source is self then this too should be set to "self"</param>
/// <param name="Key"> The key of the metadata to fetch, use this to fetch metadata for a specific key for the specified source.</param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Optional: Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void GetMetadata(LootLockerMetadataSources Source, string SourceID, string Key, Action<LootLockerGetMetadataResponse> onComplete, bool IgnoreFiles=false)
{
Expand All @@ -5884,17 +5891,36 @@ public static void GetMetadata(LootLockerMetadataSources Source, string SourceID
/// List the requested page of Metadata for the specified source that has all of the provided tags and paginate according to the supplied pagination settings
/// </summary>
/// <param name="SourcesAndKeysToGet"> The combination of sources to get keys for, and the keys to get for those sources </param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
/// <param name="IgnoreFiles"> Optional: Base64 values will be set to content_type "application/x-redacted" and the content will be an empty String. Use this to avoid accidentally fetching large data files.</param>
public static void GetMultisourceMetadata(LootLockerMetadataSourceAndKeys[] SourcesAndKeysToGet, Action<LootLockerGetMultisourceMetadataResponse> onComplete, bool ignoreFiles = false)
public static void GetMultisourceMetadata(LootLockerMetadataSourceAndKeys[] SourcesAndKeysToGet, Action<LootLockerGetMultisourceMetadataResponse> onComplete, bool IgnoreFiles = false)
{
if (!CheckInitialized())
{
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerGetMultisourceMetadataResponse>());
return;
}

LootLockerAPIManager.GetMultisourceMetadata(SourcesAndKeysToGet, ignoreFiles, onComplete);
LootLockerAPIManager.GetMultisourceMetadata(SourcesAndKeysToGet, IgnoreFiles, onComplete);
}

/// <summary>
/// Perform the specified metadata operations for the specified source
/// Note that a subset of the specified operations can fail without the full request failing. Make sure to check the errors array in the response.
/// </summary>
/// <param name="Source"> The source type that the source id refers to </param>
/// <param name="SourceID"> The specific source id for which to set metadata, note that if the source is self then this too should be set to "self" </param>
/// <param name="OperationsToPerform"> List of operations to perform for the given source </param>
/// <param name="onComplete">Delegate for handling the server response</param>
public static void PerformMetadataOperations(LootLockerMetadataSources Source, string SourceID, List<LootLockerMetadataOperation> OperationsToPerform, Action<LootLockerMetadataOperationsResponse> onComplete)
{
if (!CheckInitialized())
{
onComplete?.Invoke(LootLockerResponseFactory.SDKNotInitializedError<LootLockerMetadataOperationsResponse>());
return;
}

LootLockerAPIManager.PerformMetadataOperations(Source, SourceID, OperationsToPerform, onComplete);
}
#endregion

Expand All @@ -5903,7 +5929,7 @@ public static void GetMultisourceMetadata(LootLockerMetadataSourceAndKeys[] Sour
/// <summary>
/// List notifications without filters and with default pagination settings
/// </summary>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
public static void ListNotificationsWithDefaultParameters(Action<LootLockerListNotificationsResponse> onComplete)
{
if (!CheckInitialized())
Expand Down Expand Up @@ -5942,7 +5968,7 @@ public static void ListNotificationsWithDefaultParameters(Action<LootLockerListN
/// <param name="PerPage">(Optional) Used together with Page to apply pagination to this request. PerPage designates how many notifications are considered a "page". Set to 0 to not use this filter.</param>
/// <param name="Page">(Optional) Used together with PerPage to apply pagination to this request. Page designates which "page" of items to fetch. Set to 0 to not use this filter.</param>
/// <param name="onComplete"></param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
public static void ListNotifications(bool ShowRead, LootLockerNotificationPriority? WithPriority, string OfType, string WithSource, int PerPage, int Page, Action<LootLockerListNotificationsResponse> onComplete)
{
if (!CheckInitialized())
Expand Down Expand Up @@ -5982,7 +6008,7 @@ public static void ListNotifications(bool ShowRead, LootLockerNotificationPriori
///
/// Warning: This will mark ALL unread notifications as read, so if you have listed notifications but due to filters and/or pagination not pulled all of them you may have unviewed unread notifications
/// </summary>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
public static void MarkAllNotificationsAsRead(Action<LootLockerReadNotificationsResponse> onComplete)
{
if (!CheckInitialized())
Expand All @@ -5998,7 +6024,7 @@ public static void MarkAllNotificationsAsRead(Action<LootLockerReadNotifications
/// Mark the specified notifications as read
/// </summary>
/// <param name="NotificationIds">List of ids of notifications to mark as read</param>
/// <param name="OnComplete">Delegate for handling the server response</param>
/// <param name="onComplete">Delegate for handling the server response</param>
public static void MarkNotificationsAsRead(string[] NotificationIds, Action<LootLockerReadNotificationsResponse> onComplete)
{
if (!CheckInitialized())
Expand Down
11 changes: 10 additions & 1 deletion Runtime/Game/Requests/EntitlementRequests.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Runtime/Game/Requests/LootLockerSessionRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ public static void Session(LootLockerSessionRequest data, Action<LootLockerSessi
var response = LootLockerResponse.Deserialize<LootLockerSessionResponse>(serverResponse);
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.deviceID = data?.player_identifier;
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -381,6 +382,7 @@ public static void GuestSession(LootLockerSessionRequest data, Action<LootLocker
var response = LootLockerResponse.Deserialize<LootLockerGuestSessionResponse>(serverResponse);
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.deviceID = (data as LootLockerSessionRequest)?.player_identifier;
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -439,6 +441,7 @@ public static void NintendoSwitchSession(LootLockerNintendoSwitchSessionRequest
var response = LootLockerResponse.Deserialize<LootLockerSessionResponse>(serverResponse);
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -474,6 +477,7 @@ private static void EpicSession(string json, Action<LootLockerEpicSessionRespons
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.refreshToken = response.refresh_token;
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand All @@ -493,6 +497,7 @@ public static void XboxOneSession(LootLockerXboxOneSessionRequest data, Action<L
var response = LootLockerResponse.Deserialize<LootLockerSessionResponse>(serverResponse);
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.deviceID = "";
LootLockerConfig.current.playerULID = response.player_ulid;
onComplete?.Invoke(response);
}, false);
}
Expand Down Expand Up @@ -531,6 +536,7 @@ private static void AppleSession(string json, Action<LootLockerAppleSessionRespo
var response = LootLockerAppleSessionResponse.Deserialize<LootLockerAppleSessionResponse>(serverResponse);
LootLockerConfig.current.token = response.session_token;
LootLockerConfig.current.deviceID = response.player_identifier;
LootLockerConfig.current.playerULID = response.player_ulid;
LootLockerConfig.current.refreshToken = response.refresh_token;
onComplete?.Invoke(response);
}, false);
Expand Down
Loading
Loading