From b653e6a01271c05bdbd947ab7120d10d30ecee91 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 21 Feb 2012 16:27:30 +0000 Subject: Removed cChunkPtrs from everywhere but internal cChunkMap usage. Now we should finally be threadsafe :) Also fixed a threading issue when a player connecting might have gotten stuck in "Downloading world" forever git-svn-id: http://mc-server.googlecode.com/svn/trunk@304 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index bbeb2f1b4..2fec4bcbe 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -46,10 +46,15 @@ class cClientHandle; class cServer; class MTRand; class cPlayer; +class cChunkMap; typedef std::list cClientHandleList; typedef std::list cBlockEntityList; + + + + /** Interface class used for getting data out of a chunk using the GetAllData() function. Implementation must use the pointers immediately and NOT store any of them for later use */ @@ -108,7 +113,7 @@ public: static const int c_NumBlocks = 16 * 128 * 16; static const int c_BlockDataSize = c_NumBlocks * 2 + (c_NumBlocks/2); // 2.5 * numblocks - cChunk(int a_X, int a_Y, int a_Z, cWorld* a_World); + cChunk(int a_X, int a_Y, int a_Z, cChunkMap * a_ChunkMap, cWorld * a_World); ~cChunk(); bool IsValid(void) const {return m_IsValid; } // Returns true if the chunk is valid (loaded / generated) @@ -248,7 +253,8 @@ private: bool m_bCalculateHeightmap; int m_PosX, m_PosY, m_PosZ; - cWorld * m_World; + cWorld * m_World; + cChunkMap * m_ChunkMap; char m_BlockData[c_BlockDataSize]; // Chunk data ready to be compressed and sent char *m_BlockType; // Pointers to an element in m_BlockData -- cgit v1.2.3