* For your enjoyment, some RAdmin improvements, namely a new LoadHeightmap method.

ThreadPoolClientBranch
Adam Frisby 2008-01-12 03:17:28 +00:00
parent 5d7e120d56
commit bf8ffc7a0c
2 changed files with 48 additions and 0 deletions

View File

@ -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");

View File

@ -774,6 +774,15 @@ namespace OpenSim.Region.Environment.Scenes
mapTexture.Save(fileName, ImageFormat.Jpeg);
}
/// <summary>
/// Loads a world map from a specified R32 file
/// </summary>
/// <param name="filename">A working R32 file</param>
public void LoadWorldMap(string filename)
{
Terrain.LoadFromFileF32(filename);
}
/// <summary>
/// Loads the World heightmap
/// </summary>