1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
17 void TimerManager::TickTimers(time_t TIME)
19 timerlist::iterator found = Timers.find(TIME);
21 if (found != Timers.end())
23 timergroup* x = found->second;
25 * There are pending timers to trigger
27 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
39 void TimerManager::DelTimer(InspTimer* T)
41 timerlist::iterator found = Timers.find(T->GetTimer());
43 if (found != Timers.end())
45 timergroup* x = found->second;
46 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
62 * Because some muppets may do odd things, and their ircd may lock up due
63 * to crappy 3rd party modules, or they may change their system time a bit,
64 * this accounts for shifts of up to 120 secs by looking behind for missed
65 * timers and executing them. This is only executed once every 5 secs.
66 * If you move your clock BACK, and your timers move further ahead as a result,
67 * then tough titty you'll just have to wait.
69 void TimerManager::TickMissedTimers(time_t TIME)
71 for (time_t n = TIME-1; n > TIME-120; n--)
73 timerlist::iterator found = Timers.find(n);
74 if (found != Timers.end())
76 timergroup* x = found->second;
77 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
90 void TimerManager::AddTimer(InspTimer* T)
94 timerlist::iterator found = Timers.find(T->GetTimer());
96 if (found != Timers.end())
103 Timers[T->GetTimer()] = x;