From: brain Date: Sat, 10 Feb 2007 15:05:00 +0000 (+0000) Subject: timermanager never had a ServerInstance. Give it one so we can use InspIRCd::Time... X-Git-Tag: v2.0.23~5828 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=8a15b719601bd886487775c9709ba16cf3e39096;p=user%2Fhenk%2Fcode%2Finspircd.git timermanager never had a ServerInstance. Give it one so we can use InspIRCd::Time() rather than time() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6561 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/include/timer.h b/include/timer.h index dbf83c2c8..e28987234 100644 --- a/include/timer.h +++ b/include/timer.h @@ -14,6 +14,8 @@ #ifndef INSPIRCD_TIMER_H #define INSPIRCD_TIMER_H +class InspIRCd; + /** Timer class for one-second resolution timers * InspTimer provides a facility which allows module * developers to create one-shot timers. The timer @@ -114,6 +116,9 @@ class TimerManager : public Extensible /** Set when ticking timers, to prevent deletion while iterating */ bool CantDeleteHere; + /** Creating server instance + */ + InspIRCd* ServerInstance; private: /** The current timer set, a map of timergroups diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8f9bb4589..c7e261e3b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -346,7 +346,7 @@ InspIRCd::InspIRCd(int argc, char** argv) this->OpenLog(argv, argc); this->stats = new serverstats(); - this->Timers = new TimerManager(); + this->Timers = new TimerManager(this); this->Parser = new CommandParser(this); this->XLines = new XLineManager(this); Config->ClearStack(); diff --git a/src/timer.cpp b/src/timer.cpp index 63c7b5874..c04107502 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -14,7 +14,7 @@ #include "inspircd.h" #include "timer.h" -TimerManager::TimerManager() : CantDeleteHere(false) +TimerManager::TimerManager(InspIRCd* Instance) : CantDeleteHere(false), ServerInstance(Instance) { } @@ -116,7 +116,7 @@ void TimerManager::AddTimer(InspTimer* T, long secs_from_now) if (!secs_from_now) time_to_trigger = T->GetTimer(); else - time_to_trigger = secs_from_now + time(NULL); + time_to_trigger = secs_from_now + ServerInstance->Time(); timerlist::iterator found = Timers.find(time_to_trigger);