]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Two stage commit: don't set user->muted except in QuitUser (duplicate setting), also...
[user/henk/code/inspircd.git] / include / inspircd.h
index 28d2d534c127a832f242f7bc15c93ac4f6121383..c60f7c23049b7d7d6b48f8d533a3550551607b76 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -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"
  */
 #define ETIREDHAMSTERS EAGAIN
 
-/** Delete a pointer, and NULL its value
- */
-template<typename T> inline void DELETE(T* x)
-{
-       delete x;
-       x = NULL;
-}
-
 /** Template function to convert any input type to std::string
  */
 template<typename T> inline std::string ConvNumeric(const T &in)
@@ -77,7 +70,7 @@ template<typename T> inline std::string ConvNumeric(const T &in)
                ++out;
                quotient /= 10;
        }
-       if ( in < 0)
+       if (in < 0)
                *out++ = '-';
        *out = 0;
        std::reverse(res,out);
@@ -98,13 +91,6 @@ inline std::string ConvToStr(const long in)
        return ConvNumeric(in);
 }
 
-/** Template function to convert any input type to std::string
- */
-inline std::string ConvToStr(const unsigned long in)
-{
-       return ConvNumeric(in);
-}
-
 /** Template function to convert any input type to std::string
  */
 inline std::string ConvToStr(const char* in)
@@ -226,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*);
@@ -239,6 +222,7 @@ DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
 
 /* Forward declaration - required */
 class XLineManager;
+class BanCacheManager;
 
 /** The main class of the irc server.
  * This class contains instances of all the other classes
@@ -408,6 +392,11 @@ class CoreExport InspIRCd : public classbase
         */
        ModuleManager* Modules;
 
+       /** BanCacheManager is used to speed up checking of restrictions on connection
+        * to the IRCd.
+        */
+       BanCacheManager *BanCache;
+
        /** Stats class, holds miscellaneous stats counters
         */
        serverstats* stats;
@@ -442,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;
@@ -462,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;
@@ -481,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
         */
@@ -681,11 +656,6 @@ class CoreExport InspIRCd : public classbase
         */
        int RegisteredUserCount();
 
-       /** Return a count of invisible (umode +i) users only
-        * @return The number of invisible users
-        */
-       int InvisibleUserCount();
-
        /** Return a count of opered (umode +o) users only
         * @return The number of opers
         */
@@ -732,10 +702,9 @@ class CoreExport InspIRCd : public classbase
 
        /** Add a new mode to this server's mode parser
         * @param mh The modehandler to add
-        * @param modechar The mode character this modehandler handles
         * @return True if the mode handler was added
         */
-       bool AddMode(ModeHandler* mh, const unsigned char modechar);
+       bool AddMode(ModeHandler* mh);
 
        /** Add a new mode watcher to this server's mode parser
         * @param mw The modewatcher to add
@@ -808,76 +777,6 @@ class CoreExport InspIRCd : public classbase
         */
        bool IsValidModuleCommand(const std::string &commandname, int pcnt, User* user);
 
-       /** Add a gline and apply it
-        * @param duration How long the line should last
-        * @param source Who set the line
-        * @param reason The reason for the line
-        * @param hostmask The hostmask to set the line against
-        */
-       void AddGLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
-       /** Add a qline and apply it
-        * @param duration How long the line should last
-        * @param source Who set the line
-        * @param reason The reason for the line
-        * @param nickname The nickmask to set the line against
-        */
-       void AddQLine(long duration, const std::string &source, const std::string &reason, const std::string &nickname);
-
-       /** Add a zline and apply it
-        * @param duration How long the line should last
-        * @param source Who set the line
-        * @param reason The reason for the line
-        * @param ipaddr The ip-mask to set the line against
-        */
-       void AddZLine(long duration, const std::string &source, const std::string &reason, const std::string &ipaddr);
-
-       /** Add a kline and apply it
-        * @param duration How long the line should last
-        * @param source Who set the line
-        * @param reason The reason for the line
-        * @param hostmask The hostmask to set the line against
-        */
-       void AddKLine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
-       /** Add an eline
-        * @param duration How long the line should last
-        * @param source Who set the line
-        * @param reason The reason for the line
-        * @param hostmask The hostmask to set the line against
-        */
-       void AddELine(long duration, const std::string &source, const std::string &reason, const std::string &hostmask);
-
-       /** Delete a gline
-        * @param hostmask The gline to delete
-        * @return True if the item was removed
-        */
-       bool DelGLine(const std::string &hostmask);
-
-       /** Delete a qline
-        * @param nickname The qline to delete
-        * @return True if the item was removed
-        */
-       bool DelQLine(const std::string &nickname);
-
-       /** Delete a zline
-        * @param ipaddr The zline to delete
-        * @return True if the item was removed
-        */
-       bool DelZLine(const std::string &ipaddr);
-
-       /** Delete a kline
-        * @param hostmask The kline to delete
-        * @return True if the item was removed
-        */
-       bool DelKLine(const std::string &hostmask);
-
-       /** Delete an eline
-        * @param hostmask The kline to delete
-        * @return True if the item was removed
-        */
-       bool DelELine(const std::string &hostmask);
-
        /** Return true if the given parameter is a valid nick!user\@host mask
         * @param mask A nick!user\@host masak to match against
         * @return True i the mask is valid