1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Make catch-up spectator clocks running state immutable externally

This commit is contained in:
Salman Ahmed 2022-05-13 00:07:11 +03:00
parent d73afcaf48
commit 27da293b40
3 changed files with 22 additions and 0 deletions

View File

@ -34,6 +34,16 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
public void Stop() => IsRunning = false; public void Stop() => IsRunning = false;
void IAdjustableClock.Start()
{
// Our running state should only be managed by an ISyncManager, ignore calls from external sources.
}
void IAdjustableClock.Stop()
{
// Our running state should only be managed by an ISyncManager, ignore calls from external sources.
}
public bool Seek(double position) public bool Seek(double position)
{ {
CurrentTime = position; CurrentTime = position;

View File

@ -144,6 +144,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
// Make sure the player clock is running if it can. // Make sure the player clock is running if it can.
if (!clock.WaitingOnFrames.Value) if (!clock.WaitingOnFrames.Value)
clock.Start(); clock.Start();
else
clock.Stop();
if (clock.IsCatchingUp) if (clock.IsCatchingUp)
{ {

View File

@ -11,6 +11,16 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
/// </summary> /// </summary>
public interface ISpectatorPlayerClock : IFrameBasedClock, IAdjustableClock public interface ISpectatorPlayerClock : IFrameBasedClock, IAdjustableClock
{ {
/// <summary>
/// Starts this <see cref="ISpectatorPlayerClock"/>.
/// </summary>
new void Start();
/// <summary>
/// Stops this <see cref="ISpectatorPlayerClock"/>.
/// </summary>
new void Stop();
/// <summary> /// <summary>
/// Whether this clock is waiting on frames to continue playback. /// Whether this clock is waiting on frames to continue playback.
/// </summary> /// </summary>