本文整理汇总了C++中MessageSource::GetServer方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageSource::GetServer方法的具体用法?C++ MessageSource::GetServer怎么用?C++ MessageSource::GetServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageSource
的用法示例。
在下文中一共展示了MessageSource::GetServer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void hybrid::SID::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new ::Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], hops, params[3], params[2]);
IRCD->SendPing(Me->GetName(), params[0]);
}
示例2: Server
/* SERVER hades.arpa 1 :ircd-hybrid test server */
void plexus::ServerMessage::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
/* Servers other than our immediate uplink are introduced via SID */
if (params[1] != "1")
return;
new Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
}
示例3:
// SERVER hades.arpa 1 :ircd-ratbox test server
void ratbox::Server::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
// Servers other then our immediate uplink are introduced via SID
if (params[1] != "1")
return;
new ::Server(source.GetServer() == NULL ? Me : source.GetServer(), params[0], 1, params[2], UplinkSID);
IRCD->SendPing(Me->GetName(), params[0]);
}
示例4:
// :42X UID Adam 1 1348535644 +aow Adam 192.168.0.5 192.168.0.5 42XAAAAAB 0 192.168.0.5 :Adam
void plexus::UID::Run(MessageSource &source, const std::vector<Anope::string> ¶ms)
{
/* An IP of 0 means the user is spoofed */
Anope::string ip = params[6];
if (ip == "0")
ip.clear();
time_t ts;
try
{
ts = convertTo<time_t>(params[2]);
}
catch (const ConvertException &)
{
ts = Anope::CurTime;
}
NickServ::Nick *na = NULL;
try
{
if (params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == ts)
na = NickServ::FindNick(params[0]);
}
catch (const ConvertException &) { }
if (params[8] != "0" && !na)
na = NickServ::FindNick(params[8]);
User::OnIntroduce(params[0], params[4], params[9], params[5], ip, source.GetServer(), params[10], ts, params[3], params[7], na ? na->GetAccount() : NULL);
}
示例5: Run
/*
* :42X EUID DukePyrolator 1 1353240577 +Zi ~jens erft-5d80b00b.pool.mediaWays.net 93.128.176.11 42XAAAAAD * * :jens
* :<SID> EUID <NICK> <HOPS> <TS> +<UMODE> <USERNAME> <VHOST> <IP> <UID> <REALHOST> <ACCOUNT> :<GECOS>
* 0 1 2 3 4 5 6 7 8 9 10
*
* Introduces a user. The hostname field is now always the visible host.
* The realhost field is * if the real host is equal to the visible host.
* The account field is * if the login is not set.
* Note that even if both new fields are *, an EUID command still carries more
* information than a UID command (namely that real host is visible host and the
* user is not logged in with services). Hence a NICK or UID command received
* from a remote server should not be sent in EUID form to other servers.
*/
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override
{
NickServ::Nick *na = NULL;
if (params[9] != "*")
na = NickServ::FindNick(params[9]);
User::OnIntroduce(params[0], params[4], params[8], params[5], params[6], source.GetServer(), params[10], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : Anope::CurTime, params[3], params[7], na ? na->GetAccount() : NULL);
}
示例6: Run
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override
{
if (params.size() == 3)
{
// our uplink is introducing itself
new Server(Me, params[0], 1, params[2], "1");
}
else
{
// our uplink is introducing a new server
unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
new Server(source.GetServer(), params[0], hops, params[3], params[2]);
}
/*
* ngIRCd does not send an EOB, so we send a PING immediately
* when receiving a new server and then finish sync once we
* get a pong back from that server.
*/
IRCD->SendPing(Me->GetName(), params[0]);
}
示例7: SJoin
void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users)
{
bool created;
Channel *c = Channel::FindOrCreate(chan, created, ts ? ts : Anope::CurTime);
bool keep_their_modes = true;
if (created)
c->syncing = true;
/* Some IRCds do not include a TS */
else if (!ts)
;
/* Our creation time is newer than what the server gave us, so reset the channel to the older time */
else if (c->creation_time > ts)
{
c->creation_time = ts;
c->Reset();
}
/* Their TS is newer, don't accept any modes from them */
else if (ts > c->creation_time)
keep_their_modes = false;
/* Update the modes for the channel */
if (keep_their_modes && !modes.empty())
/* If we are syncing, mlock is checked later in Channel::Sync. It is important to not check it here
* so that Channel::SetCorrectModes can correctly detect the presence of channel mode +r.
*/
c->SetModesInternal(source, modes, ts, !c->syncing);
for (std::list<SJoinUser>::const_iterator it = users.begin(), it_end = users.end(); it != it_end; ++it)
{
const ChannelStatus &status = it->first;
User *u = it->second;
keep_their_modes = ts <= c->creation_time; // OnJoinChannel can call modules which can modify this channel's ts
if (c->FindUser(u))
continue;
/* Add the user to the channel */
c->JoinUser(u, keep_their_modes ? &status : NULL);
/* Check if the user is allowed to join */
if (c->CheckKick(u))
continue;
/* Set whatever modes the user should have, and remove any that
* they aren't allowed to have (secureops etc).
*/
c->SetCorrectModes(u, true);
EventManager::Get()->Dispatch(&Event::JoinChannel::OnJoinChannel, u, c);
}
/* Channel is done syncing */
if (c->syncing)
{
/* Sync the channel (mode lock, topic, etc) */
/* the channel is synced when the netmerge is complete */
Server *src = source.GetServer() ? source.GetServer() : Me;
if (src && src->IsSynced())
{
c->Sync();
if (c->CheckDelete())
delete c;
}
}
}
示例8: Run
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) override
{
source.GetServer()->Sync(true);
}