*/
#include "inspircd.h"
-#include "configreader.h"
-#include "channels.h"
-#include "users.h"
#include <stdarg.h>
#include "socketengine.h"
#include "wildcard.h"
/* Invalidate cache */
operquit = cached_fullhost = cached_hostip = cached_makehost = cached_fullrealhost = NULL;
- if (!uid.empty())
+ if (uid.empty())
strlcpy(uuid, Instance->GetUID().c_str(), UUID_LENGTH);
else
strlcpy(uuid, uid.c_str(), UUID_LENGTH);
+ ServerInstance->Log(DEBUG,"New UUID for user: %s (%s)", uuid, uid.empty() ? "allocated new" : "used remote");
+
user_hash::iterator finduuid = Instance->uuidlist->find(uuid);
- if (finduuid != Instance->uuidlist->end())
+ if (finduuid == Instance->uuidlist->end())
(*Instance->uuidlist)[uuid] = this;
else
throw CoreException("Duplicate UUID "+std::string(uuid)+" in userrec constructor");
/* NOTE: Calling this one parameter constructor for userrec automatically
* allocates a new UUID and places it in the hash_map.
*/
- userrec* New = new userrec(Instance);
+ userrec* New = NULL;
+ try
+ {
+ New = new userrec(Instance);
+ }
+ catch (CoreException &e)
+ {
+ Instance->Log(DEFAULT,"*** WTF *** Duplicated UUID! -- Crack smoking monkies have been unleashed.");
+ return;
+ }
+
int j = 0;
Instance->unregistered_count++;