diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
3 files changed, 56 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 1f32362..7216b39 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -308,10 +308,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
308 | { | 308 | { |
309 | if (UUID.Zero == transactionID) | 309 | if (UUID.Zero == transactionID) |
310 | { | 310 | { |
311 | item.Flags = itemUpd.Flags; | ||
311 | item.Name = itemUpd.Name; | 312 | item.Name = itemUpd.Name; |
312 | item.Description = itemUpd.Description; | 313 | item.Description = itemUpd.Description; |
314 | if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) | ||
315 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | ||
313 | item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; | 316 | item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; |
317 | if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions)) | ||
318 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | ||
314 | item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; | 319 | item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; |
320 | if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) | ||
321 | item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | ||
315 | item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; | 322 | item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; |
316 | item.GroupID = itemUpd.GroupID; | 323 | item.GroupID = itemUpd.GroupID; |
317 | item.GroupOwned = itemUpd.GroupOwned; | 324 | item.GroupOwned = itemUpd.GroupOwned; |
@@ -326,9 +333,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
326 | // TODO: Check if folder changed and move item | 333 | // TODO: Check if folder changed and move item |
327 | //item.NextPermissions = itemUpd.Folder; | 334 | //item.NextPermissions = itemUpd.Folder; |
328 | item.InvType = itemUpd.InvType; | 335 | item.InvType = itemUpd.InvType; |
336 | |||
337 | if (item.SalePrice != itemUpd.SalePrice || | ||
338 | item.SaleType != itemUpd.SaleType) | ||
339 | item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale; | ||
329 | item.SalePrice = itemUpd.SalePrice; | 340 | item.SalePrice = itemUpd.SalePrice; |
330 | item.SaleType = itemUpd.SaleType; | 341 | item.SaleType = itemUpd.SaleType; |
331 | item.Flags = itemUpd.Flags; | ||
332 | 342 | ||
333 | InventoryService.UpdateItem(item); | 343 | InventoryService.UpdateItem(item); |
334 | } | 344 | } |
@@ -509,7 +519,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
509 | // Assign to the actual item. Make sure the slam bit is | 519 | // Assign to the actual item. Make sure the slam bit is |
510 | // set, if it wasn't set before. | 520 | // set, if it wasn't set before. |
511 | itemCopy.BasePermissions = basePerms; | 521 | itemCopy.BasePermissions = basePerms; |
512 | itemCopy.CurrentPermissions = ownerPerms | 16; // Slam | 522 | itemCopy.CurrentPermissions = ownerPerms; |
523 | itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | ||
513 | 524 | ||
514 | itemCopy.NextPermissions = item.NextPermissions; | 525 | itemCopy.NextPermissions = item.NextPermissions; |
515 | 526 | ||
@@ -1049,7 +1060,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1049 | else | 1060 | else |
1050 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; | 1061 | agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; |
1051 | 1062 | ||
1052 | agentItem.CurrentPermissions |= 16; // Slam | 1063 | agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1053 | agentItem.NextPermissions = taskItem.NextPermissions; | 1064 | agentItem.NextPermissions = taskItem.NextPermissions; |
1054 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); | 1065 | agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); |
1055 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; | 1066 | agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; |
@@ -1260,7 +1271,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1260 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); | 1271 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); |
1261 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & | 1272 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & |
1262 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); | 1273 | (srcTaskItem.NextPermissions | (uint)PermissionMask.Move); |
1263 | destTaskItem.CurrentPermissions |= 16; // Slam! | 1274 | destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1264 | } | 1275 | } |
1265 | } | 1276 | } |
1266 | 1277 | ||
@@ -1434,6 +1445,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1434 | // Base ALWAYS has move | 1445 | // Base ALWAYS has move |
1435 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | 1446 | currentItem.BasePermissions |= (uint)PermissionMask.Move; |
1436 | 1447 | ||
1448 | itemInfo.Flags = currentItem.Flags; | ||
1449 | |||
1437 | // Check if we're allowed to mess with permissions | 1450 | // Check if we're allowed to mess with permissions |
1438 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | 1451 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god |
1439 | { | 1452 | { |
@@ -1451,6 +1464,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1451 | // Owner can't change base, and can change other | 1464 | // Owner can't change base, and can change other |
1452 | // only up to base | 1465 | // only up to base |
1453 | itemInfo.BasePermissions = currentItem.BasePermissions; | 1466 | itemInfo.BasePermissions = currentItem.BasePermissions; |
1467 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) | ||
1468 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | ||
1469 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) | ||
1470 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | ||
1471 | if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions) | ||
1472 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; | ||
1473 | if (itemInfo.NextPermissions != currentItem.NextPermissions) | ||
1474 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | ||
1454 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | 1475 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; |
1455 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | 1476 | itemInfo.GroupPermissions &= currentItem.BasePermissions; |
1456 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | 1477 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; |
@@ -1458,6 +1479,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1458 | } | 1479 | } |
1459 | 1480 | ||
1460 | } | 1481 | } |
1482 | else | ||
1483 | { | ||
1484 | if (itemInfo.BasePermissions != currentItem.BasePermissions) | ||
1485 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase; | ||
1486 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) | ||
1487 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | ||
1488 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) | ||
1489 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | ||
1490 | if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions) | ||
1491 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; | ||
1492 | if (itemInfo.NextPermissions != currentItem.NextPermissions) | ||
1493 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | ||
1494 | } | ||
1461 | 1495 | ||
1462 | // Next ALWAYS has move | 1496 | // Next ALWAYS has move |
1463 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | 1497 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; |
@@ -1666,7 +1700,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1666 | srcTaskItem.NextPermissions; | 1700 | srcTaskItem.NextPermissions; |
1667 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & | 1701 | destTaskItem.BasePermissions = srcTaskItem.BasePermissions & |
1668 | srcTaskItem.NextPermissions; | 1702 | srcTaskItem.NextPermissions; |
1669 | destTaskItem.CurrentPermissions |= 16; // Slam! | 1703 | destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
1670 | } | 1704 | } |
1671 | } | 1705 | } |
1672 | 1706 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 50521c4..0b545c4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
118 | taskItem.NextPermissions = item.NextPermissions; | 118 | taskItem.NextPermissions = item.NextPermissions; |
119 | // We're adding this to a prim we don't own. Force | 119 | // We're adding this to a prim we don't own. Force |
120 | // owner change | 120 | // owner change |
121 | taskItem.CurrentPermissions |= 16; // Slam | 121 | taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; |
122 | } | 122 | } |
123 | else | 123 | else |
124 | { | 124 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 3b1ab01..8761284 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -815,14 +815,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
815 | 815 | ||
816 | group.SetGroup(m_part.GroupID, null); | 816 | group.SetGroup(m_part.GroupID, null); |
817 | 817 | ||
818 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | 818 | // TODO: Remove magic number badness |
819 | if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
819 | { | 820 | { |
820 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) | 821 | if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) |
821 | { | 822 | { |
822 | foreach (SceneObjectPart part in partList) | 823 | foreach (SceneObjectPart part in partList) |
823 | { | 824 | { |
824 | part.EveryoneMask = item.EveryonePermissions; | 825 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
825 | part.NextOwnerMask = item.NextPermissions; | 826 | part.EveryoneMask = item.EveryonePermissions; |
827 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
828 | part.NextOwnerMask = item.NextPermissions; | ||
829 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
830 | part.GroupMask = item.GroupPermissions; | ||
826 | } | 831 | } |
827 | 832 | ||
828 | group.ApplyNextOwnerPermissions(); | 833 | group.ApplyNextOwnerPermissions(); |
@@ -831,15 +836,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
831 | 836 | ||
832 | foreach (SceneObjectPart part in partList) | 837 | foreach (SceneObjectPart part in partList) |
833 | { | 838 | { |
834 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) | 839 | // TODO: Remove magic number badness |
840 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number | ||
835 | { | 841 | { |
836 | part.LastOwnerID = part.OwnerID; | 842 | part.LastOwnerID = part.OwnerID; |
837 | part.OwnerID = item.OwnerID; | 843 | part.OwnerID = item.OwnerID; |
838 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | 844 | part.Inventory.ChangeInventoryOwner(item.OwnerID); |
839 | } | 845 | } |
840 | 846 | ||
841 | part.EveryoneMask = item.EveryonePermissions; | 847 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0) |
842 | part.NextOwnerMask = item.NextPermissions; | 848 | part.EveryoneMask = item.EveryonePermissions; |
849 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0) | ||
850 | part.NextOwnerMask = item.NextPermissions; | ||
851 | if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0) | ||
852 | part.GroupMask = item.GroupPermissions; | ||
843 | } | 853 | } |
844 | 854 | ||
845 | rootPart.TrimPermissions(); | 855 | rootPart.TrimPermissions(); |