Skip to content

Commit 0cc33d1

Browse files
committed
fix: Update Broadcasts to new design
1 parent 45cc27c commit 0cc33d1

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

Runtime/Game/LootLockerSDKManager.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8381,7 +8381,7 @@ public static void MarkNotificationsAsRead(string[] NotificationIds, Action<Loot
83818381

83828382
#region Broadcasts
83838383
/// <summary>
8384-
/// List broadcasts for this game with default localisation and pagination settings
8384+
/// List broadcasts for this game with default localisation and limit
83858385
/// </summary>
83868386
/// <param name="onComplete">Delegate for handling the server response</param>
83878387
/// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
@@ -8397,7 +8397,7 @@ public static void ListTopBroadcasts(Action<LootLockerListBroadcastsResponse> on
83978397
}
83988398

83998399
/// <summary>
8400-
/// List broadcasts for this game with specified localisation and default pagination settings
8400+
/// List broadcasts for this game with specified localisation and default limit
84018401
/// </summary>
84028402
/// <param name="languages">Array of language codes to filter the broadcasts by. Language codes are typically ISO 639-1 codes (e.g. "en", "fr", "es") with regional variations (e.g. "en-US", "fr-FR"), but can also be custom defined by the game developer.</param>
84038403
/// <param name="onComplete">Delegate for handling the server response</param>
@@ -8427,11 +8427,10 @@ public static void ListTopBroadcastsLocalized(string[] languages, Action<LootLoc
84278427
/// List broadcasts for this game
84288428
/// </summary>
84298429
/// <param name="languages">Array of language codes to filter the broadcasts by. Language codes are typically ISO 639-1 codes (e.g. "en", "fr", "es") with regional variations (e.g. "en-US", "fr-FR"), but can also be custom defined by the game developer.</param>
8430-
/// <param name="per_page">Used for pagination, this is the number of broadcasts to retrieve per page.</param>
8431-
/// <param name="page">Used for pagination, this is the page number to retrieve.</param>
8430+
/// <param name="limit">Limit the number of broadcasts returned.</param>
84328431
/// <param name="onComplete">Delegate for handling the server response</param>
84338432
/// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
8434-
public static void ListBroadcasts(string[] languages, int per_page, int page, Action<LootLockerListBroadcastsResponse> onComplete, string forPlayerWithUlid = null)
8433+
public static void ListBroadcasts(string[] languages, int limit, Action<LootLockerListBroadcastsResponse> onComplete, string forPlayerWithUlid = null)
84358434
{
84368435
if (!CheckInitialized(false, forPlayerWithUlid))
84378436
{
@@ -8442,10 +8441,8 @@ public static void ListBroadcasts(string[] languages, int per_page, int page, Ac
84428441
var endpoint = LootLockerEndPoints.ListBroadcasts.endPoint;
84438442

84448443
var queryParams = new LootLocker.Utilities.HTTP.QueryParamaterBuilder();
8445-
if (per_page > 0)
8446-
queryParams.Add("per_page", per_page);
8447-
if (page > 0)
8448-
queryParams.Add("page", page);
8444+
if (limit > 0)
8445+
queryParams.Add("limit", limit);
84498446

84508447
endpoint += queryParams.Build();
84518448

Runtime/Game/Requests/BroadcastRequest.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,6 @@ public class __LootLockerInternalListBroadcastsResponse : LootLockerResponse
193193
/// A list of cronologically ordered broadcasts
194194
/// </summary>
195195
public __LootLockerInternalBroadcast[] broadcasts { get; set; }
196-
/// <summary>
197-
/// Pagination information for the request
198-
/// </summary>
199-
public LootLockerExtendedPagination pagination { get; set; }
200196
};
201197

202198
/// <summary>
@@ -208,10 +204,6 @@ public class LootLockerListBroadcastsResponse : LootLockerResponse
208204
/// A list of cronologically ordered broadcasts
209205
/// </summary>
210206
public LootLockerBroadcast[] broadcasts { get; set; }
211-
/// <summary>
212-
/// Pagination information for the request
213-
/// </summary>
214-
public LootLockerExtendedPagination pagination { get; set; }
215207

216208
public LootLockerListBroadcastsResponse()
217209
{
@@ -232,7 +224,6 @@ public LootLockerListBroadcastsResponse(__LootLockerInternalListBroadcastsRespon
232224
EventId = internalResponse.EventId;
233225
errorData = internalResponse.errorData;
234226
text = internalResponse.text;
235-
pagination = internalResponse.pagination;
236227

237228
if (internalResponse.broadcasts == null || internalResponse.broadcasts.Length == 0)
238229
{

Runtime/Game/Utilities/LootLockerTimezoneConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ public static bool TryConvertStringToIanaTzString(string timezone, out string ia
701701
}
702702
else if (isValidWindowsTimezone(timezone))
703703
{
704-
ianaTimezone = ConvertWindowsToIana(timezone);
704+
ianaTimezone = ConvertWindowsToIanaTzString(timezone);
705705
return true;
706706
}
707707
else
@@ -721,7 +721,7 @@ public static bool TryConvertStringToWindowsTzString(string timezone, out string
721721

722722
else if (isValidIanaTimezone(timezone))
723723
{
724-
windowsTimezone = ConvertIANAToWindows(timezone);
724+
windowsTimezone = ConvertIANAToWindowsTzString(timezone);
725725
return true;
726726
}
727727
else if (isValidWindowsTimezone(timezone))

Tests/LootLockerTests/PlayMode/BroadcastTests.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ public void Broadcasts_DeserializingBroadcasts_PopulatesConvenienceResponseObjec
2323
// Then
2424
Assert.IsNotNull(broadcastResponse);
2525
Assert.IsNotEmpty(broadcastResponse.broadcasts);
26-
Assert.IsNotNull(broadcastResponse.pagination);
27-
Assert.AreEqual(1, broadcastResponse.pagination.total);
28-
Assert.AreEqual(1, broadcastResponse.pagination.current_page);
2926
Assert.AreEqual(1, broadcastResponse.broadcasts.Length);
3027
Assert.AreEqual("01K4QGQTNHTXHM9ET5238NB4NF", broadcastResponse.broadcasts[0].id);
3128
Assert.AreEqual("Broadcast no 5", broadcastResponse.broadcasts[0].name);

0 commit comments

Comments
 (0)