diff --git a/osu.Game.Tests/Visual/Matchmaking/TestSceneMatchmakingScreen.cs b/osu.Game.Tests/Visual/Matchmaking/TestSceneMatchmakingScreen.cs index 642e9926c3..5b60f1e7a1 100644 --- a/osu.Game.Tests/Visual/Matchmaking/TestSceneMatchmakingScreen.cs +++ b/osu.Game.Tests/Visual/Matchmaking/TestSceneMatchmakingScreen.cs @@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual.Matchmaking state.CandidateItems = beatmaps.Select(b => b.ID).ToArray(); state.CandidateItem = beatmaps[0].ID; - state.FinalItem = beatmaps[0].ID; + state.GameplayItem = beatmaps[0].ID; }, waitTime: 35); changeStage(MatchmakingStage.WaitingForClientsBeatmapDownload); diff --git a/osu.Game/Online/Multiplayer/MatchTypes/Matchmaking/MatchmakingRoomState.cs b/osu.Game/Online/Multiplayer/MatchTypes/Matchmaking/MatchmakingRoomState.cs index 2901074fb0..0c4106ae2b 100644 --- a/osu.Game/Online/Multiplayer/MatchTypes/Matchmaking/MatchmakingRoomState.cs +++ b/osu.Game/Online/Multiplayer/MatchTypes/Matchmaking/MatchmakingRoomState.cs @@ -28,14 +28,20 @@ namespace osu.Game.Online.Multiplayer.MatchTypes.Matchmaking public int CurrentRound { get; set; } /// - /// The playlist items that were picked as gameplay candidates. + /// The playlist items that were picked as candidates by user. /// + /// + /// May contain -1 when any users picked the "random" playlist item. + /// [Key(2)] public long[] CandidateItems { get; set; } = []; /// - /// The final gameplay candidate. + /// A playlist item from that was randomly picked by the server. /// + /// + /// May be -1 to indicate the "random" playlist item was chosen. + /// [Key(3)] public long CandidateItem { get; set; } @@ -45,8 +51,14 @@ namespace osu.Game.Online.Multiplayer.MatchTypes.Matchmaking [Key(4)] public MatchmakingUserList Users { get; set; } = new MatchmakingUserList(); + /// + /// A playlist item from the room's playlist that will be played in the current round. + /// + /// + /// The value of this property may not equal or exist in . + /// [Key(5)] - public long FinalItem { get; set; } + public long GameplayItem { get; set; } /// /// Advances to the next round. diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs index eb2bb37482..5e8975410f 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs @@ -140,7 +140,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect panel.RemoveUser(user); }); - public void RollAndDisplayFinalBeatmap(long[] candidateItemIds, long candidateItemId, long finalItemId) => whenPanelsLoaded(() => + public void RollAndDisplayFinalBeatmap(long[] candidateItemIds, long candidateItemId, long gameplayItemId) => whenPanelsLoaded(() => { Debug.Assert(candidateItemIds.Length >= 1); Debug.Assert(candidateItemIds.Contains(candidateItemId)); @@ -156,16 +156,16 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect this.Delay(ARRANGE_DELAY) .Schedule(() => ArrangeItemsForRollAnimation()) .Delay(arrange_duration + present_beatmap_delay) - .Schedule(() => PresentUnanimouslyChosenBeatmap(candidateItemId, finalItemId)); + .Schedule(() => PresentUnanimouslyChosenBeatmap(candidateItemId, gameplayItemId)); } else { this.Delay(ARRANGE_DELAY) .Schedule(() => ArrangeItemsForRollAnimation()) .Delay(arrange_duration) - .Schedule(() => PlayRollAnimation(finalItemId, roll_duration)) + .Schedule(() => PlayRollAnimation(gameplayItemId, roll_duration)) .Delay(roll_duration + present_beatmap_delay) - .Schedule(() => PresentRolledBeatmap(candidateItemId, finalItemId)); + .Schedule(() => PresentRolledBeatmap(candidateItemId, gameplayItemId)); } }); @@ -312,10 +312,10 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect } } - internal void PresentRolledBeatmap(long candidateItem, long finalItem) + internal void PresentRolledBeatmap(long candidateItem, long gameplayItem) { Debug.Assert(rollContainer.Children.Any(it => it.Item.ID == candidateItem)); - Debug.Assert(playlistItems.ContainsKey(finalItem)); + Debug.Assert(playlistItems.ContainsKey(gameplayItem)); foreach (var panel in rollContainer.Children) { @@ -331,18 +331,18 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect { rollContainer.ChangeChildDepth(panel, float.MinValue); - var item = playlistItems[finalItem]; + var item = playlistItems[gameplayItem]; panel.PresentAsChosenBeatmap(item); }); } } - internal void PresentUnanimouslyChosenBeatmap(long candidateItem, long finalItem) + internal void PresentUnanimouslyChosenBeatmap(long candidateItem, long gameplayItem) { // TODO: display special animation in this case - PresentRolledBeatmap(candidateItem, finalItem); + PresentRolledBeatmap(candidateItem, gameplayItem); } private readonly TaskCompletionSource panelsLoaded = new TaskCompletionSource(); diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/SubScreenBeatmapSelect.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/SubScreenBeatmapSelect.cs index 607a8e47f0..9262e10526 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/SubScreenBeatmapSelect.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/SubScreenBeatmapSelect.cs @@ -134,8 +134,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect beatmapSelectGrid.SetUserSelection(user, itemId, false); } - public void RollFinalBeatmap(long[] candidateItems, long candidateItem, long finalItem) => - beatmapSelectGrid.RollAndDisplayFinalBeatmap(candidateItems, candidateItem, finalItem); + public void RollFinalBeatmap(long[] candidateItems, long candidateItem, long gameplayItem) => + beatmapSelectGrid.RollAndDisplayFinalBeatmap(candidateItems, candidateItem, gameplayItem); protected override void Dispose(bool isDisposing) { diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.ScreenStack.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.ScreenStack.cs index 4aee7e8a21..4d5a7099c4 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.ScreenStack.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/ScreenMatchmaking.ScreenStack.cs @@ -108,7 +108,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match case MatchmakingStage.ServerBeatmapFinalised: Debug.Assert(screenStack.CurrentScreen is SubScreenBeatmapSelect); - ((SubScreenBeatmapSelect)screenStack.CurrentScreen).RollFinalBeatmap(matchmakingState.CandidateItems, matchmakingState.CandidateItem, matchmakingState.FinalItem); + ((SubScreenBeatmapSelect)screenStack.CurrentScreen).RollFinalBeatmap(matchmakingState.CandidateItems, matchmakingState.CandidateItem, matchmakingState.GameplayItem); break; case MatchmakingStage.ResultsDisplaying: