]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/cmd.qc
Merge branch 'z411/team_queue' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / cmd.qc
index 0cc6086e85d09e53d82e4f2cb2485ecb64fa9a2e..1e14def1d7bb30f5470333488785886adef7c7fa 100644 (file)
@@ -1022,6 +1022,19 @@ void SV_ParseClientCommand(entity this, string command)
                case "sentcvar": break;                            // handled by server in this file
                case "spawn": break;                               // handled by engine in host_cmd.c
                case "say": case "say_team": case "tell": break;   // chat has its own flood control in chat.qc
+               case "minigame":                                   // flood control only for common commands
+                       string arg = argv(1);
+                       if (arg == "")
+                               goto flood_control;
+                       for (int i = 0; i < MINIGAME_COMMON_CMD_COUNT; ++i)
+                       {
+                               if (MINIGAME_COMMON_CMD[i] == arg)
+                                       goto flood_control;
+                       }
+                       // if we get here we haven't found any common command, so no flood control for other commands
+                       // individual minigame commands shouldn't be limited for gameplay reasons
+                       // FIXME unknown/wrong minigame commands have no flood control
+                       break;
                case "color": case "topcolor": case "bottomcolor": // handled by engine in host_cmd.c
                        if(!IS_CLIENT(this)) // on connection
                        {
@@ -1038,6 +1051,7 @@ void SV_ParseClientCommand(entity this, string command)
                        if(!IS_CLIENT(this)) break;
                        // else fall through to default: flood control
                default:
+                       LABEL(flood_control)
                        if (!timeout_status)  // not while paused
                        {
                                entity store = IS_CLIENT(this) ? CS(this) : this; // unfortunately, we need to store these on the client initially