From 1c5e9d246a4990eed062d879276b1844526a04ef Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 27 Aug 2007 11:43:12 +0000 Subject: 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 --- src/users.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/users.cpp') 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() -- cgit v1.2.3