Example #1
0
std::string SpanningTreeUtilities::ConstructLine(const std::string& prefix, const std::string& command, const parameterlist& params)
{
	std::string FullLine;
	FullLine.reserve(1024);
	FullLine = ":" + prefix + " " + command;
	for (parameterlist::const_iterator x = params.begin(); x != params.end(); ++x)
	{
		FullLine.push_back(' ');
		FullLine.append(*x);
	}
	return FullLine;
}
Example #2
0
/** ENCAP */
void TreeSocket::Encap(User* who, parameterlist &params)
{
	if (params.size() > 1)
	{
		if (ServerInstance->Config->GetSID() == params[0] || InspIRCd::Match(ServerInstance->Config->ServerName, params[0]))
		{
			parameterlist plist(params.begin() + 2, params.end());
			ServerInstance->Parser->CallHandler(params[1], plist, who);
			// discard return value, ENCAP shall succeed even if the command does not exist
		}

		params[params.size() - 1] = ":" + params[params.size() - 1];

		if (params[0].find_first_of("*?") != std::string::npos)
		{
			Utils->DoOneToAllButSender(who->uuid, "ENCAP", params, who->server);
		}
		else
			Utils->DoOneToOne(who->uuid, "ENCAP", params, params[0]);
	}
}
Example #3
0
void SpanningTreeProtocolInterface::SendMode(User* source, User* u, Channel* c, const parameterlist& modedata, const std::vector<TranslateType>& translate)
{
	parameterlist params;

	if (u)
	{
		if (u->registered != REG_ALL)
			return;

		params.push_back(u->uuid);
		params.insert(params.end(), modedata.begin(), modedata.end());
		Utils->DoOneToMany(source->uuid, "MODE", params);
	}
	else
	{
		params.push_back(c->name);
		params.push_back(ConvToStr(c->age));
		params.push_back(CommandParser::TranslateUIDs(translate, modedata));
		Utils->DoOneToMany(source->uuid, "FMODE", params);
	}
}