summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/users.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/users.h b/include/users.h
index 5cf7669af..e1171e2c3 100644
--- a/include/users.h
+++ b/include/users.h
@@ -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
@@ -787,10 +798,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.
*/