mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 23:17:18 +08:00
Fix failed scores not prepared before import
This commit is contained in:
parent
68afb65aff
commit
6285442b7d
@ -267,7 +267,12 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
FailOverlay = new FailOverlay
|
FailOverlay = new FailOverlay
|
||||||
{
|
{
|
||||||
SaveReplay = saveFailedReplay,
|
SaveReplay = () =>
|
||||||
|
{
|
||||||
|
Score.ScoreInfo.Passed = false;
|
||||||
|
Score.ScoreInfo.Rank = ScoreRank.F;
|
||||||
|
return prepareAndImportScore();
|
||||||
|
},
|
||||||
OnRetry = Restart,
|
OnRetry = Restart,
|
||||||
OnQuit = () => PerformExit(true),
|
OnQuit = () => PerformExit(true),
|
||||||
},
|
},
|
||||||
@ -721,7 +726,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!Configuration.ShowResults)
|
if (!Configuration.ShowResults)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
prepareScoreForDisplayTask ??= Task.Run(prepareScoreForResults);
|
prepareScoreForDisplayTask ??= Task.Run(prepareAndImportScore);
|
||||||
|
|
||||||
bool storyboardHasOutro = DimmableStoryboard.ContentDisplayed && !DimmableStoryboard.HasStoryboardEnded.Value;
|
bool storyboardHasOutro = DimmableStoryboard.ContentDisplayed && !DimmableStoryboard.HasStoryboardEnded.Value;
|
||||||
|
|
||||||
@ -740,7 +745,7 @@ namespace osu.Game.Screens.Play
|
|||||||
/// Asynchronously run score preparation operations (database import, online submission etc.).
|
/// Asynchronously run score preparation operations (database import, online submission etc.).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The final score.</returns>
|
/// <returns>The final score.</returns>
|
||||||
private async Task<ScoreInfo> prepareScoreForResults()
|
private async Task<ScoreInfo> prepareAndImportScore()
|
||||||
{
|
{
|
||||||
var scoreCopy = Score.DeepClone();
|
var scoreCopy = Score.DeepClone();
|
||||||
|
|
||||||
@ -1044,26 +1049,6 @@ namespace osu.Game.Screens.Play
|
|||||||
return base.OnExiting(e);
|
return base.OnExiting(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<ScoreInfo> saveFailedReplay()
|
|
||||||
{
|
|
||||||
Score.ScoreInfo.Passed = false;
|
|
||||||
Score.ScoreInfo.Rank = ScoreRank.F;
|
|
||||||
|
|
||||||
var scoreCopy = Score.DeepClone();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await ImportScore(scoreCopy);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.Error(ex, @"Score import failed!");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return scoreCopy.ScoreInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the player's <see cref="Scoring.Score"/>.
|
/// Creates the player's <see cref="Scoring.Score"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user