]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Stop this using some global ServerInstance (where's that even defined? :|) and do...
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 18 Feb 2007 17:08:42 +0000 (17:08 +0000)
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 18 Feb 2007 17:08:42 +0000 (17:08 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6593 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_conn_waitpong.cpp

index 2bb1b107a5b48a3efcc3ad04a0a133cd2dabfd0f..58eb3b5c335fa05b452e931916aef73a2e1a8cad 100644 (file)
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-
 #include "inspircd.h"
 
 /* $ModDesc: Forces connecting clients to send a PONG message back to the server before they can complete their connection */
 
-
-
 char* RandString(unsigned int length)
 {
        unsigned char* out = new unsigned char[length+1];
@@ -35,34 +32,30 @@ char* RandString(unsigned int length)
 
 class ModuleWaitPong : public Module
 {
-       
-       ConfigReader* Conf;
-       
+       InspIRCd* Instance;
        bool sendsnotice;
        bool killonbadreply;
 
  public:
        ModuleWaitPong(InspIRCd* Me)
-               : Module::Module(Me)
+        : Module::Module(Me), Instance(Me)
        {
                OnRehash(NULL,"");
        }
        
        virtual void OnRehash(userrec* user, const std::string &param)
        {
-               Conf = new ConfigReader(ServerInstance);
+               ConfigReader Conf(Instance);
                
-               sendsnotice = Conf->ReadFlag("waitpong", "sendsnotice", 0);
+               sendsnotice = Conf.ReadFlag("waitpong", "sendsnotice", 0);
                
-               if(Conf->GetError() == CONF_VALUE_NOT_FOUND)
+               if(Conf.GetError() == CONF_VALUE_NOT_FOUND)
                        sendsnotice = true;
                
-               killonbadreply = Conf->ReadFlag("waitpong", "killonbadreply", 0);
+               killonbadreply = Conf.ReadFlag("waitpong", "killonbadreply", 0);
 
-               if(Conf->GetError() == CONF_VALUE_NOT_FOUND)
+               if(Conf.GetError() == CONF_VALUE_NOT_FOUND)
                        killonbadreply = true;
-                               
-               DELETE(Conf);
        }
 
        void Implements(char* List)