예제 #1
0
파일: opertype.cpp 프로젝트: Robby-/anope
bool Oper::HasCommand(const Anope::string &cmdstr)
{
	OperType *type = GetType();
	if (type != nullptr)
		return type->HasCommand(cmdstr);
	return false;
}
예제 #2
0
파일: opertype.cpp 프로젝트: Robby-/anope
bool OperType::HasCommand(const Anope::string &cmdstr) const
{
	for (std::list<Anope::string>::const_iterator it = this->commands.begin(), it_end = this->commands.end(); it != it_end; ++it)
	{
		const Anope::string &s = *it;

		if (!s.find('~') && Anope::Match(cmdstr, s.substr(1)))
			return false;
		else if (Anope::Match(cmdstr, s))
			return true;
	}
	for (std::set<OperType *>::const_iterator iit = this->inheritances.begin(), iit_end = this->inheritances.end(); iit != iit_end; ++iit)
	{
		OperType *ot = *iit;

		if (ot->HasCommand(cmdstr))
			return true;
	}

	return false;
}