diff options
author | Justin Clark-Casey (justincc) | 2009-12-04 18:26:58 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-12-04 18:26:58 +0000 |
commit | c0f3a4c8332f235e998714214011c5412bdcacf0 (patch) | |
tree | 78838e69a71b5a3d76d320161ba89111d156665a /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |
parent | * Clarifies that the PrimMaxPhys in OpenSim.ini.example does nothing. Tells ... (diff) | |
download | opensim-SC_OLD-c0f3a4c8332f235e998714214011c5412bdcacf0.zip opensim-SC_OLD-c0f3a4c8332f235e998714214011c5412bdcacf0.tar.gz opensim-SC_OLD-c0f3a4c8332f235e998714214011c5412bdcacf0.tar.bz2 opensim-SC_OLD-c0f3a4c8332f235e998714214011c5412bdcacf0.tar.xz |
Allow terrain heightmaps to be loaded directly from URIs via the remote admin plugin
See http://opensimulator.org/mantis/view.php?id=4418
Thanks StrawberryFride
See
Diffstat (limited to '')
-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 3149eaa..adf7967 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -315,8 +315,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
315 | 315 | ||
316 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); | 316 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); |
317 | if (null == terrainModule) throw new Exception("terrain module not available"); | 317 | if (null == terrainModule) throw new Exception("terrain module not available"); |
318 | terrainModule.LoadFromFile(file); | 318 | if (Uri.IsWellFormedUriString(file, UriKind.Absolute)) |
319 | 319 | { | |
320 | m_log.Info("[RADMIN]: Terrain path is URL"); | ||
321 | Uri result; | ||
322 | if (Uri.TryCreate(file, UriKind.RelativeOrAbsolute, out result)) | ||
323 | { | ||
324 | // the url is valid | ||
325 | string fileType = file.Substring(file.LastIndexOf('/') + 1); | ||
326 | terrainModule.LoadFromStream(fileType, result); | ||
327 | } | ||
328 | } | ||
329 | else | ||
330 | { | ||
331 | terrainModule.LoadFromFile(file); | ||
332 | } | ||
320 | responseData["success"] = false; | 333 | responseData["success"] = false; |
321 | 334 | ||
322 | response.Value = responseData; | 335 | response.Value = responseData; |