Skip to content

Protocol Format Strings

Joshua Dong edited this page Jun 12, 2015 · 2 revisions

Protocol Format Strings

Structs can be serialized to bytes by defining a format string for the packet serializer. The following table describes the format guidelines.

fmt type
b 1 byte
h 2 bytes
w 4 bytes
l 8 bytes
q 16 bytes
s string
v varint32
S Slot
* array

Note: the array format character is a prefix to other types (e.g. *b for a char array).

Clone this wiki locally