From 1be072f19ee72f8b983aeceb036b1e6c6e041991 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Aug 2012 09:55:44 +0100 Subject: [PATCH 1/2] Move inititalization to RegionLoaded to avoid a module loading order issue --- .../Avatar/Attachments/TempAttachmentsModule.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index e659ec0580..7011f38986 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs @@ -58,6 +58,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments } public void AddRegion(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) { m_scene = scene; @@ -73,14 +81,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments } } - public void RemoveRegion(Scene scene) - { - } - - public void RegionLoaded(Scene scene) - { - } - public void Close() { } From a5b6492223ae0dfeb12d768c12e6347e93225d14 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Aug 2012 13:40:13 +0100 Subject: [PATCH 2/2] Perform ownership transfer and permission propagation as well as needed updates on the new temp attachment. --- .../Attachments/TempAttachmentsModule.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index 7011f38986..27ba5c93ea 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs @@ -120,6 +120,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) return; + if (target.UUID != hostPart.ParentGroup.OwnerID) + { + uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); + + if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) + return; + + hostPart.ParentGroup.SetOwnerId(target.UUID); + hostPart.ParentGroup.SetRootPartOwner(hostPart.ParentGroup.RootPart, target.UUID, target.ControllingClient.ActiveGroupId); + + if (m_scene.Permissions.PropagatePermissions()) + { + foreach (SceneObjectPart child in hostPart.ParentGroup.Parts) + { + child.Inventory.ChangeInventoryOwner(target.UUID); + child.TriggerScriptChangedEvent(Changed.OWNER); + child.ApplyNextOwnerPermissions(); + } + } + + hostPart.ParentGroup.RootPart.ObjectSaleType = 0; + hostPart.ParentGroup.RootPart.SalePrice = 10; + + hostPart.ParentGroup.HasGroupChanged = true; + hostPart.ParentGroup.RootPart.SendPropertiesToClient(target.ControllingClient); + hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); + } + attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, true); } }