]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqllog.cpp
Updated copyrights in headers etc using perl inplace edit
[user/henk/code/inspircd.git] / src / modules / extra / m_sqllog.cpp
index 03501265095640fe8653fab2802a5887db9d77fd..8e7deac8b8b71c0c6d6ea9df30d97d05974e22ef 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2004 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -14,6 +14,8 @@
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include <stdlib.h>
@@ -63,13 +65,21 @@ class ModuleSQLLog : public Module
                return (SQLModule);
        }
 
-       ModuleSQLLog()
+       ModuleSQLLog(Server* Me)
+               : Module::Module(Me)
        {
-               Srv = new Server;
+               Srv = Me;
                ReadConfig();
        }
 
-       virtual void OnRehash()
+       void Implements(char* List)
+       {
+               List[I_OnRehash] = List[I_OnOper] = List[I_OnGlobalOper] = List[I_OnKill] = 1;
+               List[I_OnPreCommand] = List[I_OnUserConnect] = List[I_OnGlobalConnect] = 1;
+               List[I_OnUserQuit] = List[I_OnLoadModule] = 1;
+       }
+
+       virtual void OnRehash(std::string parameter)
        {
                ReadConfig();
        }
@@ -188,7 +198,7 @@ class ModuleSQLLog : public Module
                InsertEntry((unsigned)category,(unsigned)nickid,(unsigned)hostid,(unsigned)sourceid,(unsigned long)time(NULL));
        }
 
-       virtual void OnOper(userrec* user)
+       virtual void OnOper(userrec* user, std::string opertype)
        {
                AddLogEntry(LT_OPER,user->nick,user->host,user->server);
        }
@@ -204,13 +214,6 @@ class ModuleSQLLog : public Module
                return 0;
        }
 
-       virtual int OnMeshToken(char token,string_list params,serverrec* source,serverrec* reply, std::string tcp_host,std::string ipaddr,int port)
-       {
-               if ((token == 'U') || (token == 's') || (token == 'S'))
-                       AddLogEntry(LT_SERVLINK,tcp_host,ipaddr,Srv->GetServerName());
-               return 0;
-       }
-
        virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user)
        {
                if ((command == "GLINE") || (command == "KLINE") || (command == "ELINE") || (command == "ZLINE"))
@@ -230,7 +233,7 @@ class ModuleSQLLog : public Module
                AddLogEntry(LT_CONNECT,user->nick,user->host,user->server);
        }
 
-       virtual void OnUserQuit(userrec* user)
+       virtual void OnUserQuit(userrec* user, std::string reason)
        {
                AddLogEntry(LT_DISCONNECT,user->nick,user->host,user->server);
        }
@@ -242,7 +245,6 @@ class ModuleSQLLog : public Module
 
        virtual ~ModuleSQLLog()
        {
-               delete Srv;
        }
        
        virtual Version GetVersion()
@@ -263,9 +265,9 @@ class ModuleSQLLogFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule()
+       virtual Module * CreateModule(Server* Me)
        {
-               return new ModuleSQLLog;
+               return new ModuleSQLLog(Me);
        }
        
 };