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

Fixed compile error in NetRandomSeed for non-full .net implementations

This commit is contained in:
lidgren
2014-08-13 09:18:42 +00:00
parent 009c947f94
commit 82fcede26c

View File

@@ -32,11 +32,11 @@ namespace Lidgren.Network
s2 |= (((ulong)Guid.NewGuid().GetHashCode()) << 32);
seed ^= s2;
#else
ulong v1 = (ulong)Environment.TickCount;
v1 |= (((ulong)(new object().GetHashCode())) << 32);
ulong v2 = (ulong)Guid.NewGuid().GetHashCode();
v2 |= (((ulong)(Interlocked.Increment(ref m_seedIncrement)) << 32);
return v1 ^ v2;
ulong seed = (ulong)Environment.TickCount;
seed |= (((ulong)(new object().GetHashCode())) << 32);
ulong s2 = (ulong)Guid.NewGuid().GetHashCode();
s2 |= (((ulong)Interlocked.Increment(ref m_seedIncrement)) << 32);
seed ^= s2;
#endif
return seed;
}