summaryrefslogtreecommitdiff
path: root/src/emerge.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-01-31 00:24:00 +0100
committersapier <Sapier at GMX dot net>2014-01-31 18:44:43 +0100
commite258675eabc874d31bc9c6cf49e4bbc1f7f3f417 (patch)
tree2d9dfd872c8b88db13cfdeaa0503b3d88545d179 /src/emerge.cpp
parent21f1bec72433748e220d19e97a846df83340518e (diff)
downloadminetest-e258675eabc874d31bc9c6cf49e4bbc1f7f3f417.tar.gz
minetest-e258675eabc874d31bc9c6cf49e4bbc1f7f3f417.tar.bz2
minetest-e258675eabc874d31bc9c6cf49e4bbc1f7f3f417.zip
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
Diffstat (limited to 'src/emerge.cpp')
-rw-r--r--src/emerge.cpp15
1 files changed, 2 insertions, 13 deletions
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<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) {