From 6aa3e0882a54358a019c3b782244089a311bd9bb Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Tue, 24 Feb 2026 22:14:50 +0000 Subject: [PATCH] add playerId filter to GetEntriesOptions --- .../Talo/Runtime/APIs/LeaderboardsAPI.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Talo Game Services/Talo/Runtime/APIs/LeaderboardsAPI.cs b/Assets/Talo Game Services/Talo/Runtime/APIs/LeaderboardsAPI.cs index bafd90d..48f07ad 100644 --- a/Assets/Talo Game Services/Talo/Runtime/APIs/LeaderboardsAPI.cs +++ b/Assets/Talo Game Services/Talo/Runtime/APIs/LeaderboardsAPI.cs @@ -10,6 +10,7 @@ public class GetEntriesOptions { public int page = 0; public int aliasId = -1; + public string playerId = ""; public bool includeArchived = false; public string propKey = ""; public string propValue = ""; @@ -20,6 +21,7 @@ public string ToQueryString() { var query = new Dictionary { ["page"] = page.ToString() }; if (aliasId != -1) query["aliasId"] = aliasId.ToString(); + if (!string.IsNullOrEmpty(playerId)) query["playerId"] = playerId; if (includeArchived) query["withDeleted"] = "1"; if (!string.IsNullOrEmpty(propKey)) query["propKey"] = propKey; if (!string.IsNullOrEmpty(propValue)) query["propValue"] = propValue; @@ -32,7 +34,7 @@ public string ToQueryString() public class LeaderboardsAPI : BaseAPI { - private LeaderboardEntriesManager _entriesManager = new(); + private readonly LeaderboardEntriesManager _entriesManager = new(); public LeaderboardsAPI() : base("v1/leaderboards") { } @@ -65,6 +67,7 @@ public async Task GetEntries(string internalName, Ge return res; } + [Obsolete("Use GetEntries(string internalName, GetEntriesOptions options) with the aliasId or playerId option instead.")] public async Task GetEntriesForCurrentPlayer(string internalName, GetEntriesOptions options = null) { Talo.IdentityCheck(); @@ -86,7 +89,7 @@ public async Task GetEntries(string internalName, in }); } - [Obsolete("Use GetEntriesForCurrentPlayer(string internalName, GetEntriesOptions options) instead.")] + [Obsolete("Use GetEntries(string internalName, GetEntriesOptions options) with the aliasId or playerId option instead.")] public async Task GetEntriesForCurrentPlayer(string internalName, int page, bool includeArchived = false) { Talo.IdentityCheck();