aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-10 01:10:33 +0000
committerMelanie Thielker2008-10-10 01:10:33 +0000
commit96689723e5002075b45d01fe4243bf2d87d916b4 (patch)
tree5d8f9b35097da6657493db7b01738d55647dd31d /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
parentFixed renaming of in-prim items (Mantis #2366) (diff)
downloadopensim-SC-96689723e5002075b45d01fe4243bf2d87d916b4.zip
opensim-SC-96689723e5002075b45d01fe4243bf2d87d916b4.tar.gz
opensim-SC-96689723e5002075b45d01fe4243bf2d87d916b4.tar.bz2
opensim-SC-96689723e5002075b45d01fe4243bf2d87d916b4.tar.xz
Add the beginnings of a sim health check (through remote admin)
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 3a64ec2..5744867 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -97,6 +97,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
97 m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod); 97 m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod);
98 m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod); 98 m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod);
99 m_httpd.AddXmlRPCHandler("admin_load_oar", XmlRpcLoadOARMethod); 99 m_httpd.AddXmlRPCHandler("admin_load_oar", XmlRpcLoadOARMethod);
100 m_httpd.AddXmlRPCHandler("admin_region_query", XmlRpcRegionQueryMethod);
100 } 101 }
101 } 102 }
102 catch (NullReferenceException) 103 catch (NullReferenceException)
@@ -1084,6 +1085,61 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1084 return response; 1085 return response;
1085 } 1086 }
1086 1087
1088 public XmlRpcResponse XmlRpcRegionQueryMethod(XmlRpcRequest request)
1089 {
1090 m_log.Info("[RADMIN]: Received Save XML Administrator Request");
1091 XmlRpcResponse response = new XmlRpcResponse();
1092 Hashtable responseData = new Hashtable();
1093
1094 try
1095 {
1096 responseData["success"] = "true";
1097
1098 Hashtable requestData = (Hashtable)request.Params[0];
1099
1100 // check completeness
1101 if (!requestData.Contains("password"))
1102 throw new Exception(String.Format("missing required parameter"));
1103 if (!String.IsNullOrEmpty(requiredPassword) &&
1104 (string)requestData["password"] != requiredPassword) throw new Exception("wrong password");
1105
1106 if (requestData.Contains("region_uuid"))
1107 {
1108 UUID region_uuid = (UUID)(string)requestData["region_uuid"];
1109 if (!m_app.SceneManager.TrySetCurrentScene(region_uuid))
1110 throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
1111 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString());
1112 }
1113 else if (requestData.Contains("region_name"))
1114 {
1115 string region_name = (string)requestData["region_name"];
1116 if (!m_app.SceneManager.TrySetCurrentScene(region_name))
1117 throw new Exception(String.Format("failed to switch to region {0}", region_name));
1118 m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name);
1119 }
1120 else throw new Exception("neither region_name nor region_uuid given");
1121
1122 Scene s = m_app.SceneManager.CurrentScene;
1123
1124 int health = s.GetHealth();
1125
1126 responseData["health"] = health;
1127
1128 response.Value = responseData;
1129 }
1130 catch (Exception e)
1131 {
1132 m_log.InfoFormat("[RADMIN] RegionQuery: {0}", e.Message);
1133
1134 responseData["success"] = "false";
1135 responseData["error"] = e.Message;
1136
1137 response.Value = responseData;
1138 }
1139
1140 return response;
1141 }
1142
1087 public void Dispose() 1143 public void Dispose()
1088 { 1144 {
1089 } 1145 }