]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added optional module path to the configuration file
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 8 Apr 2005 13:06:19 +0000 (13:06 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 8 Apr 2005 13:06:19 +0000 (13:06 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1011 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp

index c0cebd522f86cabc7a4b95575c50e8bccd8ddbb3..141e566794ed62c9b8fed6e8d9f7f06e1b982036 100644 (file)
@@ -191,6 +191,7 @@ char MyExecutable[1024];
 int boundPortCount = 0;
 int portCount = 0, UDPportCount = 0, ports[MAXSOCKS];
 int defaultRoute = 0;
+char ModPath[MAXBUF];
 
 connection C;
 
@@ -375,6 +376,7 @@ void ReadConfig(bool bail, userrec* user)
        ConfValue("options","allowfounder",0,AF,&config_f);
        ConfValue("dns","server",0,DNSServer,&config_f);
        ConfValue("dns","timeout",0,DNT,&config_f);
+       ConfValue("options","moduledir",0,ModPath,&config_f);
        NetBufferSize = atoi(NB);
        MaxWhoResults = atoi(MW);
        dns_timeout = atoi(DNT);
@@ -382,6 +384,8 @@ void ReadConfig(bool bail, userrec* user)
                dns_timeout = 5;
        if (!strcmp(DNSServer,""))
                strlcpy(DNSServer,"127.0.0.1",MAXBUF);
+       if (!strcmp(ModPath,""))
+               strlcpy(ModPath,MOD_PATH,MAXBUF);
        AllowHalfop = ((!strcasecmp(AH,"true")) || (!strcasecmp(AH,"1")) || (!strcasecmp(AH,"yes")));
        AllowProtect = ((!strcasecmp(AP,"true")) || (!strcasecmp(AP,"1")) || (!strcasecmp(AP,"yes")));
        AllowFounder = ((!strcasecmp(AF,"true")) || (!strcasecmp(AF,"1")) || (!strcasecmp(AF,"yes")));
@@ -3445,7 +3449,7 @@ bool DirValid(char* dirandfile)
 bool LoadModule(const char* filename)
 {
        char modfile[MAXBUF];
-       snprintf(modfile,MAXBUF,"%s/%s",MOD_PATH,filename);
+       snprintf(modfile,MAXBUF,"%s/%s",ModPath,filename);
        if (!DirValid(modfile))
        {
                log(DEFAULT,"Module %s is not within the modules directory.",modfile);