From ad2aecf19116b1491fa3776e069e1160d4e76927 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 22 Jul 2022 20:44:47 +0100 Subject: Remove some unnecessary getters in ConnectClass. All of these members are public anyway. --- src/users.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 3e47a9aae..66709d06e 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -243,21 +243,21 @@ void UserIOHandler::OnDataReady() if (user->quitting) return; - if (recvq.length() > user->GetClass()->GetRecvqMax() && !user->HasPrivPermission("users/flood/increased-buffers")) + if (recvq.length() > user->GetClass()->recvqmax && !user->HasPrivPermission("users/flood/increased-buffers")) { ServerInstance->Users.QuitUser(user, "RecvQ exceeded"); ServerInstance->SNO.WriteToSnoMask('a', "User %s RecvQ of %zu exceeds connect class maximum of %lu", - user->nick.c_str(), recvq.length(), user->GetClass()->GetRecvqMax()); + user->nick.c_str(), recvq.length(), user->GetClass()->recvqmax); return; } unsigned long sendqmax = ULONG_MAX; if (!user->HasPrivPermission("users/flood/increased-buffers")) - sendqmax = user->GetClass()->GetSendqSoftMax(); + sendqmax = user->GetClass()->softsendqmax; unsigned long penaltymax = ULONG_MAX; if (!user->HasPrivPermission("users/flood/no-fakelag")) - penaltymax = user->GetClass()->GetPenaltyThreshold() * 1000; + penaltymax = user->GetClass()->penaltythreshold * 1000; // The cleaned message sent by the user or empty if not found yet. std::string line; @@ -320,7 +320,8 @@ void UserIOHandler::AddWriteBuf(const std::string &data) { if (user->quitting_sendq) return; - if (!user->quitting && GetSendQSize() + data.length() > user->GetClass()->GetSendqHardMax() && + + if (!user->quitting && GetSendQSize() + data.length() > user->GetClass()->hardsendqmax && !user->HasPrivPermission("users/flood/increased-buffers")) { user->quitting_sendq = true; @@ -508,29 +509,29 @@ void LocalUser::CheckClass(bool clone_count) else if (clone_count) { const UserManager::CloneCounts& clonecounts = ServerInstance->Users.GetCloneCounts(this); - if ((a->GetMaxLocal()) && (clonecounts.local > a->GetMaxLocal())) + if (a->maxlocal && clonecounts.local > a->maxlocal) { ServerInstance->Users.QuitUser(this, "No more connections allowed from your host via this connect class (local)"); if (a->maxconnwarn) { ServerInstance->SNO.WriteToSnoMask('a', "WARNING: maximum local connections for the %s class (%ld) exceeded by %s", - a->name.c_str(), a->GetMaxLocal(), this->GetIPString().c_str()); + a->name.c_str(), a->maxlocal, this->GetIPString().c_str()); } return; } - else if ((a->GetMaxGlobal()) && (clonecounts.global > a->GetMaxGlobal())) + else if (a->maxglobal && clonecounts.global > a->maxglobal) { ServerInstance->Users.QuitUser(this, "No more connections allowed from your host via this connect class (global)"); if (a->maxconnwarn) { ServerInstance->SNO.WriteToSnoMask('a', "WARNING: maximum global connections for the %s class (%ld) exceeded by %s", - a->name.c_str(), a->GetMaxGlobal(), this->GetIPString().c_str()); + a->name.c_str(), a->maxglobal, this->GetIPString().c_str()); } return; } } - this->nextping = ServerInstance->Time() + a->GetPingTime(); + this->nextping = ServerInstance->Time() + a->pingtime; this->uniqueusername = a->uniqueusername; } -- cgit v1.3.1-10-gc9f91