From 95928708f7927f57940a5ca6aaeb3daeb9c1061a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 22 Aug 2015 21:49:33 -0500 Subject: [PATCH] Make sending downloads using legacy protocol work with sv_dlRate 1000 Send snapshot with each download block so that client updates reliable acknowledge, otherwise client can error when asking for next block via nextdl reliable command. --- code/server/server.h | 3 +++ code/server/sv_client.c | 9 +++++++-- code/server/sv_snapshot.c | 10 ++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/code/server/server.h b/code/server/server.h index 407d6ab6..fcce31be 100644 --- a/code/server/server.h +++ b/code/server/server.h @@ -397,6 +397,9 @@ void SV_WriteFrameToClient (client_t *client, msg_t *msg); void SV_SendMessageToClient( msg_t *msg, client_t *client ); void SV_SendClientMessages( void ); void SV_SendClientSnapshot( client_t *client ); +#ifdef ELITEFORCE +void SV_WriteSnapshotToClient( client_t *client, msg_t *msg ); +#endif // // sv_game.c diff --git a/code/server/sv_client.c b/code/server/sv_client.c index 5d3bd3c9..17a6a96d 100644 --- a/code/server/sv_client.c +++ b/code/server/sv_client.c @@ -1259,9 +1259,14 @@ int SV_SendDownloadMessages(void) if(retval) { #ifdef ELITEFORCE - if(!msg.compat) + if(msg.compat) + { + // compat clients need svc_snapshot to update reliableAcknowledge + SV_WriteSnapshotToClient(cl, &msg); + } + else #endif - MSG_WriteByte(&msg, svc_EOF); + MSG_WriteByte(&msg, svc_EOF); SV_Netchan_Transmit(cl, &msg); numDLs += retval; } diff --git a/code/server/sv_snapshot.c b/code/server/sv_snapshot.c index b249d520..8af9a6b6 100644 --- a/code/server/sv_snapshot.c +++ b/code/server/sv_snapshot.c @@ -119,7 +119,10 @@ static void SV_EmitPacketEntities( clientSnapshot_t *from, clientSnapshot_t *to, SV_WriteSnapshotToClient ================== */ -static void SV_WriteSnapshotToClient( client_t *client, msg_t *msg ) { +#ifndef ELITEFORCE +static +#endif +void SV_WriteSnapshotToClient( client_t *client, msg_t *msg ) { clientSnapshot_t *frame, *oldframe; int lastframe; int i; @@ -671,12 +674,7 @@ void SV_SendClientMessages(void) if(!c->state) continue; // not connected -#ifdef ELITEFORCE - // compat clients need svc_snapshot to update reliableAcknowledge - if(*c->downloadName && !c->compat) -#else if(*c->downloadName) -#endif continue; // Client is downloading, don't send snapshots if(c->netchan.unsentFragments || c->netchan_start_queue)