qbyte signon_buf[NET_MAXMESSAGE];
} server_t;
+// if defined this does ping smoothing, otherwise it does not
+//#define NUM_PING_TIMES 16
-#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
// LordHavoc: can be used for prediction or whatever...
float ping;
void SV_ApplyClientMove (void)
{
+#ifdef NUM_PING_TIMES
int i;
- prvm_eval_t *val;
float total;
+#endif
+ prvm_eval_t *val;
usercmd_t *move = &host_client->cmd;
// calculate average ping time
+ host_client->ping = move->receivetime - move->time;
+#ifdef NUM_PING_TIMES
host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = move->receivetime - move->time;
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
// set the edict fields
host_client->edict->fields.server->button0 = move->buttons & 1;