From 1d5e19e47659e889df4959528e504a598f32c41e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 3 Dec 2007 07:28:04 +0000 Subject: * Added a XMLRPC Restart command to RemoteAdminPlugin --- .../RemoteController/RemoteAdminPlugin.cs | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 8cd6fc6..18d5f0c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -13,6 +13,7 @@ using Nini.Config; using Nwc.XmlRpc; using System.Collections; using System.Timers; +using libsecondlife; [assembly: Addin] [assembly: AddinDependency("OpenSim", "0.4")] @@ -37,9 +38,36 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_httpd.AddXmlRPCHandler("admin_create_region", XmlRpcCreateRegionMethod); m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); + m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); } } + public XmlRpcResponse XmlRpcRestartMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + + LLUUID regionID = new LLUUID((string)requestData["regionID"]); + + Hashtable responseData = new Hashtable(); + responseData["accepted"] = "true"; + response.Value = responseData; + + OpenSim.Region.Environment.Scenes.Scene RebootedScene; + + if (m_app.SceneManager.TryGetScene(regionID, out RebootedScene)) + { + responseData["rebooting"] = "true"; + RebootedScene.Restart(30); + } + else + { + responseData["rebooting"] = "false"; + } + + return response; + } + public XmlRpcResponse XmlRpcAlertMethod(XmlRpcRequest request) { XmlRpcResponse response = new XmlRpcResponse(); -- cgit v1.1