1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 18:53:51 +08:00

Fix stall when attempting to import replay after hitting nothing

This commit is contained in:
Bartłomiej Dach 2024-09-06 13:16:27 +02:00
parent 7e53df5226
commit 4e9ad1388f
No known key found for this signature in database

View File

@ -274,6 +274,16 @@ namespace osu.Game.Screens.Play
return Task.CompletedTask;
}
// if the user never hit anything, this score should not be counted in any way.
if (!score.ScoreInfo.Statistics.Any(s => s.Key.IsHit() && s.Value > 0))
{
Logger.Log("No hits registered, skipping score submission");
return Task.CompletedTask;
}
// mind the timing of this.
// once `scoreSubmissionSource` is created, it is presumed that submission is taking place in the background,
// so all exceptional circumstances that would disallow submission must be handled above.
lock (scoreSubmissionLock)
{
if (scoreSubmissionSource != null)
@ -282,10 +292,6 @@ namespace osu.Game.Screens.Play
scoreSubmissionSource = new TaskCompletionSource<bool>();
}
// if the user never hit anything, this score should not be counted in any way.
if (!score.ScoreInfo.Statistics.Any(s => s.Key.IsHit() && s.Value > 0))
return Task.CompletedTask;
Logger.Log($"Beginning score submission (token:{token.Value})...");
var request = CreateSubmissionRequest(score, token.Value);