naia-lib / naia

a cross-platform (including Wasm!) networking library built in Rust. Intended to make multiplayer game development dead-simple & lightning-fast
Apache License 2.0
878 stars 58 forks source link

Add sequenced unreliable channels #112

Closed cBournhonesque closed 1 year ago

cBournhonesque commented 1 year ago

This PR aims at adding SequencedUnreliable channels, as defined in: https://timonpost.github.io/laminar/reliability/reliability.html#unreliable-sequenced

I.e. messages are sent unreliably, and only the latest ones are processed.

I basically combined some bits and pieces from unordered_unreliable (e.g. not having internal buffers) and reliable channels (adding a wrapping message id).

One thing I'm unsure about is why the message_id is a wrapping_diff with the previous message_id, instead of simply being a wrapping id. This may actually mean that my implementation is not correct? I'd need more info on why we're using wrapping_diff

connorcarpenter commented 1 year ago

Merged into Release 0.15 (https://github.com/naia-lib/naia/pull/130)