return;
}
- /*
- // Player is (somehow) outside of the map, or flying, or noclipping
- if (PRVM_serveredictfloat(host_client->edict, movetype) != MOVETYPE_NOCLIP && (PRVM_serveredictfloat(host_client->edict, movetype) == MOVETYPE_FLY || SV_TestEntityPosition (host_client->edict)))
- //if (PRVM_serveredictfloat(host_client->edict, movetype) == MOVETYPE_NOCLIP || PRVM_serveredictfloat(host_client->edict, movetype) == MOVETYPE_FLY || SV_TestEntityPosition (host_client->edict))
- {
- SV_FreeMove ();
- return;
- }
- */
-
// walk
if ((PRVM_serveredictfloat(host_client->edict, waterlevel) >= 2) && (PRVM_serveredictfloat(host_client->edict, movetype) != MOVETYPE_NOCLIP))
{
sv_readmoves[sv_numreadmoves++] = *move;
// movement packet loss tracking
- if(move->sequence)
+ // bones_was_here: checking begun prevents heavy loss detection right after a map change
+ if(move->sequence && host_client->begun)
{
if(move->sequence > host_client->movement_highestsequence_seen)
{
{
prvm_prog_t *prog = SVVM_prog;
int moveindex;
- float moveframetime;
+ double moveframetime;
double oldframetime;
double oldframetime2;
#ifdef NUM_PING_TIMES
// this is a new move
move->time = bound(sv.time - 1, move->time, sv.time); // prevent slowhack/speedhack combos
move->time = max(move->time, host_client->cmd.time); // prevent backstepping of time
- moveframetime = bound(0, move->time - host_client->cmd.time, min(0.1, sv_clmovement_inputtimeout.value));
+ // bones_was_here: limit moveframetime to a multiple of sv.frametime to match inputtimeout behaviour
+ moveframetime = min(move->time - host_client->cmd.time, min(0.1, sys_ticrate.value > 0.0 ? sv.frametime * ceil(sv_clmovement_inputtimeout.value / sv.frametime) : sv_clmovement_inputtimeout.value));
// discard (treat like lost) moves with too low distance from
// the previous one to prevent hacks using float inaccuracy
// with this approach, and if they don't send input for a while they
// start moving anyway, so the longest 'lagaport' possible is
// determined by the sv_clmovement_inputtimeout cvar)
- if (moveframetime <= 0)
- continue;
oldframetime = PRVM_serverglobalfloat(frametime);
oldframetime2 = sv.frametime;
// update ping time for qc to see while executing this move
SV_Physics_ClientMove();
sv.frametime = oldframetime2;
PRVM_serverglobalfloat(frametime) = oldframetime;
- host_client->clmovement_inputtimeout = sv_clmovement_inputtimeout.value;
+ host_client->clmovement_inputtimeout = min(0.1, sv_clmovement_inputtimeout.value);
}
}
}
if (strncasecmp(s, "spawn", 5) == 0
|| strncasecmp(s, "begin", 5) == 0
|| strncasecmp(s, "prespawn", 8) == 0)
- Cmd_ExecuteString (&cmd_serverfromclient, s, src_client, true);
+ Cmd_ExecuteString (cmd_serverfromclient, s, src_client, true);
else if (PRVM_serverfunction(SV_ParseClientCommand))
{
int restorevm_tempstringsbuf_cursize;
prog->tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
}
else
- Cmd_ExecuteString (&cmd_serverfromclient, s, src_client, true);
+ Cmd_ExecuteString (cmd_serverfromclient, s, src_client, true);
break;
clc_stringcmd_invalid: