X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fuid.h;h=c00161cac2104a533df6dc2762b8c390552ee5c7;hb=b0f16081ccaef527ed4b5434a7264508cf455f39;hp=8be003628393e8aa286f419f77a3c95367b6ea1a;hpb=48f7fa6b11a0a6b1526c54914e60ddbe51ede8c4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/uid.h b/include/uid.h index 8be003628..c00161cac 100644 --- a/include/uid.h +++ b/include/uid.h @@ -1,6 +1,10 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2013, 2019 Sadie Powell + * Copyright (C) 2013 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2010 Craig Edwards * Copyright (C) 2007 Robin Burchell * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -18,28 +22,24 @@ #pragma once -/** - * This is the maximum length of a UUID (unique user identifier). - * This length is set in compliance with TS6 protocol, and really should not be changed. Ever. - * It allows for a lot of clients as-is. -- w00t. - */ -#define UUID_LENGTH 10 - -class TestSuite; - class CoreExport UIDGenerator { - friend class TestSuite; - + private: /** Holds the current UID. Used to generate the next one. */ - char current_uid[UUID_LENGTH]; + std::string current_uid; /** Increments the current UID by one. */ void IncrementUID(unsigned int pos); public: + /** + * This is the maximum length of a UUID (unique user identifier). + * It allows up to 12,960 servers and 2,176,782,336 users per server. + */ + static const unsigned int UUID_LENGTH = 9; + /** Initializes this UID generator with the given SID * @param sid SID that conforms to InspIRCd::IsSID() */