diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-24 23:01:52 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-24 23:01:52 +0000 |
commit | 16a963e19f65aa6d69025a82d20254aa72d48c02 (patch) | |
tree | 2e994db4ac5fa3e5e93e3fccf4df97131aecc296 | |
parent | db6ee71db2c96b243c564f422c490a87f9ba5d00 (diff) |
Test stuff to fix remote stats brokage
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6710 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/commands/cmd_stats.h | 2 | ||||
-rw-r--r-- | src/cmd_stats.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 14 |
3 files changed, 15 insertions, 3 deletions
diff --git a/include/commands/cmd_stats.h b/include/commands/cmd_stats.h index 00fada769..632bfa17b 100644 --- a/include/commands/cmd_stats.h +++ b/include/commands/cmd_stats.h @@ -30,7 +30,7 @@ void DoStats(InspIRCd* Instance, char statschar, userrec* user, string_list &res class cmd_stats : public command_t { public: - cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = "[<servername>] <stats-symbol>"; } + cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = "<stats-symbol> [<servername>]"; } CmdResult Handle(const char** parameters, int pcnt, userrec *user); }; diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index e2e94db4f..7197b15df 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -28,7 +28,7 @@ extern "C" command_t* init_command(InspIRCd* Instance) CmdResult cmd_stats::Handle (const char** parameters, int pcnt, userrec *user) { - if (pcnt < 2) + if (IS_LOCAL(user)) { string_list values; DoStats(this->ServerInstance, *parameters[0], user, values); diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 4fa165d10..60d332c57 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -241,19 +241,31 @@ 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; params.push_back(parameters[0]); params.push_back(parameters[1]); /* Send it out remotely, generate no reply yet */ + 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()); } else - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]); + { + user->WriteServ( "402 %s %s :No such server", user->nick, parameters[1]); + } return 1; } return 0; |