lidgren / lidgren-network-gen3

Lidgren Network Library
https://groups.google.com/forum/#!forum/lidgren-network-gen3
MIT License
1.19k stars 331 forks source link

Fixed sublte bug in ReadUInt64(int) and PeekUInt64(int) #31

Closed zsebastian closed 9 years ago

zsebastian commented 9 years ago

Peek and Read for UInt64, with numberBits as parameter, in NetBuffer breaks when reading values above 32 bits. This is due to reading the same position twice, and not casting the second read to UInt64, breaking the bit shift.

Added tests that reproduce the bug which fails before the fix and passes after the fix.

(This is my first pull request, let me know if I did it incorrectly).

lidgren commented 9 years ago

Nice catch, thanks!