From e258675eabc874d31bc9c6cf49e4bbc1f7f3f417 Mon Sep 17 00:00:00 2001 From: sapier Date: Fri, 31 Jan 2014 00:24:00 +0100 Subject: 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 --- src/emerge.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/emerge.cpp') diff --git a/src/emerge.cpp b/src/emerge.cpp index bd9b7c7bd..f63bc5dfe 100644 --- a/src/emerge.cpp +++ b/src/emerge.cpp @@ -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::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) { -- cgit v1.2.3