diff options
author | Oren Hurvitz | 2013-11-04 19:28:24 +0200 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-01-10 19:37:59 +0000 |
commit | 13f31fdf85c404896c166932730b7b8bc5416626 (patch) | |
tree | 7fc489557e3b3c040b02c185c5ea97bcdf85434d /OpenSim/Region/CoreModules/Framework | |
parent | If an agent is sitting, then do send the rotation in the agent update instead... (diff) | |
download | opensim-SC_OLD-13f31fdf85c404896c166932730b7b8bc5416626.zip opensim-SC_OLD-13f31fdf85c404896c166932730b7b8bc5416626.tar.gz opensim-SC_OLD-13f31fdf85c404896c166932730b7b8bc5416626.tar.bz2 opensim-SC_OLD-13f31fdf85c404896c166932730b7b8bc5416626.tar.xz |
Refactored setting permissions when rezzing items: use the same function when rezzing from user inventory and prim inventory.
Also, fixed a bug: when rezzing a coalesced object from a prim's inventory, apply the coalesced object's name and description only to the first sub-object; not to all the objects in the coalescence. (This was already done correctly when rezzing from a user's inventory.)
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 831922e..da36ed0 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -512,10 +512,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
512 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; | 512 | item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; |
513 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; | 513 | item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; |
514 | 514 | ||
515 | // Magic number badness. Maybe this deserves an enum. | 515 | // apply next owner perms on rez |
516 | // bit 4 (16) is the "Slam" bit, it means treat as passed | 516 | item.CurrentPermissions |= SceneObjectGroup.SLAM; |
517 | // and apply next owner perms on rez | ||
518 | item.CurrentPermissions |= 16; // Slam! | ||
519 | } | 517 | } |
520 | else | 518 | else |
521 | { | 519 | { |
@@ -809,11 +807,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
809 | group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; | 807 | group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; |
810 | } | 808 | } |
811 | 809 | ||
812 | foreach (SceneObjectPart part in group.Parts) | 810 | if (item == null) |
813 | { | 811 | { |
814 | // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. | 812 | // Change ownership. Normally this is done in DoPreRezWhenFromItem(), but in this case we must do it here. |
815 | part.LastOwnerID = part.OwnerID; | 813 | foreach (SceneObjectPart part in group.Parts) |
816 | part.OwnerID = remoteClient.AgentId; | 814 | { |
815 | // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. | ||
816 | part.LastOwnerID = part.OwnerID; | ||
817 | part.OwnerID = remoteClient.AgentId; | ||
818 | } | ||
817 | } | 819 | } |
818 | 820 | ||
819 | if (!attachment) | 821 | if (!attachment) |
@@ -969,44 +971,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
969 | // "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}", | 971 | // "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}", |
970 | // rootPart.OwnerID, item.Owner, item.CurrentPermissions); | 972 | // rootPart.OwnerID, item.Owner, item.CurrentPermissions); |
971 | 973 | ||
972 | if ((rootPart.OwnerID != item.Owner) || | 974 | if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) |
973 | (item.CurrentPermissions & 16) != 0) | ||
974 | { | 975 | { |
975 | //Need to kill the for sale here | 976 | //Need to kill the for sale here |
976 | rootPart.ObjectSaleType = 0; | 977 | rootPart.ObjectSaleType = 0; |
977 | rootPart.SalePrice = 10; | 978 | rootPart.SalePrice = 10; |
978 | |||
979 | if (m_Scene.Permissions.PropagatePermissions()) | ||
980 | { | ||
981 | foreach (SceneObjectPart part in so.Parts) | ||
982 | { | ||
983 | if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) | ||
984 | { | ||
985 | part.EveryoneMask = item.EveryOnePermissions; | ||
986 | part.NextOwnerMask = item.NextPermissions; | ||
987 | } | ||
988 | part.GroupMask = 0; // DO NOT propagate here | ||
989 | } | ||
990 | |||
991 | so.ApplyNextOwnerPermissions(); | ||
992 | } | ||
993 | } | 979 | } |
994 | 980 | ||
995 | foreach (SceneObjectPart part in so.Parts) | 981 | foreach (SceneObjectPart part in so.Parts) |
996 | { | 982 | { |
997 | part.FromUserInventoryItemID = fromUserInventoryItemId; | 983 | part.FromUserInventoryItemID = fromUserInventoryItemId; |
998 | 984 | part.ApplyPermissionsOnRez(item, true, m_Scene); | |
999 | if ((part.OwnerID != item.Owner) || | ||
1000 | (item.CurrentPermissions & 16) != 0) | ||
1001 | { | ||
1002 | part.Inventory.ChangeInventoryOwner(item.Owner); | ||
1003 | part.GroupMask = 0; // DO NOT propagate here | ||
1004 | } | ||
1005 | |||
1006 | part.EveryoneMask = item.EveryOnePermissions; | ||
1007 | part.NextOwnerMask = item.NextPermissions; | ||
1008 | } | 985 | } |
1009 | 986 | ||
1010 | rootPart.TrimPermissions(); | 987 | rootPart.TrimPermissions(); |
1011 | 988 | ||
1012 | if (isAttachment) | 989 | if (isAttachment) |