]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
centered quake hud in deathmatch, this makes the new score block visible
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 66f4fa76a5478d8a74dfe40cff4221a17959ab73..fa64cf64e16bb35ec03d5bd21e8afe6382706188 100644 (file)
--- a/host.c
+++ b/host.c
@@ -222,7 +222,7 @@ void Host_SaveConfig_f(void)
 // dedicated servers initialize the host but don't parse and set the
 // config.cfg cvars
        // LordHavoc: don't save a config if it crashed in startup
-       if (host_framecount >= 3 && cls.state != ca_dedicated && !COM_CheckParm("-benchmark"))
+       if (host_framecount >= 3 && cls.state != ca_dedicated && !COM_CheckParm("-benchmark") && !COM_CheckParm("-capturedemo"))
        {
                f = FS_Open ("config.cfg", "wb", false, false);
                if (!f)
@@ -369,7 +369,7 @@ if (crash = true), don't bother sending signofs
 void SV_DropClient(qboolean crash)
 {
        int i;
-       Con_Printf("Client \"%s^%i\" dropped\n", host_client->name, STRING_COLOR_DEFAULT);
+       Con_Printf("Client \"%s\" dropped\n", host_client->name);
 
        // make sure edict is not corrupt (from a level change for example)
        host_client->edict = PRVM_EDICT_NUM(host_client - svs.clients + 1);
@@ -386,9 +386,9 @@ void SV_DropClient(qboolean crash)
                        buf.data = bufdata;
                        buf.maxsize = sizeof(bufdata);
                        MSG_WriteByte(&buf, svc_disconnect);
-                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
-                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
-                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000);
+                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
+                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
+                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol, 10000, false);
                }
                // break the net connection
                NetConn_Close(host_client->netconnection);
@@ -1005,6 +1005,15 @@ static void Host_Init (void)
                Cbuf_Execute();
        }
 
+// COMMANDLINEOPTION: Client: -capturedemo <demoname> captures a playdemo and quits
+       i = COM_CheckParm("-capturedemo");
+       if (i && i + 1 < com_argc)
+       if (!sv.active && !cls.demoplayback && !cls.connect_trying)
+       {
+               Cbuf_AddText(va("playdemo %s\ncl_capturevideo 1\n", com_argv[i + 1]));
+               Cbuf_Execute();
+       }
+
        if (cls.state == ca_dedicated || COM_CheckParm("-listen"))
        if (!sv.active && !cls.demoplayback && !cls.connect_trying)
        {
@@ -1044,6 +1053,11 @@ void Host_Shutdown(void)
                Con_Print("recursive shutdown\n");
                return;
        }
+       if (setjmp(host_abortframe))
+       {
+               Con_Print("aborted the quitting frame?!?\n");
+               return;
+       }
        isdown = true;
 
        // be quiet while shutting down