mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Add test coverage of incorrect beatmap being used in multiplayer when match started from song select
This commit is contained in:
@ -397,6 +397,44 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddUntilStep("user state is idle", () => client.LocalUser?.State == MultiplayerUserState.Idle);
|
AddUntilStep("user state is idle", () => client.LocalUser?.State == MultiplayerUserState.Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestPlayStartsWithCorrectBeatmapWhileAtSongSelect()
|
||||||
|
{
|
||||||
|
createRoom(() => new Room
|
||||||
|
{
|
||||||
|
Name = { Value = "Test Room" },
|
||||||
|
Playlist =
|
||||||
|
{
|
||||||
|
new PlaylistItem
|
||||||
|
{
|
||||||
|
Beatmap = { Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First(b => b.RulesetID == 0)).BeatmapInfo },
|
||||||
|
Ruleset = { Value = new OsuRuleset().RulesetInfo },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("Enter song select", () =>
|
||||||
|
{
|
||||||
|
var currentSubScreen = ((Screens.OnlinePlay.Multiplayer.Multiplayer)multiplayerScreenStack.CurrentScreen).CurrentSubScreen;
|
||||||
|
|
||||||
|
((MultiplayerMatchSubScreen)currentSubScreen).SelectBeatmap();
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for song select", () => this.ChildrenOfType<MultiplayerMatchSongSelect>().FirstOrDefault()?.IsLoaded == true);
|
||||||
|
|
||||||
|
AddAssert("Beatmap matches current item", () => Beatmap.Value.BeatmapInfo.OnlineID == client.Room?.Playlist.First().BeatmapID);
|
||||||
|
|
||||||
|
AddStep("Select next beatmap", () => InputManager.Key(Key.Down));
|
||||||
|
|
||||||
|
AddUntilStep("Beatmap doesn't match current item", () => Beatmap.Value.BeatmapInfo.OnlineID != client.Room?.Playlist.First().BeatmapID);
|
||||||
|
|
||||||
|
AddStep("start match externally", () => client.StartMatch());
|
||||||
|
|
||||||
|
AddUntilStep("play started", () => multiplayerScreenStack.CurrentScreen is Player);
|
||||||
|
|
||||||
|
AddAssert("Beatmap matches current item", () => Beatmap.Value.BeatmapInfo.OnlineID == client.Room?.Playlist.First().BeatmapID);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestLocalPlayDoesNotStartWhileSpectatingWithNoBeatmap()
|
public void TestLocalPlayDoesNotStartWhileSpectatingWithNoBeatmap()
|
||||||
{
|
{
|
||||||
|
@ -138,11 +138,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 40,
|
Height = 40,
|
||||||
Action = () =>
|
Action = SelectBeatmap,
|
||||||
{
|
|
||||||
if (this.IsCurrentScreen())
|
|
||||||
this.Push(new MultiplayerMatchSongSelect(Room));
|
|
||||||
},
|
|
||||||
Alpha = 0
|
Alpha = 0
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -224,6 +220,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
internal void SelectBeatmap()
|
||||||
|
{
|
||||||
|
if (!this.IsCurrentScreen())
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.Push(new MultiplayerMatchSongSelect(Room));
|
||||||
|
}
|
||||||
|
|
||||||
protected override Drawable CreateFooter() => new MultiplayerMatchFooter
|
protected override Drawable CreateFooter() => new MultiplayerMatchFooter
|
||||||
{
|
{
|
||||||
OnReadyClick = onReadyClick,
|
OnReadyClick = onReadyClick,
|
||||||
|
Reference in New Issue
Block a user