1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 07:06:30 +09:00

UNITY specifics for GetMyAddress incorporated

This commit is contained in:
Michael Lidgren
2015-05-05 15:41:46 +02:00
parent 77515da42d
commit 9b82d2a0c6

View File

@@ -28,6 +28,18 @@ namespace Lidgren.Network
/// </summary>
public static IPAddress GetMyAddress(out IPAddress mask)
{
#if UNITY_ANDROID || UNITY_STANDALONE_OSX || UNITY_STANDLONE_WIN || UNITY_STANDLONE_LINX || UNITY_IOS
try
{
if (!(UnityEngine.Application.internetReachability == UnityEngine.NetworkReachability.NotReachable))
return null;
return IPAddress.Parse(UnityEngine.Network.player.externalIP);
}
catch // Catch Access Denied errors
{
return null;
}
#endif
mask = null;
return null;
}