larku / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
60 stars 27 forks source link

Fixed RakNet GUID generation. #10

Closed larku closed 9 years ago

larku commented 9 years ago

A mistake in the generation of the random 64bit RakNet GUID causes only about half of the bits to be set on the Windows platform. On other platforms 'gettimeofday' is used to generate the GUID, which can lead to collisions. Also using the 4 last bits of a short sleep duration as a source of randomness isn't sufficiently random so the granularity has been increased a bit.