diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-14 07:24:37 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-14 07:24:37 +0000 |
commit | fce32c7b5baa50aa4d2d414e0361009489eccd1c (patch) | |
tree | 1f6198cf5902f2f487f889fdc0085ca67c57c244 /src/modules/m_spanningtree | |
parent | 0797f1312163ccc5174e52042d87af21dc042124 (diff) |
Lots, lots more numerics.h conversion
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10014 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/override_admin.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_map.cpp | 21 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_motd.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_time.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/time.cpp | 2 |
6 files changed, 10 insertions, 21 deletions
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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string>& 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<std::string> ¶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 { |