From bb25ba4977198728b6ee30b61fcc6f48d1d94d4d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 25 Aug 2012 17:52:08 +0000 Subject: Removed cPackets from cChunk. Also decoupled a possible deadlock in player login code. git-svn-id: http://mc-server.googlecode.com/svn/trunk@788 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/cChunk.h') diff --git a/source/cChunk.h b/source/cChunk.h index 707ea5840..1b08f4d6b 100644 --- a/source/cChunk.h +++ b/source/cChunk.h @@ -138,7 +138,7 @@ public: int GetHeight( int a_X, int a_Z ); - void SendBlockTo( int a_X, int a_Y, int a_Z, cClientHandle* a_Client ); + void SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client); /// Adds a client to the chunk; returns true if added, false if already there bool AddClient (cClientHandle* a_Client ); @@ -193,9 +193,13 @@ public: void SendBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client); - void PositionToWorldPosition(int a_ChunkX, int a_ChunkY, int a_ChunkZ, int & a_X, int & a_Y, int & a_Z); - Vector3i PositionToWorldPosition( const Vector3i & a_InChunkPos ) { return PositionToWorldPosition( a_InChunkPos.x, a_InChunkPos.y, a_InChunkPos.z ); } - Vector3i PositionToWorldPosition( int a_ChunkX, int a_ChunkY, int a_ChunkZ ); + Vector3i PositionToWorldPosition(const Vector3i & a_RelPos) + { + return PositionToWorldPosition(a_RelPos.x, a_RelPos.y, a_RelPos.z); + } + + void PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ, int & a_BlockX, int & a_BlockY, int & a_BlockZ); + Vector3i PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ ); inline void MarkDirty(void) { @@ -268,6 +272,9 @@ private: // Makes a copy of the list cClientHandleList GetAllClients(void) const {return m_LoadedByClient; } + /// Sends m_PendingSendBlocks to all clients + void BroadcastPendingBlockChanges(void); + /// Checks the block scheduled for checking in m_ToTickBlocks[] void CheckBlocks(void); -- cgit v1.2.3