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
parent
f5d3145bea
commit
14ae89dbe7
|
@ -327,18 +327,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
// k, (string)requestData[k], ((string)requestData[k]).Length);
|
// k, (string)requestData[k], ((string)requestData[k]).Length);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
CheckStringParameters(requestData, responseData, new string[] {"filename", "regionid"});
|
CheckStringParameters(requestData, responseData, new string[] { "filename" });
|
||||||
CheckRegionParams(requestData, responseData);
|
CheckRegionParams(requestData, responseData);
|
||||||
|
|
||||||
Scene scene = null;
|
Scene scene = null;
|
||||||
GetSceneFromRegionParams(requestData, responseData, out scene);
|
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");
|
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());
|
// 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);
|
CheckRegionParams(requestData, responseData);
|
||||||
|
|
||||||
Scene region = null;
|
Scene scene = null;
|
||||||
GetSceneFromRegionParams(requestData, responseData, out region);
|
GetSceneFromRegionParams(requestData, responseData, out scene);
|
||||||
|
|
||||||
string file = (string)requestData["filename"];
|
if (scene != null)
|
||||||
m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
|
{
|
||||||
|
string file = (string)requestData["filename"];
|
||||||
|
m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
|
||||||
|
|
||||||
responseData["accepted"] = true;
|
responseData["accepted"] = true;
|
||||||
|
|
||||||
ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>();
|
ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>();
|
||||||
if (null == terrainModule) throw new Exception("terrain module not available");
|
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");
|
m_log.Info("[RADMIN]: Save height maps request complete");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue