From ba26e2d59e1ecc20bf556b70e03055fa4390474c Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 25 Mar 2007 01:09:33 +0000 Subject: Allow some commands to use a mask of * (this usually finds the 'root' server) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6711 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 60d332c57..9f466a044 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -193,6 +193,9 @@ int ModuleSpanningTree::HandleMotd(const char** parameters, int pcnt, userrec* u { if (pcnt > 0) { + if (match(ServerInstance->Config->ServerName, parameters[0])) + return 0; + /* Remote MOTD, the server is within the 1st parameter */ std::deque params; params.push_back(parameters[0]); @@ -211,6 +214,9 @@ int ModuleSpanningTree::HandleAdmin(const char** parameters, int pcnt, userrec* { if (pcnt > 0) { + if (match(ServerInstance->Config->ServerName, parameters[0])) + return 1; + /* Remote ADMIN, the server is within the 1st parameter */ std::deque params; params.push_back(parameters[0]); @@ -227,6 +233,9 @@ int ModuleSpanningTree::HandleAdmin(const char** parameters, int pcnt, userrec* int ModuleSpanningTree::HandleModules(const char** parameters, int pcnt, userrec* user) { + if (match(ServerInstance->Config->ServerName, parameters[0])) + return 1; + std::deque params; params.push_back(parameters[0]); TreeServer* s = Utils->FindServerMask(parameters[0]); @@ -241,12 +250,8 @@ int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec* { if (pcnt > 1) { - ServerInstance->Log(DEBUG,"Match %s against %s", ServerInstance->Config->ServerName, parameters[1]); if (match(ServerInstance->Config->ServerName, parameters[1])) - { - ServerInstance->Log(DEBUG,"Matched %s against %s", ServerInstance->Config->ServerName, parameters[1]); return 0; - } /* Remote STATS, the server is within the 2nd parameter */ std::deque params; @@ -257,8 +262,6 @@ int ModuleSpanningTree::HandleStats(const char** parameters, int pcnt, userrec* TreeServer* s = Utils->FindServerMask(parameters[1]); if (s) { - ServerInstance->Log(DEBUG,"Found %s", s->GetName().c_str()); - params[1] = s->GetName(); Utils->DoOneToOne(user->nick, "STATS", params, s->GetName()); } @@ -611,6 +614,7 @@ int ModuleSpanningTree::OnPreCommand(const std::string &command, const char** pa /* If the command doesnt appear to be valid, we dont want to mess with it. */ if (!validated) return 0; + if (command == "CONNECT") { return this->HandleConnect(parameters,pcnt,user); @@ -665,8 +669,7 @@ int ModuleSpanningTree::OnPreCommand(const std::string &command, const char** pa } else if ((command == "MODULES") && (pcnt > 0)) { - this->HandleModules(parameters,pcnt,user); - return 1; + return this->HandleModules(parameters,pcnt,user); } return 0; } -- cgit v1.2.3