1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:52:57 +08:00

Remove unnecessary extra task

Further testing shows continuations also run before the .Wait() returns.
This commit is contained in:
smoogipoo 2021-10-15 13:27:54 +09:00
parent eed8fa8d69
commit 80dfd11c90

View File

@ -359,25 +359,22 @@ namespace osu.Game.Online.Multiplayer
if (Room == null) if (Room == null)
return; return;
await Task.Run(async () => await PopulateUser(user).ConfigureAwait(false);
Scheduler.Add(() =>
{ {
await PopulateUser(user).ConfigureAwait(false); if (Room == null)
return;
Scheduler.Add(() => // for sanity, ensure that there can be no duplicate users in the room user list.
{ if (Room.Users.Any(existing => existing.UserID == user.UserID))
if (Room == null) return;
return;
// for sanity, ensure that there can be no duplicate users in the room user list. Room.Users.Add(user);
if (Room.Users.Any(existing => existing.UserID == user.UserID))
return;
Room.Users.Add(user); UserJoined?.Invoke(user);
RoomUpdated?.Invoke();
UserJoined?.Invoke(user); });
RoomUpdated?.Invoke();
});
}).ConfigureAwait(false);
} }
Task IMultiplayerClient.UserLeft(MultiplayerRoomUser user) => Task IMultiplayerClient.UserLeft(MultiplayerRoomUser user) =>