1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:45:09 +08:00

Add method to stop countdown

This commit is contained in:
Dan Balasescu 2022-03-24 20:13:58 +09:00
parent ea9de0199d
commit 209de886ce

View File

@ -132,7 +132,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
shouldStopCountdown |= Room.Host?.State != MultiplayerUserState.Ready && Room.Host?.State != MultiplayerUserState.Spectating;
if (shouldStopCountdown)
countdownStopSource?.Cancel();
stopCountdown();
break;
case MultiplayerRoomState.WaitingForLoad:
@ -319,10 +319,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
break;
case StopCountdownRequest _:
countdownStopSource?.Cancel();
Room.Countdown = null;
await MatchEvent(new CountdownChangedEvent { Countdown = Room.Countdown });
stopCountdown();
break;
case ChangeTeamRequest changeTeam:
@ -348,7 +345,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
Debug.Assert(Room != null);
Debug.Assert(ThreadSafety.IsUpdateThread);
countdownStopSource?.Cancel();
stopCountdown();
// Note that this will leak CTSs, however this is a test method and we haven't noticed foregoing disposal of non-linked CTSs to be detrimental.
// If necessary, this can be moved into the final schedule below, and the class-level fields be nulled out accordingly.
@ -397,6 +394,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
}
}
private void stopCountdown() => countdownStopSource?.Cancel();
public override Task StartMatch()
{
Debug.Assert(Room != null);