mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 08:33:55 +09:00
Schedule callback continuations
This commit is contained in:
@ -67,13 +67,13 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
|||||||
Debug.Assert(room.RoomID.Value != null);
|
Debug.Assert(room.RoomID.Value != null);
|
||||||
|
|
||||||
var joinTask = multiplayerClient.JoinRoom(room);
|
var joinTask = multiplayerClient.JoinRoom(room);
|
||||||
joinTask.ContinueWith(_ => onSuccess?.Invoke(room), TaskContinuationOptions.OnlyOnRanToCompletion);
|
joinTask.ContinueWith(_ => Schedule(() => onSuccess?.Invoke(room)), TaskContinuationOptions.OnlyOnRanToCompletion);
|
||||||
joinTask.ContinueWith(t =>
|
joinTask.ContinueWith(t =>
|
||||||
{
|
{
|
||||||
PartRoom();
|
PartRoom();
|
||||||
if (t.Exception != null)
|
if (t.Exception != null)
|
||||||
Logger.Error(t.Exception, "Failed to join multiplayer room.");
|
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);
|
}, TaskContinuationOptions.NotOnRanToCompletion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user