diff options
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 48 |
1 files changed, 48 insertions, 0 deletions
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 | |||
70 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); | 70 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); |
71 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); | 71 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); |
72 | m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); | 72 | m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); |
73 | m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod); | ||
73 | } | 74 | } |
74 | } | 75 | } |
75 | catch (NullReferenceException) | 76 | catch (NullReferenceException) |
@@ -336,6 +337,53 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
336 | return response; | 337 | return response; |
337 | } | 338 | } |
338 | 339 | ||
340 | public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request) | ||
341 | { | ||
342 | m_log.Info("[RADMIN]: Received Load XML Administrator Request"); | ||
343 | XmlRpcResponse response = new XmlRpcResponse(); | ||
344 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
345 | Hashtable responseData = new Hashtable(); | ||
346 | if (requiredPassword != System.String.Empty && | ||
347 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) | ||
348 | { | ||
349 | responseData["loaded"] = "false"; | ||
350 | responseData["switched"] = "false"; | ||
351 | response.Value = responseData; | ||
352 | } | ||
353 | else | ||
354 | { | ||
355 | try | ||
356 | { | ||
357 | string region_name = (string) requestData["region_name"]; | ||
358 | string filename = (string) requestData["filename"]; | ||
359 | |||
360 | if (m_app.SceneManager.TrySetCurrentScene(region_name)) | ||
361 | { | ||
362 | m_log.Info("[RADMIN] Switched to region "+region_name); | ||
363 | responseData["switched"] = "true"; | ||
364 | m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new LLVector3(0, 0, 0)); | ||
365 | responseData["loaded"] = "true"; | ||
366 | response.Value = responseData; | ||
367 | } | ||
368 | else | ||
369 | { | ||
370 | m_log.Info("[RADMIN] Failed to switch to region "+region_name); | ||
371 | responseData["loaded"] = "false"; | ||
372 | responseData["switched"] = "false"; | ||
373 | response.Value = responseData; | ||
374 | } | ||
375 | } | ||
376 | catch (Exception e) | ||
377 | { | ||
378 | responseData["loaded"] = "false"; | ||
379 | responseData["error"] = e.ToString(); | ||
380 | response.Value = responseData; | ||
381 | } | ||
382 | } | ||
383 | |||
384 | return response; | ||
385 | } | ||
386 | |||
339 | public void Close() | 387 | public void Close() |
340 | { | 388 | { |
341 | } | 389 | } |