const std::string ModuleSpanningTree::MapOperInfo(TreeServer* Current)
{
time_t secs_up = ServerInstance->Time() - Current->age;
- return (" [Up: " + TimeToStr(secs_up) + " Lag: " + (Current->rtt == 0 ? "<1ms" : ConvToStr(Current->rtt)) + "ms]");
+ return (" [Up: " + TimeToStr(secs_up) + " Lag: " + (Current->rtt == 0 ? "<1" : ConvToStr(Current->rtt)) + "ms]");
}
// WARNING: NOT THREAD SAFE - DONT GET ANY SMART IDEAS.
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 (*user->oper)
+ if (IS_OPER(user))
{
- ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers);
+ 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 && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers);
+ 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");
}
}
// and divisons, we instead render the map onto a backplane of characters
// (a character matrix), then draw the branches as a series of "L" shapes
// from the nodes. This is not only friendlier on CPU it uses less stack.
-int ModuleSpanningTree::HandleMap(const char* const* parameters, int pcnt, User* user)
+int ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, User* user)
{
- if (pcnt > 0)
+ if (parameters.size() > 0)
{
/* Remote MAP, the server is within the 1st parameter */
TreeServer* s = Utils->FindServerMask(parameters[0]);
bool ret = false;
if (!s)
{
- user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0]);
+ user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str());
ret = true;
}
else if (s && s != Utils->TreeRoot)
ServerInstance->Logs->Log("map",DEBUG,"local");
for (int t = 0; t < line; t++)
{
- user->WriteNumeric(6, "%s :%s",user->nick,&matrix[t][0]);
+ user->WriteNumeric(6, "%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,totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users);
- user->WriteNumeric(7, "%s :End of /MAP",user->nick);
+ 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());
}
else
{