]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Remove spanningtree override of /LUSERS
[user/henk/code/inspircd.git] / include / users.h
index 5cf7669affa83638e5b696923028cd84432a718d..637f8f88e0ca815b470c1ba1b751db78d3e8fa47 100644 (file)
@@ -71,6 +71,9 @@ struct CoreExport ConnectClass : public refcountbase
         */
        char type;
 
+       /** True if this class uses fake lag to manage flood, false if it kills */
+       bool fakelag;
+
        /** Connect class name
         */
        std::string name;
@@ -111,7 +114,10 @@ struct CoreExport ConnectClass : public refcountbase
 
        /** Seconds worth of penalty before penalty system activates
         */
-       unsigned long penaltythreshold;
+       unsigned int penaltythreshold;
+
+       /** Maximum rate of commands (units: millicommands per second) */
+       unsigned int commandrate;
 
        /** Local max when connecting by this connection class
         */
@@ -188,9 +194,14 @@ struct CoreExport ConnectClass : public refcountbase
 
        /** Returns the penalty threshold value
         */
-       unsigned long GetPenaltyThreshold()
+       unsigned int GetPenaltyThreshold()
+       {
+               return (penaltythreshold ? penaltythreshold : 10);
+       }
+
+       unsigned int GetCommandRate()
        {
-               return penaltythreshold;
+               return commandrate ? commandrate : 1000;
        }
 
        /** Returusn the maximum number of local sessions
@@ -236,11 +247,6 @@ class CoreExport User : public Extensible
         */
        std::string cachedip;
 
-       /** When we erase the user (in the destructor),
-        * we call this method to subtract one from all
-        * mode characters this user is making use of.
-        */
-       void DecrementModes();
  public:
 
        /** Hostname of connection.
@@ -787,10 +793,10 @@ class CoreExport LocalUser : public User
         */
        time_t nping;
 
-       /** This value contains how far into the penalty threshold the user is. Once its over
-        * the penalty threshold then commands are held and processed on-timer.
+       /** This value contains how far into the penalty threshold the user is.
+        * This is used either to enable fake lag or for excess flood quits
         */
-       int Penalty;
+       unsigned int CommandFloodPenalty;
 
        /** Stored reverse lookup from res_forward. Should not be used after resolution.
         */