Expand description
Implementation of an ad-hoc protocol on top of UDP used for sending gameplay update between the server and client.
This protocol provides the following qualities on top of UDP:
- Reliability. Messages are queued up and resent until the peer confirms that they’ve received them.
- Ordering. Messages are sent with ordered message ids, so the receiver can build up their own ordered queue of received messages.
- Compression. The sent messages are compressed after serialization, using Google’s Snappy compression, using the snap library.
- Encryption. Messages are encrypted using ChaCha20-Poly1305, with a randomly generated nonce included in plaintext in front of the message. The encryption key is shared during the login process which is implemented directly in the server and client modules.
Structs
Owns any relevant state and provides the functions needed to use the gameplay message protocol with a specific peer who has a matching MessageOrderer.
Constants
The amount of time after which the peer is considered to have disconnected.