mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Resend blocks when modified while sending to client
This commit is contained in:
parent
2c72f6da7b
commit
089f9bbe81
2 changed files with 22 additions and 6 deletions
|
@ -370,17 +370,21 @@ queue_full_break:
|
|||
|
||||
void RemoteClient::GotBlock(v3s16 p)
|
||||
{
|
||||
if(m_blocks_sending.find(p) != m_blocks_sending.end())
|
||||
m_blocks_sending.erase(p);
|
||||
else
|
||||
{
|
||||
m_excess_gotblocks++;
|
||||
if (m_blocks_modified.find(p) == m_blocks_modified.end()) {
|
||||
if (m_blocks_sending.find(p) != m_blocks_sending.end())
|
||||
m_blocks_sending.erase(p);
|
||||
else
|
||||
m_excess_gotblocks++;
|
||||
|
||||
m_blocks_sent.insert(p);
|
||||
}
|
||||
m_blocks_sent.insert(p);
|
||||
}
|
||||
|
||||
void RemoteClient::SentBlock(v3s16 p)
|
||||
{
|
||||
if (m_blocks_modified.find(p) != m_blocks_modified.end())
|
||||
m_blocks_modified.erase(p);
|
||||
|
||||
if(m_blocks_sending.find(p) == m_blocks_sending.end())
|
||||
m_blocks_sending[p] = 0.0;
|
||||
else
|
||||
|
@ -397,6 +401,7 @@ void RemoteClient::SetBlockNotSent(v3s16 p)
|
|||
m_blocks_sending.erase(p);
|
||||
if(m_blocks_sent.find(p) != m_blocks_sent.end())
|
||||
m_blocks_sent.erase(p);
|
||||
m_blocks_modified.insert(p);
|
||||
}
|
||||
|
||||
void RemoteClient::SetBlocksNotSent(std::map<v3s16, MapBlock*> &blocks)
|
||||
|
@ -409,6 +414,7 @@ void RemoteClient::SetBlocksNotSent(std::map<v3s16, MapBlock*> &blocks)
|
|||
i != blocks.end(); ++i)
|
||||
{
|
||||
v3s16 p = i->first;
|
||||
m_blocks_modified.insert(p);
|
||||
|
||||
if(m_blocks_sending.find(p) != m_blocks_sending.end())
|
||||
m_blocks_sending.erase(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue