summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-10-11 12:21:16 +0100
committerPeter Powell <petpow@saberuk.com>2019-10-13 22:05:19 +0100
commitdd24f8ac713793d5d5a7e959228937f48788ba66 (patch)
tree1f55ed9c83ad62acdb628f77f0b347044f26d61a /src/coremods
parentf751aef21057d8b4be40cdb697982ea3e53e992c (diff)
Convert a bunch of LocalUser* casts to IS_LOCAL.
This is a lot safer and handles users changing servers properly.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_hostname_lookup.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp
index 85d0f530c..13214115b 100644
--- a/src/coremods/core_hostname_lookup.cpp
+++ b/src/coremods/core_hostname_lookup.cpp
@@ -58,7 +58,7 @@ class UserResolver : public DNS::Request
*/
void OnLookupComplete(const DNS::Query* r) CXX11_OVERRIDE
{
- LocalUser* bound_user = (LocalUser*)ServerInstance->FindUUID(uuid);
+ LocalUser* bound_user = IS_LOCAL(ServerInstance->FindUUID(uuid));
if (!bound_user)
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Resolution finished for user '%s' who is gone", uuid.c_str());
@@ -166,7 +166,7 @@ class UserResolver : public DNS::Request
*/
void OnError(const DNS::Query* query) CXX11_OVERRIDE
{
- LocalUser* bound_user = (LocalUser*)ServerInstance->FindUUID(uuid);
+ LocalUser* bound_user = IS_LOCAL(ServerInstance->FindUUID(uuid));
if (bound_user)
{
bound_user->WriteNotice("*** Could not resolve your hostname: " + this->manager->GetErrorStr(query->error) + "; using your IP address (" + bound_user->GetIPString() + ") instead.");