本文整理汇总了C++中MessageSource::GetSource方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageSource::GetSource方法的具体用法?C++ MessageSource::GetSource怎么用?C++ MessageSource::GetSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageSource
的用法示例。
在下文中一共展示了MessageSource::GetSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
void Topic::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
Channel *c = Channel::Find(params[0]);
if (c)
c->ChangeTopicInternal(source.GetUser(), source.GetSource(), params[1], Anope::CurTime);
return;
}
示例2:
void Message::Stats::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
User *u = source.GetUser();
switch (params[0][0])
{
case 'l':
if (u->HasMode("OPER"))
{
IRCD->SendNumeric(211, source.GetSource(), "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
IRCD->SendNumeric(211, source.GetSource(), "%s %d %d %d %d %d %d %ld", Config->Uplinks[Anope::CurrentUplink].host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, static_cast<long>(Anope::CurTime - Anope::StartTime));
}
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
break;
case 'o':
case 'O':
/* Check whether the user is an operator */
if (!u->HasMode("OPER") && Config->GetBlock("options")->Get<bool>("hidestatso"))
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
else
{
for (Oper *o : Serialize::GetObjects<Oper *>())
IRCD->SendNumeric(243, source.GetSource(), "O * * %s %s 0", o->GetName().c_str(), o->GetType()->GetName().replace_all_cs(" ", "_").c_str());
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
}
break;
case 'u':
{
::Stats *s = Serialize::GetObject<::Stats *>();
long uptime = static_cast<long>(Anope::CurTime - Anope::StartTime);
IRCD->SendNumeric(242, source.GetSource(), ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
IRCD->SendNumeric(250, source.GetSource(), ":Current users: %d (%d ops); maximum %d", UserListByNick.size(), OperCount, s ? s->GetMaxUserCount() : 0);
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
break;
} /* case 'u' */
default:
IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
}
return;
}