1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-05 01:10:22 +02:00

Add propper client initialization

-add client states to avoid server sending data to uninitialized clients
  -don't show uninitialized clients to other players
  -propper client disconnect handling
Minor comment fixes in server
Minor bugfixes in connection
  -improved peer id calculation
  -honor NDEBUG flag
  -improved disconnect handling
  -increased initial send window
Remove some dead code
This commit is contained in:
sapier
2014-01-31 00:24:00 +01:00
parent 21f1bec724
commit e258675eab
10 changed files with 1818 additions and 1609 deletions

View File

@ -592,23 +592,12 @@ void *EmergeThread::Thread() {
/*
Set sent status of modified blocks on clients
*/
// NOTE: Server's clients are also behind the connection mutex
//conlock: consistently takes 30-40ms to acquire
JMutexAutoLock lock(m_server->m_con_mutex);
// Add the originally fetched block to the modified list
if (block)
modified_blocks[p] = block;
// Set the modified blocks unsent for all the clients
for (std::map<u16, RemoteClient*>::iterator
i = m_server->m_clients.begin();
i != m_server->m_clients.end(); ++i) {
RemoteClient *client = i->second;
if (modified_blocks.size() > 0) {
// Remove block from sent history
client->SetBlocksNotSent(modified_blocks);
}
if (modified_blocks.size() > 0) {
m_server->SetBlocksNotSent(modified_blocks);
}
}
catch (VersionMismatchException &e) {