mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
* For your enjoyment, some RAdmin improvements, namely a new LoadHeightmap method.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user