diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 325816d..b22003c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -413,8 +413,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
413 | 413 | ||
414 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); | 414 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); |
415 | if (null == terrainModule) throw new Exception("terrain module not available"); | 415 | if (null == terrainModule) throw new Exception("terrain module not available"); |
416 | terrainModule.LoadFromFile(file); | 416 | if (Uri.IsWellFormedUriString(file, UriKind.Absolute)) |
417 | 417 | { | |
418 | m_log.Info("[RADMIN]: Terrain path is URL"); | ||
419 | Uri result; | ||
420 | if (Uri.TryCreate(file, UriKind.RelativeOrAbsolute, out result)) | ||
421 | { | ||
422 | // the url is valid | ||
423 | string fileType = file.Substring(file.LastIndexOf('/') + 1); | ||
424 | terrainModule.LoadFromStream(fileType, result); | ||
425 | } | ||
426 | } | ||
427 | else | ||
428 | { | ||
429 | terrainModule.LoadFromFile(file); | ||
430 | } | ||
418 | responseData["success"] = false; | 431 | responseData["success"] = false; |
419 | 432 | ||
420 | response.Value = responseData; | 433 | response.Value = responseData; |