diff --git a/osu.Game/Online/Spectator/SpectatorClient.cs b/osu.Game/Online/Spectator/SpectatorClient.cs index 0620643bc3..d0b89e981d 100644 --- a/osu.Game/Online/Spectator/SpectatorClient.cs +++ b/osu.Game/Online/Spectator/SpectatorClient.cs @@ -46,18 +46,6 @@ namespace osu.Game.Online.Spectator /// public IBindableList PlayingUsers => playingUsers; - /// - /// All users currently being watched. - /// - private readonly List watchedUsers = new List(); - - private readonly BindableDictionary watchedUserStates = new BindableDictionary(); - private readonly BindableList playingUsers = new BindableList(); - private readonly SpectatorState currentState = new SpectatorState(); - - private IBeatmap? currentBeatmap; - private Score? currentScore; - /// /// Whether the local user is playing. /// @@ -78,6 +66,30 @@ namespace osu.Game.Online.Spectator /// public event Action? OnUserFinishedPlaying; + /// + /// All users currently being watched. + /// + private readonly List watchedUsers = new List(); + + private readonly BindableDictionary watchedUserStates = new BindableDictionary(); + private readonly BindableList playingUsers = new BindableList(); + private readonly SpectatorState currentState = new SpectatorState(); + + private IBeatmap? currentBeatmap; + private Score? currentScore; + + private readonly Queue pendingFrameBundles = new Queue(); + + private readonly Queue pendingFrames = new Queue(); + + private double lastPurgeTime; + + private Task? lastSend; + + private int totalBundledFrames; + + private const int max_pending_frames = 30; + [BackgroundDependencyLoader] private void load() { @@ -240,24 +252,13 @@ namespace osu.Game.Online.Spectator protected abstract Task BeginPlayingInternal(SpectatorState state); protected abstract Task SendFramesInternal(FrameDataBundle bundle); + protected abstract Task EndPlayingInternal(SpectatorState state); protected abstract Task WatchUserInternal(int userId); protected abstract Task StopWatchingUserInternal(int userId); - private readonly Queue pendingFrameBundles = new Queue(); - - private readonly Queue pendingFrames = new Queue(); - - private double lastPurgeTime; - - private Task? lastSend; - - private int totalBundledFrames; - - private const int max_pending_frames = 30; - protected override void Update() { base.Update();