std::string command;
parameterlist params;
- ServerInstance->Logs->Log("m_spanningtree", LOG_RAWIO, "S[%d] I %s", this->GetFd(), line.c_str());
+ ServerInstance->Logs->Log(MODNAME, LOG_RAWIO, "S[%d] I %s", this->GetFd(), line.c_str());
Split(line, prefix, command, params);
linkID = capab->name;
- MyRoot = new TreeServer(Utils, capab->name, capab->description, capab->sid, Utils->TreeRoot, this, capab->hidden);
+ MyRoot = new TreeServer(capab->name, capab->description, capab->sid, Utils->TreeRoot, this, capab->hidden);
Utils->TreeRoot->AddChild(MyRoot);
MyRoot->bursting = true;
}
else
{
- ServerInstance->Logs->Log("m_spanningtree", LOG_DEBUG, "Command '%s' from unknown prefix '%s'! Dropping entire command.",
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Command '%s' from unknown prefix '%s'! Dropping entire command.",
command.c_str(), prefix.c_str());
return;
}
if ((!route_back_again) || (route_back_again->GetSocket() != this))
{
if (route_back_again)
- ServerInstance->Logs->Log("m_spanningtree", LOG_DEBUG, "Protocol violation: Fake direction '%s' from connection '%s'",
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Protocol violation: Fake direction '%s' from connection '%s'",
prefix.c_str(),linkID.c_str());
return;
}
- /*
- * First up, check for any malformed commands (e.g. MODE without a timestamp)
- * and rewrite commands where necessary (SVSMODE -> MODE for services). -- w
- */
- if (command == "SVSMODE") // This isn't in an "else if" so we still force FMODE for changes on channels.
- command = "MODE";
-
+ // Translate commands coming from servers using an older protocol
if (proto_version < ProtocolVersion)
{
if (!PreProcessOldProtocolMessage(who, command, params))
}
}
who->ForceNickChange(params[0]);
- Utils->RouteCommand(route_back_again, command, params, who);
+ Utils->DoOneToAllButSender(prefix, command, params, prefix);
}
else
{
if (!cmd)
{
- irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Unrecognised S2S command :%s %s %s",
+ irc::stringjoiner pmlist(params);
+ ServerInstance->Logs->Log(MODNAME, LOG_SPARSE, "Unrecognised S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Unrecognised command '" + command + "' -- possibly loaded mismatched modules");
return;
if (params.size() < cmd->min_params)
{
- irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Insufficient parameters for S2S command :%s %s %s",
+ irc::stringjoiner pmlist(params);
+ ServerInstance->Logs->Log(MODNAME, LOG_SPARSE, "Insufficient parameters for S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Insufficient parameters for command '" + command + "'");
return;
if (res == CMD_INVALID)
{
- irc::stringjoiner pmlist(" ", params, 0, params.size() - 1);
- ServerInstance->Logs->Log("m_spanningtree", LOG_SPARSE, "Error handling S2S command :%s %s %s",
+ irc::stringjoiner pmlist(params);
+ ServerInstance->Logs->Log(MODNAME, LOG_SPARSE, "Error handling S2S command :%s %s %s",
who->uuid.c_str(), command.c_str(), pmlist.GetJoined().c_str());
SendError("Error handling '" + command + "' -- possibly loaded mismatched modules");
}
else if (res == CMD_SUCCESS)
- Utils->RouteCommand(route_back_again, command, params, who);
+ Utils->RouteCommand(route_back_again, cmd, params, who);
}
}