Fix error handling of failed MP server refresh
This commit is contained in:
@@ -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(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user