]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
reworked sendsignon logic so that unlimited sends are allowed once
[xonotic/darkplaces.git] / sv_main.c
index 6c4516dfedd4c9783c9433203250524db77b1326..facd0dabac503df32158197604a1a2693608d83b 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -714,7 +714,7 @@ void SV_SendServerinfo (client_t *client)
        MSG_WriteByte (&client->netconnection->message, 1);
 
        client->spawned = false;                // need prespawn, spawn, etc
-       client->sendsignon = true;              // send this message, this will be cleared later
+       client->sendsignon = 1;                 // send this message, and increment to 2, 2 will be set to 0 by the prespawn command
 
        // clear movement info until client enters the new level properly
        memset(&client->cmd, 0, sizeof(client->cmd));
@@ -1684,9 +1684,9 @@ static void SV_SendClientDatagram (client_t *client)
        }
 
 // send the datagram
-       NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, !client->spawned && !client->sendsignon);
-       if (!client->netconnection->message.cursize)
-               client->sendsignon = false;
+       NetConn_SendUnreliableMessage (client->netconnection, &msg, sv.protocol, clientrate, client->sendsignon == 2);
+       if (client->sendsignon == 1 && !client->netconnection->message.cursize)
+               client->sendsignon = 2; // prevent reliable until client sends prespawn (this is the keepalive phase)
 }
 
 /*