|
@ -17,24 +17,34 @@ |
|
|
|
|
|
|
|
|
typedef void(RenX::Server::*logFuncType)(const char *fmt, ...) const; |
|
|
typedef void(RenX::Server::*logFuncType)(const char *fmt, ...) const; |
|
|
|
|
|
|
|
|
void RenX_DNSPlugin::RenX_OnJoin(RenX::Server *server, const RenX::PlayerInfo *player) |
|
|
void RenX_DNSPlugin::RenX_OnPlayerCreate(RenX::Server *server, const RenX::PlayerInfo *player) |
|
|
{ |
|
|
{ |
|
|
Jupiter::ReferenceString host = Jupiter::ReferenceString(Jupiter::Socket::resolveHostname(Jupiter::CStringS(player->ip).c_str(), 0)); |
|
|
if (player->isBot == false) |
|
|
const_cast<RenX::PlayerInfo *>(player)->varData.set(RenX_DNSPlugin::name, STRING_LITERAL_AS_REFERENCE("Host"), host); |
|
|
|
|
|
|
|
|
|
|
|
logFuncType func; |
|
|
|
|
|
if (RenX_DNSPlugin::resolveAdmin) |
|
|
|
|
|
{ |
|
|
{ |
|
|
if (RenX_DNSPlugin::resolvePublic) |
|
|
Jupiter::ReferenceString host = Jupiter::ReferenceString(Jupiter::Socket::resolveHostname(Jupiter::CStringS(player->ip).c_str(), 0)); |
|
|
func = &RenX::Server::sendLogChan; |
|
|
const_cast<RenX::PlayerInfo *>(player)->varData.set(RenX_DNSPlugin::name, STRING_LITERAL_AS_REFERENCE("Host"), host); |
|
|
else func = &RenX::Server::sendAdmChan; |
|
|
|
|
|
} |
|
|
} |
|
|
else if (RenX_DNSPlugin::resolvePublic) |
|
|
} |
|
|
func = &RenX::Server::sendPubChan; |
|
|
|
|
|
else return; |
|
|
void RenX_DNSPlugin::RenX_OnJoin(RenX::Server *server, const RenX::PlayerInfo *player) |
|
|
|
|
|
{ |
|
|
|
|
|
if (player->isBot == false) |
|
|
|
|
|
{ |
|
|
|
|
|
logFuncType func; |
|
|
|
|
|
if (RenX_DNSPlugin::resolveAdmin) |
|
|
|
|
|
{ |
|
|
|
|
|
if (RenX_DNSPlugin::resolvePublic) |
|
|
|
|
|
func = &RenX::Server::sendLogChan; |
|
|
|
|
|
else func = &RenX::Server::sendAdmChan; |
|
|
|
|
|
} |
|
|
|
|
|
else if (RenX_DNSPlugin::resolvePublic) |
|
|
|
|
|
func = &RenX::Server::sendPubChan; |
|
|
|
|
|
else return; |
|
|
|
|
|
|
|
|
Jupiter::ReadableString &name = RenX::getFormattedPlayerName(player); |
|
|
const Jupiter::ReadableString &host = player->varData.get(RenX_DNSPlugin::name, STRING_LITERAL_AS_REFERENCE("Host"), Jupiter::ReferenceString::empty); |
|
|
(server->*func)(IRCCOLOR "03[DNS] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "'s hostname resolved to: " IRCBOLD IRCCOLOR "10%.*s" IRCBOLD, name.size(), name.ptr(), host.size(), host.ptr()); |
|
|
Jupiter::ReadableString &name = RenX::getFormattedPlayerName(player); |
|
|
|
|
|
(server->*func)(IRCCOLOR "03[DNS] " IRCBOLD "%.*s" IRCBOLD IRCCOLOR "'s hostname resolved to: " IRCBOLD IRCCOLOR "10%.*s" IRCBOLD, name.size(), name.ptr(), host.size(), host.ptr()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int RenX_DNSPlugin::OnRehash() |
|
|
int RenX_DNSPlugin::OnRehash() |
|
|