1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 18:52:55 +08:00

Rename countdown Delay -> Duration

This commit is contained in:
Dan Balasescu 2022-03-23 15:21:16 +09:00
parent f7c0047206
commit a83a90e675
4 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
MultiplayerClient.TransferHost(2); MultiplayerClient.TransferHost(2);
}); });
AddStep("start with countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Delay = TimeSpan.FromMinutes(2) }).WaitSafely()); AddStep("start with countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Duration = TimeSpan.FromMinutes(2) }).WaitSafely());
ClickButtonWhenEnabled<ReadyButton>(); ClickButtonWhenEnabled<ReadyButton>();
AddUntilStep("user is ready", () => MultiplayerClient.Room?.Users[0].State == MultiplayerUserState.Ready); AddUntilStep("user is ready", () => MultiplayerClient.Room?.Users[0].State == MultiplayerUserState.Ready);
@ -193,7 +193,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
MultiplayerClient.TransferHost(2); MultiplayerClient.TransferHost(2);
}); });
AddStep("start countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Delay = TimeSpan.FromMinutes(1) }).WaitSafely()); AddStep("start countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Duration = TimeSpan.FromMinutes(1) }).WaitSafely());
AddUntilStep("countdown started", () => MultiplayerClient.Room?.Countdown != null); AddUntilStep("countdown started", () => MultiplayerClient.Room?.Countdown != null);
AddStep("transfer host to local user", () => MultiplayerClient.TransferHost(API.LocalUser.Value.OnlineID)); AddStep("transfer host to local user", () => MultiplayerClient.TransferHost(API.LocalUser.Value.OnlineID));

View File

@ -18,6 +18,6 @@ namespace osu.Game.Online.Multiplayer.Countdown
/// How long the countdown should last. /// How long the countdown should last.
/// </summary> /// </summary>
[Key(0)] [Key(0)]
public TimeSpan Delay { get; set; } public TimeSpan Duration { get; set; }
} }
} }

View File

@ -150,7 +150,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
Debug.Assert(clickOperation == null); Debug.Assert(clickOperation == null);
clickOperation = ongoingOperationTracker.BeginOperation(); clickOperation = ongoingOperationTracker.BeginOperation();
Client.SendMatchRequest(new StartMatchCountdownRequest { Delay = duration }).ContinueWith(_ => endOperation()); Client.SendMatchRequest(new StartMatchCountdownRequest { Duration = duration }).ContinueWith(_ => endOperation());
} }
private void endOperation() private void endOperation()

View File

@ -315,7 +315,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
var stopSource = countdownStopSource = new CancellationTokenSource(); var stopSource = countdownStopSource = new CancellationTokenSource();
var finishSource = countdownFinishSource = new CancellationTokenSource(); var finishSource = countdownFinishSource = new CancellationTokenSource();
var cancellationSource = CancellationTokenSource.CreateLinkedTokenSource(stopSource.Token, finishSource.Token); var cancellationSource = CancellationTokenSource.CreateLinkedTokenSource(stopSource.Token, finishSource.Token);
var countdown = new MatchStartCountdown { TimeRemaining = matchCountdownRequest.Delay }; var countdown = new MatchStartCountdown { TimeRemaining = matchCountdownRequest.Duration };
Task lastCountdownTask = countdownTask; Task lastCountdownTask = countdownTask;
countdownTask = start(); countdownTask = start();
@ -335,7 +335,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
try try
{ {
await Task.Delay(matchCountdownRequest.Delay, cancellationSource.Token).ConfigureAwait(false); await Task.Delay(matchCountdownRequest.Duration, cancellationSource.Token).ConfigureAwait(false);
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {