Skip to content

Athena Message Format

Martin McDonough edited this page Dec 20, 2015 · 2 revisions

This page describes the format of the Athena message protocol. It the default used by Athena to transmit and receive JSON data over the network.

In a perfect world, we would understand HTTP as well, and we would have a compile-time option to use the Athena format for local messages as well.

Someday it would also be nice to add xz or zlib compression to our protocol, but that's not necessary yet. It will probably be more useful when we end up wanting to send images over the network for custom flags, units, etc.

Format

The format is plain text and case sensitive, and is described as so:

Athena Message<At least one character, but no more than 33>\n
Size:<size of message in bytes>\n
<JSON Text of Size length>

Note that '\n' means a literal newline character.

After the "Athena Message" on the first line, any number of characters up to 33 can follow before the newline, although we suggest only using a single character. This space can be used as a sort of ID space. After Size is a plain ASCII number in decimal. If it is more than 2048, we will discard the entire message as oversized.

Clone this wiki locally