From 34a330e8bec3b8db52c2b35e46fef3689a39375a Mon Sep 17 00:00:00 2001 From: Samual Date: Tue, 20 Dec 2011 10:57:35 -0500 Subject: [PATCH] Antispam fixes for cmd's --- commands.cfg | 2 +- qcsrc/server/command/cmd.qc | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/commands.cfg b/commands.cfg index 9b0d00753..fd602081f 100644 --- a/commands.cfg +++ b/commands.cfg @@ -107,7 +107,7 @@ alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\"" // cmd (client-to-server command) - server/command/cmd.qc // ======================================================== set sv_clientcommand_antispam_time 1 "Amount of seconds after a command before another command can be called again without being considered spam. (Use -1 for no antispam limit)" -set sv_clientcommand_antispam_count 5 "Amount of commands considered spam before commands are rejected. +set sv_clientcommand_antispam_count 8 "Amount of commands considered spam before commands are rejected." seta sv_status_privacy 1 "hide IP addresses from \"status\" and \"who\" replies shown to clients" seta cl_autoswitch 1 "automatically switch to newly picked up weapons if they are better than what you are carrying" diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index ac3d7a93a..83bb50b4e 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -616,13 +616,12 @@ void SV_ParseClientCommand(string command) // argv: 0 - 1 - 2 - 3 // cmd vote - master - login - password - print("recieved normal command: ", command, ".\n"); - // for floodcheck switch(strtolower(argv(0))) { // exempt commands which are not subject to floodcheck case "begin": break; // handled by engine in host_cmd.c + case "download": break; // handled by engine in cl_parse.c case "getmapvotepic": break; // handled by server in this file case "pause": break; // handled by engine in host_cmd.c case "prespawn": break; // handled by engine in host_cmd.c @@ -634,7 +633,7 @@ void SV_ParseClientCommand(string command) if(SV_ParseClientCommand_floodcheck()) break; // "TRUE": continue, as we're not flooding yet else - return print("ANTISPAM CAUGHT: ", command, ".\n"); // "FALSE": not allowed to continue, halt + return print("^1ERROR: ^7ANTISPAM CAUGHT: ", command, ".\n"); // "FALSE": not allowed to continue, halt } /* NOTE: totally disabled for now, however the functionality and descriptions are there if we ever want it. @@ -662,11 +661,8 @@ void SV_ParseClientCommand(string command) } else if(ClientCommand_macro_command(argc, command)) // continue as usual and scan for normal commands { - return; // handled by one of the above GameCommand_* functions + return; // handled by one of the above ClientCommand_* functions } else - { - print("sent command to engine: ", command, ".\n"); clientcommand(self, command); - } } \ No newline at end of file -- 2.39.2