From c1dd7cec47e2caee8ef405eff7a9b7e62f501397 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 9 Jan 2012 20:02:47 +0000 Subject: [PATCH] force a send if movesequence changed git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11644 d7cf8633-e32d-0410-b094-e92efae38249 --- server.h | 4 ++++ sv_main.c | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/server.h b/server.h index 18352eef..327bbd7a 100644 --- a/server.h +++ b/server.h @@ -302,6 +302,10 @@ typedef struct client_s // number of skipped entity frames // if it exceeds a limit, an empty entity frame is sent int num_skippedentityframes; + + // last sent move sequence + // if the move sequence changed, an empty entity frame is sent + int lastmovesequence; } client_t; diff --git a/sv_main.c b/sv_main.c index 27befbcf..8529655e 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1895,8 +1895,17 @@ static void SV_WriteEntitiesToClient(client_t *client, prvm_edict_t *clent, size else EntityFrameCSQC_WriteFrame(msg, maxsize, numcsqcsendstates, sv.writeentitiestoclient_csqcsendstates, 0); - if(client->num_skippedentityframes >= 10) - need_empty = true; // force every 10th frame to be not empty (or cl_movement replay takes too long) + // force every 16th frame to be not empty (or cl_movement replay takes + // too long) + // BTW, this should normally not kick in any more due to the check + // below, except if the client stopped sending movement frames + if(client->num_skippedentityframes >= 16) + need_empty = true; + + // help cl_movement a bit more + if(client->movesequence != client->lastmovesequence) + need_empty = true; + client->lastmovesequence = client->movesequence; if (client->entitydatabase5) success = EntityFrame5_WriteFrame(msg, maxsize, client->entitydatabase5, numsendstates, sv.writeentitiestoclient_sendstates, client - svs.clients + 1, client->movesequence, need_empty); -- 2.39.2