mirror of
https://github.com/anope/anope.git
synced 2026-07-04 14:33:15 +02:00
We now store a list of users using a NickCore in the NickCore, this prevents having to loop every user all the time to find them
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2780 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+7
-12
@@ -38,20 +38,15 @@ NickCore::~NickCore()
|
||||
/* Clean up this nick core from any users online using it
|
||||
* (ones that /nick but remain unidentified)
|
||||
*/
|
||||
User *user;
|
||||
for (int i = 0; i < 1024; ++i)
|
||||
for (std::list<User *>::iterator it = this->Users.begin(); it != this->Users.end(); ++it)
|
||||
{
|
||||
for (user = userlist[i]; user; user = user->next)
|
||||
{
|
||||
if (user->nc && user->nc == this)
|
||||
{
|
||||
ircdproto->SendAccountLogout(user, user->nc);
|
||||
ircdproto->SendUnregisteredNick(user);
|
||||
user->nc = NULL;
|
||||
FOREACH_MOD(I_OnNickLogout, OnNickLogout(user));
|
||||
}
|
||||
}
|
||||
User *user = *it;
|
||||
ircdproto->SendAccountLogout(user, user->Account());
|
||||
ircdproto->SendUnregisteredNick(user);
|
||||
user->Logout();
|
||||
FOREACH_MOD(I_OnNickLogout, OnNickLogout(user));
|
||||
}
|
||||
this->Users.clear();
|
||||
|
||||
/* (Hopefully complete) cleanup */
|
||||
cs_remove_nick(this);
|
||||
|
||||
Reference in New Issue
Block a user