mirror of https://github.com/ppy/osu
Remove all references to "score submission" from Player
This commit is contained in:
parent
194b2d05d3
commit
571124669d
|
@ -133,9 +133,9 @@ private void onMatchStarted() => Scheduler.Add(() =>
|
|||
|
||||
private void onResultsReady() => resultsReady.SetResult(true);
|
||||
|
||||
protected override async Task SubmitScore(Score score)
|
||||
protected override async Task PrepareScoreForResultsAsync(Score score)
|
||||
{
|
||||
await base.SubmitScore(score).ConfigureAwait(false);
|
||||
await base.PrepareScoreForResultsAsync(score).ConfigureAwait(false);
|
||||
|
||||
await client.ChangeState(MultiplayerUserState.FinishedPlay).ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -559,7 +559,7 @@ public void Restart()
|
|||
}
|
||||
|
||||
private ScheduledDelegate completionProgressDelegate;
|
||||
private Task<ScoreInfo> scoreSubmissionTask;
|
||||
private Task<ScoreInfo> prepareScoreForDisplayTask;
|
||||
|
||||
private void updateCompletionState(ValueChangedEvent<bool> completionState)
|
||||
{
|
||||
|
@ -586,17 +586,17 @@ private void updateCompletionState(ValueChangedEvent<bool> completionState)
|
|||
|
||||
if (!Configuration.ShowResults) return;
|
||||
|
||||
scoreSubmissionTask ??= Task.Run(async () =>
|
||||
prepareScoreForDisplayTask ??= Task.Run(async () =>
|
||||
{
|
||||
var score = CreateScore();
|
||||
|
||||
try
|
||||
{
|
||||
await SubmitScore(score).ConfigureAwait(false);
|
||||
await PrepareScoreForResultsAsync(score).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex, "Score submission failed!");
|
||||
Logger.Error(ex, "Score preparation failed!");
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -617,7 +617,7 @@ private void updateCompletionState(ValueChangedEvent<bool> completionState)
|
|||
|
||||
private void scheduleCompletion() => completionProgressDelegate = Schedule(() =>
|
||||
{
|
||||
if (!scoreSubmissionTask.IsCompleted)
|
||||
if (!prepareScoreForDisplayTask.IsCompleted)
|
||||
{
|
||||
scheduleCompletion();
|
||||
return;
|
||||
|
@ -625,7 +625,7 @@ private void scheduleCompletion() => completionProgressDelegate = Schedule(() =>
|
|||
|
||||
// screen may be in the exiting transition phase.
|
||||
if (this.IsCurrentScreen())
|
||||
this.Push(CreateResults(scoreSubmissionTask.Result));
|
||||
this.Push(CreateResults(prepareScoreForDisplayTask.Result));
|
||||
});
|
||||
|
||||
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !GameplayClockContainer.IsPaused.Value;
|
||||
|
@ -895,11 +895,11 @@ protected virtual Task ImportScore(Score score)
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Submits the player's <see cref="Score"/>.
|
||||
/// Prepare the <see cref="Score"/> for display at results.
|
||||
/// </summary>
|
||||
/// <param name="score">The <see cref="Score"/> to submit.</param>
|
||||
/// <returns>The submitted score.</returns>
|
||||
protected virtual Task SubmitScore(Score score) => Task.CompletedTask;
|
||||
/// <param name="score">The <see cref="Score"/> to prepare.</param>
|
||||
/// <returns>A task that prepares the provided score. On completion, the score is assumed to be ready for display.</returns>
|
||||
protected virtual Task PrepareScoreForResultsAsync(Score score) => Task.CompletedTask;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the <see cref="ResultsScreen"/> for a <see cref="ScoreInfo"/>.
|
||||
|
|
|
@ -59,9 +59,9 @@ private void load()
|
|||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
protected override async Task SubmitScore(Score score)
|
||||
protected override async Task PrepareScoreForResultsAsync(Score score)
|
||||
{
|
||||
await base.SubmitScore(score).ConfigureAwait(false);
|
||||
await base.PrepareScoreForResultsAsync(score).ConfigureAwait(false);
|
||||
|
||||
Debug.Assert(Token != null);
|
||||
|
||||
|
|
Loading…
Reference in New Issue