mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-17 21:41:06 +00:00
Updated chunk handling
This commit is contained in:
parent
6c39ef1b3f
commit
9e1d38329c
1 changed files with 4 additions and 19 deletions
23
world.js
23
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue