/** Client list stored by UUID. Contains all clients, and is updated
* automatically by the constructor and destructor of User.
*/
- user_hash* uuidlist;
+ user_hash uuidlist;
/** Local client list, a list containing only local clients
*/
User *InspIRCd::FindUUID(const std::string &uid)
{
- user_hash::iterator finduuid = this->Users->uuidlist->find(uid);
+ user_hash::iterator finduuid = this->Users->uuidlist.find(uid);
- if (finduuid == this->Users->uuidlist->end())
+ if (finduuid == this->Users->uuidlist.end())
return NULL;
return finduuid->second;
UserManager::UserManager()
: clientlist(new user_hash)
- , uuidlist(new user_hash)
, unregistered_count(0)
{
}
}
delete clientlist;
- delete uuidlist;
}
/* add a client connection to the sockets list */
else
ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Nick not found in clientlist, cannot remove: " + user->nick);
- uuidlist->erase(user->uuid);
+ uuidlist.erase(user->uuid);
user->PurgeEmptyChannels();
}
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New UUID for user: %s", uuid.c_str());
- if (!ServerInstance->Users->uuidlist->insert(std::make_pair(uuid, this)).second)
+ if (!ServerInstance->Users->uuidlist.insert(std::make_pair(uuid, this)).second)
throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor");
}
User::~User()
{
- if (ServerInstance->Users->uuidlist->find(uuid) != ServerInstance->Users->uuidlist->end())
+ if (ServerInstance->FindUUID(uuid))
ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "User destructor for %s called without cull", uuid.c_str());
}
// Fake users don't quit, they just get culled.
quitting = true;
// Fake users are not inserted into UserManager::clientlist, they're only in the uuidlist
- ServerInstance->Users->uuidlist->erase(uuid);
+ ServerInstance->Users->uuidlist.erase(uuid);
return User::cull();
}