fixed NullReferenceException for unknown IPs

closes #3167
This commit is contained in:
Matthias Mailänder
2013-04-27 09:34:57 +02:00
parent 7ec4bcad0e
commit b5e8b5426e
2 changed files with 12 additions and 1 deletions

View File

@@ -182,6 +182,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return "Poor";
}
public static string DescriptiveIpAddress(string ip)
{
if (ip == null)
return "Unknown Host";
if (ip == "127.0.0.1")
return "Local Host";
return ip;
}
public static void SetupClientWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
{
parent.Get("ADMIN_INDICATOR").IsVisible = () => c.IsAdmin;