default setting change, random tinkering
authorPerttu Ahola <celeron55@gmail.com>
Mon, 29 Nov 2010 17:55:41 +0000 (19:55 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 29 Nov 2010 17:55:41 +0000 (19:55 +0200)
minetest.conf.example
src/main.cpp
src/map.h
src/server.cpp

index 16d9ba4e1da588f3007067fac338675a255f741a..e6c9832a5d785b009b98a392d6eba72b996882f6 100644 (file)
@@ -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
 
index f7b2b2c6baa84624d344cee4df98679e93d4f8bf..8ce19ed92f3c0f9d6146c9c001639f0b13394f26 100644 (file)
@@ -340,7 +340,7 @@ void set_default_settings()
        g_settings.set("ravines_amount", "1.0");\r
        g_settings.set("objectdata_interval", "0.2");\r
        g_settings.set("active_object_range", "2");\r
-       g_settings.set("max_simultaneous_block_sends_per_client", "2");\r
+       g_settings.set("max_simultaneous_block_sends_per_client", "1");\r
        g_settings.set("max_simultaneous_block_sends_server_total", "4");\r
 }\r
 \r
index 5b04ae9d17f0954aae24dffccd818b31831166b1..edfe5ef2a815c63f2a9ad6fd90fb1d14483d1626 100644 (file)
--- 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;
        }
 
index a4035284718defead7336bea5cd9fd84e0c9455c..99683615ab454b5a04402a6e5596f44016ef4063 100644 (file)
@@ -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()