本文整理汇总了C++中LocalUser::StartDNSLookup方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalUser::StartDNSLookup方法的具体用法?C++ LocalUser::StartDNSLookup怎么用?C++ LocalUser::StartDNSLookup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalUser
的用法示例。
在下文中一共展示了LocalUser::StartDNSLookup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddUser
//.........这里部分代码省略.........
/* The users default nick is their UUID */
New->nick.assign(New->uuid, 0, ServerInstance->Config->Limits.NickMax);
(*(this->clientlist))[New->nick] = New;
New->registered = REG_NONE;
New->signon = ServerInstance->Time() + ServerInstance->Config->dns_timeout;
New->lastping = 1;
ServerInstance->Users->AddLocalClone(New);
ServerInstance->Users->AddGlobalClone(New);
New->localuseriter = this->local_users.insert(local_users.end(), New);
if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)ServerInstance->SE->GetMaxFds()))
{
ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit);
this->QuitUser(New,"No more connections allowed");
return;
}
/*
* First class check. We do this again in FullConnect after DNS is done, and NICK/USER is recieved.
* See my note down there for why this is required. DO NOT REMOVE. :) -- w00t
*/
New->SetClass();
/*
* Check connect class settings and initialise settings into User.
* This will be done again after DNS resolution. -- w00t
*/
New->CheckClass();
if (New->quitting)
return;
/*
* even with bancache, we still have to keep User::exempt current.
* besides that, if we get a positive bancache hit, we still won't fuck
* them over if they are exempt. -- w00t
*/
New->exempt = (ServerInstance->XLines->MatchesLine("E",New) != NULL);
if (BanCacheHit *b = ServerInstance->BanCache->GetHit(New->GetIPString()))
{
if (!b->Type.empty() && !New->exempt)
{
/* user banned */
ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Positive hit for " + New->GetIPString());
if (!ServerInstance->Config->MoronBanner.empty())
New->WriteServ("NOTICE %s :*** %s", New->nick.c_str(), ServerInstance->Config->MoronBanner.c_str());
this->QuitUser(New, b->Reason);
return;
}
else
{
ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Negative hit for " + New->GetIPString());
}
}
else
{
if (!New->exempt)
{
XLine* r = ServerInstance->XLines->MatchesLine("Z",New);
if (r)
{
r->Apply(New);
return;
}
}
}
if (!ServerInstance->SE->AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
{
ServerInstance->Logs->Log("USERS", DEBUG,"Internal error on new connection");
this->QuitUser(New, "Internal error handling connection");
}
/* NOTE: even if dns lookups are *off*, we still need to display this.
* BOPM and other stuff requires it.
*/
New->WriteServ("NOTICE Auth :*** Looking up your hostname...");
if (ServerInstance->Config->RawLog)
New->WriteServ("NOTICE Auth :*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.");
FOREACH_MOD(I_OnSetUserIP,OnSetUserIP(New));
if (New->quitting)
return;
FOREACH_MOD(I_OnUserInit,OnUserInit(New));
if (ServerInstance->Config->NoUserDns)
{
New->WriteServ("NOTICE %s :*** Skipping host resolution (disabled by server administrator)", New->nick.c_str());
New->dns_done = true;
}
else
{
New->StartDNSLookup();
}
}