From f3017195549d748d2373ec51a6c798a6e3a61d00 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 8 Apr 2005 13:06:19 +0000 Subject: Added optional module path to the configuration file git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1011 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index c0cebd522..141e56679 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -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); -- cgit v1.2.3