RandyGaul / cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
4.24k stars 264 forks source link

[cute_net] Bug when sending reliable packets (repro code inside) #329

Closed roig closed 1 year ago

roig commented 1 year ago

Just posting this to not lose the info/tracking about this bug :)

Bad behavior that we get: imatge

We should be getting:

Client received packet_number: 0
Client received packet_number: 1
Client received packet_number: 2
Client received packet_number: 3
Client received packet_number: 4
Client received packet_number: 5
Client received packet_number: 6
Client received packet_number: 7
Client received packet_number: 8
Client received packet_number: 9
Client received packet_number: 10
Client received packet_number: 11
Client received packet_number: 12

Now it seems that when arrives to 8, it skips 8 packets.

Code to reproduce this bug: https://gist.github.com/roig/acfa68fa5e94aadd42f3ebeb783d8bcc

RandyGaul commented 1 year ago

Thanks! Very helpful of you to post this. I'm actually going to be working on this with a friend quite soon, so good timing.

RandyGaul commented 1 year ago

Should be fixed, please try it out when you can. Let me know if there are still issues!

https://github.com/RandyGaul/cute_headers/commit/bcfa78b801f53dbac18e09682e5a1e6193fdef14