1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Fix unstable multiplayer room ordering when selection is made

This commit is contained in:
Dean Herbert 2021-01-12 18:05:29 +09:00
parent b8c85ef017
commit ede5abdba4

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -47,9 +48,11 @@ namespace osu.Game.Screens.OnlinePlay.Components
pollReq.Success += result =>
{
var rooms = new List<Room>(roomManager.Rooms);
// existing rooms need to be ordered by their position because the received of NotifyRoomsReceives expects to be able to sort them based on this order.
var rooms = new List<Room>(roomManager.Rooms.OrderBy(r => r.Position.Value));
int index = rooms.FindIndex(r => r.RoomID.Value == result.RoomID.Value);
if (index < 0)
return;