diff --git a/src/protocol/protocol.hjson b/src/protocol/protocol.hjson index e5f8304..41ea841 100644 --- a/src/protocol/protocol.hjson +++ b/src/protocol/protocol.hjson @@ -2,9 +2,16 @@ types: { varint: { + // native type type: int32_t + + // this is the max size. varint is 3 to 5 size: 5 + + // R/W: ReadVarInt, WriteVarInt method: VarInt + + // Alias types use ReadVarInt generic: true } @@ -15,6 +22,7 @@ string: { type: std::string method: String + // requires count: e.g. string[256] size: count } @@ -43,11 +51,12 @@ byte: {type: 'uint8_t', size: 1} - bool: {type: 'bool', size: 1} + // if no native type is specified, + // it's assumed to be the type's name + bool: {size: 1} float: {size: 4} double: {size: 8} - } states :