mirror of https://github.com/ppy/osu
Submit and send failed spectator state more aggressively
This commit is contained in:
parent
8375dd72d6
commit
4ad3cb3b49
|
@ -54,6 +54,8 @@ private void load()
|
||||||
}
|
}
|
||||||
|
|
||||||
AddInternal(new PlayerTouchInputDetector());
|
AddInternal(new PlayerTouchInputDetector());
|
||||||
|
|
||||||
|
HealthProcessor.Failed += onFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadAsyncComplete()
|
protected override void LoadAsyncComplete()
|
||||||
|
@ -165,10 +167,21 @@ protected override void StartGameplay()
|
||||||
spectatorClient.BeginPlaying(token, GameplayState, Score);
|
spectatorClient.BeginPlaying(token, GameplayState, Score);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool onFail()
|
||||||
|
{
|
||||||
|
submitFromFailOrQuit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool OnExiting(ScreenExitEvent e)
|
public override bool OnExiting(ScreenExitEvent e)
|
||||||
{
|
{
|
||||||
bool exiting = base.OnExiting(e);
|
bool exiting = base.OnExiting(e);
|
||||||
|
submitFromFailOrQuit();
|
||||||
|
return exiting;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void submitFromFailOrQuit()
|
||||||
|
{
|
||||||
if (LoadedBeatmapSuccessfully)
|
if (LoadedBeatmapSuccessfully)
|
||||||
{
|
{
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
|
@ -177,8 +190,6 @@ public override bool OnExiting(ScreenExitEvent e)
|
||||||
spectatorClient.EndPlaying(GameplayState);
|
spectatorClient.EndPlaying(GameplayState);
|
||||||
}).FireAndForget();
|
}).FireAndForget();
|
||||||
}
|
}
|
||||||
|
|
||||||
return exiting;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue