]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/userprocess.cpp
extern time_t TIME -> InspIRCd::Time()
[user/henk/code/inspircd.git] / src / userprocess.cpp
index 88fdeec54d9574924e5807a2f1c2a62bec35bf51..ccd32a9c973f2e987e45065c15877f55c4baaef3 100644 (file)
@@ -19,7 +19,6 @@
 using namespace std;
 
 #include "inspircd_config.h"
-#include "inspircd.h"
 #include "configreader.h"
 #include <unistd.h>
 #include <fcntl.h>
@@ -39,7 +38,6 @@ using namespace std;
 #include "modules.h"
 #include "dynamic.h"
 #include "wildcard.h"
-#include "message.h"
 #include "mode.h"
 #include "commands.h"
 #include "xline.h"
@@ -48,17 +46,14 @@ using namespace std;
 #include "hashcomp.h"
 #include "socketengine.h"
 #include "userprocess.h"
+#include "inspircd.h"
 #include "typedefs.h"
 #include "command_parse.h"
 #include "cull_list.h"
 
 extern struct sockaddr_in client,server;
 extern socklen_t length;
-extern std::vector<Module*> modules;
-extern std::vector<ircd_module*> factory;
-extern time_t TIME;
-extern time_t OLDTIME;
-extern std::vector<userrec*> local_users;
+
 char data[65536];
 
 void InspIRCd::ProcessUser(userrec* cu)
@@ -147,8 +142,8 @@ void InspIRCd::ProcessUser(userrec* cu)
                                        if (current->lines_in > current->flood)
                                        {
                                                log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                               WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                               userrec::QuitUser(current,"Excess flood");
+                                               this->WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+                                               userrec::QuitUser(this, current,"Excess flood");
                                                return;
                                        }
                                        else
@@ -159,7 +154,7 @@ void InspIRCd::ProcessUser(userrec* cu)
                                }
                                else
                                {
-                                       WriteOpers("*** Excess flood from %s",current->GetIPString());
+                                       this->WriteOpers("*** Excess flood from %s",current->GetIPString());
                                        log(DEFAULT,"Excess flood from: %s",current->GetIPString());
                                        add_zline(120,this->Config->ServerName,"Flood from unregistered connection",current->GetIPString());
                                        apply_lines(APPLY_ZLINES);
@@ -172,11 +167,11 @@ void InspIRCd::ProcessUser(userrec* cu)
                        {
                                if (current->registered == REG_ALL)
                                {
-                                       userrec::QuitUser(current,"RecvQ exceeded");
+                                       userrec::QuitUser(this, current,"RecvQ exceeded");
                                }
                                else
                                {
-                                       WriteOpers("*** Excess flood from %s",current->GetIPString());
+                                       this->WriteOpers("*** Excess flood from %s",current->GetIPString());
                                        log(DEFAULT,"Excess flood from: %s",current->GetIPString());
                                        add_zline(120,this->Config->ServerName,"Flood from unregistered connection",current->GetIPString());
                                        apply_lines(APPLY_ZLINES);
@@ -198,7 +193,7 @@ void InspIRCd::ProcessUser(userrec* cu)
                                {
                                        log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
                                        WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                       userrec::QuitUser(current,"Excess flood");
+                                       userrec::QuitUser(this, current,"Excess flood");
                                        return;
                                }
 
@@ -208,7 +203,7 @@ void InspIRCd::ProcessUser(userrec* cu)
                                        {
                                                log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
                                                WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
-                                               userrec::QuitUser(current,"Excess flood");
+                                               userrec::QuitUser(this, current,"Excess flood");
                                        }
                                        else
                                        {
@@ -253,7 +248,7 @@ void InspIRCd::ProcessUser(userrec* cu)
                if ((result == -1) && (errno != EAGAIN) && (errno != EINTR))
                {
                        log(DEBUG,"killing: %s",cu->nick);
-                       userrec::QuitUser(cu,strerror(errno));
+                       userrec::QuitUser(this,cu,strerror(errno));
                        return;
                }
        }
@@ -266,7 +261,7 @@ void InspIRCd::ProcessUser(userrec* cu)
        else if (result == 0)
        {
                log(DEBUG,"InspIRCd: Exited: %s",cu->nick);
-               userrec::QuitUser(cu,"Client exited");
+               userrec::QuitUser(this,cu,"Client exited");
                log(DEBUG,"Bailing from client exit");
                return;
        }
@@ -304,15 +299,15 @@ void InspIRCd::DoSocketTimeouts(time_t TIME)
  */
 void InspIRCd::DoBackgroundUserStuff(time_t TIME)
 {
-       CullList GlobalGoners;
+       CullList GlobalGoners(this);
 
        /* XXX: IT IS NOT SAFE TO USE AN ITERATOR HERE. DON'T EVEN THINK ABOUT IT. */
-       for (unsigned long count2 = 0; count2 != local_users.size(); count2++)
+       for (unsigned long count2 = 0; count2 != this->local_users.size(); count2++)
        {
-               if (count2 >= local_users.size())
+               if (count2 >= this->local_users.size())
                        break;
 
-               userrec* curr = local_users[count2];
+               userrec* curr = this->local_users[count2];
 
                if (curr)
                {