summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_connflood.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index 809055a5a..fe581e072 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -27,6 +27,7 @@
class ModuleConnFlood : public Module
{
+ private:
unsigned int seconds;
unsigned int timeout;
unsigned int boot_wait;
@@ -36,6 +37,16 @@ class ModuleConnFlood : public Module
time_t first;
std::string quitmsg;
+ static bool IsExempt(LocalUser* user)
+ {
+ // E-lined and already banned users shouldn't be hit.
+ if (user->exempt || user->quitting)
+ return true;
+
+ // Users in an exempt class shouldn't be hit.
+ return user->GetClass() && !user->GetClass()->config->getBool("useconnflood", true);
+ }
+
public:
ModuleConnFlood()
: conns(0), throttled(false)
@@ -65,7 +76,7 @@ public:
ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE
{
- if (user->exempt)
+ if (IsExempt(user))
return MOD_RES_PASSTHRU;
time_t next = ServerInstance->Time();