From 00f8c3a2251833f2d16ec89861a4377029cb2401 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 19 Jul 2020 16:29:49 +0100 Subject: Implement "caching" in ChunkDataSerializer + When sending a chunk to multiple clients, group them by protocol version and send the same data --- src/ClientHandle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 2a2c719b6..15b7238fe 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -2461,7 +2461,7 @@ void cClientHandle::SendChatSystem(const cCompositeChat & a_Message) -void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) +void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, const std::string_view a_ChunkData) { ASSERT(m_Player != nullptr); @@ -2490,7 +2490,7 @@ void cClientHandle::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerializ return; } - m_Protocol->SendChunkData(a_ChunkX, a_ChunkZ, a_Serializer); + m_Protocol->SendChunkData(a_ChunkData); // Add the chunk to the list of chunks sent to the player: { -- cgit v1.2.3