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/xmlrpc_main.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/xmlrpc_main.cpp')
-rw-r--r-- | modules/xmlrpc_main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/xmlrpc_main.cpp b/modules/xmlrpc_main.cpp index af0253028..a812b1fba 100644 --- a/modules/xmlrpc_main.cpp +++ b/modules/xmlrpc_main.cpp @@ -1,5 +1,6 @@ #include "module.h" #include "modules/xmlrpc.h" +#include "modules/operserv/stats.h" static Module *me; @@ -117,7 +118,7 @@ class MyXMLRPCEvent : public XMLRPCEvent else { NickServ::IdentifyRequest *req = NickServ::service->CreateIdentifyRequest(new XMLRPCIdentifyRequest(request, client, iface), me, username, password); - Event::OnCheckAuthentication(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req); + EventManager::Get()->Dispatch(&Event::CheckAuthentication::OnCheckAuthentication, nullptr, req); req->Dispatch(); return false; } @@ -127,6 +128,8 @@ class MyXMLRPCEvent : public XMLRPCEvent void DoStats(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) { + Stats *stats = Serialize::GetObject<Stats *>(); + request.reply("uptime", stringify(Anope::CurTime - Anope::StartTime)); request.reply("uplinkname", Me->GetLinks().front()->GetName()); { @@ -138,7 +141,7 @@ class MyXMLRPCEvent : public XMLRPCEvent request.reply("uplinkcapab", buf); } request.reply("usercount", stringify(UserListByNick.size())); - request.reply("maxusercount", stringify(MaxUserCount)); + request.reply("maxusercount", stringify(stats ? stats->GetMaxUserCount() : 0)); request.reply("channelcount", stringify(ChannelList.size())); } @@ -258,7 +261,7 @@ class ModuleXMLRPCMain : public Module MyXMLRPCEvent stats; public: - ModuleXMLRPCMain(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), xmlrpc("XMLRPCServiceInterface", "xmlrpc") + ModuleXMLRPCMain(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR) { me = this; |