mirror of
https://github.com/anope/anope.git
synced 2026-06-29 03:06:37 +02:00
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.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -639,7 +639,10 @@ class OSSession : public Module
|
||||
exception_type("Exception", Exception::Unserialize), ss(this), commandossession(this), commandosexception(this), akills("XLineManager", "xlinemanager/sgline")
|
||||
{
|
||||
this->SetPermanent(true);
|
||||
}
|
||||
|
||||
void Prioritize() anope_override
|
||||
{
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,10 @@ class NSIdentifyLDAP : public Module
|
||||
{
|
||||
|
||||
me = this;
|
||||
}
|
||||
|
||||
void Prioritize() anope_override
|
||||
{
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
|
||||
@@ -1258,7 +1258,10 @@ class ProtoUnreal : public Module
|
||||
{
|
||||
|
||||
this->AddModes();
|
||||
}
|
||||
|
||||
void Prioritize() anope_override
|
||||
{
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user