summaryrefslogtreecommitdiff
path: root/src/modules
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
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')
-rw-r--r--src/modules/extra/m_sqllog.cpp9
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp2
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp2
-rw-r--r--src/modules/extra/m_testclient.cpp2
-rw-r--r--src/modules/m_callerid.cpp2
-rw-r--r--src/modules/m_joinflood.cpp10
-rw-r--r--src/modules/m_kicknorejoin.cpp4
-rw-r--r--src/modules/m_messageflood.cpp16
-rw-r--r--src/modules/m_nickflood.cpp10
-rw-r--r--src/modules/m_permchannels.cpp3
-rw-r--r--src/modules/m_randquote.cpp2
-rw-r--r--src/modules/m_spanningtree/handshaketimer.cpp2
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp2
-rw-r--r--src/modules/m_spanningtree/utils.cpp2
-rw-r--r--src/modules/m_timedbans.cpp2
15 files changed, 31 insertions, 39 deletions
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index a3f995355..e57e40354 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -28,8 +28,6 @@ std::map<unsigned long,QueryInfo*> active_queries;
class QueryInfo
{
-private:
- InspIRCd* ServerInstance;
public:
QueryState qs;
unsigned long id;
@@ -43,9 +41,8 @@ public:
time_t date;
bool insert;
- QueryInfo(InspIRCd* Instance, const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
+ QueryInfo(const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
{
- ServerInstance = Instance;
qs = FIND_SOURCE;
nick = n;
source = s;
@@ -53,7 +50,7 @@ public:
id = i;
category = cat;
sourceid = nickid = hostid = -1;
- date = ServerInstance->Time();
+ date = time(NULL);
insert = false;
}
@@ -253,7 +250,7 @@ class ModuleSQLLog : public Module
SQLrequest req = SQLrequest(this, SQLModule, dbid, SQLquery("SELECT id,actor FROM ircd_log_actors WHERE actor='?'") % source);
if(req.Send())
{
- QueryInfo* i = new QueryInfo(ServerInstance, nick, source, host, req.id, category);
+ QueryInfo* i = new QueryInfo(nick, source, host, req.id, category);
i->qs = FIND_SOURCE;
active_queries[req.id] = i;
}
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 1b2a1de96..aaf19f925 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -903,7 +903,7 @@ class ModuleSSLGnuTLS : public Module
/* Beware here we do not check for errors.
*/
- if ((gnutls_x509_crt_get_expiration_time(cert) < ServerInstance->Time()) || (gnutls_x509_crt_get_activation_time(cert) > ServerInstance->Time()))
+ if ((gnutls_x509_crt_get_expiration_time(cert) < time(0)) || (gnutls_x509_crt_get_activation_time(cert) > time(0)))
{
certinfo->data.insert(std::make_pair("error","Not activated, or expired certificate"));
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 796db66d7..389fffb85 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -871,7 +871,7 @@ class ModuleSSLOpenSSL : public Module
certinfo->data.insert(std::make_pair("fingerprint",irc::hex(md, n)));
}
- if ((ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(cert), ServerInstance->Time()) == -1) || (ASN1_UTCTIME_cmp_time_t(X509_get_notBefore(cert), ServerInstance->Time()) == 0))
+ if ((ASN1_UTCTIME_cmp_time_t(X509_get_notAfter(cert), time(NULL)) == -1) || (ASN1_UTCTIME_cmp_time_t(X509_get_notBefore(cert), time(NULL)) == 0))
{
certinfo->data.insert(std::make_pair("error","Not activated, or expired certificate"));
}
diff --git a/src/modules/extra/m_testclient.cpp b/src/modules/extra/m_testclient.cpp
index d80070939..c5c07efc0 100644
--- a/src/modules/extra/m_testclient.cpp
+++ b/src/modules/extra/m_testclient.cpp
@@ -40,7 +40,7 @@ public:
if(target)
{
SQLrequest foo = SQLrequest(this, target, "foo",
- SQLquery("UPDATE rawr SET foo = '?' WHERE bar = 42") % ServerInstance->Time());
+ SQLquery("UPDATE rawr SET foo = '?' WHERE bar = 42") % time(NULL));
if(foo.Send())
{
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index d8e50b280..0204ee77f 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -338,7 +338,7 @@ public:
if (i == dat->accepting.end())
{
- time_t now = ServerInstance->Time();
+ time_t now = time(NULL);
/* +g and *not* accepted */
user->WriteNumeric(716, "%s %s :is in +g mode (server-side ignore).", user->nick.c_str(), dest->nick.c_str());
if (now > (dat->lastnotify + (time_t)notify_cooldown))
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 40a007c2c..33ba98aa4 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -33,7 +33,7 @@ class joinfloodsettings : public classbase
joinfloodsettings(int b, int c) : secs(b), joins(c)
{
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
counter = 0;
locked = false;
};
@@ -41,10 +41,10 @@ class joinfloodsettings : public classbase
void addjoin()
{
counter++;
- if (ServerInstance->Time() > reset)
+ if (time(NULL) > reset)
{
counter = 0;
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
}
}
@@ -62,7 +62,7 @@ class joinfloodsettings : public classbase
{
if (locked)
{
- if (ServerInstance->Time() > unlocktime)
+ if (time(NULL) > unlocktime)
{
locked = false;
return false;
@@ -78,7 +78,7 @@ class joinfloodsettings : public classbase
void lock()
{
locked = true;
- unlocktime = ServerInstance->Time() + 60;
+ unlocktime = time(NULL) + 60;
}
};
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index bf5e10595..cd027f089 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -141,7 +141,7 @@ public:
for (delaylist::iterator iter = dl->begin(); iter != dl->end(); iter++)
{
- if (iter->second > ServerInstance->Time())
+ if (iter->second > time(NULL))
{
if (iter->first == user)
{
@@ -180,7 +180,7 @@ public:
dl = new delaylist;
chan->Extend("norejoinusers", dl);
}
- (*dl)[user] = ServerInstance->Time() + strtoint(chan->GetModeParameter('J'));
+ (*dl)[user] = time(NULL) + strtoint(chan->GetModeParameter('J'));
}
}
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);
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index 4961e97a0..72e2831da 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -33,7 +33,7 @@ class nickfloodsettings : public classbase
nickfloodsettings(int b, int c) : secs(b), nicks(c)
{
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
counter = 0;
locked = false;
};
@@ -41,10 +41,10 @@ class nickfloodsettings : public classbase
void addnick()
{
counter++;
- if (ServerInstance->Time() > reset)
+ if (time(NULL) > reset)
{
counter = 0;
- reset = ServerInstance->Time() + secs;
+ reset = time(NULL) + secs;
}
}
@@ -62,7 +62,7 @@ class nickfloodsettings : public classbase
{
if (locked)
{
- if (ServerInstance->Time() > unlocktime)
+ if (time(NULL) > unlocktime)
{
locked = false;
return false;
@@ -78,7 +78,7 @@ class nickfloodsettings : public classbase
void lock()
{
locked = true;
- unlocktime = ServerInstance->Time() + 60;
+ unlocktime = time(NULL) + 60;
}
};
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index 207093e0e..3b3df4d26 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -27,9 +27,6 @@ class PermChannel : public ModeHandler
{
if (adding)
{
- if (!source->HasPrivPermission("channels/set-permanent"))
- return MODEACTION_DENY;
-
if (!channel->IsModeSet('P'))
{
channel->SetMode('P',true);
diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp
index 8092d5162..c03b2777a 100644
--- a/src/modules/m_randquote.cpp
+++ b/src/modules/m_randquote.cpp
@@ -64,7 +64,7 @@ class ModuleRandQuote : public Module
conf = new ConfigReader(ServerInstance);
// Sort the Randomizer thingie..
- srand(ServerInstance->Time());
+ srand(time(NULL));
q_file = conf->ReadValue("randquote","file",0);
prefix = conf->ReadValue("randquote","prefix",0);
diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp
index facbf6c30..44938bafa 100644
--- a/src/modules/m_spanningtree/handshaketimer.cpp
+++ b/src/modules/m_spanningtree/handshaketimer.cpp
@@ -27,7 +27,7 @@
/* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */
-HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, Inst->Time()), Instance(Inst), sock(s), lnk(l), Utils(u)
+HandshakeTimer::HandshakeTimer(InspIRCd* Inst, TreeSocket* s, Link* l, SpanningTreeUtilities* u, int delay) : Timer(delay, time(NULL)), Instance(Inst), sock(s), lnk(l), Utils(u)
{
thefd = sock->GetFd();
}
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index a286150b2..c3167b9b3 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -67,7 +67,7 @@ TreeServer::TreeServer(SpanningTreeUtilities* Util, InspIRCd* Instance, std::str
bursting = false;
VersionString.clear();
ServerUserCount = ServerOperCount = 0;
- this->SetNextPingTime(ServerInstance->Time() + Utils->PingFreq);
+ this->SetNextPingTime(time(NULL) + Utils->PingFreq);
this->SetPingFlag();
Warned = DupError = false;
StartBurst = rtt = 0;
diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp
index 23df8da4c..c6c9ae700 100644
--- a/src/modules/m_spanningtree/utils.cpp
+++ b/src/modules/m_spanningtree/utils.cpp
@@ -536,7 +536,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
}
- L.NextConnectTime = ServerInstance->Time() + L.AutoConnect;
+ L.NextConnectTime = time(NULL) + L.AutoConnect;
if (L.Name.find('.') == std::string::npos)
throw CoreException("The link name '"+assign(L.Name)+"' is invalid and must contain at least one '.' character");
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 5e0650a3d..a10f90819 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -64,7 +64,7 @@ class CommandTban : public Command
TimedBan T;
std::string channelname = parameters[0];
long duration = ServerInstance->Duration(parameters[1]);
- unsigned long expire = duration + ServerInstance->Time();
+ unsigned long expire = duration + time(NULL);
if (duration < 1)
{
user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time");