Merge pull request #434 from kamyker/leaderboards-users-ids

Added GetScoresForUsersAsync (DownloadLeaderboardEntriesForUsers)
This commit is contained in:
Garry Newman 2020-05-21 09:53:17 +01:00 committed by GitHub
commit d4356b75dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,21 @@ public async Task<Result> AttachUgc( Ugc file )
return r.Value.Result;
}
/// <summary>
/// Fetches leaderboard entries for an arbitrary set of users on a specified leaderboard.
/// </summary>
public async Task<LeaderboardEntry[]> GetScoresForUsersAsync( SteamId[] users )
{
if ( users == null || users.Length == 0 )
return null;
var r = await SteamUserStats.Internal.DownloadLeaderboardEntriesForUsers( Id, users, users.Length );
if ( !r.HasValue )
return null;
return await LeaderboardResultToEntries( r.Value );
}
/// <summary>
/// Used to query for a sequential range of leaderboard entries by leaderboard Sort.
/// </summary>