From 2e5bdd06160599c0007fd360ec993a5d2753c924 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 8 Oct 2004 20:11:04 +0000 Subject: [PATCH] got rid of cl_nodelta cvar (it has never been useful, and rarely worked) got rid of ackframenum -1 handling removed ackframenum from entityframe4 and entityframe5 databases as they didn't use it for anything anyway (it is used only temporarily inside the AckFrame functions) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4612 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_input.c | 11 ++--------- protocol.c | 13 +++---------- protocol.h | 5 ----- sv_user.c | 2 +- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/cl_input.c b/cl_input.c index 9908c917..e5284397 100644 --- a/cl_input.c +++ b/cl_input.c @@ -244,8 +244,6 @@ cvar_t cl_pitchspeed = {CVAR_SAVE, "cl_pitchspeed","150"}; cvar_t cl_anglespeedkey = {CVAR_SAVE, "cl_anglespeedkey","1.5"}; -cvar_t cl_nodelta = {0, "cl_nodelta", "0"}; - /* ================ CL_AdjustAngles @@ -427,13 +425,10 @@ void CL_SendMove(usercmd_t *cmd) // FIXME: should ack latest 3 frames perhaps? if (cl.latestframenum > 0) { - i = cl.latestframenum; - if (cl_nodelta.integer) - i = -1; if (developer_networkentities.integer >= 1) - Con_Printf("send clc_ackentities %i\n", i); + Con_Printf("send clc_ackentities %i\n", cl.latestframenum); MSG_WriteByte(&buf, clc_ackentities); - MSG_WriteLong(&buf, i); + MSG_WriteLong(&buf, cl.latestframenum); } // deliver the message @@ -506,7 +501,5 @@ void CL_InitInput (void) Cmd_AddCommand ("-button7", IN_Button7Up); Cmd_AddCommand ("+button8", IN_Button8Down); Cmd_AddCommand ("-button8", IN_Button8Up); - - Cvar_RegisterVariable(&cl_nodelta); } diff --git a/protocol.c b/protocol.c index cb02e557..f22241e7 100644 --- a/protocol.c +++ b/protocol.c @@ -682,8 +682,7 @@ void EntityFrame_ClearDatabase(entityframe_database_t *d) void EntityFrame_AckFrame(entityframe_database_t *d, int frame) { int i; - if (d->ackframenum < frame) - d->ackframenum = frame; + d->ackframenum = frame; for (i = 0;i < d->numframes && d->frames[i].framenum < frame;i++); // ignore outdated frame acks (out of order packets) if (i == 0) @@ -801,7 +800,7 @@ void EntityFrame_WriteFrame(sizebuf_t *msg, entityframe_database_t *d, int numst EntityFrame_AddFrame(d, eye, d->latestframenum, numstates, states); - EntityFrame_FetchFrame(d, d->ackframenum > 0 ? d->ackframenum : -1, o); + EntityFrame_FetchFrame(d, d->ackframenum, o); MSG_WriteByte (msg, svc_entities); MSG_WriteLong (msg, o->framenum); @@ -1020,7 +1019,6 @@ entityframe4_database_t *EntityFrame4_AllocDatabase(mempool_t *pool) d = Mem_Alloc(pool, sizeof(*d)); d->mempool = pool; EntityFrame4_ResetDatabase(d); - d->ackframenum = -1; return d; } @@ -1038,7 +1036,6 @@ void EntityFrame4_FreeDatabase(entityframe4_database_t *d) void EntityFrame4_ResetDatabase(entityframe4_database_t *d) { int i; - d->ackframenum = -1; d->referenceframenum = -1; for (i = 0;i < MAX_ENTITY_HISTORY;i++) d->commit[i].numentities = 0; @@ -1141,7 +1138,7 @@ void EntityFrame4_CL_ReadFrame(void) if (!d->commit[i].numentities) { d->currentcommit = d->commit + i; - d->currentcommit->framenum = d->ackframenum = framenum; + d->currentcommit->framenum = framenum; d->currentcommit->numentities = 0; } } @@ -1356,7 +1353,6 @@ void EntityFrame5_ResetDatabase(entityframe5_database_t *d) int i; memset(d, 0, sizeof(*d)); d->latestframenum = 0; - d->ackframenum = -1; for (i = 0;i < MAX_EDICTS;i++) d->states[i] = defaultstate; } @@ -1773,9 +1769,6 @@ void EntityFrame5_AckFrame(entityframe5_database_t *d, int framenum, int viewent int i, j, k, l, bits; entityframe5_changestate_t *s, *s2; entityframe5_packetlog_t *p, *p2; - if (framenum <= d->ackframenum) - return; - d->ackframenum = framenum; // scan for packets made obsolete by this ack for (i = 0, p = d->packetlog;i < ENTITYFRAME5_MAXPACKETLOGS;i++, p++) { diff --git a/protocol.h b/protocol.h index 1e78cf34..c0e96df3 100644 --- a/protocol.h +++ b/protocol.h @@ -592,9 +592,6 @@ typedef struct entity_database4_s int currententitynumber; // (server only) int latestframenumber; - // (client only) most recently received frame number to be sent in next - // input update - int ackframenum; } entityframe4_database_t; @@ -716,8 +713,6 @@ typedef struct entityframe5_database_s { // number of the latest message sent to client int latestframenum; - // number of the latest message acknowledged by client - int ackframenum; // logs of all recently sent messages (between acked and latest) entityframe5_packetlog_t packetlog[ENTITYFRAME5_MAXPACKETLOGS]; diff --git a/sv_user.c b/sv_user.c index 147a5552..fc0af458 100644 --- a/sv_user.c +++ b/sv_user.c @@ -768,7 +768,7 @@ void SV_ReadClientMessage(void) if (host_client->entitydatabase) EntityFrame_AckFrame(host_client->entitydatabase, num); else if (host_client->entitydatabase4) - EntityFrame4_AckFrame(host_client->entitydatabase4, host_client->entitydatabase4->ackframenum, true); + EntityFrame4_AckFrame(host_client->entitydatabase4, num, true); else if (host_client->entitydatabase5) EntityFrame5_AckFrame(host_client->entitydatabase5, num, host_client - svs.clients + 1); break; -- 2.39.2