summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2015-03-09 22:32:12 +0100
committerHowaner <franzi.moos@googlemail.com>2015-03-09 22:32:12 +0100
commitce6219530a2a3e6550967b21bad8ad9a2145c465 (patch)
tree6289561eb5c52efe2d99f49d1e1c563fe2cda8fc
parentMerge pull request #1794 from mc-server/MesaPlateauF (diff)
downloadcuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar.gz
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar.bz2
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar.lz
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar.xz
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.tar.zst
cuberite-ce6219530a2a3e6550967b21bad8ad9a2145c465.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index e05fa4a99..00ac1fdb1 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -776,10 +776,22 @@ void cChunk::BroadcastPendingBlockChanges(void)
{
return;
}
-
- for (cClientHandleList::iterator itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr)
+
+ if (m_PendingSendBlocks.size() >= 10240)
+ {
+ // Resend the full chunk
+ for (cClientHandleList::iterator itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr)
+ {
+ m_World->ForceSendChunkTo(m_PosX, m_PosZ, cChunkSender::E_CHUNK_PRIORITY_MEDIUM, (*itr));
+ }
+ }
+ else
{
- (*itr)->SendBlockChanges(m_PosX, m_PosZ, m_PendingSendBlocks);
+ // Only send block changes
+ for (cClientHandleList::iterator itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr)
+ {
+ (*itr)->SendBlockChanges(m_PosX, m_PosZ, m_PendingSendBlocks);
+ }
}
m_PendingSendBlocks.clear();
}