]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fixup! Instead, run additional client network frames after every select() sleep. divVerent/fix-checkforpacketsduringsleep
authorRudolf Polzer <divverent@xonotic.org>
Thu, 10 Oct 2013 05:08:30 +0000 (07:08 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 10 Oct 2013 05:10:06 +0000 (07:10 +0200)
host.c

diff --git a/host.c b/host.c
index 6102ffec8fb50dff3a3c352576ee7794ec66c19c..7e7bc56a7f2950de8df0e6c6a9ffa52273338326 100644 (file)
--- a/host.c
+++ b/host.c
@@ -804,8 +804,12 @@ void Host_Main(void)
                                wait = 1; // because we cast to int
 
                        time0 = Sys_DirtyTime();
-                       if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded)
+                       if (sv_checkforpacketsduringsleep.integer && !sys_usenoclockbutbenchmark.integer && !svs.threaded) {
                                NetConn_SleepMicroseconds((int)wait);
+                               if (cls.state != ca_dedicated)
+                                       NetConn_ClientFrame(); // helps server browser get good ping values
+                               // TODO can we do the same for ServerFrame? Probably not.
+                       }
                        else
                                Sys_Sleep((int)wait);
                        delta = Sys_DirtyTime() - time0;
@@ -1049,10 +1053,6 @@ void Host_Main(void)
                                                        pass1+pass2+pass3, pass1, pass2, pass3);
                        }
                }
-               else if (cls.state != ca_dedicated)
-               {
-                       NetConn_ClientFrame();
-               }
 
 #if MEMPARANOIA
                Mem_CheckSentinelsGlobal();