1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:05:34 +08:00

Don't trigger the same exception multiple times

This commit is contained in:
smoogipoo 2020-06-27 00:19:22 +09:00
parent c233dc4768
commit e8d36bc3cb

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using osu.Framework.Allocation;
@ -142,6 +143,8 @@ namespace osu.Game.Screens.Multi
joinedRoom = null;
}
private readonly List<int> roomsFailedUpdate = new List<int>();
/// <summary>
/// Invoked when the listing of all <see cref="Room"/>s is received from the server.
/// </summary>
@ -172,8 +175,15 @@ namespace osu.Game.Screens.Multi
addRoom(r);
}
catch (Exception ex)
{
Debug.Assert(r.RoomID.Value != null);
if (!roomsFailedUpdate.Contains(r.RoomID.Value.Value))
{
Logger.Error(ex, $"Failed to update room: {r.Name.Value}.");
roomsFailedUpdate.Add(r.RoomID.Value.Value);
}
rooms.Remove(r);
}
}