diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 11:43:12 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-27 11:43:12 +0000 |
commit | 1c5e9d246a4990eed062d879276b1844526a04ef (patch) | |
tree | f87579a5d9ef656a755b74058a69e0e8a035d5b0 /src/users.cpp | |
parent | 78474291ab99852dc92a43286c67f244c7292a31 (diff) |
Add uuid hash_map - its management is automatic via userrec constructors/destructors.
Note that this means 'fake' users used to set modes etc get a uid, but this isnt a major thing.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7876 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp index 476a4f1cd..72cf2103d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -347,6 +347,12 @@ userrec::userrec(InspIRCd* Instance, const std::string &uid) : ServerInstance(In operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL; if (!uid.empty()) strlcpy(uuid, uid.c_str(), UUID_LENGTH); + + user_hash::iterator finduuid = Instance->uuidlist->find(uuid); + if (finduuid != Instance->uuidlist->end()) + (*Instance->uuidlist)[uuid] = this; + else + throw CoreException("Duplicate UUID "+uid+" in userrec constructor"); } void userrec::RemoveCloneCounts() @@ -393,6 +399,8 @@ userrec::~userrec() } #endif } + + ServerInstance->uuidlist->erase(uuid); } char* userrec::MakeHost() |