diff options
author | Justin Clarke Casey | 2008-06-21 23:45:22 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-06-21 23:45:22 +0000 |
commit | ca88e3580b8ef94cd882d1b6723c37815601e54e (patch) | |
tree | f3e2fcb35fff62a3af70e7dae9ff88b69d2db627 /OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | |
parent | Mantis#1580. Thank you kindly, Dmiles for a patch that: (diff) | |
download | opensim-SC_OLD-ca88e3580b8ef94cd882d1b6723c37815601e54e.zip opensim-SC_OLD-ca88e3580b8ef94cd882d1b6723c37815601e54e.tar.gz opensim-SC_OLD-ca88e3580b8ef94cd882d1b6723c37815601e54e.tar.bz2 opensim-SC_OLD-ca88e3580b8ef94cd882d1b6723c37815601e54e.tar.xz |
* archive each object as a separate xml file rather than put them all in one single large file
* this is being done for reasons of compositionality
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index a0c6dbf..5d63ce4 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -172,44 +172,17 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver | |||
172 | } | 172 | } |
173 | } | 173 | } |
174 | 174 | ||
175 | string serializedEntities = SerializeObjects(entities); | 175 | if (entities.Count > 0) |
176 | |||
177 | if (serializedEntities != null && serializedEntities.Length > 0) | ||
178 | { | 176 | { |
179 | m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); | 177 | m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); |
180 | m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); | 178 | m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); |
181 | 179 | ||
182 | // Asynchronously request all the assets required to perform this archive operation | 180 | // Asynchronously request all the assets required to perform this archive operation |
183 | ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution(serializedEntities, m_savePath); | 181 | ArchiveWriteRequestExecution awre |
182 | = new ArchiveWriteRequestExecution( | ||
183 | entities, m_scene.RequestModuleInterface<IRegionSerialiser>(), m_savePath); | ||
184 | new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); | 184 | new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | |||
188 | /// <summary> | ||
189 | /// Get an xml representation of the given scene objects. | ||
190 | /// </summary> | ||
191 | /// <param name="scene"></param> | ||
192 | /// <returns></returns> | ||
193 | protected static string SerializeObjects(List<EntityBase> entities) | ||
194 | { | ||
195 | string serialization = "<scene>"; | ||
196 | |||
197 | List<string> serObjects = new List<string>(); | ||
198 | |||
199 | foreach (EntityBase ent in entities) | ||
200 | { | ||
201 | if (ent is SceneObjectGroup) | ||
202 | { | ||
203 | serObjects.Add(((SceneObjectGroup) ent).ToXmlString2()); | ||
204 | } | ||
205 | } | ||
206 | |||
207 | foreach (string serObject in serObjects) | ||
208 | serialization += serObject; | ||
209 | |||
210 | serialization += "</scene>"; | ||
211 | |||
212 | return serialization; | ||
213 | } | ||
214 | } | 187 | } |
215 | } | 188 | } |