summaryrefslogtreecommitdiff
path: root/src/modules/m_messageflood.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-23 21:39:00 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-10-23 21:39:00 +0000
commit1200d6285b1d64699c6fa2c8241e2ee40f52d2a3 (patch)
tree997983815c2f0ab3a1d434ebc5851a3b8568f843 /src/modules/m_messageflood.cpp
parentb928aff22f8f9a458df9aa73a0c6b22b979101bc (diff)
Revert earlier time() -> SI->Time() diff for now, this causes problems with dns.cpp in mysterious ways.. seemingly a bad pointer there somehow..?
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10695 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_messageflood.cpp')
-rw-r--r--src/modules/m_messageflood.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 53df408f6..c374c5346 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -19,8 +19,6 @@
*/
class floodsettings : public classbase
{
- private:
- InspIRCd *ServerInstance;
public:
bool ban;
int secs;
@@ -28,10 +26,10 @@ 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)
+ floodsettings() : ban(0), secs(0), lines(0) {};
+ floodsettings(bool a, int b, int c) : ban(a), secs(b), lines(c)
{
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
};
void addmessage(User* who)
@@ -45,10 +43,10 @@ class floodsettings : public classbase
{
counters[who] = 1;
}
- if (ServerInstance->Time() > reset)
+ if (time(NULL) > reset)
{
counters.clear();
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
}
}
@@ -142,7 +140,7 @@ class MsgFlood : public ModeHandler
if (!channel->GetExt("flood", f))
{
parameter = std::string(ban ? "*" : "") + ConvToStr(nlines) + ":" +ConvToStr(nsecs);
- floodsettings *fs = new floodsettings(ServerInstance,ban,nsecs,nlines);
+ floodsettings *fs = new floodsettings(ban,nsecs,nlines);
channel->Extend("flood",fs);
channel->SetMode('f', true);
channel->SetModeParam('f', parameter.c_str(), true);
@@ -162,7 +160,7 @@ class MsgFlood : public ModeHandler
if ((((nlines != f->lines) || (nsecs != f->secs) || (ban != f->ban))) && (((nsecs > 0) && (nlines > 0))))
{
delete f;
- floodsettings *fs = new floodsettings(ServerInstance,ban,nsecs,nlines);
+ floodsettings *fs = new floodsettings(ban,nsecs,nlines);
channel->Shrink("flood");
channel->Extend("flood",fs);
channel->SetModeParam('f', cur_param.c_str(), false);