1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Submit and send failed spectator state more aggressively

This commit is contained in:
Dean Herbert 2023-11-22 18:20:22 +09:00
parent 8375dd72d6
commit 4ad3cb3b49
No known key found for this signature in database

View File

@ -54,6 +54,8 @@ namespace osu.Game.Screens.Play
}
AddInternal(new PlayerTouchInputDetector());
HealthProcessor.Failed += onFail;
}
protected override void LoadAsyncComplete()
@ -165,10 +167,21 @@ namespace osu.Game.Screens.Play
spectatorClient.BeginPlaying(token, GameplayState, Score);
}
private bool onFail()
{
submitFromFailOrQuit();
return true;
}
public override bool OnExiting(ScreenExitEvent e)
{
bool exiting = base.OnExiting(e);
submitFromFailOrQuit();
return exiting;
}
private void submitFromFailOrQuit()
{
if (LoadedBeatmapSuccessfully)
{
Task.Run(async () =>
@ -177,8 +190,6 @@ namespace osu.Game.Screens.Play
spectatorClient.EndPlaying(GameplayState);
}).FireAndForget();
}
return exiting;
}
/// <summary>