mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 11:12:55 +08:00
Use full async
flow rather than ContinueWith
This commit is contained in:
parent
6ea1623889
commit
187fa5eccd
@ -810,19 +810,19 @@ namespace osu.Game.Online.Multiplayer
|
||||
protected async Task PopulateUsers(IEnumerable<MultiplayerRoomUser> multiplayerUsers)
|
||||
{
|
||||
var request = new GetUsersRequest(multiplayerUsers.Select(u => u.UserID).Distinct().ToArray());
|
||||
await API.PerformAsync(request).ContinueWith(t =>
|
||||
{
|
||||
|
||||
await API.PerformAsync(request).ConfigureAwait(false);
|
||||
|
||||
if (request.Response == null)
|
||||
return;
|
||||
|
||||
var users = request.Response.Users.ToDictionary(user => user.Id);
|
||||
Dictionary<int, APIUser> users = request.Response.Users.ToDictionary(user => user.Id);
|
||||
|
||||
foreach (var multiplayerUser in multiplayerUsers)
|
||||
{
|
||||
if (users.TryGetValue(multiplayerUser.UserID, out var user))
|
||||
multiplayerUser.User = user;
|
||||
}
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user