diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 3abf40b..c78cf3b 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -327,18 +327,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
327 | // k, (string)requestData[k], ((string)requestData[k]).Length); | 327 | // k, (string)requestData[k], ((string)requestData[k]).Length); |
328 | // } | 328 | // } |
329 | 329 | ||
330 | CheckStringParameters(requestData, responseData, new string[] {"filename", "regionid"}); | 330 | CheckStringParameters(requestData, responseData, new string[] { "filename" }); |
331 | CheckRegionParams(requestData, responseData); | 331 | CheckRegionParams(requestData, responseData); |
332 | 332 | ||
333 | Scene scene = null; | 333 | Scene scene = null; |
334 | GetSceneFromRegionParams(requestData, responseData, out scene); | 334 | GetSceneFromRegionParams(requestData, responseData, out scene); |
335 | string file = (string)requestData["filename"]; | ||
336 | 335 | ||
337 | responseData["accepted"] = true; | 336 | if (scene != null) |
337 | { | ||
338 | string file = (string)requestData["filename"]; | ||
338 | 339 | ||
339 | LoadHeightmap(file, scene.RegionInfo.RegionID); | 340 | responseData["accepted"] = true; |
340 | 341 | ||
341 | responseData["success"] = true; | 342 | LoadHeightmap(file, scene.RegionInfo.RegionID); |
343 | |||
344 | responseData["success"] = true; | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | responseData["success"] = false; | ||
349 | } | ||
342 | 350 | ||
343 | m_log.Info("[RADMIN]: Load height maps request complete"); | 351 | m_log.Info("[RADMIN]: Load height maps request complete"); |
344 | } | 352 | } |
@@ -352,23 +360,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
352 | 360 | ||
353 | // m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString()); | 361 | // m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString()); |
354 | 362 | ||
355 | CheckStringParameters(requestData, responseData, new string[] { "filename", "regionid" }); | 363 | CheckStringParameters(requestData, responseData, new string[] { "filename" }); |
356 | CheckRegionParams(requestData, responseData); | 364 | CheckRegionParams(requestData, responseData); |
357 | 365 | ||
358 | Scene region = null; | 366 | Scene scene = null; |
359 | GetSceneFromRegionParams(requestData, responseData, out region); | 367 | GetSceneFromRegionParams(requestData, responseData, out scene); |
360 | 368 | ||
361 | string file = (string)requestData["filename"]; | 369 | if (scene != null) |
362 | m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file); | 370 | { |
371 | string file = (string)requestData["filename"]; | ||
372 | m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file); | ||
363 | 373 | ||
364 | responseData["accepted"] = true; | 374 | responseData["accepted"] = true; |
365 | 375 | ||
366 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); | 376 | ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>(); |
367 | if (null == terrainModule) throw new Exception("terrain module not available"); | 377 | if (null == terrainModule) throw new Exception("terrain module not available"); |
368 | 378 | ||
369 | terrainModule.SaveToFile(file); | 379 | terrainModule.SaveToFile(file); |
370 | 380 | ||
371 | responseData["success"] = true; | 381 | responseData["success"] = true; |
382 | } | ||
383 | else | ||
384 | { | ||
385 | responseData["success"] = false; | ||
386 | } | ||
372 | 387 | ||
373 | m_log.Info("[RADMIN]: Save height maps request complete"); | 388 | m_log.Info("[RADMIN]: Save height maps request complete"); |
374 | } | 389 | } |