aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-11-29 19:55:41 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-11-29 19:55:41 +0200
commitc51fef56a89d91f1c014aeb14cc0b3f9d22d81f8 (patch)
treeb46104e842c74be5e9d0d879a34a34e52efddfbe
parentd10627a77fe022263e2319be282fbec68e713545 (diff)
downloadminetest-c51fef56a89d91f1c014aeb14cc0b3f9d22d81f8.tar.gz
minetest-c51fef56a89d91f1c014aeb14cc0b3f9d22d81f8.tar.bz2
minetest-c51fef56a89d91f1c014aeb14cc0b3f9d22d81f8.zip
default setting change, random tinkering
-rw-r--r--minetest.conf.example2
-rw-r--r--src/main.cpp2
-rw-r--r--src/map.h4
-rw-r--r--src/server.cpp15
4 files changed, 16 insertions, 7 deletions
diff --git a/minetest.conf.example b/minetest.conf.example
index 16d9ba4e1..e6c9832a5 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -50,6 +50,6 @@
#active_object_range = 2
-#max_simultaneous_block_sends_per_client = 2
+#max_simultaneous_block_sends_per_client = 1
#max_simultaneous_block_sends_server_total = 4
diff --git a/src/main.cpp b/src/main.cpp
index f7b2b2c6b..8ce19ed92 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -340,7 +340,7 @@ void set_default_settings()
g_settings.set("ravines_amount", "1.0");
g_settings.set("objectdata_interval", "0.2");
g_settings.set("active_object_range", "2");
- g_settings.set("max_simultaneous_block_sends_per_client", "2");
+ g_settings.set("max_simultaneous_block_sends_per_client", "1");
g_settings.set("max_simultaneous_block_sends_server_total", "4");
}
diff --git a/src/map.h b/src/map.h
index 5b04ae9d1..edfe5ef2a 100644
--- a/src/map.h
+++ b/src/map.h
@@ -143,10 +143,10 @@ public:
*/
JMutexAutoLock * waitCaches()
{
- dstream<<"waitCaches() begin"<<std::endl;
+ //dstream<<"waitCaches() begin"<<std::endl;
JMutexAutoLock waitcachelock(m_waitcache_mutex);
JMutexAutoLock *lock = new JMutexAutoLock(m_cache_mutex);
- dstream<<"waitCaches() end"<<std::endl;
+ //dstream<<"waitCaches() end"<<std::endl;
return lock;
}
diff --git a/src/server.cpp b/src/server.cpp
index a40352847..99683615a 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -302,8 +302,10 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
d_start = m_nearest_unsent_d;
}
- u16 maximum_simultaneous_block_sends = g_settings.getU16
+ u16 maximum_simultaneous_block_sends_setting = g_settings.getU16
("max_simultaneous_block_sends_per_client");
+ u16 maximum_simultaneous_block_sends =
+ maximum_simultaneous_block_sends_setting;
/*
Check the time from last addNode/removeNode.
@@ -380,13 +382,20 @@ void RemoteClient::GetNextBlocks(Server *server, float dtime,
Also, don't send blocks that are already flying.
*/
- if(d > BLOCK_SEND_DISABLE_LIMITS_MAX_D)
+
+ u16 maximum_simultaneous_block_sends_now =
+ maximum_simultaneous_block_sends;
+
+ if(d <= BLOCK_SEND_DISABLE_LIMITS_MAX_D)
+ maximum_simultaneous_block_sends_now =
+ maximum_simultaneous_block_sends_setting;
+
{
JMutexAutoLock lock(m_blocks_sending_mutex);
// Limit is dynamically lowered when building
if(m_blocks_sending.size()
- >= maximum_simultaneous_block_sends)
+ >= maximum_simultaneous_block_sends_now)
{
/*dstream<<"Not sending more blocks. Queue full. "
<<m_blocks_sending.size()