summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp2
-rw-r--r--src/configreader.cpp1
-rw-r--r--src/users.cpp5
3 files changed, 5 insertions, 3 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index fe0aab3b9..6dd4e663e 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -253,7 +253,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
{
// If it *doesn't* exist, give it a slightly heftier penalty than normal to deter flooding us crap
user->IncreasePenalty(cm != cmdlist.end() ? cm->second->Penalty : 2);
- do_more = (user->Penalty < 10);
+ do_more = (user->GetClass()->GetPenaltyThreshold() && ((unsigned long)user->Penalty < user->GetClass()->GetPenaltyThreshold()));
}
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 545ff86c2..879aeaa8e 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -724,6 +724,7 @@ void ServerConfig::CrossCheckConnectBlocks(ServerConfig* current)
me->softsendqmax = tag->getInt("softsendq", me->softsendqmax);
me->hardsendqmax = tag->getInt("hardsendq", me->hardsendqmax);
me->recvqmax = tag->getInt("recvq", me->recvqmax);
+ me->penaltythreshold = tag->getInt("threshold", me->penaltythreshold);
me->maxlocal = tag->getInt("localmax", me->maxlocal);
me->maxglobal = tag->getInt("globalmax", me->maxglobal);
me->port = tag->getInt("port", me->port);
diff --git a/src/users.cpp b/src/users.cpp
index 4707fdc39..1675b621b 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1778,7 +1778,7 @@ const std::string FakeUser::GetFullRealHost()
ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask)
: config(tag), type(t), name("unnamed"), registration_timeout(0), host(mask),
pingtime(0), pass(""), hash(""), softsendqmax(0), hardsendqmax(0),
- recvqmax(0), maxlocal(0), maxglobal(0), maxchans(0), port(0), limit(0)
+ recvqmax(0), penaltythreshold(0), maxlocal(0), maxglobal(0), maxchans(0), port(0), limit(0)
{
}
@@ -1787,7 +1787,7 @@ ConnectClass::ConnectClass(ConfigTag* tag, char t, const std::string& mask, cons
registration_timeout(parent.registration_timeout), host(mask),
pingtime(parent.pingtime), pass(parent.pass), hash(parent.hash),
softsendqmax(parent.softsendqmax), hardsendqmax(parent.hardsendqmax),
- recvqmax(parent.recvqmax), maxlocal(parent.maxlocal),
+ recvqmax(parent.recvqmax), penaltythreshold(parent.penaltythreshold), maxlocal(parent.maxlocal),
maxglobal(parent.maxglobal), maxchans(parent.maxchans),
port(parent.port), limit(parent.limit)
{
@@ -1804,6 +1804,7 @@ void ConnectClass::Update(const ConnectClass* src)
softsendqmax = src->softsendqmax;
hardsendqmax = src->hardsendqmax;
recvqmax = src->recvqmax;
+ penaltythreshold = src->penaltythreshold;
maxlocal = src->maxlocal;
maxglobal = src->maxglobal;
limit = src->limit;