]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
changed behavior of r_showtris (now only affects geometry in the game view, not sky...
[xonotic/darkplaces.git] / sv_main.c
index 39a9d48a6fbce1b5629ee13d870d5303ccd92456..923617c6b969cefb0a5b1c82213071d38b849043 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -408,7 +408,8 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection)
        strcpy(client->old_name, "unconnected");
        client->spawned = false;
        client->edict = PRVM_EDICT_NUM(clientnum+1);
-       client->netconnection->message.allowoverflow = true;            // we can catch it
+       if (client->netconnection)
+               client->netconnection->message.allowoverflow = true;            // we can catch it
        // updated by receiving "rate" command from client
        client->rate = NET_MINRATE;
        // no limits for local player
@@ -1206,6 +1207,8 @@ qboolean SV_SendClientDatagram (client_t *client)
                if (sv_maxrate.integer != maxrate)
                        Cvar_SetValueQuick(&sv_maxrate, maxrate);
 
+               // this rate limiting does not understand sys_ticrate 0
+               // (but no one should be running that on a server!)
                rate = bound(NET_MINRATE, client->rate, maxrate);
                rate = (int)(client->rate * sys_ticrate.value);
                maxsize = bound(100, rate, 1400);
@@ -1606,36 +1609,6 @@ void SV_CreateBaseline (void)
 }
 
 
-/*
-================
-SV_SendReconnect
-
-Tell all the clients that the server is changing levels
-================
-*/
-void SV_SendReconnect (void)
-{
-#if 1
-       MSG_WriteByte(&sv.reliable_datagram, svc_stufftext);
-       MSG_WriteString(&sv.reliable_datagram, "reconnect\n");
-#else
-       unsigned char data[128];
-       sizebuf_t msg;
-
-       msg.data = data;
-       msg.cursize = 0;
-       msg.maxsize = sizeof(data);
-
-       MSG_WriteChar (&msg, svc_stufftext);
-       MSG_WriteString (&msg, "reconnect\n");
-       NetConn_SendToAll (&msg, 5);
-
-       if (cls.state != ca_dedicated)
-               Cmd_ExecuteString ("reconnect\n", src_command);
-#endif
-}
-
-
 /*
 ================
 SV_SaveSpawnparms
@@ -1748,8 +1721,10 @@ void SV_SpawnServer (const char *server)
 //
        if (sv.active)
        {
+               // Tell all the clients that the server is changing levels
                SV_VM_Begin();
-               SV_SendReconnect();
+               MSG_WriteByte(&sv.reliable_datagram, svc_stufftext);
+               MSG_WriteString(&sv.reliable_datagram, "reconnect\n");
                SV_VM_End();
        }
        else