You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-18 08:06:33 +09:00
One more define to allow unity web player to run
This commit is contained in:
@@ -131,7 +131,7 @@ namespace Lidgren.Network
|
|||||||
}
|
}
|
||||||
catch (NotSupportedException)
|
catch (NotSupportedException)
|
||||||
{
|
{
|
||||||
// not supported; lets just kee the random bytes set above
|
// not supported; lets just keep the random bytes set above
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
byte[] epBytes = BitConverter.GetBytes(boundEp.GetHashCode());
|
byte[] epBytes = BitConverter.GetBytes(boundEp.GetHashCode());
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ namespace Lidgren.Network
|
|||||||
|
|
||||||
IPAddress mask;
|
IPAddress mask;
|
||||||
var client = NetUtility.GetMyAddress(out mask);
|
var client = NetUtility.GetMyAddress(out mask);
|
||||||
|
if (client == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
#define IS_FULL_NET_AVAILABLE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.NetworkInformation;
|
using System.Net.NetworkInformation;
|
||||||
@@ -118,6 +119,7 @@ namespace Lidgren.Network
|
|||||||
return best;
|
return best;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_FULL_NET_AVAILABLE
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the physical (MAC) address for the first usable network interface
|
/// Returns the physical (MAC) address for the first usable network interface
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -128,6 +130,7 @@ namespace Lidgren.Network
|
|||||||
return null;
|
return null;
|
||||||
return ni.GetPhysicalAddress();
|
return ni.GetPhysicalAddress();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a hex string from an Int64 value
|
/// Create a hex string from an Int64 value
|
||||||
@@ -159,6 +162,7 @@ namespace Lidgren.Network
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static IPAddress GetMyAddress(out IPAddress mask)
|
public static IPAddress GetMyAddress(out IPAddress mask)
|
||||||
{
|
{
|
||||||
|
#if IS_FULL_NET_AVAILABLE
|
||||||
NetworkInterface ni = GetNetworkInterface();
|
NetworkInterface ni = GetNetworkInterface();
|
||||||
if (ni == null)
|
if (ni == null)
|
||||||
{
|
{
|
||||||
@@ -175,7 +179,7 @@ namespace Lidgren.Network
|
|||||||
return unicastAddress.Address;
|
return unicastAddress.Address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
mask = null;
|
mask = null;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user