diff options
author | Peter Powell <petpow@saberuk.com> | 2018-12-13 16:58:39 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-12-13 16:58:39 +0000 |
commit | 3d0d64933da3d37866fadfa042e34a1125315db6 (patch) | |
tree | 6cd5eb3af71d06e2afa5171f2e4055a116017291 /src/modules/m_cloaking.cpp | |
parent | ee7db9bbfbb5f3bc7359d22e7021415aebddb9d2 (diff) |
Update the cloaks of connected users when their IP address changes.
Diffstat (limited to 'src/modules/m_cloaking.cpp')
-rw-r--r-- | src/modules/m_cloaking.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 756781ef0..3b00d3347 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -466,6 +466,24 @@ class ModuleCloaking : public Module return chost; } + void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE + { + // Connecting users are handled in OnUserConnect not here. + if (user->registered != REG_ALL) + return; + + // Remove the cloaks and generate new ones. + cu.ext.unset(user); + OnUserConnect(user); + + // If a user is using a cloak then update it. + if (user->IsModeSet(cu)) + { + CloakList* cloaklist = cu.ext.get(user); + user->ChangeDisplayedHost(cloaklist->front()); + } + } + void OnUserConnect(LocalUser* dest) CXX11_OVERRIDE { if (cu.ext.get(dest)) |