]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
rewrote server sendstates building code, no longer builds two
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 2ce7a994f3ad214e6aa2ae5a5ec6b5b01f5595d9..3e1ba42a2ae36babb0036bb75592e9c0c5576abb 100644 (file)
--- a/host.c
+++ b/host.c
@@ -418,7 +418,7 @@ if (crash = true), don't bother sending signofs
 void SV_DropClient(qboolean crash)
 {
        int i;
-       Con_Printf("Client \"%s\" dropped\n", host_client->name);
+       Con_Printf("Client \"%s^%i\" dropped\n", host_client->name, STRING_COLOR_DEFAULT);
 
        // make sure edict is not corrupt (from a level change for example)
        host_client->edict = PRVM_EDICT_NUM(host_client - svs.clients + 1);
@@ -435,9 +435,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);
-                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol);
-                       NetConn_SendUnreliableMessage(host_client->netconnection, &buf, sv.protocol);
+                       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);
                }
                // break the net connection
                NetConn_Close(host_client->netconnection);
@@ -731,17 +731,14 @@ void Host_Main(void)
                                if (sv.frametime)
                                        SV_Physics();
 
-                               // send all messages to the clients
-                               SV_SendClientMessages();
-
-                               // clear the general datagram
-                               SV_ClearDatagram();
-
                                // if this server frame took too long, break out of the loop
                                if (framelimit > 1 && Sys_DoubleTime() >= aborttime)
                                        break;
                        }
 
+                       // send all messages to the clients
+                       SV_SendClientMessages();
+
                        // end the server VM frame
                        SV_VM_End();
 
@@ -774,7 +771,7 @@ void Host_Main(void)
                                clframetime = cl.realframetime = 0.1;
 
                        // apply slowmo scaling
-                       clframetime *= slowmo.value;
+                       clframetime *= cl.movevars_slowmo;
 
                        // host_framerate overrides all else
                        if (host_framerate.value)
@@ -792,16 +789,17 @@ void Host_Main(void)
                        // Collect input into cmd
                        CL_Input();
 
+                       // check for new packets
                        NetConn_ClientFrame();
 
-                       if (cls.state == ca_connected)
-                       {
-                               CL_ReadFromServer();
-                               // if running the server remotely, send intentions now after
-                               // the incoming messages have been read
-                               //if (!cl.islocalgame)
-                               //      CL_SendCmd();
-                       }
+                       // read a new frame from a demo if needed
+                       CL_ReadDemoMessage();
+
+                       // now that packets have been read, send input to server
+                       CL_SendMove();
+
+                       // update client world (interpolate entities, create trails, etc)
+                       CL_UpdateWorld();
 
                        // update video
                        if (host_speeds.integer)
@@ -817,10 +815,10 @@ void Host_Main(void)
                                time2 = Sys_DoubleTime();
 
                        // update audio
-                       if(csqc_usecsqclistener)
+                       if(cl.csqc_usecsqclistener)
                        {
-                               S_Update(&csqc_listenermatrix);
-                               csqc_usecsqclistener = false;
+                               S_Update(&cl.csqc_listenermatrix);
+                               cl.csqc_usecsqclistener = false;
                        }
                        else
                                S_Update(&r_view.matrix);