diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-18 17:08:42 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-18 17:08:42 +0000 |
commit | 41c2e2896a6090508ca01fda70c299593c26ebcd (patch) | |
tree | a6ab55d77f5e73c5fb59c4489c02fe5a842dee52 /src/modules | |
parent | a69fd6266977e43b8a06cc3020a1b6a8d17be93a (diff) |
Stop this using some global ServerInstance (where's that even defined? :|) and do some slight cleanups
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6593 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_conn_waitpong.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 2bb1b107a..58eb3b5c3 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -16,13 +16,10 @@ #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 ¶m) { - 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) |