* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
so->clear();
for (StatsIter a = sh->begin(); a != sh->end(); a++)
InsertOrder(a->first, a->second);
- for (user_hash::iterator u = ServerInstance->clientlist->begin(); u != ServerInstance->clientlist->end(); u++)
+ for (user_hash::iterator u = ServerInstance->Users->clientlist->begin(); u != ServerInstance->Users->clientlist->end(); u++)
{
StatsHash::iterator n = Servers->find(u->second->server);
if (n != Servers->end())
data << "<server><name>" << ServerInstance->Config->ServerName << "</name><gecos>" << ServerInstance->Config->ServerDesc << "</gecos></server>";
data << "<general>";
- data << "<usercount>" << ServerInstance->clientlist->size() << "</usercount>";
+ data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
data << "<channelcount>" << ServerInstance->chanlist->size() << "</channelcount>";
- data << "<opercount>" << ServerInstance->all_opers.size() << "</opercount>";
+ data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>";
data << "<socketcount>" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << "</socketcount><socketmax>" << ServerInstance->SE->GetMaxFds() <<
"</socketmax><socketengine>" << ServerInstance->SE->GetName() << "</socketengine>";
data << "</general>";
data << "<modulelist>";
- /* XXX FIXME
- * for (int i = 0; i <= ServerInstance->Modules->GetCount(); i++)
+ std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
+ for (std::vector<std::string>::iterator i = module_names.begin(); i != module_names.end(); ++i)
{
- if (!ServerInstance->Config->module_names[i].empty())
- {
- Version v = ServerInstance->Modules->modules[i]->GetVersion();
- data << "<module><name>" << ServerInstance->Config->module_names[i] << "</name><version>" <<
- v.Major << "." << v.Minor << "." << v.Revision << "." << v.Build << "</version></module>";
- }
+ Module* m = ServerInstance->Modules->Find(i->c_str());
+ Version v = m->GetVersion();
+ data << "<module><name>" << *i << "</name><version>" << v.Major << "." << v.Minor << "." << v.Revision << "." << v.Build << "</version></module>";
}
- */
data << "</modulelist>";
data << "<channellist>";
this->changed = true;
}
- void OnUserJoin(User* user, Channel* channel, bool &silent)
+ void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
{
StatsIter a = sh->find(channel->name);
if (a != sh->end())
this->changed = true;
}
- char* OnRequest(Request* request)
+ const char* OnRequest(Request* request)
{
return NULL;
}
- void Implements(char* List)
- {
- List[I_OnEvent] = List[I_OnRequest] = List[I_OnChannelDelete] = List[I_OnUserJoin] = List[I_OnUserPart] = List[I_OnUserQuit] = 1;
- }
virtual ~ModuleHttpStats()
{
virtual Version GetVersion()
{
- return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+ return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION);
}
};