diff --git a/OpenRA.Game/Network/GameServer.cs b/OpenRA.Game/Network/GameServer.cs index 0df3700b0a..d810a76739 100644 --- a/OpenRA.Game/Network/GameServer.cs +++ b/OpenRA.Game/Network/GameServer.cs @@ -97,6 +97,9 @@ namespace OpenRA.Network /// URL to a 32x32 px icon for the mod. public readonly string ModIcon32 = ""; + /// GeoIP resolved server location. + public readonly string Location = ""; + /// Password protected public readonly bool Protected = false; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index 670f9baaf2..16b678dafd 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -370,6 +370,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (addressNode != null) addressNode.Value.Value = bl.Address.ToString().Split(':')[0] + ":" + addressNode.Value.Value.Split(':')[1]; + game.Nodes.Add(new MiniYamlNode("Location", "Local Network")); + lanGames.Add(new GameServer(game)); } } @@ -658,8 +660,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (location != null) { var font = Game.Renderer.Fonts[location.Font]; - var cachedServerLocation = game.Id != -1 ? GeoIP.LookupCountry(game.Address.Split(':')[0]) : "Local Network"; - var label = WidgetUtils.TruncateText(cachedServerLocation, location.Bounds.Width, font); + var label = WidgetUtils.TruncateText(game.Location, location.Bounds.Width, font); location.GetText = () => label; location.GetColor = () => canJoin ? location.TextColor : incompatibleGameColor; }