diff --git a/OpenRA.Game/Network/UPnP.cs b/OpenRA.Game/Network/UPnP.cs index 4252a86af3..7676566e31 100644 --- a/OpenRA.Game/Network/UPnP.cs +++ b/OpenRA.Game/Network/UPnP.cs @@ -16,7 +16,7 @@ using Mono.Nat.Upnp; namespace OpenRA.Network { - class UPnP + public class UPnP { public static INatDevice NatDevice; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 75191b6a01..f8a6799fe9 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -75,6 +75,10 @@ False ..\thirdparty\ICSharpCode.SharpZipLib.dll + + ..\thirdparty\Mono.Nat.dll + False + diff --git a/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs index 07d911c033..8aee073cc5 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs @@ -68,6 +68,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic admin.IsVisible = () => orderManager.LobbyInfo.ClientWithIndex(clientIndex).IsAdmin; latency.GetText = () => "Latency: {0}".F(LobbyUtils.LatencyDescription(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency)); var ipAddress = orderManager.LobbyInfo.ClientWithIndex(clientIndex).IpAddress; + if ((ipAddress == null || ipAddress == "127.0.0.1") && UPnP.NatDevice != null) + ipAddress = UPnP.NatDevice.GetExternalIP().ToString(); ip.GetText = () => LobbyUtils.DescriptiveIpAddress(ipAddress); location.GetText = () => LobbyUtils.LookupCountry(ipAddress); }