diff options
author | Adam <Adam@anope.org> | 2012-11-24 21:22:32 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-11-24 21:22:32 -0500 |
commit | 0210cf2b171af3f5fd4842389e653dd909c716f8 (patch) | |
tree | 2334a5d17fdc7942ff6cdde893f24020ba5e4271 /modules/pseudoclients/global.cpp | |
parent | f0708340ef8919b3a4f9f90f22187d68b06048c0 (diff) |
Make the actual clients into services too
Diffstat (limited to 'modules/pseudoclients/global.cpp')
-rw-r--r-- | modules/pseudoclients/global.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/pseudoclients/global.cpp b/modules/pseudoclients/global.cpp index a5e1eb573..3fca89039 100644 --- a/modules/pseudoclients/global.cpp +++ b/modules/pseudoclients/global.cpp @@ -53,12 +53,19 @@ class GlobalCore : public Module { this->SetAuthor("Anope"); - Global = BotInfo::Find(Config->Global); - if (!Global) + BotInfo *bi = BotInfo::Find(Config->Global); + if (!bi) throw ModuleException("No bot named " + Config->Global); Implementation i[] = { I_OnRestart, I_OnShutdown, I_OnNewServer, I_OnPreHelp }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + + Service::AddAlias("BotInfo", "Global", bi->nick); + } + + ~GlobalCore() + { + Service::DelAlias("BotInfo", "Global"); } void OnRestart() anope_override |