From cfa30d9e1d81255a76729be1a791a4c0f9036ca1 Mon Sep 17 00:00:00 2001 From: Will Franzen Date: Tue, 30 Dec 2014 02:08:21 -0600 Subject: [PATCH] Add packets to protocol and threshold to client --- lib/client.js | 1 + lib/protocol.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/client.js b/lib/client.js index 23d5576..bb9b501 100644 --- a/lib/client.js +++ b/lib/client.js @@ -30,6 +30,7 @@ function Client(isServer) { this.encryptionEnabled = false; this.cipher = null; this.decipher = null; + this.compressionThreshold = -1; this.packetsToParse = {}; this.on('newListener', function(event, listener) { var direction = this.isServer ? 'toServer' : 'toClient'; diff --git a/lib/protocol.js b/lib/protocol.js index 0d0cece..87cb3d3 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -58,6 +58,9 @@ var packets = { success: {id: 0x02, fields: [ { name: "uuid", type: "string" }, { name: "username", type: "string" } + ]}, + compress: { id: 0x03, fields: [ + { name: "threshold", type: "varint"} ]} }, toServer: { @@ -534,6 +537,9 @@ var packets = { ]}, kick_disconnect: {id: 0x40, fields: [ { name: "reason", type: "string" } + ]}, + compress: { id: 0x46, fields: [ + { name: "threshold", type: "varint"} ]} }, toServer: {