Skip to content

Commit

Permalink
Make sending downloads using legacy protocol work with sv_dlRate 1000
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed Aug 23, 2015
1 parent 188ca86 commit 9592870
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions code/server/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions code/server/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 4 additions & 6 deletions code/server/sv_snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9592870

Please sign in to comment.