Fix issues with RemoteAdmin admin_save_heightmap and admin_load_heightmap not working.

This is because they were wrongly looking for both regionid and region_id parameters in the same request.
Now only region_id is required (and recognized), regionid having been already deprecated for some time.
This is essentially Michelle Argus' patch from http://opensimulator.org/mantis/view.php?id=6737 but with tabs replaced with spaces.
Thanks!
0.7.6-extended
Justin Clark-Casey (justincc) 2013-08-17 00:39:41 +01:00
parent f5d3145bea
commit 14ae89dbe7
1 changed files with 30 additions and 15 deletions

View File

@ -327,18 +327,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// k, (string)requestData[k], ((string)requestData[k]).Length);
// }
CheckStringParameters(requestData, responseData, new string[] {"filename", "regionid"});
CheckStringParameters(requestData, responseData, new string[] { "filename" });
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string file = (string)requestData["filename"];
responseData["accepted"] = true;
if (scene != null)
{
string file = (string)requestData["filename"];
LoadHeightmap(file, scene.RegionInfo.RegionID);
responseData["accepted"] = true;
responseData["success"] = true;
LoadHeightmap(file, scene.RegionInfo.RegionID);
responseData["success"] = true;
}
else
{
responseData["success"] = false;
}
m_log.Info("[RADMIN]: Load height maps request complete");
}
@ -352,23 +360,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString());
CheckStringParameters(requestData, responseData, new string[] { "filename", "regionid" });
CheckStringParameters(requestData, responseData, new string[] { "filename" });
CheckRegionParams(requestData, responseData);
Scene region = null;
GetSceneFromRegionParams(requestData, responseData, out region);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string file = (string)requestData["filename"];
m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
if (scene != null)
{
string file = (string)requestData["filename"];
m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
responseData["accepted"] = true;
responseData["accepted"] = true;
ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>();
if (null == terrainModule) throw new Exception("terrain module not available");
ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
if (null == terrainModule) throw new Exception("terrain module not available");
terrainModule.SaveToFile(file);
terrainModule.SaveToFile(file);
responseData["success"] = true;
responseData["success"] = true;
}
else
{
responseData["success"] = false;
}
m_log.Info("[RADMIN]: Save height maps request complete");
}