diff options
| author | Adam <Adam@anope.org> | 2016-07-28 21:29:35 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2016-07-28 21:29:35 -0400 |
| commit | 0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch) | |
| tree | 45df813323e023c5c89db7279426c4ad0943b4a9 /modules/operserv/modinfo.cpp | |
| parent | a3c8afae00c54d5b95c620248b51f90679d7d53f (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/operserv/modinfo.cpp')
| -rw-r--r-- | modules/operserv/modinfo.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/operserv/modinfo.cpp b/modules/operserv/modinfo.cpp index f3c6db00f..8fc76d3d7 100644 --- a/modules/operserv/modinfo.cpp +++ b/modules/operserv/modinfo.cpp @@ -31,16 +31,15 @@ class CommandOSModInfo : public Command { source.Reply(_("Module: \002{0}\002 Version: \002{1}\002 Author: \002{2}\002 Loaded: \002{3}\002"), m->name, !m->version.empty() ? m->version : "?", !m->author.empty() ? m->author : "Unknown", Anope::strftime(m->created, source.GetAccount())); if (Anope::Debug) - source.Reply(_(" Loaded at: {0}"), Anope::printf("%o", m->handle)); + source.Reply(_(" Loaded at: {0}"), Anope::printf("0x%x", m->handle)); - std::vector<Anope::string> servicekeys = Service::GetServiceKeys("Command"); - for (unsigned i = 0; i < servicekeys.size(); ++i) + std::vector<Command *> commands = ServiceManager::Get()->FindServices<Command *>(); + for (Command *c : commands) { - ServiceReference<Command> c("Command", servicekeys[i]); - if (!c || c->owner != m) + if (c->GetOwner() != m) continue; - source.Reply(_(" Providing service: \002{0}\002"), c->name); + source.Reply(_(" Providing service: \002{0}\002"), c->GetName()); for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it) { @@ -55,9 +54,9 @@ class CommandOSModInfo : public Command { const Anope::string &c_name = cit->first; const CommandInfo &info = cit->second; - if (info.name != c->name) + if (info.name != c->GetName()) continue; - source.Reply(_(" Command \002{0}\002 on \002{1}\002 is linked to \002{2}\002"), c_name, bi->nick, c->name); + source.Reply(_(" Command \002{0}\002 on \002{1}\002 is linked to \002{2}\002"), c_name, bi->nick, c->GetName()); } } } |
