From 3d0d64933da3d37866fadfa042e34a1125315db6 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 13 Dec 2018 16:58:39 +0000 Subject: Update the cloaks of connected users when their IP address changes. --- src/modules/m_cloaking.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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)) -- cgit v1.2.3