]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
Fix setinfo.
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index a54067af5250d3d20aaba69fe285f418f5a3e019..8fc6c0827ee1471c51f404285da4f425f42940c3 100644 (file)
--- a/host.c
+++ b/host.c
@@ -23,9 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include <time.h>
 #include "libcurl.h"
-#ifdef CONFIG_CD
 #include "cdaudio.h"
-#endif
 #include "cl_video.h"
 #include "progsvm.h"
 #include "csprogs.h"
@@ -212,7 +210,7 @@ static void Host_ServerOptions (void)
                else
                {
                        // default players in some games, singleplayer in most
-                       if (gamemode != GAME_GOODVSBAD2 && gamemode != GAME_NEXUIZ && gamemode != GAME_XONOTIC && gamemode != GAME_BATTLEMECH)
+                       if (gamemode != GAME_GOODVSBAD2 && !IS_NEXUIZ_DERIVED(gamemode) && gamemode != GAME_BATTLEMECH)
                                svs.maxclients = 1;
                }
        }
@@ -679,6 +677,7 @@ void Host_Main(void)
        Host_Init();
 
        realtime = 0;
+       host_dirtytime = Sys_DirtyTime();
        for (;;)
        {
                if (setjmp(host_abortframe))
@@ -803,8 +802,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;
@@ -1016,6 +1019,7 @@ void Host_Main(void)
                        R_TimeReport("client");
 
                        CL_UpdateScreen();
+                       CL_MeshEntities_Reset();
                        R_TimeReport("render");
 
                        if (host_speeds.integer)
@@ -1030,10 +1034,8 @@ void Host_Main(void)
                        else
                                S_Update(&r_refdef.view.matrix);
 
-#ifdef CONFIG_CD
                        CDAudio_Update();
                        R_TimeReport("audio");
-#endif
 
                        // reset gathering of mouse input
                        in_mouse_x = in_mouse_y = 0;
@@ -1081,9 +1083,7 @@ void Host_StartVideo(void)
                // make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
                NetConn_UpdateSockets();
                VID_Start();
-#ifdef CONFIG_CD
                CDAudio_Startup();
-#endif
        }
 }
 
@@ -1286,9 +1286,7 @@ static void Host_Init (void)
                VID_Init();
                Render_Init();
                S_Init();
-#ifdef CONFIG_CD
                CDAudio_Init();
-#endif
                Key_Init();
                CL_Init();
        }
@@ -1430,9 +1428,7 @@ void Host_Shutdown(void)
 
        Host_SaveConfig();
 
-#ifdef CONFIG_CD
        CDAudio_Shutdown ();
-#endif
        S_Terminate ();
        Curl_Shutdown ();
        NetConn_Shutdown ();