]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
reworked packet sending code a bit more, this is mostly just a cleanup, not a change...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index f72a7e097fb302e51a0b7a4ef4b74dab1edb0d4e..a9050113221d2280bf956332a08df2a15f741a87 100644 (file)
--- a/host.c
+++ b/host.c
@@ -267,7 +267,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)
+       if (host_framecount >= 3 && cls.state != ca_dedicated && !COM_CheckParm("-benchmark"))
        {
                f = FS_Open ("config.cfg", "wb", false, false);
                if (!f)
@@ -350,7 +350,7 @@ void SV_BroadcastPrint(const char *msg)
 
        for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++)
        {
-               if (client->spawned && client->netconnection)
+               if (client->active && client->netconnection)
                {
                        MSG_WriteByte(&client->netconnection->message, svc_print);
                        MSG_WriteString(&client->netconnection->message, msg);
@@ -454,11 +454,18 @@ void SV_DropClient(qboolean crash)
                prog->globals.server->self = saveSelf;
        }
 
+       // if a download is active, close it
+       if (host_client->download_file)
+       {
+               Con_DPrintf("Download of %s aborted when %s dropped\n", host_client->download_name, host_client->name);
+               FS_Close(host_client->download_file);
+               host_client->download_file = NULL;
+               host_client->download_name[0] = 0;
+               host_client->download_expectedposition = 0;
+               host_client->download_started = false;
+       }
+
        // remove leaving player from scoreboard
-       //host_client->edict->fields.server->netname = PRVM_SetEngineString(host_client->name);
-       //if ((val = PRVM_GETEDICTFIELDVALUE(host_client->edict, eval_clientcolors)))
-       //      val->_float = 0;
-       //host_client->edict->fields.server->frags = 0;
        host_client->name[0] = 0;
        host_client->colors = 0;
        host_client->frags = 0;
@@ -790,7 +797,7 @@ void Host_Main(void)
                                cl.time += frametime;
 
                                // Collect input into cmd
-                               CL_Move();
+                               CL_Input();
 
                                NetConn_ClientFrame();
 
@@ -963,6 +970,7 @@ static void Host_Init (void)
        //PR_Cmd_Init();
        PRVM_Init();
        Mod_Init();
+       World_Init();
        SV_Init();
        Host_InitCommands();
        Host_InitLocal();