* 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
0.6.0-stable
Justin Clarke Casey 2008-06-27 18:18:44 +00:00
parent 7d55dfba8a
commit 442a938a3f
3 changed files with 20 additions and 11 deletions

View File

@ -50,11 +50,11 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected IRegionSerialiser m_serialiser; protected IRegionSerialiser m_serialiser;
protected List<EntityBase> m_sceneObjects; protected List<SceneObjectGroup> m_sceneObjects;
protected string m_savePath; protected string m_savePath;
public ArchiveWriteRequestExecution( public ArchiveWriteRequestExecution(
List<EntityBase> sceneObjects, IRegionSerialiser serialiser, string savePath) List<SceneObjectGroup> sceneObjects, IRegionSerialiser serialiser, string savePath)
{ {
m_sceneObjects = sceneObjects; m_sceneObjects = sceneObjects;
m_serialiser = serialiser; m_serialiser = serialiser;
@ -67,10 +67,10 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
TarArchiveWriter archive = new TarArchiveWriter(); 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 //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
SceneObjectGroup sceneObject = (SceneObjectGroup)entity;
LLVector3 position = sceneObject.AbsolutePosition; LLVector3 position = sceneObject.AbsolutePosition;
string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject); string serializedObject = m_serialiser.SaveGroupToXml2(sceneObject);

View File

@ -163,24 +163,31 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
Dictionary<LLUUID, int> assetUuids = new Dictionary<LLUUID, int>(); Dictionary<LLUUID, int> assetUuids = new Dictionary<LLUUID, int>();
List<EntityBase> entities = m_scene.GetEntities(); List<EntityBase> entities = m_scene.GetEntities();
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
// 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) foreach (EntityBase entity in entities)
{ {
if (entity is SceneObjectGroup) if (entity is SceneObjectGroup)
{ sceneObjects.Add((SceneObjectGroup)entity);
GetSceneObjectAssetUuids((SceneObjectGroup)entity, assetUuids);
}
} }
if (entities.Count > 0) foreach (SceneObjectGroup sceneObject in sceneObjects)
{ {
m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} entities", entities.Count); GetSceneObjectAssetUuids(sceneObject, assetUuids);
}
if (sceneObjects.Count > 0)
{
m_log.DebugFormat("[ARCHIVER]: Successfully got serialization for {0} scene objects", sceneObjects.Count);
m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count); m_log.DebugFormat("[ARCHIVER]: Requiring save of {0} assets", assetUuids.Count);
// Asynchronously request all the assets required to perform this archive operation // Asynchronously request all the assets required to perform this archive operation
ArchiveWriteRequestExecution awre ArchiveWriteRequestExecution awre
= new ArchiveWriteRequestExecution( = new ArchiveWriteRequestExecution(
entities, m_scene.RequestModuleInterface<IRegionSerialiser>(), m_savePath); sceneObjects, m_scene.RequestModuleInterface<IRegionSerialiser>(), m_savePath);
new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute(); new AssetsRequest(assetUuids.Keys, m_scene.AssetCache, awre.ReceivedAllAssets).Execute();
} }
} }

View File

@ -319,6 +319,7 @@ mesh_physical_lod = 16
;; append to existing physics logfile, or overwrite existing logfiles? ;; append to existing physics logfile, or overwrite existing logfiles?
;physics_logging_append_existing_logfile = true ;physics_logging_append_existing_logfile = true
[RemoteAdmin] [RemoteAdmin]
enabled = false enabled = false
access_password = unknown access_password = unknown
@ -333,6 +334,7 @@ prefix = /admin
[RestRegionPlugin] [RestRegionPlugin]
enabled = false enabled = false
; Uncomment the following for IRC bridge ; Uncomment the following for IRC bridge
; experimental, so if it breaks... keep both parts... yada yada ; experimental, so if it breaks... keep both parts... yada yada
; also, not good error detection when it fails ; also, not good error detection when it fails