1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 void TimerManager::TickTimers(time_t TIME)
22 timerlist::iterator found = Timers.find(TIME);
24 if (found != Timers.end())
26 timergroup* x = found->second;
28 * There are pending timers to trigger
30 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
42 void TimerManager::DelTimer(InspTimer* T)
44 timerlist::iterator found = Timers.find(T->GetTimer());
46 if (found != Timers.end())
48 timergroup* x = found->second;
49 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
65 * Because some muppets may do odd things, and their ircd may lock up due
66 * to crappy 3rd party modules, or they may change their system time a bit,
67 * this accounts for shifts of up to 120 secs by looking behind for missed
68 * timers and executing them. This is only executed once every 5 secs.
69 * If you move your clock BACK, and your timers move further ahead as a result,
70 * then tough titty you'll just have to wait.
72 void TimerManager::TickMissedTimers(time_t TIME)
74 for (time_t n = TIME-1; n > TIME-120; n--)
76 timerlist::iterator found = Timers.find(n);
77 if (found != Timers.end())
79 timergroup* x = found->second;
80 for (timergroup::iterator y = x->begin(); y != x->end(); y++)
93 void TimerManager::AddTimer(InspTimer* T)
97 timerlist::iterator found = Timers.find(T->GetTimer());
99 if (found != Timers.end())
106 Timers[T->GetTimer()] = x;