mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Move spectator begin/end playing to SubmittingPlayer
This commit is contained in:
@ -15,6 +15,7 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Online.Spectator;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
@ -33,6 +34,9 @@ namespace osu.Game.Screens.Play
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private SpectatorClient spectatorClient { get; set; }
|
||||
|
||||
private TaskCompletionSource<bool> scoreSubmissionSource;
|
||||
|
||||
protected SubmittingPlayer(PlayerConfiguration configuration = null)
|
||||
@ -134,6 +138,8 @@ namespace osu.Game.Screens.Play
|
||||
if (realmBeatmap != null)
|
||||
realmBeatmap.LastPlayed = DateTimeOffset.Now;
|
||||
});
|
||||
|
||||
spectatorClient.BeginPlaying(GameplayState, Score);
|
||||
}
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
@ -141,7 +147,10 @@ namespace osu.Game.Screens.Play
|
||||
bool exiting = base.OnExiting(e);
|
||||
|
||||
if (LoadedBeatmapSuccessfully)
|
||||
{
|
||||
submitScore(Score.DeepClone());
|
||||
spectatorClient.EndPlaying(GameplayState);
|
||||
}
|
||||
|
||||
return exiting;
|
||||
}
|
||||
|
Reference in New Issue
Block a user