]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/timer.cpp
Look-behind for missed timers up to 2 minutes (if your ircd has hung for 2 minutes...
[user/henk/code/inspircd.git] / src / timer.cpp
index b804920e523fe057b2632e976354bcac067e0179..7d9c9f3df829d56fe60230862f0e853f23488193 100644 (file)
@@ -65,6 +65,27 @@ void TickTimers(time_t TIME)
        }
 }
 
+void TickMissedTimers(time_t TIME)
+{
+       for (time_t n = TIME-1; time_t n > TIME-120; n--)
+       {
+               timerlist::iterator found = Timers.find(n);
+               if (found != Timers.end())
+               {
+                       timergroup* x = found->second;
+                       for (timergroup::iterator y = x->begin(); y != x->end(); y++)
+                       {
+                               InspTimer* z = (InspTimer*)*y;
+                               z->Tick(TIME);
+                               delete z;
+                       }
+
+                       Timers.erase(found);
+                       delete x;
+               }
+       }
+}
+
 void AddTimer(InspTimer* T)
 {
        timergroup* x = NULL;