0
0
Fork 0
mirror of https://git.code.sf.net/p/quake/quakeforge synced 2025-02-17 17:31:28 +00:00

Hurricane's patch for correcting time kick. (Closes: )

This commit is contained in:
Bill Currie 2003-01-10 18:09:09 +00:00
parent f8eda03b63
commit 33365ef00d

View file

@ -1407,6 +1407,7 @@ adjust_usecs (usercmd_t *ucmd)
host_client->msecs = bound (-fuzz, host_client->msecs, fuzz); host_client->msecs = bound (-fuzz, host_client->msecs, fuzz);
ucmd->msec = passed; ucmd->msec = passed;
} }
host_client->last_check = realtime;
} }
static void static void
@ -1423,25 +1424,27 @@ check_usecs (usercmd_t *ucmd)
tmp_time = realtime - host_client->last_check; tmp_time = realtime - host_client->last_check;
if (tmp_time < sv_timekick_interval->value) if (tmp_time < sv_timekick_interval->value)
return; return;
host_client->last_check = realtime;
tmp_time1 = tmp_time * (1000 + sv_timekick_fuzz->value); tmp_time1 = tmp_time * (1000 + sv_timekick_fuzz->value);
if (host_client->msecs < tmp_time1) if (host_client->msecs >= tmp_time1) {
return;
host_client->msec_cheating++; host_client->msec_cheating++;
SV_BroadcastPrintf (PRINT_HIGH, "%s thinks there are %d ms " SV_BroadcastPrintf (PRINT_HIGH, "%s thinks there are %d ms "
"in %d seconds (Strike %d/%d)\n", "in %d seconds (Strike %d/%d)\n",
host_client->name, host_client->msecs, host_client->name, host_client->msecs,
(int) tmp_time, host_client->msec_cheating, (int) tmp_time, host_client->msec_cheating,
sv_timekick->int_val); sv_timekick->int_val);
if (host_client->msec_cheating < sv_timekick->int_val) if (host_client->msec_cheating >= sv_timekick->int_val) {
return;
SV_BroadcastPrintf (PRINT_HIGH, "Strike %d for %s!!\n", SV_BroadcastPrintf (PRINT_HIGH, "Strike %d for %s!!\n",
host_client->msec_cheating, host_client->name); host_client->msec_cheating, host_client->name);
SV_BroadcastPrintf (PRINT_HIGH, "Please see " SV_BroadcastPrintf (PRINT_HIGH, "Please see "
"http://www.quakeforge.net/speed_cheat.php for " "http://www.quakeforge.net/speed_cheat.php "
"information on QuakeForge's time cheat protection. " "for information on QuakeForge's time cheat "
"That page explains how some may be cheating " "protection. That page explains how some may "
"without knowing it.\n"); "be cheating without knowing it.\n");
SV_DropClient (host_client); SV_DropClient (host_client);
}
}
host_client->msecs = 0;
} }
static void static void
@ -1456,6 +1459,7 @@ SV_RunCmd (usercmd_t *ucmd, qboolean inside)
} else { } else {
check_usecs (ucmd); check_usecs (ucmd);
} }
if (host_client->last_check == -1.0)
host_client->last_check = realtime; host_client->last_check = realtime;
} }