if(IS_REAL_CLIENT(p))
{
- if(p.latency_cnt)
+ if(CS(p).latency_cnt)
{
- float latency = (p.latency_sum / p.latency_cnt);
+ float latency = (CS(p).latency_sum / CS(p).latency_cnt);
if(latency) { PS_GR_P_ADDVAL(p, PLAYERSTATS_AVGLATENCY, latency); }
}
}
ATTRIB(Client, just_joined, bool, this.just_joined);
ATTRIB(Client, race_completed, bool, this.race_completed);
ATTRIBARRAY(Client, msg_choice_choices, int, 50); // TODO: actually NOTIF_CHOICE_MAX
+ ATTRIB(Client, latency_sum, float, this.latency_sum);
+ ATTRIB(Client, latency_cnt, int, this.latency_cnt);
+ ATTRIB(Client, latency_time, float, this.latency_time);
METHOD(Client, m_unwind, bool(Client this));
WriteByte(MSG_BROADCAST, min(ceil(CS(e).ping_movementloss * 255), 255));
// record latency times for clients throughout the match so we can report it to playerstats
- if(time > (e.latency_time + LATENCY_THINKRATE))
+ if(time > (CS(e).latency_time + LATENCY_THINKRATE))
{
- e.latency_sum += CS(e).ping;
- e.latency_cnt += 1;
- e.latency_time = time;
- //print("sum: ", ftos(e.latency_sum), ", cnt: ", ftos(e.latency_cnt), ", avg: ", ftos(e.latency_sum / e.latency_cnt), ".\n");
+ CS(e).latency_sum += CS(e).ping;
+ CS(e).latency_cnt += 1;
+ CS(e).latency_time = time;
+ //print("sum: ", ftos(CS(e).latency_sum), ", cnt: ", ftos(CS(e).latency_cnt), ", avg: ", ftos(CS(e).latency_sum / CS(e).latency_cnt), ".\n");
}
}
else