Merge pull request #21753 from bdach/submission-early-exit-ordering-guarantees

Ensure score submission completion before notifying spectator server when exiting play early
This commit is contained in:
Dan Balasescu 2022-12-22 14:48:43 +09:00 committed by GitHub
commit 198567aa95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Online.API;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms;
using osu.Game.Online.Spectator;
using osu.Game.Rulesets.Scoring;
@ -158,8 +159,11 @@ namespace osu.Game.Screens.Play
if (LoadedBeatmapSuccessfully)
{
submitScore(Score.DeepClone());
spectatorClient.EndPlaying(GameplayState);
Task.Run(async () =>
{
await submitScore(Score.DeepClone()).ConfigureAwait(false);
spectatorClient.EndPlaying(GameplayState);
}).FireAndForget();
}
return exiting;