Rename start countdown request

This commit is contained in:
Dan Balasescu
2022-03-18 21:05:19 +09:00
parent 72843a6797
commit 04f4e81852
6 changed files with 7 additions and 7 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 MatchStartCountdownRequest { Delay = TimeSpan.FromMinutes(2) })); AddStep("start with countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Delay = TimeSpan.FromMinutes(2) }));
ClickButtonWhenEnabled<MultiplayerReadyButton.ReadyButton>(); ClickButtonWhenEnabled<MultiplayerReadyButton.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 MatchStartCountdownRequest { Delay = TimeSpan.FromMinutes(1) })); AddStep("start countdown", () => MultiplayerClient.SendMatchRequest(new StartMatchCountdownRequest { Delay = TimeSpan.FromMinutes(1) }));
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

@ -12,7 +12,7 @@ namespace osu.Game.Online.Multiplayer.Countdown
/// A request for a countdown to start the match. /// A request for a countdown to start the match.
/// </summary> /// </summary>
[MessagePackObject] [MessagePackObject]
public class MatchStartCountdownRequest : MatchUserRequest public class StartMatchCountdownRequest : MatchUserRequest
{ {
/// <summary> /// <summary>
/// How long the countdown should last. /// How long the countdown should last.

View File

@ -15,7 +15,7 @@ namespace osu.Game.Online.Multiplayer
[MessagePackObject] [MessagePackObject]
// IMPORTANT: Add rules to SignalRUnionWorkaroundResolver for new derived types. // IMPORTANT: Add rules to SignalRUnionWorkaroundResolver for new derived types.
[Union(0, typeof(ChangeTeamRequest))] [Union(0, typeof(ChangeTeamRequest))]
[Union(1, typeof(MatchStartCountdownRequest))] [Union(1, typeof(StartMatchCountdownRequest))]
[Union(2, typeof(StopCountdownRequest))] [Union(2, typeof(StopCountdownRequest))]
public abstract class MatchUserRequest public abstract class MatchUserRequest
{ {

View File

@ -19,7 +19,7 @@ namespace osu.Game.Online
internal static readonly IReadOnlyList<(Type derivedType, Type baseType)> BASE_TYPE_MAPPING = new[] internal static readonly IReadOnlyList<(Type derivedType, Type baseType)> BASE_TYPE_MAPPING = new[]
{ {
(typeof(ChangeTeamRequest), typeof(MatchUserRequest)), (typeof(ChangeTeamRequest), typeof(MatchUserRequest)),
(typeof(MatchStartCountdownRequest), typeof(MatchUserRequest)), (typeof(StartMatchCountdownRequest), typeof(MatchUserRequest)),
(typeof(StopCountdownRequest), typeof(MatchUserRequest)), (typeof(StopCountdownRequest), typeof(MatchUserRequest)),
(typeof(CountdownChangedEvent), typeof(MatchServerEvent)), (typeof(CountdownChangedEvent), typeof(MatchServerEvent)),
(typeof(TeamVersusRoomState), typeof(MatchRoomState)), (typeof(TeamVersusRoomState), typeof(MatchRoomState)),

View File

@ -161,7 +161,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 MatchStartCountdownRequest { Delay = duration }).ContinueWith(_ => endOperation()); Client.SendMatchRequest(new StartMatchCountdownRequest { Delay = duration }).ContinueWith(_ => endOperation());
} }
private void endOperation() private void endOperation()

View File

@ -309,7 +309,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
switch (request) switch (request)
{ {
case MatchStartCountdownRequest matchCountdownRequest: case StartMatchCountdownRequest matchCountdownRequest:
countdownStopSource?.Cancel(); countdownStopSource?.Cancel();
var stopSource = countdownStopSource = new CancellationTokenSource(); var stopSource = countdownStopSource = new CancellationTokenSource();