summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_joinflood.cpp12
-rw-r--r--src/modules/m_messageflood.cpp1
-rw-r--r--src/modules/m_nickflood.cpp14
3 files changed, 11 insertions, 16 deletions
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 40a007c2c..be33debcc 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -19,19 +19,17 @@
*/
class joinfloodsettings : public classbase
{
+ private:
+ InspIRCd* ServerInstance;
public:
-
int secs;
int joins;
time_t reset;
time_t unlocktime;
int counter;
bool locked;
- InspIRCd* ServerInstance;
-
- joinfloodsettings() : secs(0), joins(0) {};
- joinfloodsettings(int b, int c) : secs(b), joins(c)
+ joinfloodsettings(InspIRCd *Instance, int b, int c) : ServerInstance(Instance), secs(b), joins(c)
{
reset = ServerInstance->Time() + secs;
counter = 0;
@@ -144,7 +142,7 @@ class JoinFlood : public ModeHandler
if (!channel->GetExt("joinflood", dummy))
{
parameter = ConvToStr(njoins) + ":" +ConvToStr(nsecs);
- joinfloodsettings *f = new joinfloodsettings(nsecs,njoins);
+ joinfloodsettings *f = new joinfloodsettings(ServerInstance, nsecs, njoins);
channel->Extend("joinflood", f);
channel->SetMode('j', true);
channel->SetModeParam('j', parameter.c_str(), true);
@@ -167,7 +165,7 @@ class JoinFlood : public ModeHandler
joinfloodsettings* f;
channel->GetExt("joinflood", f);
delete f;
- f = new joinfloodsettings(nsecs,njoins);
+ f = new joinfloodsettings(ServerInstance, nsecs, njoins);
channel->Shrink("joinflood");
channel->Extend("joinflood", f);
channel->SetModeParam('j', cur_param.c_str(), false);
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 53df408f6..1b5612a4a 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -28,7 +28,6 @@ class floodsettings : public classbase
time_t reset;
std::map<User*,int> counters;
- floodsettings(InspIRCd *Instance) : ServerInstance(Instance), ban(0), secs(0), lines(0) {};
floodsettings(InspIRCd *Instance, bool a, int b, int c) : ServerInstance(Instance), ban(a), secs(b), lines(c)
{
reset = ServerInstance->Time() + secs;
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index 4961e97a0..e281713c3 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -19,21 +19,19 @@
*/
class nickfloodsettings : public classbase
{
+ private:
+ InspIRCd* ServerInstance;
public:
-
int secs;
int nicks;
time_t reset;
time_t unlocktime;
int counter;
bool locked;
- InspIRCd* ServerInstance;
-
- nickfloodsettings() : secs(0), nicks(0) {};
- nickfloodsettings(int b, int c) : secs(b), nicks(c)
+ nickfloodsettings(InspIRCd *Instance, int b, int c) : ServerInstance(Instance), secs(b), nicks(c)
{
- reset = ServerInstance->Time() + secs;
+ reset = Instance->Time() + secs;
counter = 0;
locked = false;
};
@@ -144,7 +142,7 @@ class NickFlood : public ModeHandler
if (!channel->GetExt("nickflood", dummy))
{
parameter = ConvToStr(nnicks) + ":" +ConvToStr(nsecs);
- nickfloodsettings *f = new nickfloodsettings(nsecs,nnicks);
+ nickfloodsettings *f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
channel->Extend("nickflood", f);
channel->SetMode('F', true);
channel->SetModeParam('F', parameter.c_str(), true);
@@ -167,7 +165,7 @@ class NickFlood : public ModeHandler
nickfloodsettings* f;
channel->GetExt("nickflood", f);
delete f;
- f = new nickfloodsettings(nsecs, nnicks);
+ f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
channel->Shrink("nickflood");
channel->Extend("nickflood", f);
channel->SetModeParam('F', cur_param.c_str(), false);