diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index fb694de..df5b443 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -104,11 +104,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
104 | { | 104 | { |
105 | bool mergeOar = false; | 105 | bool mergeOar = false; |
106 | bool skipAssets = false; | 106 | bool skipAssets = false; |
107 | bool noTerrain = false; | ||
108 | bool noParcels = false; | ||
107 | Vector3 displacement = new Vector3(0f, 0f, 0f); | 109 | Vector3 displacement = new Vector3(0f, 0f, 0f); |
108 | 110 | ||
109 | OptionSet options = new OptionSet(); | 111 | OptionSet options = new OptionSet(); |
110 | options.Add("m|merge", delegate (string v) { mergeOar = (v != null); }); | 112 | options.Add("m|merge", delegate (string v) { mergeOar = (v != null); }); |
111 | options.Add("s|skip-assets", delegate (string v) { skipAssets = (v != null); }); | 113 | options.Add("s|skip-assets", delegate (string v) { skipAssets = (v != null); }); |
114 | options.Add("noterrain", delegate (string v) { noTerrain = (v != null); }); | ||
115 | options.Add("noparcels", delegate (string v) { noParcels = (v != null); }); | ||
112 | options.Add("displacement=", delegate (string v) { | 116 | options.Add("displacement=", delegate (string v) { |
113 | try | 117 | try |
114 | { | 118 | { |
@@ -138,13 +142,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
138 | // foreach (string param in mainParams) | 142 | // foreach (string param in mainParams) |
139 | // m_log.DebugFormat("GOT PARAM [{0}]", param); | 143 | // m_log.DebugFormat("GOT PARAM [{0}]", param); |
140 | 144 | ||
145 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); | ||
146 | if (mergeOar) archiveOptions.Add("merge", null); | ||
147 | if (skipAssets) archiveOptions.Add("skipAssets", null); | ||
148 | if (noTerrain) archiveOptions.Add("noTerrain", null); | ||
149 | if (noParcels) archiveOptions.Add("noParcels", null); | ||
150 | if (displacement != Vector3.Zero) archiveOptions.Add("displacement", displacement); | ||
151 | |||
141 | if (mainParams.Count > 2) | 152 | if (mainParams.Count > 2) |
142 | { | 153 | { |
143 | DearchiveRegion(mainParams[2], mergeOar, skipAssets, displacement, Guid.Empty); | 154 | DearchiveRegion(mainParams[2], Guid.Empty, archiveOptions); |
144 | } | 155 | } |
145 | else | 156 | else |
146 | { | 157 | { |
147 | DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, skipAssets, displacement, Guid.Empty); | 158 | DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, Guid.Empty, archiveOptions); |
148 | } | 159 | } |
149 | } | 160 | } |
150 | 161 | ||
@@ -214,25 +225,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
214 | 225 | ||
215 | public void DearchiveRegion(string loadPath) | 226 | public void DearchiveRegion(string loadPath) |
216 | { | 227 | { |
217 | DearchiveRegion(loadPath, false, false, new Vector3(0f, 0f, 0f), Guid.Empty); | 228 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); |
229 | DearchiveRegion(loadPath, Guid.Empty, archiveOptions); | ||
218 | } | 230 | } |
219 | 231 | ||
220 | public void DearchiveRegion(string loadPath, bool merge, bool skipAssets, Vector3 displacement, Guid requestId) | 232 | public void DearchiveRegion(string loadPath, Guid requestId, Dictionary<string,object> options) |
221 | { | 233 | { |
222 | m_log.InfoFormat( | 234 | m_log.InfoFormat( |
223 | "[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath); | 235 | "[ARCHIVER]: Loading archive to region {0} from {1}", Scene.RegionInfo.RegionName, loadPath); |
224 | 236 | ||
225 | new ArchiveReadRequest(Scene, loadPath, merge, skipAssets, displacement, requestId).DearchiveRegion(); | 237 | new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); |
226 | } | 238 | } |
227 | 239 | ||
228 | public void DearchiveRegion(Stream loadStream) | 240 | public void DearchiveRegion(Stream loadStream) |
229 | { | 241 | { |
230 | DearchiveRegion(loadStream, false, false, new Vector3(0f, 0f, 0f), Guid.Empty); | 242 | Dictionary<string, object> archiveOptions = new Dictionary<string, object>(); |
243 | DearchiveRegion(loadStream, Guid.Empty, archiveOptions); | ||
231 | } | 244 | } |
232 | 245 | ||
233 | public void DearchiveRegion(Stream loadStream, bool merge, bool skipAssets, Vector3 displacement, Guid requestId) | 246 | public void DearchiveRegion(Stream loadStream, Guid requestId, Dictionary<string, object> options) |
234 | { | 247 | { |
235 | new ArchiveReadRequest(Scene, loadStream, merge, skipAssets, requestId).DearchiveRegion(); | 248 | new ArchiveReadRequest(Scene, loadStream, requestId, options).DearchiveRegion(); |
236 | } | 249 | } |
237 | } | 250 | } |
238 | } | 251 | } |