XLine* xl = NULL;
try
{
- xl = xlf->Generate(ServerInstance->Time(), atoi(params[4].c_str()), params[2], params[5], params[1]);
+ xl = xlf->Generate(ServerInstance->Time(), ConvToInt(params[4]), params[2], params[5], params[1]);
}
catch (ModuleException &e)
{
ServerInstance->SNO->WriteToSnoMask('d',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason());
return true;
}
- xl->SetCreateTime(atoi(params[3].c_str()));
+ xl->SetCreateTime(ConvToInt(params[3]));
if (ServerInstance->XLines->AddLine(xl, NULL))
{
if (xl->duration)
FOREACH_MOD(I_OnSetAway, OnSetAway(u, params[params.size() - 1]));
if (params.size() > 1)
- u->awaytime = atoi(params[0].c_str());
+ u->awaytime = ConvToInt(params[0]);
else
u->awaytime = ServerInstance->Time();
capab->OptModuleList.clear();
capab->CapKeys.clear();
if (params.size() > 1)
- proto_version = atoi(params[1].c_str());
+ proto_version = ConvToInt(params[1]);
SendCapabilities(2);
}
else if (params[0] == "END")
}
else
{
- proto_version = atoi(capab->CapKeys.find("PROTOCOL")->second.c_str());
+ proto_version = ConvToInt(capab->CapKeys.find("PROTOCOL")->second);
if (proto_version < MinCompatProtocol)
{
reason = "Server is using protocol version " + ConvToStr(proto_version) +
/** FTOPIC command */
CmdResult CommandFTopic::Handle(const std::vector<std::string>& params, User *user)
{
- time_t ts = atoi(params[1].c_str());
+ time_t ts = ConvToInt(params[1]);
Channel* c = ServerInstance->FindChan(params[0]);
if (c)
{
CmdResult CommandOpertype::Handle(const std::vector<std::string>& params, User *u)
{
SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
- std::string opertype = params[0];
+ const std::string& opertype = params[0];
if (!u->IsOper())
ServerInstance->Users->all_opers.push_back(u);
u->modes[UM_OPERATOR] = 1;
return true;
if (params.size() == 1)
{
- std::string stufftobounce = params[0];
- this->WriteLine(":"+ServerInstance->Config->GetSID()+" PONG "+stufftobounce);
+ this->WriteLine(":"+ServerInstance->Config->GetSID()+" PONG "+params[0]);
return true;
}
else
{
- std::string forwardto = params[1];
+ const std::string& forwardto = params[1];
if (forwardto == ServerInstance->Config->ServerName || forwardto == ServerInstance->Config->GetSID())
{
// this is a ping for us, send back PONG to the requesting server
}
else
{
- std::string forwardto = params[1];
+ const std::string& forwardto = params[1];
if (forwardto == ServerInstance->Config->GetSID() || forwardto == ServerInstance->Config->ServerName)
{
/*
std::string password = params[1];
std::string sid = params[3];
std::string description = params[4];
- int hops = atoi(params[2].c_str());
+ int hops = ConvToInt(params[2]);
this->SendCapabilities(2);
std::string password = params[1];
std::string sid = params[3];
std::string description = params[4];
- int hops = atoi(params[2].c_str());
+ int hops = ConvToInt(params[2]);
this->SendCapabilities(2);
}
}
- u->age = atoi(parameters[2].c_str());
+ u->age = ConvToInt(parameters[2]);
}
return CMD_SUCCESS;
{
if (params.size())
{
- time_t them = atoi(params[0].c_str());
+ time_t them = ConvToInt(params[0]);
time_t delta = them - ServerInstance->Time();
if ((delta < -600) || (delta > 600))
{
}
/* Update timestamp on user when they change nicks */
- who->age = atoi(params[1].c_str());
+ who->age = ConvToInt(params[1]);
/*
* On nick messages, check that the nick doesnt already exist here.
return;
}
-bool SpanningTreeUtilities::DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit)
+bool SpanningTreeUtilities::DoOneToAllButSender(const std::string& prefix, const std::string& command, const parameterlist& params, const std::string& omit)
{
TreeServer* omitroute = this->BestRouteTo(omit);
std::string FullLine = ":" + prefix + " " + command;
return true;
}
-bool SpanningTreeUtilities::DoOneToMany(const char* prefix, const char* command, const parameterlist ¶ms)
-{
- std::string spfx = prefix;
- std::string scmd = command;
- return this->DoOneToMany(spfx, scmd, params);
-}
-
-bool SpanningTreeUtilities::DoOneToAllButSender(const char* prefix, const char* command, const parameterlist ¶ms, std::string omit)
-{
- std::string spfx = prefix;
- std::string scmd = command;
- return this->DoOneToAllButSender(spfx, scmd, params, omit);
-}
-
-bool SpanningTreeUtilities::DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string target)
+bool SpanningTreeUtilities::DoOneToOne(const std::string& prefix, const std::string& command, const parameterlist& params, const std::string& target)
{
TreeServer* Route = this->BestRouteTo(target);
if (Route)
/** Send a message from this server to one other local or remote
*/
- bool DoOneToOne(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string target);
+ bool DoOneToOne(const std::string& prefix, const std::string& command, const parameterlist& params, const std::string& target);
/** Send a message from this server to all but one other, local or remote
*/
- bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist ¶ms, std::string omit);
-
- /** Send a message from this server to all but one other, local or remote
- */
- bool DoOneToAllButSender(const char* prefix, const char* command, const parameterlist ¶ms, std::string omit);
+ bool DoOneToAllButSender(const std::string &prefix, const std::string &command, const parameterlist& params, const std::string& omit);
/** Send a message from this server to all others
*/
bool DoOneToMany(const std::string &prefix, const std::string &command, const parameterlist ¶ms);
- /** Send a message from this server to all others
- */
- bool DoOneToMany(const char* prefix, const char* command, const parameterlist ¶ms);
-
/** Read the spanningtree module's tags from the config file
*/
void ReadConfiguration();