summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ClientHandle.h')
-rw-r--r--src/ClientHandle.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index a9cc29d50..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);
@@ -204,7 +209,7 @@ public:
void SendWholeInventory (const cWindow & a_Window);
void SendWindowClose (const cWindow & a_Window);
void SendWindowOpen (const cWindow & a_Window);
- void SendWindowProperty (const cWindow & a_Window, int a_Property, int a_Value);
+ void SendWindowProperty (const cWindow & a_Window, short a_Property, short a_Value);
// tolua_begin
const AString & GetUsername(void) const;
@@ -343,6 +348,7 @@ private:
cCriticalSection m_CSChunkLists;
cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to
cChunkCoordsList m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them)
+ cChunkCoordsList m_SentChunks; // Chunks that are currently sent to the client
cProtocol * m_Protocol;
@@ -358,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;
@@ -444,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);