diff options
author | Justin Clark-Casey (justincc) | 2011-04-15 00:42:06 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-15 00:42:06 +0100 |
commit | a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75 (patch) | |
tree | 4c1f6780b2f8c766f7af29e827d77269790a94e9 /OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |
parent | implement stub TestLoadCoalesecedItem(). Doesn't do what it's meant to do yet. (diff) | |
download | opensim-SC_OLD-a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75.zip opensim-SC_OLD-a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75.tar.gz opensim-SC_OLD-a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75.tar.bz2 opensim-SC_OLD-a0d80140f2d0ad6dd63970a3a3d5c0da8320ae75.tar.xz |
Make all the objects in a coalescence reappears after being loaded from an IAR. This still doesn't work proprerly since some required textures/contained item assets might be missing.
From pure code inspection, it looks like the uuid gatherer may get most asset uuids because the scene object serializer naively pulls non-root parts from all contained scene objects into one mega-object. However, root part uuids may well still be missing, and there may be other odd artifacts from this bug.
It appears that storing the size of the coalescence and the offsets is redundant, since one can work out this information from the position data already in the scene object groups.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 01170aa..f3d2f26 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -471,16 +471,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
471 | if (m_creatorIdForAssetId.ContainsKey(assetId)) | 471 | if (m_creatorIdForAssetId.ContainsKey(assetId)) |
472 | { | 472 | { |
473 | string xmlData = Utils.BytesToString(data); | 473 | string xmlData = Utils.BytesToString(data); |
474 | SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); | 474 | List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); |
475 | foreach (SceneObjectPart sop in sog.Parts) | 475 | |
476 | CoalescedSceneObjects coa = null; | ||
477 | if (CoalescedSceneObjectsSerializer.TryFromXml(xmlData, out coa)) | ||
478 | { | ||
479 | // m_log.DebugFormat( | ||
480 | // "[INVENTORY ARCHIVER]: Loaded coalescence {0} has {1} objects", assetId, coa.Count); | ||
481 | |||
482 | sceneObjects.AddRange(coa.Objects); | ||
483 | } | ||
484 | else | ||
476 | { | 485 | { |
477 | if (sop.CreatorData == null || sop.CreatorData == "") | 486 | sceneObjects.Add(SceneObjectSerializer.FromOriginalXmlFormat(xmlData)); |
478 | { | ||
479 | sop.CreatorID = m_creatorIdForAssetId[assetId]; | ||
480 | } | ||
481 | } | 487 | } |
482 | 488 | ||
483 | data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sog)); | 489 | foreach (SceneObjectGroup sog in sceneObjects) |
490 | foreach (SceneObjectPart sop in sog.Parts) | ||
491 | if (sop.CreatorData == null || sop.CreatorData == "") | ||
492 | sop.CreatorID = m_creatorIdForAssetId[assetId]; | ||
493 | |||
494 | if (coa != null) | ||
495 | data = Utils.StringToBytes(CoalescedSceneObjectsSerializer.ToXml(coa)); | ||
496 | else | ||
497 | data = Utils.StringToBytes(SceneObjectSerializer.ToOriginalXmlFormat(sceneObjects[0])); | ||
484 | } | 498 | } |
485 | } | 499 | } |
486 | 500 | ||