summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-28 15:44:20 +0200
committerGitHub <noreply@github.com>2021-03-28 15:44:20 +0200
commit2687f2df30210ada485c28c98e52db08d460d5a3 (patch)
treed0b25a9c996c1dd72e3ed4840dded5e8642d4342 /src/ClientHandle.h
parentDo not fake a tool when converting to pickups (#5170) (diff)
downloadcuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.gz
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.bz2
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.lz
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.xz
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.tar.zst
cuberite-2687f2df30210ada485c28c98e52db08d460d5a3.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 983cb039d..d18b66280 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -105,6 +105,9 @@ public: // tolua_export
We use Version-3 UUIDs for offline UUIDs, online UUIDs are Version-4, thus we can tell them apart. */
static bool IsUUIDOnline(const cUUID & a_UUID); // Exported in ManualBindings.cpp
+ /** Flushes all buffered outgoing data to the network. */
+ void ProcessProtocolOut();
+
/** Formats the type of message with the proper color and prefix for sending to the client. */
static AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData);
@@ -443,13 +446,17 @@ private:
/** Protects m_IncomingData against multithreaded access. */
cCriticalSection m_CSIncomingData;
- /** Queue for the incoming data received on the link until it is processed in Tick().
+ /** Queue for the incoming data received on the link until it is processed in ProcessProtocolIn().
Protected by m_CSIncomingData. */
ContiguousByteBuffer m_IncomingData;
/** Protects m_OutgoingData against multithreaded access. */
cCriticalSection m_CSOutgoingData;
+ /** Buffer for storing outgoing data from any thread; will get sent in ProcessProtocolOut() at the end of each tick.
+ Protected by m_CSOutgoingData. */
+ ContiguousByteBuffer m_OutgoingData;
+
/** A pointer to a World-owned player object, created in FinishAuthenticate when authentication succeeds.
The player should only be accessed from the tick thread of the World that owns him.
After the player object is handed off to the World, lifetime is managed automatically, guaranteed to outlast this client handle.