diff options
author | Adam <Adam@anope.org> | 2013-05-26 17:13:11 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-26 17:13:11 -0400 |
commit | 22658d63bdb1e52a66f4514af45fa55ca5891345 (patch) | |
tree | 673304ab19f7e077b489354248247867518331f8 /src/main.cpp | |
parent | f2dee1e1d642b07947f59f91dfba9af34ef84685 (diff) |
Get rid of the remaining references in the core to specific services. Move more stuff out of the core to the proper modules.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index 99174279b..576df28a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,20 +47,30 @@ class UpdateTimer : public Timer public: UpdateTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { } - void Tick(time_t) + void Tick(time_t) anope_override { Anope::SaveDatabases(); } }; +class ExpireTimer : public Timer +{ + public: + ExpireTimer(time_t timeout) : Timer(timeout, Anope::CurTime, true) { } + + void Tick(time_t) anope_override + { + FOREACH_MOD(I_OnExpireTick, OnExpireTick()); + } +}; + void Anope::SaveDatabases() { if (Anope::ReadOnly) return; - EventReturn MOD_RESULT; - FOREACH_RESULT(I_OnSaveDatabase, OnSaveDatabase()); Log(LOG_DEBUG) << "Saving databases"; + FOREACH_MOD(I_OnSaveDatabase, OnSaveDatabase()); } /** The following comes from InspIRCd to get the full path of the Anope executable @@ -100,8 +110,6 @@ static Anope::string GetFullProgDir(const Anope::string &argv0) return "/"; } -/*************************************************************************/ - /* Main routine. (What does it look like? :-) ) */ int main(int ac, char **av, char **envp) @@ -150,6 +158,7 @@ int main(int ac, char **av, char **envp) /* Set up timers */ time_t last_check = Anope::CurTime; UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout")); + ExpireTimer expireTimer(Config->GetBlock("options")->Get<time_t>("expiretimeout")); /*** Main loop. ***/ while (!Anope::Quitting) |