diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 85 |
1 files changed, 21 insertions, 64 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 380e402..fb8ecd5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -764,48 +764,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
764 | // Since renaming the item in the inventory does not affect the name stored | 764 | // Since renaming the item in the inventory does not affect the name stored |
765 | // in the serialization, transfer the correct name from the inventory to the | 765 | // in the serialization, transfer the correct name from the inventory to the |
766 | // object itself before we rez. | 766 | // object itself before we rez. |
767 | rootPart.Name = item.Name; | 767 | // Only do these for the first object if we are rezzing a coalescence. |
768 | rootPart.Description = item.Description; | 768 | if (i == 0) |
769 | |||
770 | SceneObjectPart[] partList = group.Parts; | ||
771 | |||
772 | group.SetGroup(m_part.GroupID, null); | ||
773 | |||
774 | // TODO: Remove magic number badness | ||
775 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
776 | { | 769 | { |
777 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) | 770 | rootPart.Name = item.Name; |
778 | { | 771 | rootPart.Description = item.Description; |
779 | foreach (SceneObjectPart part in partList) | ||
780 | { | ||
781 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | ||
782 | part.EveryoneMask = item.EveryonePermissions; | ||
783 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
784 | part.NextOwnerMask = item.NextPermissions; | ||
785 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
786 | part.GroupMask = item.GroupPermissions; | ||
787 | } | ||
788 | |||
789 | group.ApplyNextOwnerPermissions(); | ||
790 | } | ||
791 | } | 772 | } |
792 | 773 | ||
793 | foreach (SceneObjectPart part in partList) | 774 | group.SetGroup(m_part.GroupID, null); |
794 | { | ||
795 | // TODO: Remove magic number badness | ||
796 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
797 | { | ||
798 | part.LastOwnerID = part.OwnerID; | ||
799 | part.OwnerID = item.OwnerID; | ||
800 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | ||
801 | } | ||
802 | 775 | ||
803 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) | 776 | foreach (SceneObjectPart part in group.Parts) |
804 | part.EveryoneMask = item.EveryonePermissions; | 777 | { |
805 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | 778 | // Convert between InventoryItem classes. You can never have too many similar but slightly different classes :) |
806 | part.NextOwnerMask = item.NextPermissions; | 779 | InventoryItemBase dest = new InventoryItemBase(item.ItemID, item.OwnerID); |
807 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | 780 | dest.BasePermissions = item.BasePermissions; |
808 | part.GroupMask = item.GroupPermissions; | 781 | dest.CurrentPermissions = item.CurrentPermissions; |
782 | dest.EveryOnePermissions = item.EveryonePermissions; | ||
783 | dest.GroupPermissions = item.GroupPermissions; | ||
784 | dest.NextPermissions = item.NextPermissions; | ||
785 | dest.Flags = item.Flags; | ||
786 | |||
787 | part.ApplyPermissionsOnRez(dest, false, m_part.ParentGroup.Scene); | ||
809 | } | 788 | } |
810 | 789 | ||
811 | rootPart.TrimPermissions(); | 790 | rootPart.TrimPermissions(); |
@@ -1130,25 +1109,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1130 | mask &= ~((uint)PermissionMask.Transfer >> 13); | 1109 | mask &= ~((uint)PermissionMask.Transfer >> 13); |
1131 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) | 1110 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) |
1132 | mask &= ~((uint)PermissionMask.Modify >> 13); | 1111 | mask &= ~((uint)PermissionMask.Modify >> 13); |
1133 | |||
1134 | if (item.InvType != (int)InventoryType.Object) | ||
1135 | { | ||
1136 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0) | ||
1137 | mask &= ~((uint)PermissionMask.Copy >> 13); | ||
1138 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0) | ||
1139 | mask &= ~((uint)PermissionMask.Transfer >> 13); | ||
1140 | if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0) | ||
1141 | mask &= ~((uint)PermissionMask.Modify >> 13); | ||
1142 | } | ||
1143 | else | ||
1144 | { | ||
1145 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | ||
1146 | mask &= ~((uint)PermissionMask.Copy >> 13); | ||
1147 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | ||
1148 | mask &= ~((uint)PermissionMask.Transfer >> 13); | ||
1149 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1150 | mask &= ~((uint)PermissionMask.Modify >> 13); | ||
1151 | } | ||
1152 | 1112 | ||
1153 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1113 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1154 | mask &= ~(uint)PermissionMask.Copy; | 1114 | mask &= ~(uint)PermissionMask.Copy; |
@@ -1172,14 +1132,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1172 | // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", | 1132 | // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", |
1173 | // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); | 1133 | // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); |
1174 | 1134 | ||
1175 | if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) | 1135 | if (item.InvType == (int)InventoryType.Object) |
1176 | { | 1136 | { |
1177 | if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) | 1137 | uint perms = item.CurrentPermissions; |
1178 | item.CurrentPermissions &= ~(uint)PermissionMask.Copy; | 1138 | PermissionsUtil.ApplyFoldedPermissions(perms, ref perms); |
1179 | if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) | 1139 | item.CurrentPermissions = perms; |
1180 | item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; | ||
1181 | if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) | ||
1182 | item.CurrentPermissions &= ~(uint)PermissionMask.Modify; | ||
1183 | } | 1140 | } |
1184 | 1141 | ||
1185 | item.CurrentPermissions &= item.NextPermissions; | 1142 | item.CurrentPermissions &= item.NextPermissions; |