From 442a938a3f7fa09f9aa00cdebcb0f1fbe9088df3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 27 Jun 2008 18:18:44 +0000 Subject: * fix a bug where I was assuming all entities would be SceneObjectGroups - of course, some are ScenePresences * would be nice to have a separate list in InnerScene in the future since a lot of methods end up screen entities for SOGs --- .../World/Archiver/ArchiveWriteRequestExecution.cs | 10 +++++----- .../World/Archiver/ArchiveWriteRequestPreparation.cs | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs index 3799c57..3ef8149 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -50,11 +50,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected IRegionSerialiser m_serialiser; - protected List m_sceneObjects; + protected List m_sceneObjects; protected string m_savePath; public ArchiveWriteRequestExecution( - List sceneObjects, IRegionSerialiser serialiser, string savePath) + List sceneObjects, IRegionSerialiser serialiser, string savePath) { m_sceneObjects = sceneObjects; m_serialiser = serialiser; @@ -67,10 +67,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver TarArchiveWriter archive = new TarArchiveWriter(); - foreach (EntityBase entity in m_sceneObjects) + foreach (SceneObjectGroup sceneObject in m_sceneObjects) { - // FIXME: I'm fairly sure that all entities are in fact SceneObjectGroups... must fix this - SceneObjectGroup sceneObject = (SceneObjectGroup)entity; + //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); + LLVector3 position = sceneObject.AbsolutePosition; string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs index 5d63ce4..bed30b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -163,24 +163,31 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver Dictionary assetUuids = new Dictionary(); List entities = m_scene.GetEntities(); + List sceneObjects = new List(); + // Filter entities so that we only have scene objects. + // FIXME: Would be nicer to have this as a proper list in InnerScene, since lots of methods + // end up having to do this foreach (EntityBase entity in entities) { if (entity is SceneObjectGroup) - { - GetSceneObjectAssetUuids((SceneObjectGroup)entity, assetUuids); - } + sceneObjects.Add((SceneObjectGroup)entity); + } + + foreach (SceneObjectGroup sceneObject in sceneObjects) + { + GetSceneObjectAssetUuids(sceneObject, assetUuids); } - if (entities.Count > 0) + if (sceneObjects.Count > 0) { - m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); + m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} scene objects", sceneObjects.Count); m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); // Asynchronously request all the assets required to perform this archive operation ArchiveWriteRequestExecution awre = new ArchiveWriteRequestExecution( - entities, m_scene.RequestModuleInterface(), m_savePath); + sceneObjects, m_scene.RequestModuleInterface(), m_savePath); new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); } } -- cgit v1.1