From 47c2bd2b9581047292d9ff770de1c6c27d924da8 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 7 Oct 2008 11:28:45 +0000 Subject: From: chris yeoh If you use load-oar to transfer region data from one sim to another then currently inventory items can be left with unknown owner permission which results in them being no-mod/no-copy for everyone. The attached patch fixes things up so if the owner uuid does not exist on the destination system then it assigns ownership (and the creator for completeness) to the master avatar id. This will make it much more practical to share copies of regions :-) --- .../Modules/World/Archiver/ArchiveReadRequest.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs index 5e029d1..88e1d24 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs @@ -153,6 +153,19 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver // And zap any troublesome sit target information part.SitTargetOrientation = new Quaternion(0,0,0,1); part.SitTargetPosition = new Vector3(0,0,0); + + // Fix ownership/creator of inventory items + // Not doing so results in inventory items + // being no copy/no mod for everyone + TaskInventoryDictionary inv = part.TaskInventory; + foreach (KeyValuePair kvp in inv) { + if (!resolveUserUuid(kvp.Value.OwnerID)) { + kvp.Value.OwnerID = masterAvatarId; + } + if (!resolveUserUuid(kvp.Value.CreatorID)) { + kvp.Value.CreatorID = masterAvatarId; + } + } } if (m_scene.AddRestoredSceneObject(sceneObject, true, false)) -- cgit v1.1