diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 90 |
1 files changed, 25 insertions, 65 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 88bd869..4891c1a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -75,6 +75,7 @@ namespace OpenSim | |||
75 | protected int proxyOffset = 0; | 75 | protected int proxyOffset = 0; |
76 | 76 | ||
77 | public string userStatsURI = String.Empty; | 77 | public string userStatsURI = String.Empty; |
78 | public string managedStatsURI = String.Empty; | ||
78 | 79 | ||
79 | protected bool m_autoCreateClientStack = true; | 80 | protected bool m_autoCreateClientStack = true; |
80 | 81 | ||
@@ -199,6 +200,8 @@ namespace OpenSim | |||
199 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); | 200 | new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule"); |
200 | 201 | ||
201 | m_permsModules = new List<string>(permissionModules.Split(',')); | 202 | m_permsModules = new List<string>(permissionModules.Split(',')); |
203 | |||
204 | managedStatsURI = startupConfig.GetString("ManagedStatsRemoteFetchURI", String.Empty); | ||
202 | } | 205 | } |
203 | 206 | ||
204 | // Load the simulation data service | 207 | // Load the simulation data service |
@@ -248,10 +251,7 @@ namespace OpenSim | |||
248 | } | 251 | } |
249 | 252 | ||
250 | if (m_console != null) | 253 | if (m_console != null) |
251 | { | ||
252 | StatsManager.RegisterConsoleCommands(m_console); | ||
253 | AddPluginCommands(m_console); | 254 | AddPluginCommands(m_console); |
254 | } | ||
255 | } | 255 | } |
256 | 256 | ||
257 | protected virtual void AddPluginCommands(ICommandConsole console) | 257 | protected virtual void AddPluginCommands(ICommandConsole console) |
@@ -496,9 +496,6 @@ namespace OpenSim | |||
496 | scene.SnmpService.LinkUp(scene); | 496 | scene.SnmpService.LinkUp(scene); |
497 | } | 497 | } |
498 | 498 | ||
499 | scene.Start(); | ||
500 | scene.StartScripts(); | ||
501 | |||
502 | return clientServers; | 499 | return clientServers; |
503 | } | 500 | } |
504 | 501 | ||
@@ -813,7 +810,7 @@ namespace OpenSim | |||
813 | 810 | ||
814 | if (foundClientServer) | 811 | if (foundClientServer) |
815 | { | 812 | { |
816 | m_clientServers[clientServerElement].NetworkStop(); | 813 | m_clientServers[clientServerElement].Stop(); |
817 | m_clientServers.RemoveAt(clientServerElement); | 814 | m_clientServers.RemoveAt(clientServerElement); |
818 | } | 815 | } |
819 | } | 816 | } |
@@ -827,6 +824,7 @@ namespace OpenSim | |||
827 | ShutdownClientServer(whichRegion); | 824 | ShutdownClientServer(whichRegion); |
828 | IScene scene; | 825 | IScene scene; |
829 | CreateRegion(whichRegion, true, out scene); | 826 | CreateRegion(whichRegion, true, out scene); |
827 | scene.Start(); | ||
830 | } | 828 | } |
831 | 829 | ||
832 | # region Setup methods | 830 | # region Setup methods |
@@ -840,73 +838,49 @@ namespace OpenSim | |||
840 | /// <summary> | 838 | /// <summary> |
841 | /// Handler to supply the current status of this sim | 839 | /// Handler to supply the current status of this sim |
842 | /// </summary> | 840 | /// </summary> |
841 | /// <remarks> | ||
843 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service | 842 | /// Currently this is always OK if the simulator is still listening for connections on its HTTP service |
844 | public class SimStatusHandler : IStreamedRequestHandler | 843 | /// </remarks> |
844 | public class SimStatusHandler : BaseStreamHandler | ||
845 | { | 845 | { |
846 | public byte[] Handle(string path, Stream request, | 846 | public SimStatusHandler() : base("GET", "/simstatus", "SimStatus", "Simulator Status") {} |
847 | |||
848 | protected override byte[] ProcessRequest(string path, Stream request, | ||
847 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 849 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
848 | { | 850 | { |
849 | return Util.UTF8.GetBytes("OK"); | 851 | return Util.UTF8.GetBytes("OK"); |
850 | } | 852 | } |
851 | 853 | ||
852 | public string Name { get { return "SimStatus"; } } | 854 | public override string ContentType |
853 | public string Description { get { return "Simulator Status"; } } | ||
854 | |||
855 | public string ContentType | ||
856 | { | 855 | { |
857 | get { return "text/plain"; } | 856 | get { return "text/plain"; } |
858 | } | 857 | } |
859 | |||
860 | public string HttpMethod | ||
861 | { | ||
862 | get { return "GET"; } | ||
863 | } | ||
864 | |||
865 | public string Path | ||
866 | { | ||
867 | get { return "/simstatus"; } | ||
868 | } | ||
869 | } | 858 | } |
870 | 859 | ||
871 | /// <summary> | 860 | /// <summary> |
872 | /// Handler to supply the current extended status of this sim | 861 | /// Handler to supply the current extended status of this sim |
873 | /// Sends the statistical data in a json serialization | 862 | /// Sends the statistical data in a json serialization |
874 | /// </summary> | 863 | /// </summary> |
875 | public class XSimStatusHandler : IStreamedRequestHandler | 864 | public class XSimStatusHandler : BaseStreamHandler |
876 | { | 865 | { |
877 | OpenSimBase m_opensim; | 866 | OpenSimBase m_opensim; |
878 | string osXStatsURI = String.Empty; | ||
879 | |||
880 | public string Name { get { return "XSimStatus"; } } | ||
881 | public string Description { get { return "Simulator XStatus"; } } | ||
882 | 867 | ||
883 | public XSimStatusHandler(OpenSimBase sim) | 868 | public XSimStatusHandler(OpenSimBase sim) |
869 | : base("GET", "/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus") | ||
884 | { | 870 | { |
885 | m_opensim = sim; | 871 | m_opensim = sim; |
886 | osXStatsURI = Util.SHA1Hash(sim.osSecret); | ||
887 | } | 872 | } |
888 | 873 | ||
889 | public byte[] Handle(string path, Stream request, | 874 | protected override byte[] ProcessRequest(string path, Stream request, |
890 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 875 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
891 | { | 876 | { |
892 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 877 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
893 | } | 878 | } |
894 | 879 | ||
895 | public string ContentType | 880 | public override string ContentType |
896 | { | 881 | { |
897 | get { return "text/plain"; } | 882 | get { return "text/plain"; } |
898 | } | 883 | } |
899 | |||
900 | public string HttpMethod | ||
901 | { | ||
902 | get { return "GET"; } | ||
903 | } | ||
904 | |||
905 | public string Path | ||
906 | { | ||
907 | // This is for the OpenSimulator instance and is the osSecret hashed | ||
908 | get { return "/" + osXStatsURI; } | ||
909 | } | ||
910 | } | 884 | } |
911 | 885 | ||
912 | /// <summary> | 886 | /// <summary> |
@@ -915,42 +889,26 @@ namespace OpenSim | |||
915 | /// If the request contains a key, "callback" the response will be wrappend in the | 889 | /// If the request contains a key, "callback" the response will be wrappend in the |
916 | /// associated value for jsonp used with ajax/javascript | 890 | /// associated value for jsonp used with ajax/javascript |
917 | /// </summary> | 891 | /// </summary> |
918 | public class UXSimStatusHandler : IStreamedRequestHandler | 892 | protected class UXSimStatusHandler : BaseStreamHandler |
919 | { | 893 | { |
920 | OpenSimBase m_opensim; | 894 | OpenSimBase m_opensim; |
921 | string osUXStatsURI = String.Empty; | ||
922 | |||
923 | public string Name { get { return "UXSimStatus"; } } | ||
924 | public string Description { get { return "Simulator UXStatus"; } } | ||
925 | 895 | ||
926 | public UXSimStatusHandler(OpenSimBase sim) | 896 | public UXSimStatusHandler(OpenSimBase sim) |
897 | : base("GET", "/" + sim.userStatsURI, "UXSimStatus", "Simulator UXStatus") | ||
927 | { | 898 | { |
928 | m_opensim = sim; | 899 | m_opensim = sim; |
929 | osUXStatsURI = sim.userStatsURI; | ||
930 | |||
931 | } | 900 | } |
932 | 901 | ||
933 | public byte[] Handle(string path, Stream request, | 902 | protected override byte[] ProcessRequest(string path, Stream request, |
934 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 903 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
935 | { | 904 | { |
936 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 905 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
937 | } | 906 | } |
938 | 907 | ||
939 | public string ContentType | 908 | public override string ContentType |
940 | { | 909 | { |
941 | get { return "text/plain"; } | 910 | get { return "text/plain"; } |
942 | } | 911 | } |
943 | |||
944 | public string HttpMethod | ||
945 | { | ||
946 | get { return "GET"; } | ||
947 | } | ||
948 | |||
949 | public string Path | ||
950 | { | ||
951 | // This is for the OpenSimulator instance and is the user provided URI | ||
952 | get { return "/" + osUXStatsURI; } | ||
953 | } | ||
954 | } | 912 | } |
955 | 913 | ||
956 | #endregion | 914 | #endregion |
@@ -958,7 +916,7 @@ namespace OpenSim | |||
958 | /// <summary> | 916 | /// <summary> |
959 | /// Performs any last-minute sanity checking and shuts down the region server | 917 | /// Performs any last-minute sanity checking and shuts down the region server |
960 | /// </summary> | 918 | /// </summary> |
961 | public override void ShutdownSpecific() | 919 | protected override void ShutdownSpecific() |
962 | { | 920 | { |
963 | if (proxyUrl.Length > 0) | 921 | if (proxyUrl.Length > 0) |
964 | { | 922 | { |
@@ -978,6 +936,8 @@ namespace OpenSim | |||
978 | { | 936 | { |
979 | m_log.Error("[SHUTDOWN]: Ignoring failure during shutdown - ", e); | 937 | m_log.Error("[SHUTDOWN]: Ignoring failure during shutdown - ", e); |
980 | } | 938 | } |
939 | |||
940 | base.ShutdownSpecific(); | ||
981 | } | 941 | } |
982 | 942 | ||
983 | /// <summary> | 943 | /// <summary> |