本文整理汇总了C++中XLine::GetExpires方法的典型用法代码示例。如果您正苦于以下问题:C++ XLine::GetExpires方法的具体用法?C++ XLine::GetExpires怎么用?C++ XLine::GetExpires使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLine
的用法示例。
在下文中一共展示了XLine::GetExpires方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendAkill
void SendAkill(User *u, XLine *x) override
{
if (x->IsRegex() || x->HasNickOrReal())
{
if (!u)
{
/*
* No user (this akill was just added), and contains nick and/or realname.
* Find users that match and ban them.
*/
for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
if (x->GetManager()->Check(it->second, x))
this->SendAkill(it->second, x);
return;
}
XLine *old = x;
if (old->GetManager()->HasEntry("*@" + u->host))
return;
/* We can't akill x as it has a nick and/or realname included, so create a new akill for *@host */
XLine *xl = Serialize::New<XLine *>();
xl->SetMask("*@" + u->host);
xl->SetBy(old->GetBy());
xl->SetExpires(old->GetExpires());
xl->SetReason(old->GetReason());
xl->SetID(old->GetID());
old->GetManager()->AddXLine(xl);
x = xl;
Log(Config->GetClient("OperServ"), "akill") << "AKILL: Added an akill for " << x->GetMask() << " because " << u->GetMask() << "#"
<< u->realname << " matches " << old->GetMask();
}
/* Calculate the time left before this would expire, capping it at 2 days */
time_t timeleft = x->GetExpires() - Anope::CurTime;
if (timeleft > 172800 || !x->GetExpires())
timeleft = 172800;
Uplink::Send(Config->GetClient("OperServ"), "KLINE", timeleft, x->GetUser(), x->GetHost(), x->GetReason());
}