catch (DNS::Exception& e)
{
delete res_forward;
- ServerInstance->Logs->Log("RESOLVER", LOG_DEBUG,"Error in resolver: %s",e.GetReason());
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error in resolver: " + e.GetReason());
- bound_user->WriteServ("NOTICE Auth :*** There was an internal error resolving your host, using your IP address (%s) instead.", bound_user->GetIPString().c_str());
+ bound_user->WriteNotice("*** There was an internal error resolving your host, using your IP address (" + bound_user->GetIPString() + ") instead.");
dl->set(bound_user, 0);
}
}
if (hostname == NULL)
{
ServerInstance->Logs->Log("RESOLVER", LOG_DEFAULT, "ERROR: User has no hostname attached when doing a forward lookup");
- bound_user->WriteServ("NOTICE Auth :*** There was an internal error resolving your host, using your IP address (%s) instead.", bound_user->GetIPString().c_str());
+ bound_user->WriteNotice("*** There was an internal error resolving your host, using your IP address (" + bound_user->GetIPString() + ") instead.");
return;
}
else if (hostname->length() < 65)
if ((*hostname)[0] == ':')
hostname->insert(0, "0");
- bound_user->WriteServ("NOTICE Auth :*** Found your hostname (%s)%s", hostname->c_str(), (r->cached ? " -- cached" : ""));
+ bound_user->WriteNotice("*** Found your hostname (" + *hostname + (r->cached ? ") -- cached" : ")"));
bound_user->host.assign(*hostname, 0, 64);
bound_user->dhost = bound_user->host;
}
else
{
- bound_user->WriteServ("NOTICE Auth :*** Your hostname is longer than the maximum of 64 characters, using your IP address (%s) instead.", bound_user->GetIPString().c_str());
+ bound_user->WriteNotice("*** Your hostname is longer than the maximum of 64 characters, using your IP address (" + bound_user->GetIPString() + ") instead.");
}
ph->unset(bound_user);
}
else
{
- bound_user->WriteServ("NOTICE Auth :*** Your hostname does not match up with your IP address. Sorry, using your IP address (%s) instead.", bound_user->GetIPString().c_str());
+ bound_user->WriteNotice("*** Your hostname does not match up with your IP address. Sorry, using your IP address (" + bound_user->GetIPString() + ") instead.");
}
}
}
LocalUser* bound_user = (LocalUser*)ServerInstance->FindUUID(uuid);
if (bound_user)
{
- bound_user->WriteServ("NOTICE Auth :*** Could not resolve your hostname: %s; using your IP address (%s) instead.", this->manager->GetErrorStr(query->error).c_str(), bound_user->GetIPString().c_str());
+ bound_user->WriteNotice("*** Could not resolve your hostname: " + this->manager->GetErrorStr(query->error) + "; using your IP address (" + bound_user->GetIPString() + ") instead.");
dl->set(bound_user, 0);
ServerInstance->stats->statsDnsBad++;
}
ph = &ptrHosts;
}
- void init()
- {
- OnRehash(NULL);
- ServerInstance->Modules->AddService(this->dnsLookup);
- ServerInstance->Modules->AddService(this->ptrHosts);
-
- Implementation i[] = { I_OnUserInit, I_OnCheckReady };
- ServerInstance->Modules->Attach(i, this, sizeof(i) / sizeof(Implementation));
- }
-
void OnUserInit(LocalUser *user)
{
- if (!DNS || user->MyClass->nouserdns)
+ if (!DNS || !user->MyClass->resolvehostnames)
{
- user->WriteServ("NOTICE %s :*** Skipping host resolution (disabled by server administrator)", user->nick.c_str());
+ user->WriteNotice("*** Skipping host resolution (disabled by server administrator)");
return;
}
- user->WriteServ("NOTICE Auth :*** Looking up your hostname...");
+ user->WriteNotice("*** Looking up your hostname...");
UserResolver* res_reverse = new UserResolver(*this->DNS, this, user, user->GetIPString(), DNS::QUERY_PTR);
try
{
this->dnsLookup.set(user, 0);
delete res_reverse;
- ServerInstance->Logs->Log("USERS", LOG_DEBUG,"Error in resolver: %s", e.GetReason());
+ ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error in resolver: " + e.GetReason());
ServerInstance->stats->statsDnsBad++;
}
}