display the client location in a lobby tooltip

This commit is contained in:
Matthias Mailänder
2013-08-08 09:40:40 +02:00
parent 781c680ad3
commit feb7f80a39
5 changed files with 38 additions and 7 deletions

View File

@@ -194,6 +194,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return ip;
}
public static string LookupCountry(string ip)
{
var ip2geo = new GeoIP.LookupService("GeoIP.dat", GeoIP.LookupService.GEOIP_MEMORY_CACHE);
var country = ip2geo.getCountry(ip);
return country.getName();
}
public static void SetupClientWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
{
parent.Get("ADMIN_INDICATOR").IsVisible = () => c.IsAdmin;