Expand description
Renetcode is a simple connection based client/server protocol agnostic to the transport layer,
was developed be used in games with UDP in mind. Implements the Netcode 1.a2 standard with renet2
extensions. The standard is available here and the original implementation in C++ is
available in the netcode repository. The extensions are available in NETCODE_EXTENSIONS.md
.
Has the following feature:
- Encrypted and signed packets
- Secure client connection with connect tokens
- Connection based protocol
and protects the game server from the following attacks:
- Zombie clients
- Man in the middle
- DDoS amplification
- Packet replay attacks
Structs§
- Connect
Token - A public connect token that the client receives to start connecting to the server. How the client receives ConnectToken is up to you, could be from a matchmaking system or from a call to a REST API as an example.
- Netcode
Client - A client that can generate encrypted packets that be sent to the connected server, or consume encrypted packets from the server. The client is agnostic from the transport layer, only consuming and generating bytes that can be transported in any way desired.
- Netcode
Server - A server that can generate packets from connect clients, that are encrypted, or process incoming encrypted packets from clients. The server is agnostic from the transport layer, only consuming and generating bytes that can be transported in any way desired.
- Server
Config - Server
Socket Config - Configuration details for a socket associated with a netcode server.
Enums§
- Client
Authentication - Configuration to establish a secure or unsecure connection with the server.
- Disconnect
Reason - The reason why a client is in error state
- Netcode
Error - Errors from the renetcode crate.
- Packet
- Packet
Type - Server
Authentication - Configuration to establish a secure or unsecure connection with the server.
- Server
Result - Result from processing an packet in the server
- Token
Generation Error
Constants§
- NETCODE_
KEY_ BYTES - The number of bytes in a private key;
- NETCODE_
MAX_ PACKET_ BYTES - The maximum number of bytes that a netcode packet can contain.
- NETCODE_
MAX_ PAYLOAD_ BYTES - The maximum number of bytes that a payload can have when generating a payload packet.
- NETCODE_
USER_ DATA_ BYTES - The number of bytes that an user data can contain in the ConnectToken.
Functions§
- generate_
random_ bytes - Generate a buffer with random bytes using randomness from the operating system.