From 12737ab4ad61a0d8a908c8a21594c7012e21eb3c Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 11 Aug 2006 01:35:01 +0000 Subject: ConfigReader and FileReader now take InspIRCd* to their constructors git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4865 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 03e7856f7..fc772c797 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -45,7 +45,6 @@ #include "dns.h" #include "inspircd.h" -extern InspIRCd* ServerInstance; extern time_t TIME; extern command_table cmdlist; @@ -116,7 +115,7 @@ Module* Event::GetSource() return this->source; } -char* Event::Send() +char* Event::Send(InspIRCd* ServerInstance) { FOREACH_MOD(I_OnEvent,OnEvent(this)); return NULL; @@ -438,7 +437,7 @@ bool InspIRCd::PseudoToUser(userrec* alive, userrec* zombie, const std::string & { log(DEBUG,"PseudoToUser"); zombie->fd = alive->fd; - FOREACH_MOD(I_OnUserQuit,OnUserQuit(alive,message)); + FOREACH_MOD_I(this,I_OnUserQuit,OnUserQuit(alive,message)); alive->fd = FD_MAGIC_NUMBER; alive->FlushWriteBuf(); alive->ClearBuffer(); @@ -580,7 +579,7 @@ Module* InspIRCd::FindModule(const std::string &name) return NULL; } -ConfigReader::ConfigReader() +ConfigReader::ConfigReader(InspIRCd* Instance) : ServerInstance(Instance) { /* Is there any reason to load the entire config file again here? * it's needed if they specify another config file, but using the @@ -602,10 +601,10 @@ ConfigReader::~ConfigReader() } -ConfigReader::ConfigReader(const std::string &filename) +ConfigReader::ConfigReader(InspIRCd* Instance, const std::string &filename) : ServerInstance(Instance) { ServerInstance->Config->ClearStack(); - + this->data = new ConfigDataHash; this->privatehash = true; this->errorlog = new std::ostringstream(std::stringstream::in | std::stringstream::out); @@ -720,7 +719,7 @@ bool ConfigReader::Verify() } -FileReader::FileReader(const std::string &filename) +FileReader::FileReader(InspIRCd* Instance, const std::string &filename) : ServerInstance(Instance) { file_cache c; ServerInstance->Config->ReadFile(c,filename.c_str()); @@ -728,7 +727,7 @@ FileReader::FileReader(const std::string &filename) this->CalcSize(); } -FileReader::FileReader() +FileReader::FileReader(InspIRCd* Instance) : ServerInstance(Instance) { } -- cgit v1.2.3