diff options
| author | 2014-03-17 11:05:09 +0100 | |
|---|---|---|
| committer | 2014-03-17 11:05:09 +0100 | |
| commit | d60103cada2c954f6d735c0ae4fb7d9b1b5ed844 (patch) | |
| tree | 43e0dfde15c012ad9e6e86ab615a6054968639c9 /src/users.cpp | |
| parent | m_connectban Don't depend on the definition of clonemap (diff) | |
| download | inspircd++-d60103cada2c954f6d735c0ae4fb7d9b1b5ed844.tar.gz inspircd++-d60103cada2c954f6d735c0ae4fb7d9b1b5ed844.tar.bz2 inspircd++-d60103cada2c954f6d735c0ae4fb7d9b1b5ed844.zip | |
Rewrite clone counting to use one map instead of two
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/users.cpp b/src/users.cpp index 6a31f0a93..a78e9635b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -497,14 +497,15 @@ void LocalUser::CheckClass(bool clone_count) } else if (clone_count) { - if ((a->GetMaxLocal()) && (ServerInstance->Users->LocalCloneCount(this) > a->GetMaxLocal())) + const UserManager::CloneCounts& clonecounts = ServerInstance->Users->GetCloneCounts(this); + if ((a->GetMaxLocal()) && (clonecounts.local > a->GetMaxLocal())) { 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 (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString().c_str()); return; } - else if ((a->GetMaxGlobal()) && (ServerInstance->Users->GlobalCloneCount(this) > a->GetMaxGlobal())) + else if ((a->GetMaxGlobal()) && (clonecounts.global > a->GetMaxGlobal())) { ServerInstance->Users->QuitUser(this, "No more connections allowed from your host via this connect class (global)"); if (a->maxconnwarn) |
