From d592882fe0d1e7762470e6b5eff2b14ed26f1e69 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 20 Feb 2012 16:39:00 +0000 Subject: Removed some more cChunkPtr usage git-svn-id: http://mc-server.googlecode.com/svn/trunk@298 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/cWorld.h') diff --git a/source/cWorld.h b/source/cWorld.h index a9c068336..8a1cf729d 100644 --- a/source/cWorld.h +++ b/source/cWorld.h @@ -68,6 +68,8 @@ public: void Broadcast( const cPacket & a_Packet, cClientHandle* a_Exclude = 0 ); + void BroadcastToChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cPacket & a_Packet, cClientHandle * a_Exclude = NULL); + void BroadcastToChunkOfBlock(int a_X, int a_Y, int a_Z, cPacket * a_Packet, cClientHandle * a_Exclude = NULL); void MarkChunkDirty (int a_ChunkX, int a_ChunkY, int a_ChunkZ); @@ -80,6 +82,7 @@ public: bool IsChunkValid (int a_ChunkX, int a_ChunkY, int a_ChunkZ) const; bool HasChunkAnyClients(int a_ChunkX, int a_ChunkY, int a_ChunkZ) const; void UnloadUnusedChunks(void); + void CollectPickupsByPlayer(cPlayer * a_Player); // MOTD const AString & GetDescription(void) const {return m_Description; } @@ -105,7 +108,18 @@ public: void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player void AddEntity( cEntity* a_Entity ); - void RemoveEntityFromChunk( cEntity * a_Entity); + + /// Add an entity to the chunk specified; broadcasts the a_SpawnPacket to all clients of that chunk + void AddEntityToChunk(cEntity * a_Entity, int a_ChunkX, int a_ChunkY, int a_ChunkZ, cPacket * a_SpawnPacket); + + /// Removes the entity from the chunk specified + void RemoveEntityFromChunk(cEntity * a_Entity, int a_ChunkX, int a_ChunkY, int a_ChunkZ); + + /// Moves the entity from its current chunk to the new chunk specified + void MoveEntityToChunk(cEntity * a_Entity, int a_ChunkX, int a_ChunkY, int a_ChunkZ); + + /// Compares clients of two chunks, calls the callback accordingly + void CompareChunkClients(int a_ChunkX1, int a_ChunkY1, int a_ChunkZ1, int a_ChunkX2, int a_ChunkY2, int a_ChunkZ2, cClientDiffCallback & a_Callback); // TODO: Export to Lua bool DoWithEntity( int a_UniqueID, cEntityCallback & a_Callback ); -- cgit v1.2.3