mirror of https://github.com/ppy/osu
Standardise flow for aborting realtime player exit to avoid double-exit call
This commit is contained in:
parent
569c4092ef
commit
f5d27b40a8
|
@ -51,8 +51,12 @@ private void load()
|
|||
isConnected.BindValueChanged(connected =>
|
||||
{
|
||||
if (!connected.NewValue)
|
||||
{
|
||||
startedEvent.Set();
|
||||
|
||||
// messaging to the user about this disconnect will be provided by the RealtimeMatchSubScreen.
|
||||
Schedule(this.Exit);
|
||||
Schedule(PerformImmediateExit);
|
||||
}
|
||||
}, true);
|
||||
|
||||
client.ChangeState(MultiplayerUserState.Loaded);
|
||||
|
@ -61,11 +65,7 @@ private void load()
|
|||
{
|
||||
Logger.Log("Failed to start the multiplayer match in time.", LoggingTarget.Runtime, LogLevel.Important);
|
||||
|
||||
Schedule(() =>
|
||||
{
|
||||
ValidForResume = false;
|
||||
this.Exit();
|
||||
});
|
||||
Schedule(PerformImmediateExit);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ private Drawable createUnderlayComponents() =>
|
|||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
fadeOut(true);
|
||||
performImmediateExit();
|
||||
PerformImmediateExit();
|
||||
},
|
||||
},
|
||||
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, },
|
||||
|
@ -458,7 +458,7 @@ private IBeatmap loadPlayableBeatmap()
|
|||
return playable;
|
||||
}
|
||||
|
||||
private void performImmediateExit()
|
||||
protected void PerformImmediateExit()
|
||||
{
|
||||
// if a restart has been requested, cancel any pending completion (user has shown intent to restart).
|
||||
completionProgressDelegate?.Cancel();
|
||||
|
@ -498,7 +498,7 @@ public void Restart()
|
|||
RestartRequested?.Invoke();
|
||||
|
||||
if (this.IsCurrentScreen())
|
||||
performImmediateExit();
|
||||
PerformImmediateExit();
|
||||
else
|
||||
this.MakeCurrent();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue