NetrexMC / RakNet

RakNet implementation in Rust
Apache License 2.0
44 stars 12 forks source link

Wrong max frame packet header size #54

Open loudblow opened 11 months ago

loudblow commented 11 months ago

Why is it counted as 20 when the correct size is 23? https://github.com/NetrexMC/RakNet/blob/2af4c5a6973d5b5953d7361d978b40ecc53d05a2/src/protocol/mod.rs#L60

1 byte (flags) + 2 bytes (payload length) + 3 bytes (reliable index) + 3 bytes (sequence index) + 3 bytes (order index) + 1 byte (order channel) + 4 bytes (compound size) + 2 bytes (compound id) + 4 bytes (compound index) = 23

john-bv commented 10 months ago

interesting observation, i will look into this, it's more than likely something wrong on my side or just type conversion under the hood

john-bv commented 8 months ago

I think what i was doing here was allocating space for triads which take 24 bits, which would explain the discrepancy, i will still continue to look into this, as i get time. but I dont think this issue is high priority atm

loudblow commented 8 months ago

As Dylan (PMMP and RakLib maintainer) said in the same issue of the RakLib - this bug can occur problems only with sequenced packets as it has max header size.