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
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ internal FindOrCreateLeaderboardCallback( IPacketMsg packetMsg )
}

/// <summary>
/// This callback is fired in response to <see cref="GetLeaderboardEntries" />.
/// This callback is fired in response to <see cref="GetLeaderboardEntries" />
/// and <see cref="SteamUserStats.DownloadLeaderboardEntriesForUsers" />.
/// </summary>
public class LeaderboardEntriesCallback : CallbackMsg
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,37 @@ public AsyncJob<LeaderboardEntriesCallback> GetLeaderboardEntries( uint appId, i
return new AsyncJob<LeaderboardEntriesCallback>( this.Client, msg.SourceJobID );
}

/// <summary>
/// Asks the Steam back-end for a set of rows for the specified users in the leaderboard.
/// Results are returned in a <see cref="LeaderboardEntriesCallback"/>.
/// The returned <see cref="AsyncJob{T}"/> can also be awaited to retrieve the callback result.
/// </summary>
/// <param name="appId">The AppID to request leaderboard rows for.</param>
/// <param name="id">ID of the leaderboard to view.</param>
/// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="LeaderboardEntriesCallback"/>.</returns>
/// <param name="users">The IDs of each user to request leaderboard rows for.</param>
public AsyncJob<LeaderboardEntriesCallback> DownloadLeaderboardEntriesForUsers( uint appId, int id, IEnumerable<SteamID> users )
{
var msg = new ClientMsgProtobuf<CMsgClientLBSGetLBEntries>( EMsg.ClientLBSGetLBEntries );
msg.SourceJobID = Client.GetNextJobID();

// routing_appid has to be set correctly to receive a response
msg.ProtoHeader.routing_appid = appId;

msg.Body.app_id = ( int )appId;
msg.Body.leaderboard_id = id;
msg.Body.leaderboard_data_request = ( int )ELeaderboardDataRequest.Users;

foreach ( var steamId in users )
{
msg.Body.steamids.Add( steamId.ConvertToUInt64() );
}

Client.Send( msg );

return new AsyncJob<LeaderboardEntriesCallback>( this.Client, msg.SourceJobID );
}

/// <summary>
/// Handles a client message. This should not be called directly.
/// </summary>
Expand Down
Loading