Expand description
Multiplayer networking protocol: packet encoding, decoding, auth tokens, bandwidth tracking, and packet filtering.
Custom binary wire format (no serde dependency):
- Variable-length integers for sequence numbers
- Bit-packed flags in the header
- Delta encoding hints for position payloads
- 16-byte header, variable payload
Structs§
- Bandwidth
Tracker - Rolling-window bandwidth meter.
- Connection
Token - Opaque token issued by the auth server, embedded in the Connect packet.
- Packet
- A fully-parsed network packet ready for dispatch.
- Packet
Decoder - Deserializes packets from a byte buffer with strict bounds checking.
- Packet
Encoder - Serializes
Packetvalues to a contiguous byte buffer. - Packet
Filter - Tracks recently seen sequence numbers to detect replay attacks and malformed packets before they reach higher-level code.
- Packet
Header - Fixed-size header that precedes every packet on the wire.
Enums§
- Compression
Hint - Indicates how the payload bytes are compressed. The receiver must use matching decompression.
- Packet
Kind - Discriminant for every packet type on the wire.
- Protocol
Error - All errors that can arise from encoding or decoding packets.
Constants§
- FILTER_
HISTORY_ LEN - Maximum packets stored in replay/filter history.
- MAGIC
- Magic bytes at the start of every packet (PEMP = Proof-Engine Multiplayer Protocol).
- MAX_
PAYLOAD_ LEN - Maximum allowed payload length (64 KiB).
- PROTOCOL_
VERSION - Wire protocol version negotiated on connect.