From 2687f2df30210ada485c28c98e52db08d460d5a3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 14:44:20 +0100 Subject: 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 --- src/Chunk.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index c51794d24..405f5253e 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -53,6 +53,9 @@ public: cChunk(const cChunk & Other) = delete; ~cChunk(); + /** Flushes the pending block (entity) queue, and clients' outgoing data buffers. */ + void BroadcastPendingChanges(void); + /** Returns true iff the chunk block data is valid (loaded / generated) */ bool IsValid(void) const {return (m_Presence == cpPresent); } @@ -546,9 +549,6 @@ private: /** Wakes up each simulator for its specific blocks; through all the blocks in the chunk */ void WakeUpSimulators(void); - /** Sends m_PendingSendBlocks to all clients */ - void BroadcastPendingBlockChanges(void); - /** Checks the block scheduled for checking in m_ToTickBlocks[] */ void CheckBlocks(); -- cgit v1.2.3