Stream 4 chunks per tick. Added priority.

This commit is contained in:
Howaner
2014-10-06 21:27:53 +02:00
parent a59f2d15fb
commit b493beb3bb
7 changed files with 58 additions and 29 deletions
+4 -3
View File
@@ -21,6 +21,7 @@
#include "Enchantments.h"
#include "UI/SlotArea.h"
#include "json/json.h"
#include "ChunkSender.h"
@@ -113,8 +114,8 @@ public:
/** Authenticates the specified user, called by cAuthenticator */
void Authenticate(const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties);
/** This function sends a new unloaded chunk to the player. */
void StreamNextChunk(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);
@@ -448,7 +449,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);