X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusermanager.cpp;h=da8061fba630e2e122357365f486251f01744202;hb=c71801ebc4577b19e604c0d91a95fdcfe5250cc9;hp=f8b1f0de257cfe4d4b4d53f8c911c810460ac055;hpb=f209cce90b394acd26e22eacef0bff61e8f5b4e1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/usermanager.cpp b/src/usermanager.cpp index f8b1f0de2..da8061fba 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -31,7 +31,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache catch (...) { Instance->Logs->Log("USERS", DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed."); - Instance->SNO->WriteToSnoMask('A', "WARNING *** Duplicate UUID allocated!"); + Instance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!"); return; } @@ -106,7 +106,7 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache if ((this->local_users.size() > Instance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)Instance->SE->GetMaxFds())) { - Instance->SNO->WriteToSnoMask('A', "Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit); + Instance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit); this->QuitUser(New,"No more connections allowed"); return; } @@ -178,18 +178,41 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char return; } - ServerInstance->Logs->Log("USERS", DEBUG,"QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str()); - user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str()); user->quitting = true; + + ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str()); + user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str()); + user->quietquit = false; user->quitmsg = quitreason; + std::string reason; + std::string oper_reason; + reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit); if (!*operreason) + { user->operquitmsg = quitreason; + oper_reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit); + } else + { user->operquitmsg = operreason; + oper_reason.assign(operreason, 0, ServerInstance->Config->Limits.MaxQuit); + } ServerInstance->GlobalCulls.AddItem(user); + + if (user->registered == REG_ALL) + { + FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(user, reason, oper_reason)); + user->PurgeEmptyChannels(); + user->WriteCommonQuit(reason, oper_reason); + } + + FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(user)); + + // Move the user onto their UID, to allow nick to be reused immediately + user->UpdateNickHash(user->uuid.c_str()); }