diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs
index e2159f0e3b..cb00763e6b 100644
--- a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs
+++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/MultiSpectatorScreen.cs
@@ -244,10 +244,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
playerArea.LoadScore(spectatorGameplayState.Score);
});
- protected override void FailGameplay(int userId)
+ protected override void FailGameplay(int userId) => Schedule(() =>
{
// We probably want to visualise this in the future.
- }
+
+ var instance = instances.Single(i => i.UserId == userId);
+ syncManager.RemoveManagedClock(instance.SpectatorPlayerClock);
+ });
+
+ protected override void PassGameplay(int userId) => Schedule(() =>
+ {
+ var instance = instances.Single(i => i.UserId == userId);
+ syncManager.RemoveManagedClock(instance.SpectatorPlayerClock);
+ });
protected override void QuitGameplay(int userId) => Schedule(() =>
{
diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/SpectatorSyncManager.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/SpectatorSyncManager.cs
index 5ff52be8bc..9eb448d9d0 100644
--- a/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/SpectatorSyncManager.cs
+++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Spectate/SpectatorSyncManager.cs
@@ -76,6 +76,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
public void RemoveManagedClock(SpectatorPlayerClock clock)
{
playerClocks.Remove(clock);
+ Logger.Log($"Removing managed clock from {nameof(SpectatorSyncManager)} ({playerClocks.Count} remain)");
clock.IsRunning = false;
}
diff --git a/osu.Game/Screens/Spectate/SpectatorScreen.cs b/osu.Game/Screens/Spectate/SpectatorScreen.cs
index c4aef3c878..ddc638b7c5 100644
--- a/osu.Game/Screens/Spectate/SpectatorScreen.cs
+++ b/osu.Game/Screens/Spectate/SpectatorScreen.cs
@@ -135,6 +135,7 @@ namespace osu.Game.Screens.Spectate
case SpectatedUserState.Passed:
markReceivedAllFrames(userId);
+ PassGameplay(userId);
break;
case SpectatedUserState.Failed:
@@ -233,6 +234,12 @@ namespace osu.Game.Screens.Spectate
/// The gameplay state.
protected abstract void StartGameplay(int userId, SpectatorGameplayState spectatorGameplayState);
+ ///
+ /// Fired when a user passes gameplay.
+ ///
+ /// The user which passed.
+ protected virtual void PassGameplay(int userId) { }
+
///
/// Quits gameplay for a user.
/// Thread safety is not guaranteed – should be scheduled as required.