1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Added IS_MAC_AVAILABLE define for unity users

This commit is contained in:
lidgren
2010-07-17 07:51:50 +00:00
parent 37edf382c2
commit 8ee8ba4857

View File

@@ -17,6 +17,8 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR TH
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define IS_MAC_AVAILABLE
using System;
using System.Net;
using System.Net.Sockets;
@@ -77,6 +79,7 @@ namespace Lidgren.Network
InitializeRecycling();
#if IS_MAC_AVAILABLE
System.Net.NetworkInformation.PhysicalAddress pa = NetUtility.GetMacAddress();
if (pa != null)
{
@@ -87,6 +90,10 @@ namespace Lidgren.Network
{
LogWarning("Failed to get Mac address");
}
#else
// random bytes is better than nothing
NetRandom.Instance.NextBytes(m_macAddressBytes);
#endif
LogDebug("Network thread started");