From a4cd22d5a97295bb2de4b53026ae33afd1a40e56 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 1 Dec 2021 18:57:29 +0900 Subject: [PATCH] Clear lists on room leave --- .../Multiplayer/TestSceneMultiplayerPlaylist.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlaylist.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlaylist.cs index 136625682a..74284e21f1 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlaylist.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerPlaylist.cs @@ -113,6 +113,19 @@ namespace osu.Game.Tests.Visual.Multiplayer assertItemInHistoryListStep(1, 2); } + [Test] + public void TestListsClearedWhenRoomLeft() + { + addItemStep(); + AddStep("finish current item", () => Client.FinishCurrentItem()); + + AddStep("leave room", () => RoomManager.PartRoom()); + AddUntilStep("wait for room part", () => Client.Room == null); + + AddUntilStep("item 0 not in lists", () => !inHistoryList(0) && !inQueueList(0)); + AddUntilStep("item 1 not in lists", () => !inHistoryList(0) && !inQueueList(0)); + } + [Test] public void TestJoinRoomWithMixedItemsAddedInCorrectLists() { @@ -212,7 +225,11 @@ namespace osu.Game.Tests.Visual.Multiplayer base.OnRoomUpdated(); if (Room == null) + { + historyList.Items.Clear(); + queueList.Items.Clear(); return; + } if (!firstPopulation) return;