-
- FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(a->GetUser()));
-
- if (IS_LOCAL(a->GetUser()))
- {
- if (ServerInstance->Config->GetIOHook(a->GetUser()->GetPort()))
- {
- try
- {
- ServerInstance->Config->GetIOHook(a->GetUser()->GetPort())->OnRawSocketClose(a->GetUser()->GetFd());
- }
- catch (CoreException& modexcept)
- {
- ServerInstance->Log(DEBUG, "%s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
- }
- }
-
- ServerInstance->SE->DelFd(a->GetUser());
- a->GetUser()->CloseSocket();
- }
-
- /*
- * this must come before the ServerInstance->SNO->WriteToSnoMaskso that it doesnt try to fill their buffer with anything
- * if they were an oper with +sn +qQ.
- */
- if (a->GetUser()->registered == REG_ALL)
- {
- if (IS_LOCAL(a->GetUser()))
- ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,reason.c_str());
- else
- ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",a->GetUser()->server,a->GetUser()->nick,a->GetUser()->ident,a->GetUser()->host,reason.c_str());
- a->GetUser()->AddToWhoWas();
- }
-
- if (iter != ServerInstance->clientlist->end())
- {
- if (IS_LOCAL(a->GetUser()))
- {
- std::vector<userrec*>::iterator x = find(ServerInstance->local_users.begin(),ServerInstance->local_users.end(),a->GetUser());
- if (x != ServerInstance->local_users.end())
- ServerInstance->local_users.erase(x);
- }
- ServerInstance->clientlist->erase(iter);
- DELETE(a->GetUser());
- }
-
- list.erase(list.begin());
- exempt.erase(exemptiter);