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

Handle Auth payloads > 500 bytes #148

Open connorcarpenter opened 1 year ago

connorcarpenter commented 1 year ago

Currently Auth payloads are restricted in size to ~500 bytes because the Server/Client handshake process is completely unreliable, and naia seeks to keep within a 500-byte limit for individual packets in order to avoid latency-increasing fragmentation. Normally users of naia can get around this limit with Reliable Message Channels, but Authentication messages don't currently support reliability.

My current reliable channel algorithm requires both Server & Client to agree on a starting message id .. I'll have to adapt this a bit in order to get reliability working before the connection is even established.

It's likely that this feature will wait to release with a greater refactor of the connection handshake process, which should, for WebRTC connections at least, authenticate the client during the HTTP session request rather than after the WebRTC connection is already established.