RiptideNetworking / Riptide

Lightweight C# networking solution for multiplayer games.
https://riptide.tomweiland.net
MIT License
1.14k stars 144 forks source link

The second client to connect is disconnected because a reliable message can't be delivered #123

Closed tom-weiland closed 12 months ago

tom-weiland commented 12 months ago

When connecting multiple clients (tested with the dedicated server demo and the sample FPS project) the first to connect works as expected, but the second to connect is disconnected almost immediately due to "poor connection".

This is because of an issue in the Converter.SetBits method that causes it to not properly overwrite bits in some cases, which can scramble the data in messages. This results in an incorrect sequence ID being written to the message, meaning it can't be acked properly, so the sender thinks it's not being delivered despite the receiver receiving it.