diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 39 |
1 files changed, 39 insertions, 0 deletions
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 | |||
66 | m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); | 66 | m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod); |
67 | m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); | 67 | m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); |
68 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); | 68 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); |
69 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); | ||
69 | } | 70 | } |
70 | } | 71 | } |
71 | catch (NullReferenceException) | 72 | catch (NullReferenceException) |
@@ -135,6 +136,44 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
135 | return response; | 136 | return response; |
136 | } | 137 | } |
137 | 138 | ||
139 | public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request) | ||
140 | { | ||
141 | XmlRpcResponse response = new XmlRpcResponse(); | ||
142 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
143 | |||
144 | Hashtable responseData = new Hashtable(); | ||
145 | if (requiredPassword != "" && | ||
146 | (!requestData.Contains("password") || (string)requestData["password"] != requiredPassword)) | ||
147 | { | ||
148 | responseData["accepted"] = "false"; | ||
149 | response.Value = responseData; | ||
150 | } | ||
151 | else | ||
152 | { | ||
153 | string file = (string)requestData["filename"]; | ||
154 | LLUUID regionID = LLUUID.Parse((string)requestData["regionid"]); | ||
155 | MainLog.Instance.Verbose("RADMIN", "Terrain Loading: " + file); | ||
156 | |||
157 | responseData["accepted"] = "true"; | ||
158 | |||
159 | Scene region = null; | ||
160 | |||
161 | if (m_app.SceneManager.TryGetScene(regionID, out region)) | ||
162 | { | ||
163 | region.LoadWorldMap(file); | ||
164 | responseData["success"] = "true"; | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | responseData["success"] = "false"; | ||
169 | responseData["error"] = "1: Unable to get a scene with that name."; | ||
170 | } | ||
171 | response.Value = responseData; | ||
172 | } | ||
173 | |||
174 | return response; | ||
175 | } | ||
176 | |||
138 | public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) | 177 | public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) |
139 | { | 178 | { |
140 | MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request"); | 179 | MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request"); |