summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-03 09:47:35 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-03 09:47:35 +0200
commitf7b8a301f8a705cec6df17c7051164169cf619a6 (patch)
tree18e0c07ecb0b0750868a37f1f62512f84f769c93 /source/ClientHandle.h
parentdtOnFire damage wasn't dealt properly (diff)
downloadcuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar.gz
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar.bz2
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar.lz
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar.xz
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.tar.zst
cuberite-f7b8a301f8a705cec6df17c7051164169cf619a6.zip
Diffstat (limited to 'source/ClientHandle.h')
-rw-r--r--source/ClientHandle.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/ClientHandle.h b/source/ClientHandle.h
index cd0ca1ee6..c02924ebf 100644
--- a/source/ClientHandle.h
+++ b/source/ClientHandle.h
@@ -185,6 +185,7 @@ public:
bool HandleLogin(int a_ProtocolVersion, const AString & a_Username);
void SendData(const char * a_Data, int a_Size);
+
private:
int m_ViewDistance; // Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 )
@@ -270,6 +271,12 @@ private:
/// Running sum of m_NumExplosionsPerTick[]
int m_RunningSumExplosions;
+ /// Lock for the m_PendingMessages buffer
+ cCriticalSection m_CSMessages;
+
+ /// Buffer for received messages to be processed in the Tick thread
+ AStringList m_PendingMessages;
+
/// Returns true if the rate block interactions is within a reasonable limit (bot protection)
@@ -292,6 +299,9 @@ private:
/// Handles the block placing packet when it is a real block placement (not block-using, item-using or eating)
void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler);
+
+ /// Processes the messages in m_PendingMessages; called from the Tick thread
+ void ProcessPendingMessages(void);
// cSocketThreads::cCallback overrides:
virtual void DataReceived (const char * a_Data, int a_Size) override; // Data is received from the client