]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/timer.cpp
Add <options:cyclehosts> which allows a user to appear to have quit when their host...
[user/henk/code/inspircd.git] / src / timer.cpp
index 0c2cabbbe0cb004f3b491264f254d65247159576..148dafc68e0d800d9180e57aa6ac12dded852fff 100644 (file)
 #include "inspircd_config.h"
 #include "inspircd.h"
 #include "typedefs.h"
-#include "helperfuncs.h"
-#include "timer.h"
-
-extern time_t TIME;
 
-typedef std::vector<InspTimer*> timergroup;
-typedef std::map<time_t, timergroup*> timerlist;
-timerlist Timers;
+#include "timer.h"
 
-void TickTimers(time_t TIME)
+void TimerManager::TickTimers(time_t TIME)
 {
        timerlist::iterator found = Timers.find(TIME);
 
@@ -42,11 +36,11 @@ void TickTimers(time_t TIME)
                {
                        InspTimer* n = *y;
                        n->Tick(TIME);
-                       delete n;
+                       DELETE(n);
                }
 
                Timers.erase(found);
-               delete x;
+               DELETE(x);
        }
 }
 
@@ -58,7 +52,7 @@ void TickTimers(time_t TIME)
  * If you move your clock BACK, and your timers move further ahead as a result,
  * then tough titty you'll just have to wait.
  */
-void TickMissedTimers(time_t TIME)
+void TimerManager::TickMissedTimers(time_t TIME)
 {
        for (time_t n = TIME-1; n > TIME-120; n--)
        {
@@ -70,16 +64,16 @@ void TickMissedTimers(time_t TIME)
                        {
                                InspTimer* z = *y;
                                z->Tick(TIME);
-                               delete z;
+                               DELETE(z);
                        }
 
                        Timers.erase(found);
-                       delete x;
+                       DELETE(x);
                }
        }
 }
 
-void AddTimer(InspTimer* T)
+void TimerManager::AddTimer(InspTimer* T)
 {
        timergroup* x = NULL;
 
@@ -97,3 +91,4 @@ void AddTimer(InspTimer* T)
 
        x->push_back(T);
 }
+