From 1c2a5ee1a3dad5bb7ca5463379666acbd1965765 Mon Sep 17 00:00:00 2001 From: RevenantX Date: Mon, 25 May 2015 17:23:18 +0300 Subject: [PATCH 1/2] Fix compile errors in unity3d. --- Lidgren.Network/Platform/PlatformConstrained.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lidgren.Network/Platform/PlatformConstrained.cs b/Lidgren.Network/Platform/PlatformConstrained.cs index 450415d..4b896e0 100644 --- a/Lidgren.Network/Platform/PlatformConstrained.cs +++ b/Lidgren.Network/Platform/PlatformConstrained.cs @@ -28,15 +28,19 @@ namespace Lidgren.Network /// public static IPAddress GetMyAddress(out IPAddress mask) { -#if UNITY_ANDROID || UNITY_STANDALONE_OSX || UNITY_STANDLONE_WIN || UNITY_STANDLONE_LINX || UNITY_IOS +#if UNITY_ANDROID || UNITY_STANDALONE_OSX || UNITY_STANDLONE_WIN || UNITY_STANDLONE_LINUX || UNITY_IOS try { if (!(UnityEngine.Application.internetReachability == UnityEngine.NetworkReachability.NotReachable)) + { + mask = null; return null; + } return IPAddress.Parse(UnityEngine.Network.player.externalIP); } catch // Catch Access Denied errors { + mask = null; return null; } #endif From 6754530c81383f45c6dfdd94bbfc6e7694a11f8b Mon Sep 17 00:00:00 2001 From: RevenantX Date: Mon, 25 May 2015 17:27:24 +0300 Subject: [PATCH 2/2] Update PlatformConstrained.cs --- Lidgren.Network/Platform/PlatformConstrained.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lidgren.Network/Platform/PlatformConstrained.cs b/Lidgren.Network/Platform/PlatformConstrained.cs index 4b896e0..cbaa266 100644 --- a/Lidgren.Network/Platform/PlatformConstrained.cs +++ b/Lidgren.Network/Platform/PlatformConstrained.cs @@ -28,23 +28,21 @@ namespace Lidgren.Network /// public static IPAddress GetMyAddress(out IPAddress mask) { + mask = null; #if UNITY_ANDROID || UNITY_STANDALONE_OSX || UNITY_STANDLONE_WIN || UNITY_STANDLONE_LINUX || UNITY_IOS try { if (!(UnityEngine.Application.internetReachability == UnityEngine.NetworkReachability.NotReachable)) { - mask = null; return null; } return IPAddress.Parse(UnityEngine.Network.player.externalIP); } catch // Catch Access Denied errors { - mask = null; return null; } #endif - mask = null; return null; }