@NAME is a voxel-based video game with a simple, flexible network protocol.
This spec assumes packets are transported by UDP, on port 21108 by default. Implementations may use other transport protocols, but this internal framing format stays the same, for simplicity.
IPC commands start with an uppercase command name, followed by a single ASCII space, and then the command arguments, separated by semicolons if the command takes more than one argument.
Sent to the client to notify them that the connection has been closed and the client should stop sending any packets.
Sent by the client to verify they have the private key that goes with their public key. The server sends an encrypted challenge token in the $02 Server Handshake packet. If the client responds with the correct decrypted token, the server can be sure the client is not forging their identity.
Sent to mark that a client or server implementation supports a set of file formats or network protocols. Formats that are specified first are given higher priority.
The 'raw' format is 64x64 4-byte ARGB for images, and invalid for other kinds of data.
Sent by the server to give the client additional game resources. Sent from the client to give their skin texture to the server. Resources larger than 60KiB should instead be downloaded over another protocol like HTTP.
This packet is sent occasionally.
Can contain UTF-8 encoded text or arbitrary binary data.
Channels $0000-$001F are reserved. $0020-$FFFF are for implementation extensions, i.e. plugins, bots, etc.
Sent by the client to initialise a connection to the server. If packet encryption or compression is supported by both ends, they are only used after the handshake process is complete.
The profile key field may be left empty for guest users with ephemeral state.
Sent by the server in response to a client sending $02 Client Handshake. The server sends an implementation-defined random value encrypted with the client's public key, to verify the client is not forging their identity.
The client responds with "CHALLENGE (...)" with the decrypted data represented as hex on message channel 4. If the client does not respond within 5 seconds or the identity challenge fails, the server sends "KICK challenge_failure" to the client on message channel 4.