summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-13 03:37:25 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-13 03:37:25 +0000
commit2192a9f58aae466a42d60279fb34ee3c5d2950a1 (patch)
tree7c4d2c1047154f7cab1744af9564570fc7045104 /include
parentf56b7d5e861648e5ddc1b766e40779082ebaeff1 (diff)
First UserManager overhaul: Move clone counts out of InspIRCd & User.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8705 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h26
-rw-r--r--include/usermanager.h46
-rw-r--r--include/users.h16
3 files changed, 51 insertions, 37 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 7db8bf210..c60f7c230 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -32,6 +32,7 @@
#include "inspircd_config.h"
#include "uid.h"
#include "users.h"
+#include "usermanager.h"
#include "channels.h"
#include "socket.h"
#include "mode.h"
@@ -211,9 +212,6 @@ class serverstats : public classbase
/** A list of failed port bindings, used for informational purposes on startup */
typedef std::vector<std::pair<std::string, long> > FailedPortList;
-/** A list of ip addresses cross referenced against clone counts */
-typedef std::map<irc::string, unsigned int> clonemap;
-
class InspIRCd;
DEFINE_HANDLER1(ProcessUserHandler, void, User*);
@@ -433,14 +431,6 @@ class CoreExport InspIRCd : public classbase
*/
std::list<User*> all_opers;
- /** Map of local ip addresses for clone counting
- */
- clonemap local_clones;
-
- /** Map of global ip addresses for clone counting
- */
- clonemap global_clones;
-
/** DNS class, provides resolver facilities to the core and modules
*/
DNS* Res;
@@ -453,6 +443,10 @@ class CoreExport InspIRCd : public classbase
*/
XLineManager* XLines;
+ /** User manager. Various methods and data associated with users.
+ */
+ UserManager *Users;
+
/** Set to the current signal recieved
*/
int s_signal;
@@ -472,16 +466,6 @@ class CoreExport InspIRCd : public classbase
* @return The old time delta
*/
int SetTimeDelta(int delta);
-
- /** Add a user to the local clone map
- * @param user The user to add
- */
- void AddLocalClone(User* user);
-
- /** Add a user to the global clone map
- * @param user The user to add
- */
- void AddGlobalClone(User* user);
/** Number of users with a certain mode set on them
*/
diff --git a/include/usermanager.h b/include/usermanager.h
index f8337ff8c..5ca6401bb 100644
--- a/include/usermanager.h
+++ b/include/usermanager.h
@@ -14,15 +14,61 @@
#ifndef __USERMANAGER_H
#define __USERMANAGER_H
+/** A list of ip addresses cross referenced against clone counts */
+typedef std::map<irc::string, unsigned int> clonemap;
+
class CoreExport UserManager : public classbase
{
private:
InspIRCd *ServerInstance;
+
+ /** Map of local ip addresses for clone counting
+ */
+ clonemap local_clones;
public:
UserManager(InspIRCd *Instance)
{
ServerInstance = Instance;
}
+
+ /** Map of global ip addresses for clone counting
+ * XXX - this should be private, but m_clones depends on it currently.
+ */
+ clonemap global_clones;
+
+ /** Add a user to the local clone map
+ * @param user The user to add
+ */
+ void AddLocalClone(User *user);
+
+ /** Add a user to the global clone map
+ * @param user The user to add
+ */
+ void AddGlobalClone(User *user);
+
+ /** Remove all clone counts from the user, you should
+ * use this if you change the user's IP address
+ * after they have registered.
+ * @param user The user to remove
+ */
+ void RemoveCloneCounts(User *user);
+
+ /** Return the number of global clones of this user
+ * @param user The user to get a count for
+ * @return The global clone count of this user
+ */
+ unsigned long GlobalCloneCount(User *user);
+
+ /** Return the number of local clones of this user
+ * @param user The user to get a count for
+ * @return The local clone count of this user
+ */
+ unsigned long LocalCloneCount(User *user);
+
+
+
+
+ void RemoveCloneCounts();
};
#endif
diff --git a/include/users.h b/include/users.h
index dbcc345cb..67ea63a31 100644
--- a/include/users.h
+++ b/include/users.h
@@ -933,22 +933,6 @@ class CoreExport User : public connection
*/
void UnOper();
- /** Return the number of global clones of this user
- * @return The global clone count of this user
- */
- unsigned long GlobalCloneCount();
-
- /** Return the number of local clones of this user
- * @return The local clone count of this user
- */
- unsigned long LocalCloneCount();
-
- /** Remove all clone counts from the user, you should
- * use this if you change the user's IP address in
- * User::ip after they have registered.
- */
- void RemoveCloneCounts();
-
/** Write text to this user, appending CR/LF.
* @param text A std::string to send to the user
*/