- data << "<!DOCTYPE html PUBLIC \
- \"-//W3C//DTD XHTML 1.1//EN\" \
- \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n\
- <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">";
-
- data << "<head>";
- data << "<link rel='stylesheet' href='" << this->stylesheet << "' type='text/css' />";
- data << "<title>InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")</title>";
- data << "</head><body>";
- data << "<h1>InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")</h1>";
-
- data << "<div class='totals'>";
- data << "<h2>Totals</h2>";
- data << "<table>";
- data << "<tr><td>Users</td><td>" << ServerInstance->clientlist.size() << "</td></tr>";
- data << "<tr><td>Channels</td><td>" << ServerInstance->chanlist.size() << "</td></tr>";
- data << "<tr><td>Opers</td><td>" << ServerInstance->all_opers.size() << "</td></tr>";
- data << "<tr><td>Sockets</td><td>" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << " (Max: " << ServerInstance->SE->GetMaxFds() << " via socket engine '" << ServerInstance->SE->GetName() << "')</td></tr>";
- data << "</table>";
- data << "</div>";
-
- data << "<div class='modules'>";
- data << "<h2>Modules</h2>";
- data << "<table>";
- for (int i = 0; i <= ServerInstance->GetModuleCount(); i++)
- {
- if (ServerInstance->Config->module_names[i] != "")
- data << "<tr><td>" << ServerInstance->Config->module_names[i] << "</td></tr>";
- }
- data << "</table>";
- data << "</div>";
-
- data << "<div class='channels'>";
- data << "<h2>Channels</h2>";
- data << "<table>";
- data << "<tr><th>Users</th><th>Name</th><th>@</th><th>%</th><th>+</th><th>Topic</th></tr>";
-
- /* If the list has changed since last time it was displayed, re-sort it
- * this time only (not every time, as this would be moronic)
- */
- if (this->changed)
- this->SortList();
-
- int n = 0;
- for (SortedIter a = so->begin(); ((a != so->end()) && (n < 25)); a++, n++)
+ data << "<inspircdstats><server><name>" << ServerInstance->Config->ServerName << "</name><gecos>"
+ << Sanitize(ServerInstance->Config->ServerDesc) << "</gecos><version>"
+ << Sanitize(ServerInstance->GetVersionString()) << "</version></server>";
+
+ data << "<general>";
+ data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
+ data << "<channelcount>" << ServerInstance->chanlist->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>";
+
+ time_t current_time = 0;
+ current_time = ServerInstance->Time();
+ time_t server_uptime = current_time - ServerInstance->startup_time;
+ struct tm* stime;
+ stime = gmtime(&server_uptime);
+ data << "<uptime><days>" << stime->tm_yday << "</days><hours>" << stime->tm_hour << "</hours><mins>" << stime->tm_min << "</mins><secs>" << stime->tm_sec << "</secs><boot_time_t>" << ServerInstance->startup_time << "</boot_time_t></uptime>";
+
+ data << "<isupport>" << Sanitize(ServerInstance->Config->data005) << "</isupport></general><xlines>";
+ std::vector<std::string> xltypes = ServerInstance->XLines->GetAllTypes();
+ for (std::vector<std::string>::iterator it = xltypes.begin(); it != xltypes.end(); ++it)