From a2f6ab93b6140740ca2562d5f82022a64c79feb6 Mon Sep 17 00:00:00 2001 From: faketruth Date: Thu, 1 Mar 2012 18:56:56 +0000 Subject: Chunks are successfully streamed to clients (in a bad a slow way, but whatever) Fixed respawn packet for 1.2.2 git-svn-id: http://mc-server.googlecode.com/svn/trunk@350 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/packets/cPacket_MapChunk.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source/packets/cPacket_MapChunk.cpp') diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp index 859db47f3..99afd9a40 100644 --- a/source/packets/cPacket_MapChunk.cpp +++ b/source/packets/cPacket_MapChunk.cpp @@ -36,15 +36,23 @@ cPacket_MapChunk::cPacket_MapChunk(cChunk * a_Chunk) m_UnusedInt = 0; - for( int i = 0; i < 16; ++i ) - { - m_BitMap1 |= (1 << i); - } - unsigned int DataSize = 16 * (4096 + 2048 + 2048 + 2048); char* AllData = new char[ DataSize ]; memset( AllData, 0, DataSize ); + unsigned int iterator = 0; + for( int i = 0; i < 8; ++i ) // Old world is only 8 high + { + m_BitMap1 |= (1 << i); + for( int y = 0; y < 16; ++y ) for( int z = 0; z < 16; ++z ) for( int x = 0; x < 16; ++x ) + { + AllData[iterator] = a_Chunk->GetBlock( x, y+i*16, z ); + ++iterator; + } + + //iterator+=2048*2; // Ignore light and stuff + } + uLongf CompressedSize = compressBound( DataSize ); char * CompressedBlockData = new char[CompressedSize]; -- cgit v1.2.3