From 7cfd4039ca3a835abfa88dfd595187fb11aa6901 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Fri, 13 Aug 2010 16:56:24 -0400 Subject: Remove duplicated settings now solely defined by the class --- src/users.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 8a239a2d8..1fc51661b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -465,18 +465,14 @@ void UserIOHandler::OnDataReady() if (user->quitting) return; - if (recvq.length() > user->MyClass->recvqmax && !user->HasPrivPermission("users/flood/increased-buffers")) + if (recvq.length() > user->MyClass->recvqmax) { ServerInstance->Users->QuitUser(user, "RecvQ exceeded"); - ServerInstance->SNO->WriteToSnoMask('a', "User %s RecvQ of %lu exceeds connect class maximum of %lu", - user->nick.c_str(), (unsigned long)recvq.length(), user->MyClass->recvqmax); + ServerInstance->SNO->WriteToSnoMask('a', "User %s RecvQ exceeds maximum of %lu (class %s)", + user->nick.c_str(), user->MyClass->recvqmax, user->MyClass->name.c_str()); } - unsigned long sendqmax = ULONG_MAX; - if (!user->HasPrivPermission("users/flood/increased-buffers")) - sendqmax = user->MyClass->softsendqmax; - unsigned long penaltymax = ULONG_MAX; - if (!user->HasPrivPermission("users/flood/no-fakelag")) - penaltymax = user->MyClass->penaltythreshold * 1000; + unsigned long sendqmax = user->MyClass->softsendqmax; + unsigned long penaltymax = user->MyClass->penaltythreshold * 1000; while (user->CommandFloodPenalty < penaltymax && getSendQSize() < sendqmax) { @@ -505,7 +501,6 @@ eol_found: // just found a newline. Terminate the string, and pull it out of recvq recvq = recvq.substr(qpos); - // TODO should this be moved to when it was inserted in recvq? ServerInstance->stats->statsRecv += qpos; user->bytes_in += qpos; user->cmds_in++; @@ -523,16 +518,15 @@ eol_found: void UserIOHandler::AddWriteBuf(const std::string &data) { - if (!user->quitting && getSendQSize() + data.length() > user->MyClass->hardsendqmax && - !user->HasPrivPermission("users/flood/increased-buffers")) + if (!user->quitting && getSendQSize() + data.length() > user->MyClass->hardsendqmax) { /* * Quit the user FIRST, because otherwise we could recurse * here and hit the same limit. */ ServerInstance->Users->QuitUser(user, "SendQ exceeded"); - ServerInstance->SNO->WriteToSnoMask('a', "User %s SendQ exceeds connect class maximum of %lu", - user->nick.c_str(), user->MyClass->hardsendqmax); + ServerInstance->SNO->WriteToSnoMask('a', "User %s SendQ exceeds maximum of %lu (class %s)", + user->nick.c_str(), user->MyClass->hardsendqmax, user->MyClass->name.c_str()); return; } -- cgit v1.3.1-10-gc9f91