1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 19:32:55 +08:00

Rename MatchStarted() -> GameplayStarted()

This commit is contained in:
Dan Balasescu 2022-04-21 22:37:26 +09:00
parent 8c3b541312
commit 08d250fe58
6 changed files with 12 additions and 11 deletions

View File

@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
}); });
AddUntilStep("wait for player to be current", () => player.IsCurrentScreen() && player.IsLoaded); AddUntilStep("wait for player to be current", () => player.IsCurrentScreen() && player.IsLoaded);
AddStep("start gameplay", () => ((IMultiplayerClient)MultiplayerClient).MatchStarted()); AddStep("start gameplay", () => ((IMultiplayerClient)MultiplayerClient).GameplayStarted());
} }
[Test] [Test]

View File

@ -98,9 +98,10 @@ namespace osu.Game.Online.Multiplayer
Task LoadRequested(); Task LoadRequested();
/// <summary> /// <summary>
/// Signals that a match has started. All users in the <see cref="MultiplayerUserState.Loaded"/> state should begin gameplay as soon as possible. /// Signals that gameplay has started.
/// All users in the <see cref="MultiplayerUserState.Loaded"/> or <see cref="MultiplayerUserState.ReadyForGameplay"/> states should begin gameplay as soon as possible.
/// </summary> /// </summary>
Task MatchStarted(); Task GameplayStarted();
/// <summary> /// <summary>
/// Signals that the match has ended, all players have finished and results are ready to be displayed. /// Signals that the match has ended, all players have finished and results are ready to be displayed.

View File

@ -72,7 +72,7 @@ namespace osu.Game.Online.Multiplayer
/// <summary> /// <summary>
/// Invoked when the multiplayer server requests gameplay to be started. /// Invoked when the multiplayer server requests gameplay to be started.
/// </summary> /// </summary>
public event Action? MatchStarted; public event Action? GameplayStarted;
/// <summary> /// <summary>
/// Invoked when the multiplayer server has finished collating results. /// Invoked when the multiplayer server has finished collating results.
@ -604,14 +604,14 @@ namespace osu.Game.Online.Multiplayer
return Task.CompletedTask; return Task.CompletedTask;
} }
Task IMultiplayerClient.MatchStarted() Task IMultiplayerClient.GameplayStarted()
{ {
Scheduler.Add(() => Scheduler.Add(() =>
{ {
if (Room == null) if (Room == null)
return; return;
MatchStarted?.Invoke(); GameplayStarted?.Invoke();
}, false); }, false);
return Task.CompletedTask; return Task.CompletedTask;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Online.Multiplayer
connection.On<MultiplayerRoomSettings>(nameof(IMultiplayerClient.SettingsChanged), ((IMultiplayerClient)this).SettingsChanged); connection.On<MultiplayerRoomSettings>(nameof(IMultiplayerClient.SettingsChanged), ((IMultiplayerClient)this).SettingsChanged);
connection.On<int, MultiplayerUserState>(nameof(IMultiplayerClient.UserStateChanged), ((IMultiplayerClient)this).UserStateChanged); connection.On<int, MultiplayerUserState>(nameof(IMultiplayerClient.UserStateChanged), ((IMultiplayerClient)this).UserStateChanged);
connection.On(nameof(IMultiplayerClient.LoadRequested), ((IMultiplayerClient)this).LoadRequested); connection.On(nameof(IMultiplayerClient.LoadRequested), ((IMultiplayerClient)this).LoadRequested);
connection.On(nameof(IMultiplayerClient.MatchStarted), ((IMultiplayerClient)this).MatchStarted); connection.On(nameof(IMultiplayerClient.GameplayStarted), ((IMultiplayerClient)this).GameplayStarted);
connection.On(nameof(IMultiplayerClient.ResultsReady), ((IMultiplayerClient)this).ResultsReady); connection.On(nameof(IMultiplayerClient.ResultsReady), ((IMultiplayerClient)this).ResultsReady);
connection.On<int, IEnumerable<APIMod>>(nameof(IMultiplayerClient.UserModsChanged), ((IMultiplayerClient)this).UserModsChanged); connection.On<int, IEnumerable<APIMod>>(nameof(IMultiplayerClient.UserModsChanged), ((IMultiplayerClient)this).UserModsChanged);
connection.On<int, BeatmapAvailability>(nameof(IMultiplayerClient.UserBeatmapAvailabilityChanged), ((IMultiplayerClient)this).UserBeatmapAvailabilityChanged); connection.On<int, BeatmapAvailability>(nameof(IMultiplayerClient.UserBeatmapAvailabilityChanged), ((IMultiplayerClient)this).UserBeatmapAvailabilityChanged);

View File

@ -115,7 +115,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
if (!ValidForResume) if (!ValidForResume)
return; // token retrieval may have failed. return; // token retrieval may have failed.
client.MatchStarted += onMatchStarted; client.GameplayStarted += onGameplayStarted;
client.ResultsReady += onResultsReady; client.ResultsReady += onResultsReady;
ScoreProcessor.HasCompleted.BindValueChanged(completed => ScoreProcessor.HasCompleted.BindValueChanged(completed =>
@ -175,7 +175,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
leaderboardFlow.Position = new Vector2(padding, padding + HUDOverlay.TopScoringElementsHeight); leaderboardFlow.Position = new Vector2(padding, padding + HUDOverlay.TopScoringElementsHeight);
} }
private void onMatchStarted() => Scheduler.Add(() => private void onGameplayStarted() => Scheduler.Add(() =>
{ {
if (!this.IsCurrentScreen()) if (!this.IsCurrentScreen())
return; return;
@ -223,7 +223,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
if (client != null) if (client != null)
{ {
client.MatchStarted -= onMatchStarted; client.GameplayStarted -= onGameplayStarted;
client.ResultsReady -= onResultsReady; client.ResultsReady -= onResultsReady;
} }
} }

View File

@ -155,7 +155,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
foreach (var u in Room.Users.Where(u => u.State == MultiplayerUserState.Loaded)) foreach (var u in Room.Users.Where(u => u.State == MultiplayerUserState.Loaded))
ChangeUserState(u.UserID, MultiplayerUserState.Playing); ChangeUserState(u.UserID, MultiplayerUserState.Playing);
((IMultiplayerClient)this).MatchStarted(); ((IMultiplayerClient)this).GameplayStarted();
ChangeRoomState(MultiplayerRoomState.Playing); ChangeRoomState(MultiplayerRoomState.Playing);
} }