summaryrefslogtreecommitdiff
path: root/modules/global
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
committerAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
commit0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch)
tree45df813323e023c5c89db7279426c4ad0943b4a9 /modules/global
parenta3c8afae00c54d5b95c620248b51f90679d7d53f (diff)
Allow serializable fields to use storage in the respective objects.
Split service management code nito a proper servicemanager. Make service references managed instead of lazy lookup. Also made events and serializable use service manager instead of their respective systems for management
Diffstat (limited to 'modules/global')
-rw-r--r--modules/global/global.cpp6
-rw-r--r--modules/global/main/global.cpp4
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/global/global.cpp b/modules/global/global.cpp
index d6106b2be..9461dff75 100644
--- a/modules/global/global.cpp
+++ b/modules/global/global.cpp
@@ -14,6 +14,8 @@
class CommandGLGlobal : public Command
{
+ ServiceReference<Global::GlobalService> service;
+
public:
CommandGLGlobal(Module *creator) : Command(creator, "global/global", 1, 1)
{
@@ -25,14 +27,14 @@ class CommandGLGlobal : public Command
{
const Anope::string &msg = params[0];
- if (!Global::service)
+ if (!service)
{
source.Reply("No global reference, is global loaded?");
return;
}
Log(LOG_ADMIN, source, this);
- Global::service->SendGlobal(NULL, source.GetNick(), msg);
+ service->SendGlobal(NULL, source.GetNick(), msg);
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
diff --git a/modules/global/main/global.cpp b/modules/global/main/global.cpp
index f31605acb..57905c1d7 100644
--- a/modules/global/main/global.cpp
+++ b/modules/global/main/global.cpp
@@ -32,6 +32,10 @@ class GlobalCore : public Module
public:
GlobalCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR)
+ , EventHook<Event::Restart>(this)
+ , EventHook<Event::Shutdown>(this)
+ , EventHook<Event::NewServer>(this)
+ , EventHook<Event::Help>(this)
, GlobalService(this)
{
}