From bf8ffc7a0ca9411bd12b96d19075058e79b6c5e3 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 12 Jan 2008 03:17:28 +0000 Subject: * For your enjoyment, some RAdmin improvements, namely a new LoadHeightmap method. --- .../RemoteController/RemoteAdminPlugin.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 0f99c70..cce58c2 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -66,6 +66,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); + m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); } } catch (NullReferenceException) @@ -135,6 +136,44 @@ namespace OpenSim.ApplicationPlugins.LoadRegions return response; } + public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request) + { + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable requestData = (Hashtable)request.Params[0]; + + Hashtable responseData = new Hashtable(); + if (requiredPassword != "" && + (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) + { + responseData["accepted"] = "false"; + response.Value = responseData; + } + else + { + string file = (string)requestData["filename"]; + LLUUID regionID = LLUUID.Parse((string)requestData["regionid"]); + MainLog.Instance.Verbose("RADMIN", "Terrain Loading: " + file); + + responseData["accepted"] = "true"; + + Scene region = null; + + if (m_app.SceneManager.TryGetScene(regionID, out region)) + { + region.LoadWorldMap(file); + responseData["success"] = "true"; + } + else + { + responseData["success"] = "false"; + responseData["error"] = "1: Unable to get a scene with that name."; + } + response.Value = responseData; + } + + return response; + } + public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) { MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request"); -- cgit v1.1