diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-07 17:05:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-07 17:05:34 +0000 |
commit | 2d821f2980825be73e3f90b47ffff365b0ec5ecb (patch) | |
tree | 5063e20e64555f26c357ccae5ab99e54e899c69d /src/modules/extra | |
parent | 4eaa2dfa110cb0096c3fd2ff134514a9d5ffd0b6 (diff) |
Changed behaviour of module API to pass Server* to the constructor, rather than have to create one (makes more sense)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2252 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 12 | ||||
-rw-r--r-- | src/modules/extra/m_sql.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_sqlauth.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_sqllog.cpp | 10 | ||||
-rw-r--r-- | src/modules/extra/m_sqloper.cpp | 10 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 89e8fe2de..0e36115b9 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -41,14 +41,15 @@ class ModuleFilterPCRE : public Module int erroffset; public: - ModuleFilterPCRE() + ModuleFilterPCRE(Server* Me) + : Module::Module(Me) { // read the configuration file on startup. - // it is perfectly valid to set <FilterPCRE file> to the value of the + // it is perfectly valid to set <filter file> to the value of the // main config file, then append your <keyword> tags to the bottom // of the main config... but rather messy. That's why the capability // of using a seperate config file is provided. - Srv = new Server; + Srv = Me; Conf = new ConfigReader; std::string filterfile = Conf->ReadValue("filter","file",0); MyConf = new ConfigReader(filterfile); @@ -81,7 +82,6 @@ class ModuleFilterPCRE : public Module virtual ~ModuleFilterPCRE() { - delete Srv; delete MyConf; delete Conf; } @@ -239,9 +239,9 @@ class ModuleFilterPCREFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleFilterPCRE; + return new ModuleFilterPCRE(Me); } }; diff --git a/src/modules/extra/m_sql.cpp b/src/modules/extra/m_sql.cpp index f1d95cf9f..7038707f8 100644 --- a/src/modules/extra/m_sql.cpp +++ b/src/modules/extra/m_sql.cpp @@ -311,9 +311,10 @@ class ModuleSQL : public Module return NULL; } - ModuleSQL() + ModuleSQL(Server* Me) + : Module::Module(Me) { - Srv = new Server(); + Srv = Me; Conf = new ConfigReader(); LoadDatabases(Conf); } @@ -322,7 +323,6 @@ class ModuleSQL : public Module { Connections.clear(); delete Conf; - delete Srv; } virtual void OnRehash(std::string parameter) @@ -352,9 +352,9 @@ class ModuleSQLFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleSQL; + return new ModuleSQL(Me); } }; diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index e1c0929c4..1faf2c0d7 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -72,9 +72,10 @@ class ModuleSQLAuth : public Module return (SQLModule); } - ModuleSQLAuth() + ModuleSQLAuth(Server* Me) + : Module::Module(Me) { - Srv = new Server; + Srv = Me; ReadConfig(); } @@ -170,7 +171,6 @@ class ModuleSQLAuth : public Module virtual ~ModuleSQLAuth() { - delete Srv; } virtual Version GetVersion() @@ -191,9 +191,9 @@ class ModuleSQLAuthFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleSQLAuth; + return new ModuleSQLAuth(Me); } }; diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index f80fec80b..badc67731 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -65,9 +65,10 @@ class ModuleSQLLog : public Module return (SQLModule); } - ModuleSQLLog() + ModuleSQLLog(Server* Me) + : Module::Module(Me) { - Srv = new Server; + Srv = Me; ReadConfig(); } @@ -237,7 +238,6 @@ class ModuleSQLLog : public Module virtual ~ModuleSQLLog() { - delete Srv; } virtual Version GetVersion() @@ -258,9 +258,9 @@ class ModuleSQLLogFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleSQLLog; + return new ModuleSQLLog(Me); } }; diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp index 630e3520a..369815f6d 100644 --- a/src/modules/extra/m_sqloper.cpp +++ b/src/modules/extra/m_sqloper.cpp @@ -55,9 +55,10 @@ class ModuleSQLOper : public Module return (SQLModule); } - ModuleSQLOper() + ModuleSQLOper(Server* Me) + : Module::Module(Me) { - Srv = new Server; + Srv = Me; Conf = new ConfigReader(); ReadConfig(); } @@ -193,7 +194,6 @@ class ModuleSQLOper : public Module virtual ~ModuleSQLOper() { delete Conf; - delete Srv; } virtual Version GetVersion() @@ -214,9 +214,9 @@ class ModuleSQLOperFactory : public ModuleFactory { } - virtual Module * CreateModule() + virtual Module * CreateModule(Server* Me) { - return new ModuleSQLOper; + return new ModuleSQLOper(Me); } }; |