本文整理汇总了C++中MessageSource::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageSource::GetName方法的具体用法?C++ MessageSource::GetName怎么用?C++ MessageSource::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageSource
的用法示例。
在下文中一共展示了MessageSource::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
/*
* CHANINFO is used by servers to inform each other about a channel: its
* modes, channel key, user limits and its topic. The parameter combination
* <key> and <limit> is optional, as well as the <topic> parameter, so that
* there are three possible forms of this command:
*
* CHANINFO <chan> +<modes>
* CHANINFO <chan> +<modes> :<topic>
* CHANINFO <chan> +<modes> <key> <limit> :<topic>
*
* The parameter <key> must be ignored if a channel has no key (the parameter
* <modes> doesn't list the "k" channel mode). In this case <key> should
* contain "*" because the parameter <key> is required by the CHANINFO syntax
* and therefore can't be omitted. The parameter <limit> must be ignored when
* a channel has no user limit (the parameter <modes> doesn't list the "l"
* channel mode). In this case <limit> should be "0".
*/
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override
{
bool created;
Channel *c = Channel::FindOrCreate(params[0], created);
Anope::string modes = params[1];
if (params.size() == 3)
{
c->ChangeTopicInternal(NULL, source.GetName(), params[2], Anope::CurTime);
}
else if (params.size() == 5)
{
for (size_t i = 0, end = params[1].length(); i < end; ++i)
{
switch(params[1][i])
{
case 'k':
modes += " " + params[2];
continue;
case 'l':
modes += " " + params[3];
continue;
}
}
c->ChangeTopicInternal(NULL, source.GetName(), params[4], Anope::CurTime);
}
c->SetModesInternal(source, modes);
}
示例2: KillInternal
void User::KillInternal(const MessageSource &source, const Anope::string &reason)
{
if (this->quit)
{
Log(LOG_DEBUG) << "Duplicate quit for " << this->nick;
return;
}
Log(this, "killed") << "was killed by " << source.GetName() << " (Reason: " << reason << ")";
this->Quit(reason);
}
示例3: Kill
void User::Kill(const MessageSource &source, const Anope::string &reason)
{
Anope::string real_reason = source.GetName() + " (" + reason + ")";
IRCD->SendSVSKill(source, this, "%s", real_reason.c_str());
}