From 0da6b3a13def40e8fd002b9fc60f955467f6372d Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 24 May 2009 02:53:45 +0000 Subject: OnRehash changes: split to multiple hooks to clarify use and prevent explosion of rehashes on a /REHASH * git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11388 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 10 ++++++---- src/modules/m_spanningtree/main.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 37ed06c3a..45aea56ec 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -50,11 +50,11 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) I_OnPreCommand, I_OnGetServerDescription, I_OnUserInvite, I_OnPostLocalTopicChange, I_OnWallops, I_OnUserNotice, I_OnUserMessage, I_OnBackgroundTimer, I_OnUserJoin, I_OnChangeLocalUserHost, I_OnChangeName, I_OnUserPart, I_OnUnloadModule, - I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, + I_OnUserQuit, I_OnUserPostNick, I_OnUserKick, I_OnRemoteKill, I_OnRehash, I_OnPreRehash, I_OnOper, I_OnAddLine, I_OnDelLine, I_ProtoSendMode, I_OnMode, I_OnLoadModule, I_OnStats, I_ProtoSendMetaData, I_OnEvent, I_OnSetAway, I_OnPostCommand }; - ServerInstance->Modules->Attach(eventlist, this, 29); + ServerInstance->Modules->Attach(eventlist, this, 30); delete ServerInstance->PI; ServerInstance->PI = new SpanningTreeProtocolInterface(this, Utils, ServerInstance); @@ -706,19 +706,21 @@ void ModuleSpanningTree::OnRemoteKill(User* source, User* dest, const std::strin Utils->DoOneToMany(source->uuid,"KILL",params); } -void ModuleSpanningTree::OnRehash(User* user, const std::string ¶meter) +void ModuleSpanningTree::OnPreRehash(User* user, const std::string ¶meter) { ServerInstance->Logs->Log("remoterehash", DEBUG, "called with param %s", parameter.c_str()); // Send out to other servers if (!parameter.empty() && parameter[0] != '-') { - ServerInstance->Logs->Log("remoterehash", DEBUG, "sending out lol"); std::deque params; params.push_back(parameter); Utils->DoOneToAllButSender(user ? user->uuid : ServerInstance->Config->GetSID(), "REHASH", params, user ? user->server : ServerInstance->Config->ServerName); } +} +void ModuleSpanningTree::OnRehash(User* user) +{ // Re-read config stuff Utils->ReadConfiguration(true); } diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 5333b64d4..3935c3dd6 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -173,7 +173,8 @@ class ModuleSpanningTree : public Module virtual void OnUserPostNick(User* user, const std::string &oldnick); virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent); virtual void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason); - virtual void OnRehash(User* user, const std::string ¶meter); + virtual void OnPreRehash(User* user, const std::string ¶meter); + virtual void OnRehash(User* user); virtual void OnOper(User* user, const std::string &opertype); void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason); virtual void OnAddLine(User *u, XLine *x); -- cgit v1.2.3