Fix chunk block changes being sent out of order (#5169)
* Flush out all pending, buffered changes at the end of each tick, after every chunk is ticked. This makes every block update client-side in unison, instead of unlucky ones only being sent 1 tick later.
* Re-add buffer for outgoing network data; IOCP async WSASend has higher overhead than expected... Fixes regression introduced in 054a89dd9
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user