From 41c2e2896a6090508ca01fda70c299593c26ebcd Mon Sep 17 00:00:00 2001 From: om Date: Sun, 18 Feb 2007 17:08:42 +0000 Subject: 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 --- src/modules/m_conn_waitpong.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/modules') 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) -- cgit v1.2.3