move GeoIP functions into it's own class

extract the geoip database .gz in-game
This commit is contained in:
Matthias Mailänder
2015-05-23 15:37:33 +02:00
parent 78f1e9fb2f
commit 8e919d3215
6 changed files with 56 additions and 28 deletions

View File

@@ -235,21 +235,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return ip;
}
public static string LookupCountry(string ip)
{
const string Unknown = "Unknown Location";
try
{
return Game.GeoIpDatabase.Country(ip).Country.Name ?? Unknown;
}
catch (Exception e)
{
Log.Write("geoip", "LookupCountry failed: {0}", e);
return Unknown;
}
}
public static void SetupClientWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
{
parent.Get("ADMIN_INDICATOR").IsVisible = () => c.IsAdmin;