mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
Do the incoming/outgoing sequence checks before doing anything.
This fixes the bogus ping times found while checking out klik with qqshka.
This commit is contained in:
parent
087fe0015e
commit
75f2102adc
1 changed files with 10 additions and 7 deletions
|
@ -1848,19 +1848,22 @@ SV_ExecuteClientMessage (client_t *cl)
|
||||||
qboolean move_issued = false; // allow only one move command
|
qboolean move_issued = false; // allow only one move command
|
||||||
vec3_t o;
|
vec3_t o;
|
||||||
|
|
||||||
// calc ping time
|
|
||||||
cl->delta.cur_frame = cl->netchan.incoming_acknowledged & UPDATE_MASK;
|
|
||||||
cl->delta.out_frame = cl->netchan.outgoing_sequence & UPDATE_MASK;
|
|
||||||
cl->delta.in_frame = cl->netchan.incoming_sequence & UPDATE_MASK;
|
|
||||||
frame = &cl->delta.frames[cl->delta.cur_frame];
|
|
||||||
frame->ping_time = realtime - frame->senttime;
|
|
||||||
|
|
||||||
// make sure the reply sequence number matches the incoming
|
// make sure the reply sequence number matches the incoming
|
||||||
// sequence number
|
// sequence number
|
||||||
if (cl->netchan.incoming_sequence >= cl->netchan.outgoing_sequence)
|
if (cl->netchan.incoming_sequence >= cl->netchan.outgoing_sequence)
|
||||||
cl->netchan.outgoing_sequence = cl->netchan.incoming_sequence;
|
cl->netchan.outgoing_sequence = cl->netchan.incoming_sequence;
|
||||||
else
|
else
|
||||||
cl->send_message = false; // don't reply, sequences have slipped
|
cl->send_message = false; // don't reply, sequences have slipped
|
||||||
|
|
||||||
|
// setup delta information
|
||||||
|
cl->delta.cur_frame = cl->netchan.incoming_acknowledged & UPDATE_MASK;
|
||||||
|
cl->delta.out_frame = cl->netchan.outgoing_sequence & UPDATE_MASK;
|
||||||
|
cl->delta.in_frame = cl->netchan.incoming_sequence & UPDATE_MASK;
|
||||||
|
|
||||||
|
// calc ping time
|
||||||
|
frame = &cl->delta.frames[cl->delta.cur_frame];
|
||||||
|
frame->ping_time = realtime - frame->senttime;
|
||||||
|
|
||||||
// save time for ping calculations
|
// save time for ping calculations
|
||||||
cl->delta.frames[cl->delta.out_frame].senttime = realtime;
|
cl->delta.frames[cl->delta.out_frame].senttime = realtime;
|
||||||
cl->delta.frames[cl->delta.out_frame].ping_time = -1;
|
cl->delta.frames[cl->delta.out_frame].ping_time = -1;
|
||||||
|
|
Loading…
Reference in a new issue