From c7c567182aee77c3bf3024114c3eb87cc77365f4 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 11 Feb 2008 12:58:01 +0000 Subject: From: Ansgar Schmidt Here is a patch for Revision 3380. This patch adds the feature of loading XML prim specification via XML-RPC call on a given island. Call with Islandname and XMLPrim Filename. --- .../RemoteController/RemoteAdminPlugin.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index f4c0b90..a6d5089 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -70,6 +70,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); + m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod); } } catch (NullReferenceException) @@ -336,6 +337,53 @@ namespace OpenSim.ApplicationPlugins.LoadRegions return response; } + public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request) + { + m_log.Info("[RADMIN]: Received Load XML Administrator Request"); + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable) request.Params[0]; + Hashtable responseData = new Hashtable(); + if (requiredPassword != System.String.Empty && + (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) + { + responseData["loaded"] = "false"; + responseData["switched"] = "false"; + response.Value = responseData; + } + else + { + try + { + string region_name = (string) requestData["region_name"]; + string filename = (string) requestData["filename"]; + + if (m_app.SceneManager.TrySetCurrentScene(region_name)) + { + m_log.Info("[RADMIN] Switched to region "+region_name); + responseData["switched"] = "true"; + m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new LLVector3(0, 0, 0)); + responseData["loaded"] = "true"; + response.Value = responseData; + } + else + { + m_log.Info("[RADMIN] Failed to switch to region "+region_name); + responseData["loaded"] = "false"; + responseData["switched"] = "false"; + response.Value = responseData; + } + } + catch (Exception e) + { + responseData["loaded"] = "false"; + responseData["error"] = e.ToString(); + response.Value = responseData; + } + } + + return response; + } + public void Close() { } -- cgit v1.1