本文整理汇总了C++中Channel::Kick方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::Kick方法的具体用法?C++ Channel::Kick怎么用?C++ Channel::Kick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::Kick方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
{
User *u = source.u;
const Anope::string &chan = params[0];
const Anope::string &nick = params[1];
const Anope::string &s = params[2];
Channel *c;
User *u2;
if (!(c = findchan(chan)))
{
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return;
}
else if (c->bouncy_modes)
{
source.Reply(_("Services is unable to change modes. Are your servers' U:lines configured correctly?"));
return;
}
else if (!(u2 = finduser(nick)))
{
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
return;
}
c->Kick(source.owner, u2, "%s (%s)", u->nick.c_str(), s.c_str());
Log(LOG_ADMIN, u, this) << "on " << u2->nick << " in " << c->name << " (" << s << ")";
return;
}
示例2: HandleChannelKick
void WorldSession::HandleChannelKick(WorldPacket& recvPacket)
{
string channelname,otp;
recvPacket >> channelname;
recvPacket >> otp;
Channel *chn = channelmgr.GetChannel(channelname.c_str(),GetPlayer()); if(chn) chn->Kick(GetPlayer(),otp.c_str());
}
示例3: Execute
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
{
const Anope::string &chan = params[0];
const Anope::string &nick = params[1];
const Anope::string &s = params[2];
Channel *c;
User *u2;
if (!(c = Channel::Find(chan)))
{
source.Reply(_("Channel \002%s\002 doesn't exist."), chan);
return;
}
if (c->bouncy_modes)
{
source.Reply(_("Services is unable to change modes. Are your servers' U:lines configured correctly?"));
return;
}
if (!(u2 = User::Find(nick, true)))
{
source.Reply(_("\002{0}\002 isn't currently online."), nick);
return;
}
if (!c->Kick(source.service, u2, "%s (%s)", source.GetNick().c_str(), s.c_str()))
{
source.Reply(_("Access denied."));
return;
}
Log(LOG_ADMIN, source, this) << "on " << u2->nick << " in " << c->name << " (" << s << ")";
}
示例4: HandleChannelBan
void WorldSession::HandleChannelBan(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket, 1);
string channelname,newp;
Channel * chn;
Player* plr;
recvPacket >> channelname;
recvPacket >> newp;
chn = channelmgr.GetChannel(channelname.c_str(), _player);
plr = objmgr.GetPlayer(newp.c_str(), false);
if( chn != NULL && plr != NULL )
chn->Kick(_player, plr, true);
}
示例5: HandleChannelKick
void WorldSession::HandleChannelKick(WorldPacket& recvPacket)
{
CHECK_INWORLD_RETURN
CHECK_PACKET_SIZE(recvPacket, 1);
std::string channelname, newp;
Channel* chn;
Player* plr;
recvPacket >> channelname;
recvPacket >> newp;
chn = channelmgr.GetChannel(channelname.c_str(), _player);
plr = objmgr.GetPlayer(newp.c_str(), false);
if (chn && plr)
chn->Kick(_player, plr, false);
}
示例6: Execute
//.........这里部分代码省略.........
++it;
d = this->fs->FindForbid(c->name, FT_CHAN);
if (d == NULL)
continue;
ServiceBot *OperServ = Config->GetClient("OperServ");
if (IRCD->CanSQLineChannel && OperServ)
{
time_t inhabit = Config->GetModule("chanserv")->Get<time_t>("inhabit", "15s");
#warning "xline allocated on stack"
#if 0
XLine x(c->name, OperServ->nick, Anope::CurTime + inhabit, d->GetReason());
IRCD->SendSQLine(NULL, &x);
#endif
}
else if (ChanServ::service)
{
ChanServ::service->Hold(c);
}
++chan_matches;
for (Channel::ChanUserList::const_iterator cit = c->users.begin(), cit_end = c->users.end(); cit != cit_end;)
{
User *u = cit->first;
++cit;
if (u->server == Me || u->HasMode("OPER"))
continue;
reason = Anope::printf(Language::Translate(u, _("This channel has been forbidden: \002%s\002")), d->GetReason().c_str());
c->Kick(source.service, u, "%s", reason.c_str());
}
}
for (auto it = ChanServ::service->GetChannels().begin(); it != ChanServ::service->GetChannels().end();)
{
ChanServ::Channel *ci = it->second;
++it;
d = this->fs->FindForbid(ci->GetName(), FT_CHAN);
if (d == NULL)
continue;
++ci_matches;
delete ci;
}
source.Reply(_("\002{0}\002 channel(s) cleared, and \002{1}\002 channel(s) dropped."), chan_matches, ci_matches);
break;
}
default:
break;
}
}
else if (command.equals_ci("DEL") && params.size() > 2 && ftype != FT_SIZE)
{
const Anope::string &entry = params[2];
ForbidData *d = this->fs->FindForbid(entry, ftype);
if (d == nullptr)