diff options
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r-- | src/usermanager.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 9f5f8c937..588af9510 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -70,6 +70,17 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs ServerInstance->Users->AddLocalClone(New); ServerInstance->Users->AddGlobalClone(New); + this->local_users.push_back(New); + + if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)ServerInstance->SE->GetMaxFds())) + { + ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit); + this->QuitUser(New,"No more connections allowed"); + return; + } + + FOREACH_MOD(I_OnUserInit,OnUserInit(New)); + /* * First class check. We do this again in FullConnect after DNS is done, and NICK/USER is recieved. * See my note down there for why this is required. DO NOT REMOVE. :) -- w00t @@ -82,15 +93,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs */ New->CheckClass(); - this->local_users.push_back(New); - - if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)ServerInstance->SE->GetMaxFds())) - { - ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit); - this->QuitUser(New,"No more connections allowed"); - return; - } - /* * even with bancache, we still have to keep User::exempt current. * besides that, if we get a positive bancache hit, we still won't fuck |