]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Review and optimize
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index 69a9495a5d71650cd2f4c4ff8bd2bb199335b4ae..fe8fb9f91be4f9f9c135f37834c8c2281f9352d5 100644 (file)
@@ -14,6 +14,8 @@
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include "users.h"
@@ -26,21 +28,20 @@ class ModuleBotMode : public Module
 {
        Server *Srv; 
  public:
-       ModuleBotMode()
+       ModuleBotMode(Server* Me)
+               : Module::Module(Me)
        {
-               Srv = new Server;
+               Srv = Me;
                
                if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
                {
                        Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
-                       printf("Could not claim usermode +B for this module!");
                        return;
                }
        }
        
        virtual ~ModuleBotMode()
        {
-               delete Srv;
        }
        
        virtual Version GetVersion()
@@ -83,9 +84,9 @@ class ModuleBotModeFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule()
+       virtual Module * CreateModule(Server* Me)
        {
-               return new ModuleBotMode;
+               return new ModuleBotMode(Me);
        }
        
 };