From 4fd6c79d49564d7a5de3711230daacb84bfe30a6 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 19 Oct 2004 09:54:36 +0000 Subject: [PATCH] instead of sending a scoreboard update in the DropClient code, let it happen at the next SV_UpdateToReliableMessages git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4671 d7cf8633-e32d-0410-b094-e92efae38249 --- host.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/host.c b/host.c index a6c17364..12efae46 100644 --- 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); } /* -- 2.39.2