]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Change match direction of extbans to allow stacking
[user/henk/code/inspircd.git] / src / inspircd.cpp
index cc69374ecdcb1074cb54fea479ec18f48bce8132..ce3bbc06b543508e5aa792480485bfdaf5ba724a 100644 (file)
@@ -43,7 +43,7 @@
 #include "caller.h"
 #include "testsuite.h"
 
-InspIRCd* SI = NULL;
+InspIRCd* ServerInstance = NULL;
 int* mysig = NULL;
 
 /** Seperate from the other casemap tables so that code *can* still exclusively rely on RFC casemapping
@@ -126,8 +126,6 @@ void InspIRCd::Cleanup()
                        this->Modules->Unload(k->c_str());
                }
        }
-       /* Remove core commands */
-       Parser->RemoveRFCCommands();
 
        /* Cleanup Server Names */
        for(servernamelist::iterator itr = servernames.begin(); itr != servernames.end(); ++itr)
@@ -317,9 +315,7 @@ void InspIRCd::WritePID(const std::string &filename)
        }
 }
 
-InspIRCd::InspIRCd(int argc, char** argv)
-       : GlobalCulls(this),
-
+InspIRCd::InspIRCd(int argc, char** argv) :
         /* Functor initialisation. Note that the ordering here is very important.
          *
          * THIS MUST MATCH ORDER OF DECLARATION OF THE HandleWhateverFunc classes
@@ -354,6 +350,12 @@ InspIRCd::InspIRCd(int argc, char** argv)
        // Avoid erroneous frees on early exit
        WindowsIPC = 0;
 #endif
+
+       ServerInstance = this;
+
+       Extensible::Register(&User::NICKForced);
+       Extensible::Register(&User::OperQuit);
+
        FailedPortList pl;
        int do_version = 0, do_nofork = 0, do_debug = 0,
            do_nolog = 0, do_root = 0, do_testsuite = 0;    /* flag variables */
@@ -406,7 +408,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
        this->Config = new ServerConfig(this);
        this->SNO = new SnomaskManager(this);
        this->BanCache = new BanCacheManager(this);
-       this->Modules = new ModuleManager(this);
+       this->Modules = new ModuleManager();
        this->stats = new serverstats();
        this->Timers = new TimerManager(this);
        this->Parser = new CommandParser(this);
@@ -573,9 +575,6 @@ InspIRCd::InspIRCd(int argc, char** argv)
        this->Config->Apply(NULL, "");
        Logs->OpenFileLogs();
 
-       /** Note: This is safe, the method checks for user == NULL */
-       this->Parser->SetupCommandTable();
-
        this->Res = new DNS(this);
 
        this->AddServerName(Config->ServerName);
@@ -891,9 +890,9 @@ void InspIRCd::SetSignal(int signal)
  */
 ENTRYPOINT
 {
-       SI = new InspIRCd(argc, argv);
-       mysig = &SI->s_signal;
-       SI->Run();
-       delete SI;
+       new InspIRCd(argc, argv);
+       mysig = &ServerInstance->s_signal;
+       ServerInstance->Run();
+       delete ServerInstance;
        return 0;
 }