From b4cb45bb79619306b25c67c770165ab752aeb742 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Fri, 17 Apr 2009 21:48:48 +0000 Subject: Fixes Mantis # 3469. Thank you kindly, BlueWall, for a patch that: This patch adds extended status reporting with the url http://server:port/simstatusx/ [^] . The data is returned in json format as "text/plain" type. --- OpenSim/Region/Application/OpenSimBase.cs | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'OpenSim/Region/Application/OpenSimBase.cs') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 7aa9f99..18abcad 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -807,6 +807,43 @@ namespace OpenSim } } + /// + /// Handler to supply the current extended status of this sim + /// + /// Currently prints the same a "show stats" plus the uptime of the sim + public class XSimStatusHandler : IStreamedRequestHandler + { + OpenSimBase m_opensim; + + public XSimStatusHandler(OpenSimBase sim) + // public XSimStatusHandler(BaseOpenSimServer sim) + { + m_opensim = sim; + } + + public byte[] Handle(string path, Stream request, + OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { + return Encoding.UTF8.GetBytes(m_opensim.StatReport()); + } + + public string ContentType + { + get { return "text/plain"; } + } + + public string HttpMethod + { + get { return "GET"; } + } + + public string Path + { + get { return "/simstatusx/"; } + } + } + + #endregion /// -- cgit v1.1