1
0
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:
Adam-
2010-02-04 23:49:27 +00:00
parent 3d4cf39940
commit 308070e019
79 changed files with 336 additions and 294 deletions
+7 -12
View File
@@ -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);