]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Use the right pass
[user/henk/code/inspircd.git] / src / modules.cpp
index c3315490ed5b02f238670d3efa6e5a12529f665e..5ec74da7b9bc43f5db57cd7ac6ef82cce36a4fe8 100644 (file)
@@ -193,7 +193,9 @@ void                Module::OnGarbageCollect() { }
 void           Module::OnBufferFlushed(User*) { }
 void           Module::OnText(User*, void*, int, const std::string&, char, CUList&) { }
 void           Module::OnRunTestSuite() { }
-
+void           Module::OnNamesListItem(User*, User*, Channel*, std::string&, std::string&) { }
+int            Module::OnNumeric(User*, unsigned int, const std::string&) { return 0; }
+void           Module::OnHookUserIO(User*, const std::string&) { }
 
 ModuleManager::ModuleManager(InspIRCd* Ins) : ModCount(0), Instance(Ins)
 {
@@ -251,7 +253,7 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s,
         * on which they want, and we make sure our module is *at least* before or after
         * the first or last of this subset, depending again on the type of priority.
         */
-       size_t swap_pos;
+       size_t swap_pos = 0;
        size_t source = 0;
        bool swap = true;
        bool found = false;
@@ -551,17 +553,14 @@ void ModuleManager::LoadAll()
 
        for(int count = 0; count < Instance->Config->ConfValueEnum(Instance->Config->config_data, "module"); count++)
        {
-               if (!this->Find(configToken))
+               Instance->Config->ConfValue(Instance->Config->config_data, "module", "name", count, configToken, MAXBUF);
+               printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
+               
+               if (!this->Load(configToken))           
                {
-                       Instance->Config->ConfValue(Instance->Config->config_data, "module", "name", count, configToken, MAXBUF);
-                       printf_c("[\033[1;32m*\033[0m] Loading module:\t\033[1;32m%s\033[0m\n",configToken);
-                       
-                       if (!this->Load(configToken))           
-                       {
-                               Instance->Logs->Log("MODULE", DEFAULT, this->LastError());
-                               printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str());
-                               Instance->Exit(EXIT_STATUS_MODULE);
-                       }
+                       Instance->Logs->Log("MODULE", DEFAULT, this->LastError());
+                       printf_c("\n[\033[1;31m*\033[0m] %s\n\n", this->LastError().c_str());
+                       Instance->Exit(EXIT_STATUS_MODULE);
                }
        }
 }
@@ -826,11 +825,8 @@ ConfigReader::ConfigReader(InspIRCd* Instance, const std::string &filename) : Se
        this->data = new ConfigDataHash;
        this->privatehash = true;
        this->errorlog = new std::ostringstream(std::stringstream::in | std::stringstream::out);
-       for (int pass = 0; pass < 2; pass++)
-       {
-               /*** XXX: Can return a 'not ready yet!' code! */
-               this->readerror = ServerInstance->Config->LoadConf(*this->data, filename, *this->errorlog, pass);
-       }
+       /*** XXX: This might block! */
+       this->readerror = ServerInstance->Config->DoInclude(*this->data, filename, *this->errorlog);
        if (!this->readerror)
                this->error = CONF_FILE_NOT_FOUND;
 }