You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-19 00:26:30 +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);
|
||||
|
||||
#if IS_MAC_AVAILABLE
|
||||
try
|
||||
{
|
||||
System.Net.NetworkInformation.PhysicalAddress pa = NetUtility.GetMacAddress();
|
||||
if (pa != null)
|
||||
{
|
||||
@@ -104,6 +106,11 @@ namespace Lidgren.Network
|
||||
{
|
||||
LogWarning("Failed to get Mac address");
|
||||
}
|
||||
}
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
// not supported; lets just kee the random bytes set above
|
||||
}
|
||||
#endif
|
||||
byte[] epBytes = BitConverter.GetBytes(boundEp.GetHashCode());
|
||||
byte[] combined = new byte[epBytes.Length + macBytes.Length];
|
||||
|
||||
Reference in New Issue
Block a user