diff options
author | Justin Clark-Casey (justincc) | 2011-07-02 01:05:03 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-02 01:05:03 +0100 |
commit | bb4cb165127164cbc9d907aac27c4fb3eb69d443 (patch) | |
tree | 2159dcec9c141e9b6bcf336b22c2fb871ae7380f /OpenSim/ApplicationPlugins | |
parent | Create a very basic initial test which just creates an 'npc' and tests that t... (diff) | |
download | opensim-SC_OLD-bb4cb165127164cbc9d907aac27c4fb3eb69d443.zip opensim-SC_OLD-bb4cb165127164cbc9d907aac27c4fb3eb69d443.tar.gz opensim-SC_OLD-bb4cb165127164cbc9d907aac27c4fb3eb69d443.tar.bz2 opensim-SC_OLD-bb4cb165127164cbc9d907aac27c4fb3eb69d443.tar.xz |
Add profile, merge, noassets and skip-assets options for loading/saving oars via RemoteAdmin
This is http://opensimulator.org/mantis/view.php?id=5453
Thanks Michelle Argus!
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 5a011ce..93a6915 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -2201,6 +2201,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2201 | /// <description>UUID of the region</description></item> | 2201 | /// <description>UUID of the region</description></item> |
2202 | /// <item><term>region_name</term> | 2202 | /// <item><term>region_name</term> |
2203 | /// <description>region name</description></item> | 2203 | /// <description>region name</description></item> |
2204 | /// <item><term>merge</term> | ||
2205 | /// <description>true if oar should be merged</description></item> | ||
2206 | /// <item><term>skip-assets</term> | ||
2207 | /// <description>true if assets should be skiped</description></item> | ||
2204 | /// </list> | 2208 | /// </list> |
2205 | /// | 2209 | /// |
2206 | /// <code>region_uuid</code> takes precedence over | 2210 | /// <code>region_uuid</code> takes precedence over |
@@ -2259,10 +2263,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2259 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2263 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2260 | } | 2264 | } |
2261 | else throw new Exception("neither region_name nor region_uuid given"); | 2265 | else throw new Exception("neither region_name nor region_uuid given"); |
2266 | |||
2267 | bool mergeOar = false; | ||
2268 | bool skipAssets = false; | ||
2269 | |||
2270 | if ((string)requestData["merge"] == "true") | ||
2271 | { | ||
2272 | mergeOar = true; | ||
2273 | } | ||
2274 | if ((string)requestData["skip-assets"] == "true") | ||
2275 | { | ||
2276 | skipAssets = true; | ||
2277 | } | ||
2262 | 2278 | ||
2263 | IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); | 2279 | IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); |
2264 | if (archiver != null) | 2280 | if (archiver != null) |
2265 | archiver.DearchiveRegion(filename); | 2281 | archiver.DearchiveRegion(filename, mergeOar, skipAssets, Guid.Empty); |
2266 | else | 2282 | else |
2267 | throw new Exception("Archiver module not present for scene"); | 2283 | throw new Exception("Archiver module not present for scene"); |
2268 | 2284 | ||
@@ -2302,6 +2318,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2302 | /// <description>UUID of the region</description></item> | 2318 | /// <description>UUID of the region</description></item> |
2303 | /// <item><term>region_name</term> | 2319 | /// <item><term>region_name</term> |
2304 | /// <description>region name</description></item> | 2320 | /// <description>region name</description></item> |
2321 | /// <item><term>profile</term> | ||
2322 | /// <description>profile url</description></item> | ||
2323 | /// <item><term>noassets</term> | ||
2324 | /// <description>true if no assets should be saved</description></item> | ||
2305 | /// </list> | 2325 | /// </list> |
2306 | /// | 2326 | /// |
2307 | /// <code>region_uuid</code> takes precedence over | 2327 | /// <code>region_uuid</code> takes precedence over |
@@ -2359,12 +2379,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2359 | } | 2379 | } |
2360 | else throw new Exception("neither region_name nor region_uuid given"); | 2380 | else throw new Exception("neither region_name nor region_uuid given"); |
2361 | 2381 | ||
2382 | Dictionary<string, object> options = new Dictionary<string, object>(); | ||
2383 | |||
2384 | //if (requestData.Contains("version")) | ||
2385 | //{ | ||
2386 | // options["version"] = (string)requestData["version"]; | ||
2387 | //} | ||
2388 | |||
2389 | if (requestData.Contains("profile")) | ||
2390 | { | ||
2391 | options["profile"] = (string)requestData["profile"]; | ||
2392 | } | ||
2393 | |||
2394 | if (requestData["noassets"] == "true") | ||
2395 | { | ||
2396 | options["noassets"] = (string)requestData["noassets"] ; | ||
2397 | } | ||
2398 | |||
2362 | IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); | 2399 | IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>(); |
2363 | 2400 | ||
2364 | if (archiver != null) | 2401 | if (archiver != null) |
2365 | { | 2402 | { |
2366 | scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; | 2403 | scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; |
2367 | archiver.ArchiveRegion(filename, new Dictionary<string, object>()); | 2404 | archiver.ArchiveRegion(filename, options); |
2368 | lock (m_saveOarLock) Monitor.Wait(m_saveOarLock,5000); | 2405 | lock (m_saveOarLock) Monitor.Wait(m_saveOarLock,5000); |
2369 | scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; | 2406 | scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; |
2370 | } | 2407 | } |