- time_t current = ServerInstance->Time();
-
- /* Because we now store all our XLines in sorted order using (i->duration + i->set_time) as a key, this
- * means that to expire the XLines we just need to do a while, picking off the top few until there are
- * none left at the head of the queue that are after the current time.
- */
-
- while ((glines.size()) && (current > (glines.begin()->duration + glines.begin()->set_time)))
- {
- std::vector<GLine>::iterator i = glines.begin();
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed G-Line %s (set by %s %d seconds ago)",i->hostmask,i->source,i->duration);
- glines.erase(i);
- }
-
- while ((elines.size()) && (current > (elines.begin()->duration + elines.begin()->set_time)))
- {
- std::vector<ELine>::iterator i = elines.begin();
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed E-Line %s (set by %s %d seconds ago)",i->hostmask,i->source,i->duration);
- elines.erase(i);
- }
-
- while ((zlines.size()) && (current > (zlines.begin()->duration + zlines.begin()->set_time)))
- {
- std::vector<ZLine>::iterator i = zlines.begin();
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Z-Line %s (set by %s %d seconds ago)",i->ipaddr,i->source,i->duration);
- zlines.erase(i);
- }
-
- while ((klines.size()) && (current > (klines.begin()->duration + klines.begin()->set_time)))
- {
- std::vector<KLine>::iterator i = klines.begin();
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed K-Line %s (set by %s %d seconds ago)",i->hostmask,i->source,i->duration);
- klines.erase(i);
- }
-
- while ((qlines.size()) && (current > (qlines.begin()->duration + qlines.begin()->set_time)))
- {
- std::vector<QLine>::iterator i = qlines.begin();
- ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed Q-Line %s (set by %s %d seconds ago)",i->nick,i->source,i->duration);
- qlines.erase(i);
- }
-