From 16a963e19f65aa6d69025a82d20254aa72d48c02 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 24 Mar 2007 23:01:52 +0000 Subject: Test stuff to fix remote stats brokage git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6710 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/commands/cmd_stats.h | 2 +- src/cmd_stats.cpp | 2 +- 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 = "[] "; } + cmd_stats (InspIRCd* Instance) : command_t(Instance,"STATS",0,1) { syntax = " []"; } 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 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; -- cgit v1.2.3