diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-25 01:09:33 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-25 01:09:33 +0000 |
commit | ba26e2d59e1ecc20bf556b70e03055fa4390474c (patch) | |
tree | 5924df832d200323ec37b8dc1e545db89c3e9b22 | |
parent | 16a963e19f65aa6d69025a82d20254aa72d48c02 (diff) |
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
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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<std::string> 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<std::string> 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<std::string> 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<std::string> 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; } |