mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
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 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
|||||||
isConnected.BindValueChanged(connected =>
|
isConnected.BindValueChanged(connected =>
|
||||||
{
|
{
|
||||||
if (!connected.NewValue)
|
if (!connected.NewValue)
|
||||||
|
{
|
||||||
|
startedEvent.Set();
|
||||||
|
|
||||||
// messaging to the user about this disconnect will be provided by the RealtimeMatchSubScreen.
|
// messaging to the user about this disconnect will be provided by the RealtimeMatchSubScreen.
|
||||||
Schedule(this.Exit);
|
Schedule(PerformImmediateExit);
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
client.ChangeState(MultiplayerUserState.Loaded);
|
client.ChangeState(MultiplayerUserState.Loaded);
|
||||||
@ -61,11 +65,7 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
|||||||
{
|
{
|
||||||
Logger.Log("Failed to start the multiplayer match in time.", LoggingTarget.Runtime, LogLevel.Important);
|
Logger.Log("Failed to start the multiplayer match in time.", LoggingTarget.Runtime, LogLevel.Important);
|
||||||
|
|
||||||
Schedule(() =>
|
Schedule(PerformImmediateExit);
|
||||||
{
|
|
||||||
ValidForResume = false;
|
|
||||||
this.Exit();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!this.IsCurrentScreen()) return;
|
if (!this.IsCurrentScreen()) return;
|
||||||
|
|
||||||
fadeOut(true);
|
fadeOut(true);
|
||||||
performImmediateExit();
|
PerformImmediateExit();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, },
|
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, },
|
||||||
@ -458,7 +458,7 @@ namespace osu.Game.Screens.Play
|
|||||||
return playable;
|
return playable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void performImmediateExit()
|
protected void PerformImmediateExit()
|
||||||
{
|
{
|
||||||
// if a restart has been requested, cancel any pending completion (user has shown intent to restart).
|
// if a restart has been requested, cancel any pending completion (user has shown intent to restart).
|
||||||
completionProgressDelegate?.Cancel();
|
completionProgressDelegate?.Cancel();
|
||||||
@ -498,7 +498,7 @@ namespace osu.Game.Screens.Play
|
|||||||
RestartRequested?.Invoke();
|
RestartRequested?.Invoke();
|
||||||
|
|
||||||
if (this.IsCurrentScreen())
|
if (this.IsCurrentScreen())
|
||||||
performImmediateExit();
|
PerformImmediateExit();
|
||||||
else
|
else
|
||||||
this.MakeCurrent();
|
this.MakeCurrent();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user