]> 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 bc354fa6d955ab0d11341dc6e6305cf4f1c1a1f8..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
@@ -46,24 +46,23 @@ void InspIRCd::DoBackgroundUserStuff()
        /*
         * loop over all local users..
         */
-       std::vector<User*>::reverse_iterator count2 = this->Users->local_users.rbegin();
+       std::vector<LocalUser*>::reverse_iterator count2 = this->Users->local_users.rbegin();
        while (count2 != this->Users->local_users.rend())
        {
-               User *curr = *count2;
+               LocalUser *curr = *count2;
                count2++;
 
                if (curr->quitting)
                        continue;
 
-               if (curr->Penalty)
+               if (curr->CommandFloodPenalty)
                {
-                       curr->Penalty--;
-                       curr->OnDataReady();
-               }
-
-               if (curr->getSendQSize() == 0)
-               {
-                       FOREACH_MOD(I_OnBufferFlushed,OnBufferFlushed(curr));
+                       unsigned int rate = curr->MyClass->GetCommandRate();
+                       if (curr->CommandFloodPenalty > rate)
+                               curr->CommandFloodPenalty -= rate;
+                       else
+                               curr->CommandFloodPenalty = 0;
+                       curr->eh.OnDataReady();
                }
 
                switch (curr->registered)
@@ -83,7 +82,7 @@ void InspIRCd::DoBackgroundUserStuff()
                                                continue;
                                        }
 
-                                       curr->Write("PING :%s",this->Config->ServerName);
+                                       curr->Write("PING :%s",this->Config->ServerName.c_str());
                                        curr->lastping = 0;
                                        curr->nping = TIME  +curr->MyClass->GetPingTime();
                                }