diff --git a/server/bufferStuff.js b/server/bufferStuff.js index b351835..de2ea9e 100644 --- a/server/bufferStuff.js +++ b/server/bufferStuff.js @@ -30,6 +30,11 @@ module.exports.Writer = class { this.writeByte(data ? 1 : 0); } + // NOTE: Currently writing a nibble requires you to write both halves at the same time. + writeNibble(nibble1 = 0, nibble2 = 0) { + this.writeUByte(nibble1 | (nibble2 << 4)); + } + writeByte(data = 0) { if (this.baseSize == 0) { const buff = Buffer.alloc(1);