From 368ae283a276f3f202518716ad22b747ee35abb0 Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Wed, 5 Jan 2000 22:41:36 +0000 Subject: [PATCH] Applied Mads' speed cheat fix to qw-server --- AUTHORS | 8 ++++++-- qw_server/sv_user.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 8131a98..2526acc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -62,12 +62,16 @@ Svgalib fixes/optimizations: GGI support: Marcus Sundberg -SDL Support: +SDL support: Sam Lantinga Maas van den Berg X11 software renderer fixes: Justin A. McCright -GL Fullbright Support: +GL fullbright Support: Neal White III + +Cheat/exploit fixes: + Mads Bondo Dydensborg + diff --git a/qw_server/sv_user.c b/qw_server/sv_user.c index ce05f2a..0ed7e14 100644 --- a/qw_server/sv_user.c +++ b/qw_server/sv_user.c @@ -1357,7 +1357,7 @@ void SV_PreRunCmd(void) { memset(playertouch, 0, sizeof(playertouch)); } - + /* =========== SV_RunCmd @@ -1369,6 +1369,18 @@ void SV_RunCmd (usercmd_t *ucmd) int i, n; int oldmsec; + //MBD: The id client limits msec to 100. + if (ucmd->msec > 100) { + Con_Printf("Speed cheat detected for player %s\n", + host_client->name); + // We want to punish people that tries to do this. Let us + // set their fps to 1000 + ucmd->msec = 1; + // This has the added benefit that the server eventually will + // KICK the player, calling him a timedemo cheater. + // Neat, huh? :-) + } + cmd = *ucmd; // chop up very long commands