]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd.cpp
Added OnLoadModule and OnUnloadModule (OnLoadModule was not triggering)
[user/henk/code/inspircd.git] / src / inspircd.cpp
index a15d39be2e3b308ddd9faf98b68c7b074b7597c6..9523e13ca0c5abfa7f522506fef9d7c7445a95c9 100644 (file)
@@ -329,7 +329,7 @@ void ReadConfig(bool bail, userrec* user)
        ConfValue("options","softlimit",0,SLIMT,&config_f);
 
        SoftLimit = atoi(SLIMT);
-       if ((SoftLimit < 0) || (SoftLimit > MAXCLIENTS))
+       if ((SoftLimit < 1) || (SoftLimit > MAXCLIENTS))
        {
                log(DEFAULT,"WARNING: <options:softlimit> value is greater than %d or less than 0, set to %d.",MAXCLIENTS,MAXCLIENTS);
                SoftLimit = MAXCLIENTS;
@@ -2480,6 +2480,7 @@ bool UnloadModule(const char* filename)
                                snprintf(MODERR,MAXBUF,"Module not unloadable (marked static)");
                                return false;
                        }
+                       FOREACH_MOD OnUnloadModule(modules[j],module_names[j]);
                        // found the module
                        log(DEBUG,"Deleting module...");
                        erase_module(j);
@@ -2541,6 +2542,7 @@ bool LoadModule(const char* filename)
                 {
                        Module* m = factory[MODCOUNT+1]->factory->CreateModule();
                         modules[MODCOUNT+1] = m;
+                       FOREACH_MOD OnLoadModule(m,filename_str);
                         /* save the module and the module's classfactory, if
                          * this isnt done, random crashes can occur :/ */
                         module_names.push_back(filename);