1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 12:23:13 +08:00

Adjust TestMultiplayerClient for correctness

This commit is contained in:
Dan Balasescu 2021-11-10 21:27:20 +09:00
parent 1bc6a58528
commit c51cb62315

View File

@ -383,25 +383,20 @@ namespace osu.Game.Tests.Visual.Multiplayer
Debug.Assert(Room != null); Debug.Assert(Room != null);
Debug.Assert(APIRoom != null); Debug.Assert(APIRoom != null);
long nextId = 0; long nextId;
switch (Room.Settings.QueueMode) switch (Room.Settings.QueueMode)
{ {
case QueueModes.HostOnly: default:
// Pick the single non-expired playlist item. // Pick the single non-expired playlist item.
nextId = APIRoom.Playlist.SingleOrDefault(i => !i.Expired)?.ID ?? 0; nextId = APIRoom.Playlist.FirstOrDefault(i => !i.Expired)?.ID
?? APIRoom.Playlist.LastOrDefault()?.ID
?? 0;
break; break;
case QueueModes.FairRotate: case QueueModes.FairRotate:
// Group playlist items by (user_id -> count_expired), and select the first available playlist item from a user that has available beatmaps where count_expired is the lowest. // Group playlist items by (user_id -> count_expired), and select the first available playlist item from a user that has available beatmaps where count_expired is the lowest.
throw new NotImplementedException(); throw new NotImplementedException();
case QueueModes.FreeForAll:
// Pick the first available non-expired playlist item, or default to the last.
nextId = APIRoom.Playlist.FirstOrDefault(i => !i.Expired)?.ID
?? APIRoom.Playlist.LastOrDefault()?.ID
?? 0;
break;
} }
if (nextId != Room.Settings.PlaylistItemId) if (nextId != Room.Settings.PlaylistItemId)