lucaspoffo / renet

Server/Client network library for multiplayer games with authentication and connection management made with Rust
Apache License 2.0
622 stars 66 forks source link

Add helper to receive last message #80

Closed Shatur closed 1 year ago

Shatur commented 1 year ago

When you working with unreliable sequenced channel you sometimes want to receive only the last message. Currently I have to call receive_message manually until it returns false which is not very ergonomic.

lucaspoffo commented 1 year ago

There is no option for sequenced channels anymore, so this auxiliary function doesn't make a lot of sense now.

For unreliable sequenced messages, the user must implement it. This could be done by adding a sequenced_id to the unreliable messages and keeping track of it - dropping messages below the sequenced value.