diff --git a/OpenRA.Game/Server/MasterServerQuery.cs b/OpenRA.Game/Server/MasterServerQuery.cs index d6175dd085..f43fadb765 100755 --- a/OpenRA.Game/Server/MasterServerQuery.cs +++ b/OpenRA.Game/Server/MasterServerQuery.cs @@ -13,6 +13,7 @@ using System.Linq; using System.Net; using System.Text; using System.Threading; +using System.Collections.Generic; using OpenRA.FileFormats; using OpenRA.Widgets; @@ -76,7 +77,13 @@ namespace OpenRA.Server public readonly int State = 0; public readonly int Players = 0; public readonly string Map = null; - public readonly string[] Mods = { }; + public readonly string[] Mods = { }; public readonly int TTL = 0; + + public Dictionary UsefulMods { + get { + return Mods.Where(v => v.Contains('@')).ToDictionary(v => v.Split('@')[0], v => v.Split('@')[1]); + } + } } } diff --git a/OpenRA.Mods.RA/Widgets/Delegates/ServerBrowserDelegate.cs b/OpenRA.Mods.RA/Widgets/Delegates/ServerBrowserDelegate.cs index 76946e0db8..269c37a13a 100644 --- a/OpenRA.Mods.RA/Widgets/Delegates/ServerBrowserDelegate.cs +++ b/OpenRA.Mods.RA/Widgets/Delegates/ServerBrowserDelegate.cs @@ -105,11 +105,10 @@ namespace OpenRA.Mods.RA.Widgets.Delegates string GenerateModsLabel() { - return string.Join("\n", currentServer.Mods - .Select( m => m.Split('@')[0] ) + return string.Join("\n", currentServer.UsefulMods .Select(m => - Mod.AllMods.ContainsKey(m) ? string.Format("{0} ({1})", Mod.AllMods[m].Title, Mod.AllMods[m].Version) - : string.Format("Unknown Mod: {0}",m)).ToArray()); + Mod.AllMods.ContainsKey(m.Key) ? string.Format("{0} ({1})", Mod.AllMods[m.Key].Title, m.Value) + : string.Format("Unknown Mod: {0}",m.Key)).ToArray()); } void RefreshServerList(IEnumerable games)