* For your enjoyment, some RAdmin improvements, namely a new LoadHeightmap method.
parent
5d7e120d56
commit
bf8ffc7a0c
|
@ -66,6 +66,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod);
|
m_httpd.AddXmlRPCHandler("admin_shutdown", XmlRpcShutdownMethod);
|
||||||
m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod);
|
m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod);
|
||||||
m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod);
|
m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod);
|
||||||
|
m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NullReferenceException)
|
catch (NullReferenceException)
|
||||||
|
@ -135,6 +136,44 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
return response;
|
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)
|
public XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request");
|
MainLog.Instance.Verbose("RADMIN", "Received Shutdown Administrator Request");
|
||||||
|
|
|
@ -774,6 +774,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
mapTexture.Save(fileName, ImageFormat.Jpeg);
|
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>
|
/// <summary>
|
||||||
/// Loads the World heightmap
|
/// Loads the World heightmap
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue