本文整理汇总了C++中ConfigTag::init方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigTag::init方法的具体用法?C++ ConfigTag::init怎么用?C++ ConfigTag::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigTag
的用法示例。
在下文中一共展示了ConfigTag::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoStats
//.........这里部分代码省略.........
#endif
}
break;
case 'T':
{
results.push_back("249 "+user->nick+" :accepts "+ConvToStr(ServerInstance->stats->statsAccept)+" refused "+ConvToStr(ServerInstance->stats->statsRefused));
results.push_back("249 "+user->nick+" :unknown commands "+ConvToStr(ServerInstance->stats->statsUnknown));
results.push_back("249 "+user->nick+" :nick collisions "+ConvToStr(ServerInstance->stats->statsCollisions));
results.push_back("249 "+user->nick+" :dns requests "+ConvToStr(ServerInstance->stats->statsDnsGood+ServerInstance->stats->statsDnsBad)+" succeeded "+ConvToStr(ServerInstance->stats->statsDnsGood)+" failed "+ConvToStr(ServerInstance->stats->statsDnsBad));
results.push_back("249 "+user->nick+" :connection count "+ConvToStr(ServerInstance->stats->statsConnects));
results.push_back(InspIRCd::Format("249 %s :bytes sent %5.2fK recv %5.2fK", user->nick.c_str(),
ServerInstance->stats->statsSent / 1024.0, ServerInstance->stats->statsRecv / 1024.0));
}
break;
/* stats o */
case 'o':
{
ConfigTagList tags = ServerInstance->Config->ConfTags("oper");
for(ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* tag = i->second;
results.push_back("243 "+user->nick+" O "+tag->getString("host")+" * "+
tag->getString("name") + " " + tag->getString("type")+" 0");
}
}
break;
case 'O':
{
for (OperIndex::const_iterator i = ServerInstance->Config->OperTypes.begin(); i != ServerInstance->Config->OperTypes.end(); ++i)
{
OperInfo* tag = i->second;
tag->init();
std::string umodes;
std::string cmodes;
for(char c='A'; c < 'z'; c++)
{
ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER);
if (mh && mh->NeedsOper() && tag->AllowedUserModes[c - 'A'])
umodes.push_back(c);
mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL);
if (mh && mh->NeedsOper() && tag->AllowedChanModes[c - 'A'])
cmodes.push_back(c);
}
results.push_back("243 "+user->nick+" O "+tag->name.c_str() + " " + umodes + " " + cmodes);
}
}
break;
/* stats l (show user I/O stats) */
case 'l':
results.push_back("211 "+user->nick+" :nick[[email protected]] sendq cmds_out bytes_out cmds_in bytes_in time_open");
for (LocalUserList::iterator n = ServerInstance->Users->local_users.begin(); n != ServerInstance->Users->local_users.end(); n++)
{
LocalUser* i = *n;
results.push_back("211 "+user->nick+" "+i->nick+"["+i->ident+"@"+i->dhost+"] "+ConvToStr(i->eh.getSendQSize())+" "+ConvToStr(i->cmds_out)+" "+ConvToStr(i->bytes_out)+" "+ConvToStr(i->cmds_in)+" "+ConvToStr(i->bytes_in)+" "+ConvToStr(ServerInstance->Time() - i->age));
}
break;
/* stats L (show user I/O stats with IP addresses) */
case 'L':
results.push_back("211 "+user->nick+" :nick[[email protected]] sendq cmds_out bytes_out cmds_in bytes_in time_open");
for (LocalUserList::iterator n = ServerInstance->Users->local_users.begin(); n != ServerInstance->Users->local_users.end(); n++)
{
LocalUser* i = *n;