mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 21:23:04 +08:00
Change logic to ignore rooms completely after first error
This commit is contained in:
parent
e8d36bc3cb
commit
006adf0fb5
@ -143,7 +143,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
joinedRoom = null;
|
joinedRoom = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<int> roomsFailedUpdate = new List<int>();
|
private readonly HashSet<int> ignoredRooms = new HashSet<int>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when the listing of all <see cref="Room"/>s is received from the server.
|
/// Invoked when the listing of all <see cref="Room"/>s is received from the server.
|
||||||
@ -166,25 +166,26 @@ namespace osu.Game.Screens.Multi
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var r = listing[i];
|
var room = listing[i];
|
||||||
r.Position.Value = i;
|
|
||||||
|
Debug.Assert(room.RoomID.Value != null);
|
||||||
|
|
||||||
|
if (ignoredRooms.Contains(room.RoomID.Value.Value))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
room.Position.Value = i;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
update(r, r);
|
update(room, room);
|
||||||
addRoom(r);
|
addRoom(room);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.Assert(r.RoomID.Value != null);
|
Logger.Error(ex, $"Failed to update room: {room.Name.Value}.");
|
||||||
|
|
||||||
if (!roomsFailedUpdate.Contains(r.RoomID.Value.Value))
|
ignoredRooms.Add(room.RoomID.Value.Value);
|
||||||
{
|
rooms.Remove(room);
|
||||||
Logger.Error(ex, $"Failed to update room: {r.Name.Value}.");
|
|
||||||
roomsFailedUpdate.Add(r.RoomID.Value.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
rooms.Remove(r);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user