]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
enforce bans on first clientcommand too, not just on ClientConnect
authorRudolf Polzer <divverent@alientrap.org>
Sun, 8 Apr 2012 18:25:47 +0000 (20:25 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 8 Apr 2012 18:25:47 +0000 (20:25 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/cmd.qc
qcsrc/server/ipban.qc

index 38007434e58b656527bf1ec01576ddd38186df10..b68bce6949eb272048cd6594a6e9a7b81b9d2d18 100644 (file)
@@ -1355,7 +1355,7 @@ void ClientConnect (void)
                return;
        }
 
-       if(Ban_MaybeEnforceBan(self))
+       if(Ban_MaybeEnforceBanOnce(self))
                return;
 
        DecodeLevelParms();
index fc9ef5f24771920817e89d4b53642bdc91d8c522..db2707fb9e828ae10ce2d437c6dc07fe92f8feea 100644 (file)
@@ -811,9 +811,6 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
        entity head;
        float ret;
 
-       if(Ban_MaybeEnforceBan(source))
-               return 0;
-
        if(!teamsay && !privatesay)
                if(substring(msgin, 0, 1) == " ")
                        msgin = substring(msgin, 1, strlen(msgin) - 1); // work around DP say bug (say_team does not have this!)
index e885c3054b7406318ea12ae69e28a2e60e7a93ce..32bd688d3bdbd26c2460157eca266974873ae203 100644 (file)
@@ -658,6 +658,10 @@ void ClientCommand_macro_write_aliases(float fh)
 
 void SV_ParseClientCommand(string command)
 {
+       // if we're banned, don't even parse the command
+       if(Ban_MaybeEnforceBanOnce(self))
+               return;
+
        float argc = tokenize_console(command);
        
        // for the mutator hook system
index fc889ecf2d0ad9e683e82e2045ab9764b0fa10d9..f770dc513e7195de40324cc58f3d27df021f4894 100644 (file)
@@ -448,6 +448,15 @@ float Ban_MaybeEnforceBan(entity client)
        return FALSE;
 }
 
+.float ban_checked;
+float Ban_MaybeEnforceBanOnce(entity client)
+{
+       if(client.ban_checked)
+               return FALSE;
+       client.ban_checked = TRUE;
+       return Ban_MaybeEnforceBan(self);
+}
+
 string Ban_Enforce(float i, string reason)
 {
        string s;