#include "users.h"
#include "channels.h"
#include "modules.h"
-#include "helperfuncs.h"
#include "configreader.h"
#include "inspircd.h"
/* $ModDesc: Provides channel mode +j (join flood protection) */
-extern InspIRCd* ServerInstance;
+
class joinfloodsettings : public classbase
{
reset = time(NULL) + secs;
counter = 0;
locked = false;
- log(DEBUG,"Create new joinfloodsettings: %lu %lu",time(NULL),reset);
};
void addjoin()
{
counter++;
- log(DEBUG,"joinflood counter is %d",counter);
if (time(NULL) > reset)
{
- log(DEBUG,"joinflood counter reset");
counter = 0;
reset = time(NULL) + secs;
}
void clear()
{
- log(DEBUG,"joinflood counter clear");
counter = 0;
}
void lock()
{
- log(DEBUG,"joinflood lock");
locked = true;
unlocktime = time(NULL) + 60;
}
void Implements(char* List)
{
- List[I_On005Numeric] = List[I_OnChannelDelete] = List[I_OnUserPreJoin] = List[I_OnUserJoin] = 1;
- }
-
- virtual void On005Numeric(std::string &output)
- {
- ServerInstance->ModeGrok->InsertMode(output, "j", 3);
+ List[I_OnChannelDelete] = List[I_OnUserPreJoin] = List[I_OnUserJoin] = 1;
}
virtual ~ModuleJoinFlood()