From 6538f696fadb96ece202fe14b3a5031ecf643c27 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 16 Mar 2014 18:09:27 +1300 Subject: [PATCH] Use the resource site to fill in missing details in the server browser. --- .../Widgets/Logic/ServerBrowserLogic.cs | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs index 0a5fbdf279..7aa136902b 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs @@ -147,30 +147,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic { List rows = new List(); - Game.RunAfterTick(() => - { - serverList.RemoveChildren(); - currentServer = null; - - if (games == null) - { - searchStatus = SearchStatus.Failed; - return; - } - - if (!games.Any()) - { - searchStatus = SearchStatus.NoGames; - return; - } - - currentServer = games.FirstOrDefault(); - searchStatus = SearchStatus.Hidden; - - foreach (var row in rows) - serverList.AddChild(row); - }); - foreach (var loop in games.OrderByDescending(g => g.CanJoin()).ThenByDescending(g => g.Players)) { var game = loop; @@ -241,6 +217,34 @@ namespace OpenRA.Mods.RA.Widgets.Logic if (!Filtered(game)) rows.Add(item); } + + Game.RunAfterTick(() => + { + serverList.RemoveChildren(); + currentServer = null; + + if (games == null) + { + searchStatus = SearchStatus.Failed; + return; + } + + if (!games.Any()) + { + searchStatus = SearchStatus.NoGames; + return; + } + + currentServer = games.FirstOrDefault(); + searchStatus = SearchStatus.Hidden; + + // Search for any unknown maps + if (Game.Settings.Game.AllowDownloading) + Game.modData.MapCache.QueryRemoteMapDetails(games.Where(g => !Filtered(g)).Select(g => g.Map)); + + foreach (var row in rows) + serverList.AddChild(row); + }); } void OpenLobby()