X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Ftimer.cpp;h=2b30b478cf592eed5806b27d8d137449fb125cf9;hb=12737ab4ad61a0d8a908c8a21594c7012e21eb3c;hp=56cda27b2b4fbad4c28545fe88d8666849b77035;hpb=315cd88a911eaa327df520e8533be82efea0c66f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/timer.cpp b/src/timer.cpp index 56cda27b2..2b30b478c 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -14,32 +14,15 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" -#include #include #include -#include "users.h" -#include "ctables.h" -#include "typedefs.h" -#include "commands.h" -#include "globals.h" -#include "hashcomp.h" +#include "inspircd_config.h" #include "inspircd.h" -#include "inspircd_io.h" -#include "inspstring.h" +#include "typedefs.h" #include "helperfuncs.h" +#include "timer.h" -extern InspIRCd* ServerInstance; -extern ServerConfig* Config; -extern time_t TIME; - -typedef std::vector timergroup; -typedef std::map timerlist; -timerlist Timers; - -void TickTimers(time_t TIME) +void TimerManager::TickTimers(time_t TIME) { timerlist::iterator found = Timers.find(TIME); @@ -53,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); } } @@ -69,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--) { @@ -81,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; @@ -108,3 +91,4 @@ void AddTimer(InspTimer* T) x->push_back(T); } +