aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs87
1 files changed, 22 insertions, 65 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 7361f50..db76529 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -246,10 +246,7 @@ namespace OpenSim
246 } 246 }
247 247
248 if (m_console != null) 248 if (m_console != null)
249 {
250 StatsManager.RegisterConsoleCommands(m_console);
251 AddPluginCommands(m_console); 249 AddPluginCommands(m_console);
252 }
253 } 250 }
254 251
255 protected virtual void AddPluginCommands(ICommandConsole console) 252 protected virtual void AddPluginCommands(ICommandConsole console)
@@ -504,9 +501,6 @@ namespace OpenSim
504 scene.SnmpService.LinkUp(scene); 501 scene.SnmpService.LinkUp(scene);
505 } 502 }
506 503
507 scene.Start();
508 scene.StartScripts();
509
510 return clientServers; 504 return clientServers;
511 } 505 }
512 506
@@ -821,7 +815,7 @@ namespace OpenSim
821 815
822 if (foundClientServer) 816 if (foundClientServer)
823 { 817 {
824 m_clientServers[clientServerElement].NetworkStop(); 818 m_clientServers[clientServerElement].Stop();
825 m_clientServers.RemoveAt(clientServerElement); 819 m_clientServers.RemoveAt(clientServerElement);
826 } 820 }
827 } 821 }
@@ -835,6 +829,7 @@ namespace OpenSim
835 ShutdownClientServer(whichRegion); 829 ShutdownClientServer(whichRegion);
836 IScene scene; 830 IScene scene;
837 CreateRegion(whichRegion, true, out scene); 831 CreateRegion(whichRegion, true, out scene);
832 scene.Start();
838 } 833 }
839 834
840 # region Setup methods 835 # region Setup methods
@@ -848,73 +843,49 @@ namespace OpenSim
848 /// <summary> 843 /// <summary>
849 /// Handler to supply the current status of this sim 844 /// Handler to supply the current status of this sim
850 /// </summary> 845 /// </summary>
846 /// <remarks>
851 /// Currently this is always OK if the simulator is still listening for connections on its HTTP service 847 /// Currently this is always OK if the simulator is still listening for connections on its HTTP service
852 public class SimStatusHandler : IStreamedRequestHandler 848 /// </remarks>
849 public class SimStatusHandler : BaseStreamHandler
853 { 850 {
854 public byte[] Handle(string path, Stream request, 851 public SimStatusHandler() : base("GET", "/simstatus", "SimStatus", "Simulator Status") {}
852
853 protected override byte[] ProcessRequest(string path, Stream request,
855 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 854 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
856 { 855 {
857 return Util.UTF8.GetBytes("OK"); 856 return Util.UTF8.GetBytes("OK");
858 } 857 }
859 858
860 public string Name { get { return "SimStatus"; } } 859 public override string ContentType
861 public string Description { get { return "Simulator Status"; } }
862
863 public string ContentType
864 { 860 {
865 get { return "text/plain"; } 861 get { return "text/plain"; }
866 } 862 }
867
868 public string HttpMethod
869 {
870 get { return "GET"; }
871 }
872
873 public string Path
874 {
875 get { return "/simstatus"; }
876 }
877 } 863 }
878 864
879 /// <summary> 865 /// <summary>
880 /// Handler to supply the current extended status of this sim 866 /// Handler to supply the current extended status of this sim
881 /// Sends the statistical data in a json serialization 867 /// Sends the statistical data in a json serialization
882 /// </summary> 868 /// </summary>
883 public class XSimStatusHandler : IStreamedRequestHandler 869 public class XSimStatusHandler : BaseStreamHandler
884 { 870 {
885 OpenSimBase m_opensim; 871 OpenSimBase m_opensim;
886 string osXStatsURI = String.Empty;
887
888 public string Name { get { return "XSimStatus"; } }
889 public string Description { get { return "Simulator XStatus"; } }
890 872
891 public XSimStatusHandler(OpenSimBase sim) 873 public XSimStatusHandler(OpenSimBase sim)
874 : base("GET", "/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus")
892 { 875 {
893 m_opensim = sim; 876 m_opensim = sim;
894 osXStatsURI = Util.SHA1Hash(sim.osSecret);
895 } 877 }
896 878
897 public byte[] Handle(string path, Stream request, 879 protected override byte[] ProcessRequest(string path, Stream request,
898 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 880 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
899 { 881 {
900 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); 882 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
901 } 883 }
902 884
903 public string ContentType 885 public override string ContentType
904 { 886 {
905 get { return "text/plain"; } 887 get { return "text/plain"; }
906 } 888 }
907
908 public string HttpMethod
909 {
910 get { return "GET"; }
911 }
912
913 public string Path
914 {
915 // This is for the OpenSimulator instance and is the osSecret hashed
916 get { return "/" + osXStatsURI; }
917 }
918 } 889 }
919 890
920 /// <summary> 891 /// <summary>
@@ -923,42 +894,26 @@ namespace OpenSim
923 /// If the request contains a key, "callback" the response will be wrappend in the 894 /// If the request contains a key, "callback" the response will be wrappend in the
924 /// associated value for jsonp used with ajax/javascript 895 /// associated value for jsonp used with ajax/javascript
925 /// </summary> 896 /// </summary>
926 public class UXSimStatusHandler : IStreamedRequestHandler 897 protected class UXSimStatusHandler : BaseStreamHandler
927 { 898 {
928 OpenSimBase m_opensim; 899 OpenSimBase m_opensim;
929 string osUXStatsURI = String.Empty;
930
931 public string Name { get { return "UXSimStatus"; } }
932 public string Description { get { return "Simulator UXStatus"; } }
933 900
934 public UXSimStatusHandler(OpenSimBase sim) 901 public UXSimStatusHandler(OpenSimBase sim)
902 : base("GET", "/" + sim.userStatsURI, "UXSimStatus", "Simulator UXStatus")
935 { 903 {
936 m_opensim = sim; 904 m_opensim = sim;
937 osUXStatsURI = sim.userStatsURI;
938
939 } 905 }
940 906
941 public byte[] Handle(string path, Stream request, 907 protected override byte[] ProcessRequest(string path, Stream request,
942 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 908 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
943 { 909 {
944 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); 910 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
945 } 911 }
946 912
947 public string ContentType 913 public override string ContentType
948 { 914 {
949 get { return "text/plain"; } 915 get { return "text/plain"; }
950 } 916 }
951
952 public string HttpMethod
953 {
954 get { return "GET"; }
955 }
956
957 public string Path
958 {
959 // This is for the OpenSimulator instance and is the user provided URI
960 get { return "/" + osUXStatsURI; }
961 }
962 } 917 }
963 918
964 #endregion 919 #endregion
@@ -966,7 +921,7 @@ namespace OpenSim
966 /// <summary> 921 /// <summary>
967 /// Performs any last-minute sanity checking and shuts down the region server 922 /// Performs any last-minute sanity checking and shuts down the region server
968 /// </summary> 923 /// </summary>
969 public override void ShutdownSpecific() 924 protected override void ShutdownSpecific()
970 { 925 {
971 if (proxyUrl.Length > 0) 926 if (proxyUrl.Length > 0)
972 { 927 {
@@ -986,6 +941,8 @@ namespace OpenSim
986 { 941 {
987 m_log.Error("[SHUTDOWN]: Ignoring failure during shutdown - ", e); 942 m_log.Error("[SHUTDOWN]: Ignoring failure during shutdown - ", e);
988 } 943 }
944
945 base.ShutdownSpecific();
989 } 946 }
990 947
991 /// <summary> 948 /// <summary>