diff options
author | Mattes D <github@xoft.cz> | 2014-10-23 22:49:17 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-23 22:49:17 +0200 |
commit | 4df924cf4b774b68fc7cc6b144e82e47c9fe4444 (patch) | |
tree | 454cee2b4b47387ba19e7537de3d5d699be7f9fe /src/ClientHandle.h | |
parent | Fixed a crash in redstone simulator. (diff) | |
parent | Use 3 priorities. (diff) | |
download | cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.gz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.bz2 cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.lz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.xz cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.tar.zst cuberite-4df924cf4b774b68fc7cc6b144e82e47c9fe4444.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 80cf16963..082ed2fcc 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -21,6 +21,7 @@ #include "Enchantments.h" #include "UI/SlotArea.h" #include "json/json.h" +#include "ChunkSender.h" @@ -113,7 +114,11 @@ public: /** Authenticates the specified user, called by cAuthenticator */ void Authenticate(const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties); - void StreamChunks(void); + /** This function sends a new unloaded chunk to the player. Returns true if all chunks are loaded. */ + bool StreamNextChunk(); + + /** Remove all loaded chunks that are no longer in range */ + void UnloadOutOfRangeChunks(void); // Removes the client from all chunks. Used when switching worlds or destroying the player void RemoveFromAllChunks(void); @@ -359,7 +364,7 @@ private: cPlayer * m_Player; bool m_HasSentDC; ///< True if a D/C packet has been sent in either direction - + // Chunk position when the last StreamChunks() was called; used to avoid re-streaming while in the same chunk int m_LastStreamedChunkX; int m_LastStreamedChunkZ; @@ -445,7 +450,7 @@ private: bool CheckBlockInteractionsRate(void); /** Adds a single chunk to be streamed to the client; used by StreamChunks() */ - void StreamChunk(int a_ChunkX, int a_ChunkZ); + void StreamChunk(int a_ChunkX, int a_ChunkZ, cChunkSender::eChunkPriority a_Priority); /** Handles the DIG_STARTED dig packet: */ void HandleBlockDigStarted (int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta); |