diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-23 23:07:24 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-23 23:07:24 +0000 |
commit | bbb7c9eec52bd4176f25004996701d6133f51073 (patch) | |
tree | c38054caf0d793e6dd3004f9baa24fa17ab8ad0c /include | |
parent | 532bf476780b046108a8b60a2d72812552ed6e4b (diff) |
Some initial work towards tying <connect> classes to user accounts. This will (in the longer term) allow for things like limits on how many users can fit in a <connect> for 1.2
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8336 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/users.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/users.h b/include/users.h index f1dd935e0..211ae8c04 100644 --- a/include/users.h +++ b/include/users.h @@ -183,12 +183,16 @@ public: recvqmax(source.recvqmax), maxlocal(source.maxlocal), maxglobal(source.maxglobal), maxchans(source.maxchans), port(source.port) { + this->RefCount = 0; } /** Create a new connect class with no settings. */ ConnectClass() : type(CC_DENY), name("unnamed"), registration_timeout(0), flood(0), host(""), pingtime(0), pass(""), - threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0) { } + threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0) + { + this->RefCount = 0; + } /** Create a new connect class to ALLOW connections. * @param thename Name of the connect class @@ -214,7 +218,10 @@ public: * @param hst The IP mask to deny */ ConnectClass(const std::string &thename, const std::string &hst) : type(CC_DENY), name(thename), registration_timeout(0), - flood(0), host(hst), pingtime(0), pass(""), threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), maxchans(0), port(0) { } + flood(0), host(hst), pingtime(0), pass(""), threshold(0), sendqmax(0), recvqmax(0), maxlocal(0), maxglobal(0), maxchans(0), port(0) + { + this->RefCount = 0; + } /* Create a new connect class based on another class * @param thename The name of the connect class @@ -226,6 +233,7 @@ public: recvqmax(source.recvqmax), maxlocal(source.maxlocal), maxglobal(source.maxglobal), maxchans(source.maxchans), port(source.port) { + this->RefCount = 0; } /* Update an existing entry with new values @@ -260,6 +268,12 @@ public: port = p; } + /** Reference counter. Contains an int as to how many users are connected to this class. :) + * This will be 0 if no users are connected. If a <connect> is removed from the config, and there + * are 0 users on it - it will go away in RAM. :) + */ + unsigned long RefCount; + int GetMaxChans() { return maxchans; @@ -483,6 +497,11 @@ class CoreExport User : public connection unsigned int MaxChans; public: + /** Contains a pointer to the connect class a user is on from - this will be NULL for remote connections. + * The pointer is guarenteed to *always* be valid. :) + */ + ConnectClass *MyClass; + /** Resolvers for looking up this users IP address * This will occur if and when res_reverse completes. * When this class completes its lookup, User::dns_done |