From c26fc81a2b41606abcc8f7a9a32b770c59afc785 Mon Sep 17 00:00:00 2001 From: DankParrot Date: Tue, 18 Aug 2020 18:50:41 -0700 Subject: [PATCH] Tidy up and comment protocol.hjson --- src/protocol/protocol.hjson | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 :