本文整理汇总了C++中ConfigTag::getFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigTag::getFloat方法的具体用法?C++ ConfigTag::getFloat怎么用?C++ ConfigTag::getFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigTag
的用法示例。
在下文中一共展示了ConfigTag::getFloat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NickMatchesEveryone
bool InspIRCd::NickMatchesEveryone(const std::string &nick, User* user)
{
long matches = 0;
ConfigTag* insane = Config->ConfValue("insane");
if (insane->getBool("nickmasks"))
return false;
float itrigger = insane->getFloat("trigger", 95.5);
for (user_hash::iterator u = this->Users->clientlist->begin(); u != this->Users->clientlist->end(); u++)
{
if (InspIRCd::Match(u->second->nick, nick))
matches++;
}
if (!matches)
return false;
float percent = ((float)matches / (float)this->Users->clientlist->size()) * 100;
if (percent > itrigger)
{
SNO->WriteToSnoMask('a', "\2WARNING\2: %s tried to set a Q line mask of %s, which covers %.2f%% of the network!",user->nick.c_str(),nick.c_str(),percent);
return true;
}
return false;
}
示例2: MatchesEveryone
bool InsaneBan::MatchesEveryone(const std::string& mask, MatcherBase& test, User* user, const char* bantype, const char* confkey)
{
ConfigTag* insane = ServerInstance->Config->ConfValue("insane");
if (insane->getBool(confkey))
return false;
float itrigger = insane->getFloat("trigger", 95.5);
long matches = test.Run(mask);
if (!matches)
return false;
float percent = ((float)matches / (float)ServerInstance->Users->GetUsers().size()) * 100;
if (percent > itrigger)
{
ServerInstance->SNO->WriteToSnoMask('a', "\2WARNING\2: %s tried to set a %s-line mask of %s, which covers %.2f%% of the network!", user->nick.c_str(), bantype, mask.c_str(), percent);
return true;
}
return false;
}