add chunkCount to 0x38

changed some more things for more API consistency

 * 0x33: compressedData -> compressedChunkData
 * 0x38: meta.chunkX -> meta.x
 * 0x38: meta.chunkZ -> meta.z
 * 0x38: meta.primaryBitMap -> meta.bitMap
 * 0x38: add chunkCount
This commit is contained in:
Andrew Kelley 2013-01-05 16:51:42 -05:00
parent 37d1cdcca1
commit 08f71f11dc

View file

@ -264,7 +264,7 @@ var packets = {
{ name: "groundUp", type: "bool" },
{ name: "bitMap", type: "ushort" },
{ name: "addBitMap", type: "ushort" },
{ name: "compressedData", type: "byteArray32" }
{ name: "compressedChunkData", type: "byteArray32" }
],
0x34: [
{ name: "chunkX", type: "int" },
@ -635,21 +635,21 @@ function readMapChunkBulk (buffer, offset) {
cursor = compressedChunkDataEnd;
var meta = [];
var i, chunkX, chunkZ, primaryBitMap, addBitMap;
var i, chunkX, chunkZ, bitMap, addBitMap;
for (i = 0; i < chunkCount; ++i) {
chunkX = buffer.readInt32BE(cursor);
cursor += 4;
chunkZ = buffer.readInt32BE(cursor);
cursor += 4;
primaryBitMap = buffer.readUInt16BE(cursor);
bitMap = buffer.readUInt16BE(cursor);
cursor += 2;
addBitMap = buffer.readUInt16BE(cursor);
cursor += 2;
meta.push({
chunkX: chunkX,
chunkZ: chunkZ,
primaryBitMap: primaryBitMap,
x: chunkX,
z: chunkZ,
bitMap: bitMap,
addBitMap: addBitMap,
});
}
@ -657,6 +657,7 @@ function readMapChunkBulk (buffer, offset) {
return {
value: {
skyLightSent: skyLightSent,
chunkCount: chunkCount,
compressedChunkData: compressedChunkData,
meta: meta,
},