From 9e1d38329c5f030255a4cc5fe35de22af8d338e4 Mon Sep 17 00:00:00 2001 From: mhsjlw Date: Sun, 23 Aug 2015 11:20:57 -0400 Subject: [PATCH] Updated chunk handling --- world.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/world.js b/world.js index f5d5989..1ebe555 100644 --- a/world.js +++ b/world.js @@ -215,26 +215,11 @@ World.prototype.packMapChunkBulk = function() { metadatas.push(metadata); } - // Deflate/compress the buffers - var deflate = zlib.createDeflate(); - var deflateBuffer = new Buffer(0); - deflate.on('data', function(data) { - deflateBuffer = Buffer.concat([deflateBuffer, data]); + cb(null, { + skyLightSent: true, + meta: metadatas, + data: Buffer.concat(bufs) }); - deflate.on('end', function() { - cb(null, { - data: { - skyLightSent: true, - meta: metadatas, - compressedChunkData: deflateBuffer - }}); - }); - deflate.on('error', function(err) { - console.log("error"); - cb(err); - }); - deflate.write(Buffer.concat(bufs)); - deflate.end(); } World.prototype.get = function(x, y, z, key) {