Fix error handling of failed MP server refresh

This commit is contained in:
rob-v
2017-05-31 18:23:36 +02:00
committed by abcdefg30
parent 8e9f20cf4b
commit 7237fd83c6

View File

@@ -358,7 +358,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
lanGames = lanGames.GroupBy(gs => gs.Address).Select(g => g.Last()).ToList();
Game.RunAfterTick(() => RefreshServerListInner(games.Concat(lanGames).ToList()));
Game.RunAfterTick(() => RefreshServerListInner(games == null ? (lanGames.Count == 0 ? null : lanGames.ToList()) : games.Concat(lanGames).ToList()));
};
var queryURL = services.ServerList + "games?version={0}&mod={1}&modversion={2}".F(
@@ -391,15 +391,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void RefreshServerListInner(List<GameServer> games)
{
if (games == null)
return;
ScrollItemWidget nextServerRow = null;
var rows = new List<Widget>();
if (games != null)
{
var mods = games.GroupBy(g => g.Mods)
.OrderByDescending(g => GroupSortOrder(g.First()))
.ThenByDescending(g => g.Count());
ScrollItemWidget nextServerRow = null;
var rows = new List<Widget>();
foreach (var modGames in mods)
{
if (modGames.All(Filtered))
@@ -493,6 +492,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
}
}
}
Game.RunAfterTick(() =>
{