Removes unused ping smoothing feature (didn't actually compile so safe
to say nobody is using it). It could cause problems for QC mods that use
ping for antilag purposes, and QC can easily average pings if desired.
From bones_was_here
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13101
d7cf8633-e32d-0410-b094-
e92efae38249
vec_t cursor_fraction;
int cursor_entitynumber;
- double time; // time the move is executed for (cl_movement: clienttime, non-cl_movement: receivetime)
- double receivetime; // time the move was received at
- double clienttime; // time to which server state the move corresponds to
+ double time; // time the move is executed for (non-cl_movement is executed at receivetime)
+ double receivetime; // time the move was received at (used for ping)
int msec; // for predicted moves
int buttons;
int impulse;
int sendflags[NUM_CSQCENTITIES_PER_FRAME];
} csqcentityframedb_t;
-// if defined this does ping smoothing, otherwise it does not
-//#define NUM_PING_TIMES 16
-
#define NUM_SPAWN_PARMS 16
typedef struct client_s
/// PRVM_EDICT_NUM(clientnum+1)
prvm_edict_t *edict;
-#ifdef NUM_PING_TIMES
- float ping_times[NUM_PING_TIMES];
- /// ping_times[num_pings%NUM_PING_TIMES]
- int num_pings;
-#endif
/// LadyHavoc: can be used for prediction or whatever...
float ping;
client->movesequence = 0;
client->movement_highestsequence_seen = 0;
memset(&client->movement_count, 0, sizeof(client->movement_count));
-#ifdef NUM_PING_TIMES
- for (i = 0;i < NUM_PING_TIMES;i++)
- client->ping_times[i] = 0;
- client->num_pings = 0;
-#endif
client->ping = 0;
// allow the client some time to send his keepalives, even if map loading took ages
// read ping time
if (sv.protocol != PROTOCOL_QUAKE && sv.protocol != PROTOCOL_QUAKEDP && sv.protocol != PROTOCOL_NEHAHRAMOVIE && sv.protocol != PROTOCOL_NEHAHRABJP && sv.protocol != PROTOCOL_NEHAHRABJP2 && sv.protocol != PROTOCOL_NEHAHRABJP3 && sv.protocol != PROTOCOL_DARKPLACES1 && sv.protocol != PROTOCOL_DARKPLACES2 && sv.protocol != PROTOCOL_DARKPLACES3 && sv.protocol != PROTOCOL_DARKPLACES4 && sv.protocol != PROTOCOL_DARKPLACES5 && sv.protocol != PROTOCOL_DARKPLACES6)
move->sequence = MSG_ReadLong(&sv_message);
- move->time = move->clienttime = MSG_ReadFloat(&sv_message);
+ move->time = MSG_ReadFloat(&sv_message);
if (sv_message.badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
move->receivetime = (float)sv.time;
double moveframetime;
double oldframetime;
double oldframetime2;
-#ifdef NUM_PING_TIMES
- double total;
-#endif
+
if (sv_numreadmoves < 1)
return;
// only start accepting input once the player is spawned
host_client->movesequence = 0;
// make sure that normal physics takes over immediately
host_client->clmovement_inputtimeout = 0;
+ // update ping time
+ host_client->ping = host_client->cmd.receivetime - sv_readmoves[sv_numreadmoves-1].time;
}
-
- // calculate average ping time
- host_client->ping = host_client->cmd.receivetime - host_client->cmd.clienttime;
-#ifdef NUM_PING_TIMES
- host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = host_client->cmd.receivetime - host_client->cmd.clienttime;
- host_client->num_pings++;
- for (i=0, total = 0;i < NUM_PING_TIMES;i++)
- total += host_client->ping_times[i];
- host_client->ping = total / NUM_PING_TIMES;
-#endif
}
void SV_ApplyClientMove (void)