#include "inspircd.h"
#include "modules/httpd.h"
#include "xline.h"
-#include "protocol.h"
class ModuleHttpStats : public Module
{
ret += it->second;
ret += ';';
}
- else if (*x == 0x9 || *x == 0xA || *x == 0xD || *x >= 0x20)
+ else if (*x == 0x09 || *x == 0x0A || *x == 0x0D || ((*x >= 0x20) && (*x <= 0x7e)))
{
// The XML specification defines the following characters as valid inside an XML document:
// Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
<< Sanitize(ServerInstance->GetVersionString()) << "</version></server>";
data << "<general>";
- data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
- data << "<channelcount>" << ServerInstance->chanlist->size() << "</channelcount>";
+ data << "<usercount>" << ServerInstance->Users->GetUsers().size() << "</usercount>";
+ data << "<channelcount>" << ServerInstance->GetChans().size() << "</channelcount>";
data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>";
- data << "<socketcount>" << (ServerInstance->SE->GetUsedFds()) << "</socketcount><socketmax>" << ServerInstance->SE->GetMaxFds() << "</socketmax><socketengine>" << ServerInstance->SE->GetName() << "</socketengine>";
+ data << "<socketcount>" << (SocketEngine::GetUsedFds()) << "</socketcount><socketmax>" << SocketEngine::GetMaxFds() << "</socketmax><socketengine>" INSPIRCD_SOCKETENGINE_NAME "</socketengine>";
time_t current_time = 0;
current_time = ServerInstance->Time();
}
data << "</xlines><modulelist>";
- std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
+ const ModuleManager::ModuleMap& mods = ServerInstance->Modules->GetModules();
- for (std::vector<std::string>::iterator i = module_names.begin(); i != module_names.end(); ++i)
+ for (ModuleManager::ModuleMap::const_iterator i = mods.begin(); i != mods.end(); ++i)
{
- Module* m = ServerInstance->Modules->Find(i->c_str());
- Version v = m->GetVersion();
- data << "<module><name>" << *i << "</name><description>" << Sanitize(v.description) << "</description></module>";
+ Version v = i->second->GetVersion();
+ data << "<module><name>" << i->first << "</name><description>" << Sanitize(v.description) << "</description></module>";
}
data << "</modulelist><channellist>";
- for (chan_hash::const_iterator a = ServerInstance->chanlist->begin(); a != ServerInstance->chanlist->end(); ++a)
+ const chan_hash& chans = ServerInstance->GetChans();
+ for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
{
- Channel* c = a->second;
+ Channel* c = i->second;
data << "<channel>";
data << "<usercount>" << c->GetUsers()->size() << "</usercount><channelname>" << Sanitize(c->name) << "</channelname>";
{
Membership* memb = x->second;
data << "<channelmember><uid>" << memb->user->uuid << "</uid><privs>"
- << Sanitize(c->GetAllPrefixChars(x->first)) << "</privs><modes>"
+ << Sanitize(memb->GetAllPrefixChars()) << "</privs><modes>"
<< memb->modes << "</modes>";
DumpMeta(data, memb);
data << "</channelmember>";
data << "</channellist><userlist>";
- for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); ++a)
+ const user_hash& users = ServerInstance->Users->GetUsers();
+ for (user_hash::const_iterator i = users.begin(); i != users.end(); ++i)
{
- User* u = a->second;
+ User* u = i->second;
data << "<user>";
data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>"
LocalUser* lu = IS_LOCAL(u);
if (lu)
data << "<port>" << lu->GetServerPort() << "</port><servaddr>"
- << irc::sockets::satouser(lu->server_sa) << "</servaddr>";
+ << lu->server_sa.str() << "</servaddr>";
data << "<ipaddress>" << u->GetIPString() << "</ipaddress>";
DumpMeta(data, u);
data << "</userlist><serverlist>";
- ProtoServerList sl;
+ ProtocolInterface::ServerList sl;
ServerInstance->PI->GetServerList(sl);
- for (ProtoServerList::iterator b = sl.begin(); b != sl.end(); ++b)
+ for (ProtocolInterface::ServerList::const_iterator b = sl.begin(); b != sl.end(); ++b)
{
data << "<server>";
data << "<servername>" << b->servername << "</servername>";