diff options
author | Adam <Adam@anope.org> | 2014-10-14 18:58:55 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-10-14 18:58:55 -0400 |
commit | 0cd3bfa24fccea79a5055bcd12d6aa607ecc635e (patch) | |
tree | 55f039e3344f842ab1fb76d0ed50e7f2454ce895 /modules/commands/os_defcon.cpp | |
parent | e46bcff32467deef0d83790a1587cc5d6d442337 (diff) |
Fix module event prioritization which was broken with the newer
auto-attach event stuff.
Also remove logically dead code from os_defcon, and make os_defcon akill
similar masks to os_session when enforcing session akills.
Fixes #1618 which relies on os_session to be prioritized before
os_defcon.
Diffstat (limited to 'modules/commands/os_defcon.cpp')
-rw-r--r-- | modules/commands/os_defcon.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 247938049..da9621cfd 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -496,11 +496,6 @@ class OSDefcon : public Module XLine x("*@" + u->host, OperServ ? OperServ->nick : "defcon", Anope::CurTime + DConfig.akillexpire, DConfig.akillreason, XLineManager::GenerateUID()); akills->Send(NULL, &x); } - if (DConfig.Check(DEFCON_NO_NEW_CLIENTS) || DConfig.Check(DEFCON_AKILL_NEW_CLIENTS)) - { - u->Kill(OperServ ? OperServ->nick : "", DConfig.akillreason); - return; - } if (DConfig.Check(DEFCON_NO_NEW_CLIENTS) || DConfig.Check(DEFCON_AKILL_NEW_CLIENTS)) { @@ -529,9 +524,9 @@ class OSDefcon : public Module ++session->hits; if (akills && DConfig.max_session_kill && session->hits >= DConfig.max_session_kill) { - XLine x("*@" + u->host, OperServ ? OperServ->nick : "", Anope::CurTime + DConfig.session_autokill_expiry, "Defcon session limit exceeded", XLineManager::GenerateUID()); + XLine x("*@" + session->addr.mask(), OperServ ? OperServ->nick : "", Anope::CurTime + DConfig.session_autokill_expiry, "Defcon session limit exceeded", XLineManager::GenerateUID()); akills->Send(NULL, &x); - Log(OperServ, "akill/defcon") << "[DEFCON] Added a temporary AKILL for \002*@" << u->host << "\002 due to excessive connections"; + Log(OperServ, "akill/defcon") << "[DEFCON] Added a temporary AKILL for \002*@" << session->addr.mask() << "\002 due to excessive connections"; } else { |