mirror of
https://github.com/ppy/osu
synced 2025-02-09 14:47:33 +00:00
Schedule callback continuations
This commit is contained in:
parent
ab90db7c8d
commit
27e64bdb34
@ -67,13 +67,13 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
Debug.Assert(room.RoomID.Value != null);
|
||||
|
||||
var joinTask = multiplayerClient.JoinRoom(room);
|
||||
joinTask.ContinueWith(_ => onSuccess?.Invoke(room), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
joinTask.ContinueWith(_ => Schedule(() => onSuccess?.Invoke(room)), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||
joinTask.ContinueWith(t =>
|
||||
{
|
||||
PartRoom();
|
||||
if (t.Exception != null)
|
||||
Logger.Error(t.Exception, "Failed to join multiplayer room.");
|
||||
onError?.Invoke(t.Exception?.ToString() ?? string.Empty);
|
||||
Schedule(() => onError?.Invoke(t.Exception?.ToString() ?? string.Empty));
|
||||
}, TaskContinuationOptions.NotOnRanToCompletion);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user