]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/userprocess.cpp
Add Module::init() for correct exception handling during hook registration
[user/henk/code/inspircd.git] / src / userprocess.cpp
index 4cc3f0a889b0cb0f965a12bf1b2e08dfe6e64c80..75cd8634a5935e9b4660f96cafba4cbe889ab1f0 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -55,10 +55,14 @@ void InspIRCd::DoBackgroundUserStuff()
                if (curr->quitting)
                        continue;
 
-               if (curr->Penalty)
+               if (curr->CommandFloodPenalty)
                {
-                       curr->Penalty--;
-                       curr->OnDataReady();
+                       unsigned int rate = curr->MyClass->GetCommandRate();
+                       if (curr->CommandFloodPenalty > rate)
+                               curr->CommandFloodPenalty -= rate;
+                       else
+                               curr->CommandFloodPenalty = 0;
+                       curr->eh.OnDataReady();
                }
 
                switch (curr->registered)