aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-16 14:53:42 +0000
committerMelanie Thielker2017-01-16 14:53:42 +0000
commit568614af2cee0c9e6cd86dd682c7bc768afe655b (patch)
treead04210b5c1cf9f3e61e6cd12f775eb5fbaeba74 /OpenSim
parentuse of PermissionMask Bit3 for slam was a recent mistake, so make it only bit... (diff)
downloadopensim-SC_OLD-568614af2cee0c9e6cd86dd682c7bc768afe655b.zip
opensim-SC_OLD-568614af2cee0c9e6cd86dd682c7bc768afe655b.tar.gz
opensim-SC_OLD-568614af2cee0c9e6cd86dd682c7bc768afe655b.tar.bz2
opensim-SC_OLD-568614af2cee0c9e6cd86dd682c7bc768afe655b.tar.xz
Remove the last instance of the legacy slam but being set
New objects now get only the real slam bit.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Util.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs6
4 files changed, 17 insertions, 7 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 2deb1fb..0037f4f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -67,6 +67,14 @@ namespace OpenSim.Framework
67 FoldedModify = 1 << 1, 67 FoldedModify = 1 << 1,
68 FoldedCopy = 1 << 2, 68 FoldedCopy = 1 << 2,
69 FoldedExport = 1 << 3, 69 FoldedExport = 1 << 3,
70
71 // DO NOT USE THIS FOR NEW WORK. IT IS DEPRECATED AND
72 // EXISTS ONLY TO REACT TO EXISTING OBJECTS HAVING IT.
73 // NEW CODE SHOULD NEVER SET THIS BIT!
74 // Use InventoryItemFlags.ObjectSlamPerm in the Flags field of
75 // this legacy slam bit. It comes from prior incomplete
76 // understanding of the code and the prohibition on
77 // reading viewer code that used to be in place.
70 Slam = (1 << 4), 78 Slam = (1 << 4),
71 79
72 FoldedMask = 0x0f, 80 FoldedMask = 0x0f,
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 6fe7e89..b37744d 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -608,7 +608,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
608 608
609// item.BasePermissions = perms & so.RootPart.NextOwnerMask; 609// item.BasePermissions = perms & so.RootPart.NextOwnerMask;
610 610
611 uint nextp = so.RootPart.NextOwnerMask | 0x0f; 611 uint nextp = so.RootPart.NextOwnerMask | (uint)PermissionMask.FoldedMask;
612 item.BasePermissions = perms & nextp; 612 item.BasePermissions = perms & nextp;
613 item.CurrentPermissions = item.BasePermissions; 613 item.CurrentPermissions = item.BasePermissions;
614 item.NextPermissions = perms & so.RootPart.NextOwnerMask; 614 item.NextPermissions = perms & so.RootPart.NextOwnerMask;
@@ -616,7 +616,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
616 item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; 616 item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask;
617 617
618 // apply next owner perms on rez 618 // apply next owner perms on rez
619 item.CurrentPermissions |= (uint)PermissionMask.Slam; 619 item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
620 } 620 }
621 else 621 else
622 { 622 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0d09cef..c1faf21 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1258,6 +1258,10 @@ namespace OpenSim.Region.Framework.Scenes
1258 agentItem.InvType = taskItem.InvType; 1258 agentItem.InvType = taskItem.InvType;
1259 agentItem.Flags = taskItem.Flags; 1259 agentItem.Flags = taskItem.Flags;
1260 1260
1261 // The code below isn't OK. It doesn't account for flags being changed
1262 // in the object inventory, so it will break when you do it. That
1263 // is the previous behaviour, so no matter at this moment. However, there is a lot
1264 // TODO: Fix this after the inventory fixer exists and has beenr run
1261 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) 1265 if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
1262 { 1266 {
1263 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); 1267 agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
@@ -1266,7 +1270,7 @@ namespace OpenSim.Region.Framework.Scenes
1266 else 1270 else
1267 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; 1271 agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
1268 1272
1269 agentItem.CurrentPermissions = agentItem.BasePermissions; 1273 agentItem.BasePermissions = agentItem.CurrentPermissions;
1270 1274
1271 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; 1275 agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
1272 agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); 1276 agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 02b94ce..bf56de2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -943,8 +943,7 @@ namespace OpenSim.Region.Framework.Scenes
943 943
944 group.SetGroup(m_part.GroupID, null); 944 group.SetGroup(m_part.GroupID, null);
945 945
946 // TODO: Remove magic number badness 946 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
947 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
948 { 947 {
949 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) 948 if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
950 { 949 {
@@ -964,8 +963,7 @@ namespace OpenSim.Region.Framework.Scenes
964 963
965 foreach (SceneObjectPart part in partList) 964 foreach (SceneObjectPart part in partList)
966 { 965 {
967 // TODO: Remove magic number badness 966 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
968 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
969 { 967 {
970 part.LastOwnerID = part.OwnerID; 968 part.LastOwnerID = part.OwnerID;
971 part.OwnerID = item.OwnerID; 969 part.OwnerID = item.OwnerID;