You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-19 08:36:34 +09:00
try-catch added when trying to get MAC address
This commit is contained in:
@@ -94,6 +94,8 @@ namespace Lidgren.Network
|
|||||||
NetRandom.Instance.NextBytes(macBytes);
|
NetRandom.Instance.NextBytes(macBytes);
|
||||||
|
|
||||||
#if IS_MAC_AVAILABLE
|
#if IS_MAC_AVAILABLE
|
||||||
|
try
|
||||||
|
{
|
||||||
System.Net.NetworkInformation.PhysicalAddress pa = NetUtility.GetMacAddress();
|
System.Net.NetworkInformation.PhysicalAddress pa = NetUtility.GetMacAddress();
|
||||||
if (pa != null)
|
if (pa != null)
|
||||||
{
|
{
|
||||||
@@ -104,6 +106,11 @@ namespace Lidgren.Network
|
|||||||
{
|
{
|
||||||
LogWarning("Failed to get Mac address");
|
LogWarning("Failed to get Mac address");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (NotSupportedException)
|
||||||
|
{
|
||||||
|
// not supported; lets just kee the random bytes set above
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
byte[] epBytes = BitConverter.GetBytes(boundEp.GetHashCode());
|
byte[] epBytes = BitConverter.GetBytes(boundEp.GetHashCode());
|
||||||
byte[] combined = new byte[epBytes.Length + macBytes.Length];
|
byte[] combined = new byte[epBytes.Length + macBytes.Length];
|
||||||
|
|||||||
Reference in New Issue
Block a user