aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs27
1 files changed, 6 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index c11174d..3b31281 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -35,7 +35,6 @@ using Nini.Config;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Framework.Communications;
39using OpenSim.Framework.Console; 38using OpenSim.Framework.Console;
40using OpenSim.Framework.Servers; 39using OpenSim.Framework.Servers;
41using OpenSim.Framework.Servers.HttpServer; 40using OpenSim.Framework.Servers.HttpServer;
@@ -46,47 +45,33 @@ using OpenSim.Region.Framework.Scenes;
46 45
47namespace OpenSim.Region.Framework.Scenes 46namespace OpenSim.Region.Framework.Scenes
48{ 47{
49 public class RegionStatsHandler : IStreamedRequestHandler 48 public class RegionStatsHandler : BaseStreamHandler
50 { 49 {
51 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 51
53 private string osRXStatsURI = String.Empty;
54 private string osXStatsURI = String.Empty; 52 private string osXStatsURI = String.Empty;
55 //private string osSecret = String.Empty; 53 //private string osSecret = String.Empty;
56 private OpenSim.Framework.RegionInfo regionInfo; 54 private OpenSim.Framework.RegionInfo regionInfo;
57 public string localZone = TimeZone.CurrentTimeZone.StandardName; 55 public string localZone = TimeZone.CurrentTimeZone.StandardName;
58 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now); 56 public TimeSpan utcOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
59 57
60 public string Name { get { return "RegionStats"; } } 58 public RegionStatsHandler(RegionInfo region_info)
61 public string Description { get { return "Region Statistics"; } } 59 : base("GET", "/" + Util.SHA1Hash(region_info.regionSecret), "RegionStats", "Region Statistics")
62
63 public RegionStatsHandler(RegionInfo region_info)
64 { 60 {
65 regionInfo = region_info; 61 regionInfo = region_info;
66 osRXStatsURI = Util.SHA1Hash(regionInfo.regionSecret);
67 osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); 62 osXStatsURI = Util.SHA1Hash(regionInfo.osSecret);
68 } 63 }
69 64
70 public byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 65 protected override byte[] ProcessRequest(
66 string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
71 { 67 {
72 return Util.UTF8.GetBytes(Report()); 68 return Util.UTF8.GetBytes(Report());
73 } 69 }
74 70
75 public string ContentType 71 public override string ContentType
76 { 72 {
77 get { return "text/plain"; } 73 get { return "text/plain"; }
78 } 74 }
79
80 public string HttpMethod
81 {
82 get { return "GET"; }
83 }
84
85 public string Path
86 {
87 // This is for the region and is the regionSecret hashed
88 get { return "/" + osRXStatsURI; }
89 }
90 75
91 private string Report() 76 private string Report()
92 { 77 {