diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 09:06:03 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 09:06:03 +0000 |
commit | 6a9fbfda45b80ab953e15cb7e5f883b7f6f970af (patch) | |
tree | 29d772b839f2dced924b6853224a8977e2f438b3 /src/modules | |
parent | b6e38f0c4ac668369f775fb87739c580d4eb0c28 (diff) |
New API update
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4871 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_sqllog.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 4220724a6..4779e3cb2 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -14,20 +14,6 @@ * --------------------------------------------------- */ -using namespace std; - -#include <stdio.h> -#include <string> -#include <stdlib.h> -#include <time.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <string.h> -#include <unistd.h> -#include <errno.h> -#include <fcntl.h> -#include <poll.h> #include "users.h" #include "channels.h" #include "modules.h" @@ -41,8 +27,6 @@ static Module* MyMod; static std::string dbid; extern time_t TIME; -extern InspIRCd* ServerInstance; - enum LogTypes { LT_OPER = 1, LT_KILL, LT_SERVLINK, LT_XLINE, LT_CONNECT, LT_DISCONNECT, LT_FLOOD, LT_LOADMODULE }; enum QueryState { FIND_SOURCE, INSERT_SOURCE, FIND_NICK, INSERT_NICK, FIND_HOST, INSERT_HOST, INSERT_LOGENTRY, DONE }; @@ -270,24 +254,25 @@ class QueryInfo class ModuleSQLLog : public Module { - Server* Srv; + InspIRCd* Srv; ConfigReader* Conf; public: bool ReadConfig() { - Conf = new ConfigReader(); - dbid = Conf->ReadValue("sqllog","dbid",0); // database id of a database configured in sql module - DELETE(Conf); - SQLModule = ServerInstance->FindFeature("SQL"); + ConfigReader Conf(Srv); + + dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module + + SQLModule = Srv->FindFeature("SQL"); if (!SQLModule) log(DEFAULT,"WARNING: m_sqllog.so could not initialize because an SQL module is not loaded. Load the module and rehash your server."); return (SQLModule); } - ModuleSQLLog(InspIRCd* Me) : Module::Module(Me) + ModuleSQLLog(InspIRCd* Me) + : Module::Module(Me), Srv(Me) { - ReadConfig(); MyMod = this; active_queries.clear(); @@ -397,7 +382,7 @@ class ModuleSQLLog : public Module virtual void OnLoadModule(Module* mod, const std::string &name) { - AddLogEntry(LT_LOADMODULE,name,ServerInstance->Config->ServerName,ServerInstance->Config->ServerName); + AddLogEntry(LT_LOADMODULE,name,Srv->Config->ServerName, Srv->Config->ServerName); } virtual ~ModuleSQLLog() |