]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add commands.cfg file (needs a lot of work of course) and some new features to client...
authorSamual <samual@xonotic.org>
Thu, 8 Dec 2011 04:48:32 +0000 (23:48 -0500)
committerSamual <samual@xonotic.org>
Thu, 8 Dec 2011 04:48:32 +0000 (23:48 -0500)
commands.cfg [new file with mode: 0644]
qcsrc/server/clientcommands.qc

diff --git a/commands.cfg b/commands.cfg
new file mode 100644 (file)
index 0000000..06b1363
--- /dev/null
@@ -0,0 +1,11 @@
+// =================================================================
+//  Master config for managing various command aliases and settings
+// =================================================================
+
+// common
+
+
+
+// cl_cmd (clientcommand)
+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.
\ No newline at end of file
index 51d7267eea5e4ce72e0d8a5db1105f1e1f1e0d13..4795b41ae5c98f046ac9430f500a9e2e33da6b31 100644 (file)
@@ -23,11 +23,10 @@ float SV_ParseClientCommand_floodcheck()
 {
        if (timeoutStatus != 2) // if the game is not paused... but wait, doesn't that mean it could be dos'd by pausing it? eh? (old code)
        {
-               if(time == self.cmd_floodtime) // todo: add buffer time as well, ONLY one second is a short amount of time for someone to be spamming. 
+               if(time <= (self.cmd_floodtime + autocvar_sv_clientcommand_antispam_time))
                {
                        self.cmd_floodcount += 1;
-                       if(self.cmd_floodcount > 8) // todo: replace constant 8 with a cvar for the server to control
-                               return FALSE; // too much spam, halt
+                       if(self.cmd_floodcount > autocvar_sv_clientcommand_antispam_count) { return FALSE; } // too much spam, halt
                }
                else
                {