]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
instead of sending a scoreboard update in the DropClient code, let it happen at the...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index a6c17364cb29166c29e415f2204503f20b5961b0..12efae46beb787ed582d8ce18fc44e577ce6778e 100644 (file)
--- a/host.c
+++ b/host.c
@@ -438,24 +438,6 @@ void SV_DropClient(qboolean crash)
                }
        }
 
-       // send notification to all clients
-       for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++)
-       {
-               if (!client->active)
-                       continue;
-               MSG_WriteByte(&client->message, svc_updatename);
-               MSG_WriteByte(&client->message, host_client->number);
-               MSG_WriteString(&client->message, "");
-               MSG_WriteByte(&client->message, svc_updatefrags);
-               MSG_WriteByte(&client->message, host_client->number);
-               MSG_WriteShort(&client->message, 0);
-               MSG_WriteByte(&client->message, svc_updatecolors);
-               MSG_WriteByte(&client->message, host_client->number);
-               MSG_WriteByte(&client->message, 0);
-       }
-
-       NetConn_Heartbeat(1);
-
        // free the client now
        if (host_client->entitydatabase)
                EntityFrame_FreeDatabase(host_client->entitydatabase);
@@ -465,6 +447,17 @@ void SV_DropClient(qboolean crash)
                EntityFrame5_FreeDatabase(host_client->entitydatabase5);
        // clear the client struct (this sets active to false)
        memset(host_client, 0, sizeof(*host_client));
+
+       // force next SV_UpdateToReliableMessages to update this client's
+       // scoreboard data by plugging in fake old values that don't match the
+       // new empty values
+       strlcpy(host_client->old_name, "nothing", sizeof(host_client->old_name));
+       host_client->old_frags = 1;
+       host_client->old_colors = 1;
+
+       // update server listing on the master because player count changed
+       // (which the master uses for filtering empty/full servers)
+       NetConn_Heartbeat(1);
 }
 
 /*