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: {