本文整理汇总了C++中Channel::GetPrefixChar方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::GetPrefixChar方法的具体用法?C++ Channel::GetPrefixChar怎么用?C++ Channel::GetPrefixChar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::GetPrefixChar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChannelList
std::string User::ChannelList(User* source, bool spy)
{
std::string list;
for (UCListIter i = this->chans.begin(); i != this->chans.end(); i++)
{
Channel* c = *i;
/* If the target is the sender, neither +p nor +s is set, or
* the channel contains the user, it is not a spy channel
*/
if (spy != (source == this || !(c->IsModeSet('p') || c->IsModeSet('s')) || c->HasUser(source)))
list.append(c->GetPrefixChar(this)).append(c->name).append(" ");
}
return list;
}
示例2: ChannelList
std::string CommandWhois::ChannelList(User* source, User* dest, bool spy)
{
std::string list;
for (UCListIter i = dest->chans.begin(); i != dest->chans.end(); i++)
{
Channel* c = *i;
/* If the target is the sender, neither +p nor +s is set, or
* the channel contains the user, it is not a spy channel
*/
if (spy != (source == dest || !(c->IsModeSet(privatemode) || c->IsModeSet(secretmode)) || c->HasUser(source)))
list.append(c->GetPrefixChar(dest)).append(c->name).append(" ");
}
return list;
}
示例3: Handle
//.........这里部分代码省略.........
for(std::set<std::string>::iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); i++)
{
opcmds.push_back(' ');
opcmds.append(*i);
}
std::stringstream opcmddump(opcmds);
user->SendText(checkstr + " commandperms", opcmddump);
std::string privs;
for(std::set<std::string>::iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); i++)
{
privs.push_back(' ');
privs.append(*i);
}
std::stringstream privdump(privs);
user->SendText(checkstr + " permissions", privdump);
}
}
if (loctarg)
{
user->SendText(checkstr + " clientaddr " + loctarg->client_sa.str());
user->SendText(checkstr + " serveraddr " + loctarg->server_sa.str());
std::string classname = loctarg->GetClass()->name;
if (!classname.empty())
user->SendText(checkstr + " connectclass " + classname);
}
else
user->SendText(checkstr + " onip " + targuser->GetIPString());
for (UCListIter i = targuser->chans.begin(); i != targuser->chans.end(); i++)
{
Channel* c = (*i)->chan;
chliststr.append(c->GetPrefixChar(targuser)).append(c->name).append(" ");
}
std::stringstream dump(chliststr);
user->SendText(checkstr + " onchans", dump);
dumpExt(user, checkstr, targuser);
}
else if (targchan)
{
/* /check on a channel */
user->SendText(checkstr + " timestamp " + timestring(targchan->age));
if (targchan->topic[0] != 0)
{
/* there is a topic, assume topic related information exists */
user->SendText(checkstr + " topic " + targchan->topic);
user->SendText(checkstr + " topic_setby " + targchan->setby);
user->SendText(checkstr + " topic_setat " + timestring(targchan->topicset));
}
user->SendText(checkstr + " modes " + targchan->ChanModes(true));
user->SendText(checkstr + " membercount " + ConvToStr(targchan->GetUserCounter()));
/* now the ugly bit, spool current members of a channel. :| */
const UserMembList *ulist= targchan->GetUsers();
/* note that unlike /names, we do NOT check +i vs in the channel */
for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
{
/*