diff options
Diffstat (limited to 'src')
-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) |