*/
char type;
+ /** True if this class uses fake lag to manage flood, false if it kills */
+ bool fakelag;
+
/** Connect class name
*/
std::string name;
/** 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
*/
/** 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
*/
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.
*/
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.
*/