From 8a013d7add6cad22c1752a6c6a5a17a668463538 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 12 Feb 2006 02:55:42 +0000 Subject: [PATCH] fix problems with changelevel causing network compression to stop working (bug introduced when SV_SendReconnect was rewritten quite some time ago), this was happening because the compression database was being freed on level change and reallocated, and thus producing older entity frame numbers that the client refused git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5966 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_main.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/sv_main.c b/sv_main.c index b817cc97..ef06333b 100644 --- a/sv_main.c +++ b/sv_main.c @@ -308,23 +308,6 @@ void SV_SendServerinfo (client_t *client) // LordHavoc: clear entityframe tracking client->latestframenum = 0; - if (client->entitydatabase) - EntityFrame_FreeDatabase(client->entitydatabase); - if (client->entitydatabase4) - EntityFrame4_FreeDatabase(client->entitydatabase4); - if (client->entitydatabase5) - EntityFrame5_FreeDatabase(client->entitydatabase5); - - if (sv.protocol != PROTOCOL_QUAKE && sv.protocol != PROTOCOL_QUAKEDP && sv.protocol != PROTOCOL_NEHAHRAMOVIE) - { - if (sv.protocol == PROTOCOL_DARKPLACES1 || sv.protocol == PROTOCOL_DARKPLACES2 || sv.protocol == PROTOCOL_DARKPLACES3) - client->entitydatabase = EntityFrame_AllocDatabase(sv_mempool); - else if (sv.protocol == PROTOCOL_DARKPLACES4) - client->entitydatabase4 = EntityFrame4_AllocDatabase(sv_mempool); - else - client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_mempool); - } - SZ_Clear (&client->netconnection->message); MSG_WriteByte (&client->netconnection->message, svc_print); dpsnprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, prog->filecrc); @@ -435,7 +418,19 @@ void SV_ConnectClient (int clientnum, netconn_t *netconnection) // don't call SendServerinfo for a fresh botclient because its fields have // not been set up by the qc yet if (client->netconnection) + { SV_SendServerinfo (client); + if (sv.protocol != PROTOCOL_QUAKE && sv.protocol != PROTOCOL_QUAKEDP && sv.protocol != PROTOCOL_NEHAHRAMOVIE) + { + if (sv.protocol == PROTOCOL_DARKPLACES1 || sv.protocol == PROTOCOL_DARKPLACES2 || sv.protocol == PROTOCOL_DARKPLACES3) + client->entitydatabase = EntityFrame_AllocDatabase(sv_mempool); + else if (sv.protocol == PROTOCOL_DARKPLACES4) + client->entitydatabase4 = EntityFrame4_AllocDatabase(sv_mempool); + else + client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_mempool); + } + + } else client->spawned = true; } -- 2.39.2