From fce32c7b5baa50aa4d2d414e0361009489eccd1c Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 14 Jul 2008 07:24:37 +0000 Subject: Lots, lots more numerics.h conversion git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10014 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/override_admin.cpp | 2 +- src/modules/m_spanningtree/override_map.cpp | 21 +++++---------------- src/modules/m_spanningtree/override_modules.cpp | 2 +- src/modules/m_spanningtree/override_motd.cpp | 2 +- src/modules/m_spanningtree/override_time.cpp | 2 +- src/modules/m_spanningtree/time.cpp | 2 +- 6 files changed, 10 insertions(+), 21 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/override_admin.cpp b/src/modules/m_spanningtree/override_admin.cpp index a15cba93c..95b0c8432 100644 --- a/src/modules/m_spanningtree/override_admin.cpp +++ b/src/modules/m_spanningtree/override_admin.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleAdmin(const std::vector& parameters, Utils->DoOneToOne(user->uuid, "ADMIN", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, "%s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index 229997e5b..b17e266b2 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -37,7 +37,6 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha { for (int t = 0; t < depth; t++) { - ServerInstance->Logs->Log("map",DEBUG,"Zero to depth"); matrix[line][t] = ' '; } @@ -75,27 +74,20 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha strlcpy(&matrix[line][depth],text,126); line++; - ServerInstance->Logs->Log("map",DEBUG,"Increment line to %d, ChildCount %d", line, Current->ChildCount()); - for (unsigned int q = 0; q < Current->ChildCount(); q++) { - ServerInstance->Logs->Log("map",DEBUG,"Hidden? %d HideULines? %d GetName %s", Current->GetChild(q)->Hidden, Utils->HideULines, Current->GetChild(q)->GetName().c_str()); if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str())))) { if (IS_OPER(user)) { ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers); - ServerInstance->Logs->Log("map",DEBUG,"Show to oper"); } - ServerInstance->Logs->Log("map",DEBUG,"Fall through"); } else { ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers); - ServerInstance->Logs->Log("map",DEBUG,"Show to non oper"); } } - ServerInstance->Logs->Log("map",DEBUG,"After loop"); } } @@ -117,7 +109,7 @@ int ModuleSpanningTree::HandleMap(const std::vector& parameters, Us bool ret = false; if (!s) { - user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, "%s %s :No such server", user->nick.c_str(), parameters[0].c_str()); ret = true; } else if (s && s != Utils->TreeRoot) @@ -196,21 +188,18 @@ int ModuleSpanningTree::HandleMap(const std::vector& parameters, Us ServerInstance->Logs->Log("map",DEBUG,"local"); for (int t = 0; t < line; t++) { - user->WriteNumeric(6, "%s :%s",user->nick.c_str(),&matrix[t][0]); + user->WriteNumeric(RPL_MAP, "%s :%s",user->nick.c_str(),&matrix[t][0]); } - user->WriteNumeric(270, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick.c_str(),totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users); - user->WriteNumeric(7, "%s :End of /MAP",user->nick.c_str()); + user->WriteNumeric(RPL_MAPUSERS, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick.c_str(),totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users); + user->WriteNumeric(RPL_ENDMAP, "%s :End of /MAP",user->nick.c_str()); } else { - - //void SpanningTreeProtocolInterface::PushToClient(User* target, const std::string &rawline) - // ServerInstance->Logs->Log("map", DEBUG, "remote dump lines=%d", line); + // XXX: annoying that we have to use hardcoded numerics here.. for (int t = 0; t < line; t++) { - ServerInstance->Logs->Log("map",DEBUG,"Dump %d", line); ServerInstance->PI->PushToClient(user, std::string("::") + ServerInstance->Config->ServerName + " 006 " + user->nick + " :" + &matrix[t][0]); } diff --git a/src/modules/m_spanningtree/override_modules.cpp b/src/modules/m_spanningtree/override_modules.cpp index b06634a4d..f237c27b9 100644 --- a/src/modules/m_spanningtree/override_modules.cpp +++ b/src/modules/m_spanningtree/override_modules.cpp @@ -49,7 +49,7 @@ int ModuleSpanningTree::HandleModules(const std::vector& parameters Utils->DoOneToOne(user->uuid, "MODULES", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); + user->WriteServ(ERR_NOSUCHSERVER, "%s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_motd.cpp b/src/modules/m_spanningtree/override_motd.cpp index b312769c7..acbebe3da 100644 --- a/src/modules/m_spanningtree/override_motd.cpp +++ b/src/modules/m_spanningtree/override_motd.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleMotd(const std::vector& parameters, U Utils->DoOneToOne(user->uuid, "MOTD", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); + user->WriteServ(ERR_NOSUCHSERVER, "%s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_time.cpp b/src/modules/m_spanningtree/override_time.cpp index 0f6a1bef6..9f298c5f0 100644 --- a/src/modules/m_spanningtree/override_time.cpp +++ b/src/modules/m_spanningtree/override_time.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleTime(const std::vector& parameters, U } else { - user->WriteNumeric(402, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str()); + user->WriteNumeric(ERR_NOSUCHSERVER, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str()); } } return 1; diff --git a/src/modules/m_spanningtree/time.cpp b/src/modules/m_spanningtree/time.cpp index 5b6b8df82..fe3fd0461 100644 --- a/src/modules/m_spanningtree/time.cpp +++ b/src/modules/m_spanningtree/time.cpp @@ -67,7 +67,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque ¶ms char tms[26]; snprintf(tms,26,"%s",asctime(timeinfo)); tms[24] = 0; - u->WriteNumeric(391, "%s %s :%s",u->nick.c_str(),prefix.c_str(),tms); + u->WriteNumeric(RPL_TIME, "%s %s :%s",u->nick.c_str(),prefix.c_str(),tms); } else { -- cgit v1.2.3