]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Change to use InspIRCd::Time()
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 11 Aug 2006 09:28:31 +0000 (09:28 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 11 Aug 2006 09:28:31 +0000 (09:28 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4874 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/extra/m_pgsql.cpp
src/modules/m_blockamsg.cpp
src/modules/m_connflood.cpp
src/modules/m_httpd.cpp
src/modules/m_safelist.cpp
src/modules/m_securelist.cpp

index 0389ddcd56939e8be804cbb6973c14ab0322c17b..e4319aed5920dee378bea5585a5219449125b584 100644 (file)
@@ -670,7 +670,7 @@ SQLConn::SQLConn(InspIRCd* SI, ModulePgSQL* self, const SQLhost& hi)
        strlcpy(this->host, dbhost.c_str(), MAXBUF);
        strlcpy(this->IP, dbhost.c_str(), MAXBUF);
        this->port = dbport;
-       idle = TIME;
+       idle = this->Instance->Time();
        
        this->ClosePending = false;
                        
@@ -806,7 +806,7 @@ bool SQLConn::DoConnectedPoll()
                /* We just read stuff from the server, that counts as it being alive
                 * so update the idle-since time :p
                 */
-               idle = TIME;
+               idle = this->Instance->Time();
                        
                if(PQisBusy(sql))
                {
index 8c0aab79523871a0800b07718f30b69dceaf3080..59c03e1e3652e6b64aef748e531fcb69bf226224 100644 (file)
@@ -133,7 +133,7 @@ public:
                        // OR
                        // The number of target channels is equal to the number of channels the sender is on..a little suspicious.
                        // Check it's more than 1 too, or else users on one channel would have fun.
-                       if((m && (m->message == parameters[1]) && (m->target != parameters[0]) && (ForgetDelay != -1) && (m->sent >= TIME-ForgetDelay)) || ((targets > 1) && (targets == userchans)))
+                       if((m && (m->message == parameters[1]) && (m->target != parameters[0]) && (ForgetDelay != -1) && (m->sent >= ServerInstance->Time()-ForgetDelay)) || ((targets > 1) && (targets == userchans)))
                        {
                                // Block it...
                                if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS)
@@ -152,11 +152,11 @@ public:
                                // If there's already a BlockedMessage allocated, use it.
                                m->message = parameters[1];
                                m->target = parameters[0];
-                               m->sent = TIME;
+                               m->sent = ServerInstance->Time();
                        }
                        else
                        {
-                               m = new BlockedMessage(parameters[1], parameters[0], TIME);
+                               m = new BlockedMessage(parameters[1], parameters[0], ServerInstance->Time());
                                user->Extend("amsgblock", (char*)m);
                        }
                }                                       
index 291074c98c883e8ed02a83f1b07f2c5149115c05..ffa2fba83c0c777e906865c93246426d639cd617 100644 (file)
@@ -71,12 +71,12 @@ public:
                /* seconds to wait when the server just booted */
                boot_wait = conf->ReadInteger("connflood", "bootwait", 0, true);
 
-               first = TIME;
+               first = ServerInstance->Time();
        }
  
        virtual void OnUserRegister(userrec* user)
        {
-               time_t next = TIME;
+               time_t next = ServerInstance->Time();
                if (!first)
                        first = next - boot_wait;
 
index c433553beebc8e7ee0b9ac22ddb953072be927ca..6e5ddd514af97b0ca0a1096bb4e3c070de0bf20d 100644 (file)
@@ -167,7 +167,8 @@ class HttpSocket : public InspSocket
 
        void SendHeaders(unsigned long size, int response, const std::string &extraheaders)
        {
-               struct tm *timeinfo = localtime(&TIME);
+               time_t local = this->Instance->Time();
+               struct tm *timeinfo = localtime(&local);
                this->Write("HTTP/1.1 "+ConvToStr(response)+" "+Response(response)+"\r\nDate: ");
                this->Write(asctime(timeinfo));
                if (extraheaders.empty())
index ef8065637c987638c11ff47457b72afb98b6e86c..c7faf7fadd71bf7d2e7d8f410e1ea913b6a86a12 100644 (file)
@@ -55,7 +55,7 @@ class ListTimer : public InspTimer
 
  public:
 
-       ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,TIME), ServerInstance(Instance)
+       ListTimer(InspIRCd* Instance, long interval) : InspTimer(interval,Instance->Time()), ServerInstance(Instance)
        {
        }
 
@@ -197,7 +197,7 @@ class ModuleSafeList : public Module
                user->GetExt("safelist_last", last_list_time);
                if (last_list_time)
                {
-                       if (TIME < (*last_list_time)+60)
+                       if (ServerInstance->Time() < (*last_list_time)+60)
                        {
                                user->WriteServ("NOTICE %s :*** Woah there, slow down a little, you can't /LIST so often!",user->nick);
                                return 1;
@@ -210,12 +210,12 @@ class ModuleSafeList : public Module
                /*
                 * start at channel 0! ;)
                 */
-               ld = new ListData(0,TIME);
+               ld = new ListData(0,ServerInstance->Time());
                user->Extend("safelist_cache", ld);
                listusers.push_back(user);
 
                time_t* llt = new time_t;
-               *llt = TIME;
+               *llt = ServerInstance->Time();
                user->Extend("safelist_last", llt);
        
                return 1;
index 1e65fcce00c67ac550ace437304eed3ee3d6b272..92049497f2e4fd35c815dcc00eb8d0ad2353dce8 100644 (file)
@@ -59,7 +59,7 @@ class ModuleSecureList : public Module
                if (!validated)
                        return 0;
  
-               if ((command == "LIST") && (TIME < (user->signon+60)) && (!*user->oper))
+               if ((command == "LIST") && (ServerInstance->Time() < (user->signon+60)) && (!*user->oper))
                {
                        user->WriteServ("NOTICE %s :*** You cannot list within the first minute of connecting. Please try again later.",user->nick);
                        /* Some crap clients (read: mIRC, various java chat applets) muck up if they don't