1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 09:27:34 +08:00

Clear lists on room leave

This commit is contained in:
Dan Balasescu 2021-12-01 18:57:29 +09:00
parent fc8c8685b8
commit a4cd22d5a9

View File

@ -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;