Possibly fixed the extremely rare PeerNotFound loop bug.
authorPerttu Ahola <celeron55@gmail.com>
Mon, 22 Aug 2011 18:27:11 +0000 (21:27 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 22 Aug 2011 18:27:11 +0000 (21:27 +0300)
See explanation in http://2pktfkt.de/irc/minetest-delta/2011-08-22.html

src/server.cpp

index f665920477e89790ed79a55ec713942b87630871..6bcd1d0589e5028a5152e345826f6be99e296b56 100644 (file)
@@ -1252,6 +1252,20 @@ void Server::AsyncRunStep()
                m_uptime.set(m_uptime.get() + dtime);
        }
        
+       {
+               // Process connection's timeouts
+               JMutexAutoLock lock2(m_con_mutex);
+               ScopeProfiler sp(&g_profiler, "Server: connection timeout processing");
+               m_con.RunTimeouts(dtime);
+       }
+       
+       {
+               // This has to be called so that the client list gets synced
+               // with the peer list of the connection
+               ScopeProfiler sp(&g_profiler, "Server: peer change handling");
+               handlePeerChanges();
+       }
+
        /*
                Update m_time_of_day and overall game time
        */
@@ -1294,20 +1308,6 @@ void Server::AsyncRunStep()
                }
        }
 
-       {
-               // Process connection's timeouts
-               JMutexAutoLock lock2(m_con_mutex);
-               ScopeProfiler sp(&g_profiler, "Server: connection timeout processing");
-               m_con.RunTimeouts(dtime);
-       }
-       
-       {
-               // This has to be called so that the client list gets synced
-               // with the peer list of the connection
-               ScopeProfiler sp(&g_profiler, "Server: peer change handling");
-               handlePeerChanges();
-       }
-
        {
                JMutexAutoLock lock(m_env_mutex);
                // Step environment