diff options
Diffstat (limited to '')
15 files changed, 891 insertions, 597 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 0c4017e..e7c2428 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -278,6 +278,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
278 | /// <param name="datastore"></param> | 278 | /// <param name="datastore"></param> |
279 | void ProcessInventoryBackup(ISimulationDataService datastore); | 279 | void ProcessInventoryBackup(ISimulationDataService datastore); |
280 | 280 | ||
281 | void AggregateInnerPerms(ref uint owner, ref uint group, ref uint everyone); | ||
282 | |||
281 | uint MaskEffectivePermissions(); | 283 | uint MaskEffectivePermissions(); |
282 | 284 | ||
283 | void ApplyNextOwnerPermissions(); | 285 | void ApplyNextOwnerPermissions(); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c1faf21..2f016fa 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -338,6 +338,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
338 | // Update item with new asset | 338 | // Update item with new asset |
339 | item.AssetID = asset.FullID; | 339 | item.AssetID = asset.FullID; |
340 | group.UpdateInventoryItem(item); | 340 | group.UpdateInventoryItem(item); |
341 | group.AggregatePerms(); | ||
341 | 342 | ||
342 | part.SendPropertiesToClient(remoteClient); | 343 | part.SendPropertiesToClient(remoteClient); |
343 | 344 | ||
@@ -1214,6 +1215,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1214 | } | 1215 | } |
1215 | 1216 | ||
1216 | group.RemoveInventoryItem(localID, itemID); | 1217 | group.RemoveInventoryItem(localID, itemID); |
1218 | group.AggregatePerms(); | ||
1217 | } | 1219 | } |
1218 | 1220 | ||
1219 | part.SendPropertiesToClient(remoteClient); | 1221 | part.SendPropertiesToClient(remoteClient); |
@@ -1378,18 +1380,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1378 | return; | 1380 | return; |
1379 | } | 1381 | } |
1380 | 1382 | ||
1381 | if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1383 | if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId)) |
1382 | { | 1384 | { |
1383 | // If the item to be moved is no copy, we need to be able to | 1385 | // check also if we can delete the no copy item |
1384 | // edit the prim. | 1386 | if(!Permissions.CanEditObject(part.UUID, remoteClient.AgentId)) |
1385 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) | ||
1386 | return; | ||
1387 | } | ||
1388 | else | ||
1389 | { | ||
1390 | // If the item is copiable, then we just need to have perms | ||
1391 | // on it. The delete check is a pure rights check | ||
1392 | if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) | ||
1393 | return; | 1387 | return; |
1394 | } | 1388 | } |
1395 | 1389 | ||
@@ -1467,28 +1461,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1467 | return; | 1461 | return; |
1468 | } | 1462 | } |
1469 | 1463 | ||
1470 | // Can't transfer this | 1464 | if(!Permissions.CanDoObjectInvToObjectInv(srcTaskItem, part, destPart)) |
1471 | // | ||
1472 | if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) | ||
1473 | return; | ||
1474 | |||
1475 | bool overrideNoMod = false; | ||
1476 | if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0) | ||
1477 | overrideNoMod = true; | ||
1478 | |||
1479 | if (part.OwnerID != destPart.OwnerID && (destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) | ||
1480 | { | ||
1481 | // object cannot copy items to an object owned by a different owner | ||
1482 | // unless llAllowInventoryDrop has been called | ||
1483 | |||
1484 | return; | ||
1485 | } | ||
1486 | |||
1487 | // must have both move and modify permission to put an item in an object | ||
1488 | if (((part.OwnerMask & (uint)PermissionMask.Modify) == 0) && (!overrideNoMod)) | ||
1489 | { | ||
1490 | return; | 1465 | return; |
1491 | } | ||
1492 | 1466 | ||
1493 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1467 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1494 | 1468 | ||
@@ -1530,9 +1504,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1530 | destTaskItem.Type = srcTaskItem.Type; | 1504 | destTaskItem.Type = srcTaskItem.Type; |
1531 | 1505 | ||
1532 | destPart.Inventory.AddInventoryItem(destTaskItem, part.OwnerID != destPart.OwnerID); | 1506 | destPart.Inventory.AddInventoryItem(destTaskItem, part.OwnerID != destPart.OwnerID); |
1533 | |||
1534 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1507 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1508 | { | ||
1535 | part.Inventory.RemoveInventoryItem(itemId); | 1509 | part.Inventory.RemoveInventoryItem(itemId); |
1510 | } | ||
1536 | 1511 | ||
1537 | ScenePresence avatar; | 1512 | ScenePresence avatar; |
1538 | 1513 | ||
@@ -1670,76 +1645,79 @@ namespace OpenSim.Region.Framework.Scenes | |||
1670 | uint primLocalID) | 1645 | uint primLocalID) |
1671 | { | 1646 | { |
1672 | UUID itemID = itemInfo.ItemID; | 1647 | UUID itemID = itemInfo.ItemID; |
1648 | if (itemID == UUID.Zero) | ||
1649 | { | ||
1650 | m_log.ErrorFormat( | ||
1651 | "[PRIM INVENTORY]: UpdateTaskInventory called with item ID Zero on update for {1}!", | ||
1652 | remoteClient.Name); | ||
1653 | return; | ||
1654 | } | ||
1673 | 1655 | ||
1674 | // Find the prim we're dealing with | 1656 | // Find the prim we're dealing with |
1675 | SceneObjectPart part = GetSceneObjectPart(primLocalID); | 1657 | SceneObjectPart part = GetSceneObjectPart(primLocalID); |
1658 | if(part == null) | ||
1659 | { | ||
1660 | m_log.WarnFormat( | ||
1661 | "[PRIM INVENTORY]: " + | ||
1662 | "Update with item {0} requested of prim {1} for {2} but this prim does not exist", | ||
1663 | itemID, primLocalID, remoteClient.Name); | ||
1664 | return; | ||
1665 | } | ||
1676 | 1666 | ||
1677 | if (part != null) | 1667 | TaskInventoryItem currentItem = part.Inventory.GetInventoryItem(itemID); |
1668 | |||
1669 | if (currentItem == null) | ||
1678 | { | 1670 | { |
1679 | TaskInventoryItem currentItem = part.Inventory.GetInventoryItem(itemID); | 1671 | InventoryItemBase item = InventoryService.GetItem(remoteClient.AgentId, itemID); |
1680 | bool allowInventoryDrop = (part.GetEffectiveObjectFlags() | ||
1681 | & (uint)PrimFlags.AllowInventoryDrop) != 0; | ||
1682 | 1672 | ||
1683 | // Explicity allow anyone to add to the inventory if the | 1673 | // if not found Try library |
1684 | // AllowInventoryDrop flag has been set. Don't however let | 1674 | if (item == null && LibraryService != null && LibraryService.LibraryRootFolder != null) |
1685 | // them update an item unless they pass the external checks | 1675 | item = LibraryService.LibraryRootFolder.FindItem(itemID); |
1686 | // | ||
1687 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId) | ||
1688 | && (currentItem != null || !allowInventoryDrop)) | ||
1689 | return; | ||
1690 | 1676 | ||
1691 | if (currentItem == null) | 1677 | if(item == null) |
1692 | { | 1678 | { |
1693 | UUID copyID = UUID.Random(); | 1679 | m_log.ErrorFormat( |
1694 | if (itemID != UUID.Zero) | 1680 | "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!", |
1695 | { | 1681 | itemID, remoteClient.Name); |
1696 | InventoryItemBase item = InventoryService.GetItem(remoteClient.AgentId, itemID); | 1682 | return; |
1683 | } | ||
1697 | 1684 | ||
1698 | // Try library | 1685 | if (!Permissions.CanDropInObjectInv(item, remoteClient, part)) |
1699 | if (null == item && LibraryService != null && LibraryService.LibraryRootFolder != null) | 1686 | return; |
1700 | { | ||
1701 | item = LibraryService.LibraryRootFolder.FindItem(itemID); | ||
1702 | } | ||
1703 | 1687 | ||
1704 | // If we've found the item in the user's inventory or in the library | 1688 | UUID copyID = UUID.Random(); |
1705 | if (item != null) | 1689 | bool modrights = Permissions.CanEditObject(part.ParentGroup, remoteClient); |
1706 | { | 1690 | part.ParentGroup.AddInventoryItem(remoteClient.AgentId, primLocalID, item, copyID, modrights); |
1707 | part.ParentGroup.AddInventoryItem(remoteClient.AgentId, primLocalID, item, copyID); | 1691 | m_log.InfoFormat( |
1708 | m_log.InfoFormat( | 1692 | "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", |
1709 | "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", | 1693 | item.Name, primLocalID, remoteClient.Name); |
1710 | item.Name, primLocalID, remoteClient.Name); | 1694 | part.SendPropertiesToClient(remoteClient); |
1711 | part.SendPropertiesToClient(remoteClient); | 1695 | if (!Permissions.BypassPermissions()) |
1712 | if (!Permissions.BypassPermissions()) | 1696 | { |
1713 | { | 1697 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1714 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1698 | { |
1715 | { | 1699 | List<UUID> uuids = new List<UUID>(); |
1716 | List<UUID> uuids = new List<UUID>(); | 1700 | uuids.Add(itemID); |
1717 | uuids.Add(itemID); | 1701 | RemoveInventoryItem(remoteClient, uuids); |
1718 | RemoveInventoryItem(remoteClient, uuids); | ||
1719 | } | ||
1720 | } | ||
1721 | } | ||
1722 | else | ||
1723 | { | ||
1724 | m_log.ErrorFormat( | ||
1725 | "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!", | ||
1726 | itemID, remoteClient.Name); | ||
1727 | } | ||
1728 | } | 1702 | } |
1729 | } | 1703 | } |
1730 | else // Updating existing item with new perms etc | 1704 | } |
1731 | { | 1705 | else // Updating existing item with new perms etc |
1706 | { | ||
1732 | // m_log.DebugFormat( | 1707 | // m_log.DebugFormat( |
1733 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", | 1708 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", |
1734 | // currentItem.Name, part.Name); | 1709 | // currentItem.Name, part.Name); |
1735 | 1710 | ||
1736 | // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the | 1711 | if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) |
1737 | // case for updates uploded through UDP. Updates uploaded via a capability (e.g. a script update) | 1712 | return; |
1738 | // will not pass in a transaction ID in the update message. | 1713 | |
1739 | if (transactionID != UUID.Zero && AgentTransactionsModule != null) | 1714 | // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the |
1740 | { | 1715 | // case for updates uploded through UDP. Updates uploaded via a capability (e.g. a script update) |
1741 | AgentTransactionsModule.HandleTaskItemUpdateFromTransaction( | 1716 | // will not pass in a transaction ID in the update message. |
1742 | remoteClient, part, transactionID, currentItem); | 1717 | if (transactionID != UUID.Zero && AgentTransactionsModule != null) |
1718 | { | ||
1719 | AgentTransactionsModule.HandleTaskItemUpdateFromTransaction( | ||
1720 | remoteClient, part, transactionID, currentItem); | ||
1743 | 1721 | ||
1744 | // if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) | 1722 | // if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) |
1745 | // remoteClient.SendAgentAlertMessage("Notecard saved", false); | 1723 | // remoteClient.SendAgentAlertMessage("Notecard saved", false); |
@@ -1747,49 +1725,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
1747 | // remoteClient.SendAgentAlertMessage("Script saved", false); | 1725 | // remoteClient.SendAgentAlertMessage("Script saved", false); |
1748 | // else | 1726 | // else |
1749 | // remoteClient.SendAgentAlertMessage("Item saved", false); | 1727 | // remoteClient.SendAgentAlertMessage("Item saved", false); |
1750 | } | 1728 | } |
1751 | 1729 | ||
1752 | // Base ALWAYS has move | 1730 | // Base ALWAYS has move |
1753 | currentItem.BasePermissions |= (uint)PermissionMask.Move; | 1731 | currentItem.BasePermissions |= (uint)PermissionMask.Move; |
1754 | 1732 | ||
1755 | itemInfo.Flags = currentItem.Flags; | 1733 | itemInfo.Flags = currentItem.Flags; |
1756 | 1734 | ||
1757 | // Check if we're allowed to mess with permissions | 1735 | // Check if we're allowed to mess with permissions |
1758 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god | 1736 | if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god |
1737 | { | ||
1738 | if (remoteClient.AgentId != part.OwnerID) // Not owner | ||
1759 | { | 1739 | { |
1760 | if (remoteClient.AgentId != part.OwnerID) // Not owner | 1740 | // Friends and group members can't change any perms |
1761 | { | 1741 | itemInfo.BasePermissions = currentItem.BasePermissions; |
1762 | // Friends and group members can't change any perms | 1742 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; |
1763 | itemInfo.BasePermissions = currentItem.BasePermissions; | 1743 | itemInfo.GroupPermissions = currentItem.GroupPermissions; |
1764 | itemInfo.EveryonePermissions = currentItem.EveryonePermissions; | 1744 | itemInfo.NextPermissions = currentItem.NextPermissions; |
1765 | itemInfo.GroupPermissions = currentItem.GroupPermissions; | 1745 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; |
1766 | itemInfo.NextPermissions = currentItem.NextPermissions; | ||
1767 | itemInfo.CurrentPermissions = currentItem.CurrentPermissions; | ||
1768 | } | ||
1769 | else | ||
1770 | { | ||
1771 | // Owner can't change base, and can change other | ||
1772 | // only up to base | ||
1773 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1774 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) | ||
1775 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | ||
1776 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) | ||
1777 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | ||
1778 | if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions) | ||
1779 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; | ||
1780 | if (itemInfo.NextPermissions != currentItem.NextPermissions) | ||
1781 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | ||
1782 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1783 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1784 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1785 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1786 | } | ||
1787 | |||
1788 | } | 1746 | } |
1789 | else | 1747 | else |
1790 | { | 1748 | { |
1791 | if (itemInfo.BasePermissions != currentItem.BasePermissions) | 1749 | // Owner can't change base, and can change other |
1792 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase; | 1750 | // only up to base |
1751 | itemInfo.BasePermissions = currentItem.BasePermissions; | ||
1793 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) | 1752 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) |
1794 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | 1753 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; |
1795 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) | 1754 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) |
@@ -1798,24 +1757,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
1798 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; | 1757 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; |
1799 | if (itemInfo.NextPermissions != currentItem.NextPermissions) | 1758 | if (itemInfo.NextPermissions != currentItem.NextPermissions) |
1800 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | 1759 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; |
1760 | itemInfo.EveryonePermissions &= currentItem.BasePermissions; | ||
1761 | itemInfo.GroupPermissions &= currentItem.BasePermissions; | ||
1762 | itemInfo.CurrentPermissions &= currentItem.BasePermissions; | ||
1763 | itemInfo.NextPermissions &= currentItem.BasePermissions; | ||
1801 | } | 1764 | } |
1802 | 1765 | ||
1803 | // Next ALWAYS has move | 1766 | } |
1804 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; | 1767 | else |
1768 | { | ||
1769 | if (itemInfo.BasePermissions != currentItem.BasePermissions) | ||
1770 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase; | ||
1771 | if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions) | ||
1772 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone; | ||
1773 | if (itemInfo.GroupPermissions != currentItem.GroupPermissions) | ||
1774 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; | ||
1775 | if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions) | ||
1776 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner; | ||
1777 | if (itemInfo.NextPermissions != currentItem.NextPermissions) | ||
1778 | itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; | ||
1779 | } | ||
1805 | 1780 | ||
1806 | if (part.Inventory.UpdateInventoryItem(itemInfo)) | 1781 | // Next ALWAYS has move |
1807 | { | 1782 | itemInfo.NextPermissions |= (uint)PermissionMask.Move; |
1808 | part.SendPropertiesToClient(remoteClient); | 1783 | |
1809 | } | 1784 | if (part.Inventory.UpdateInventoryItem(itemInfo)) |
1785 | { | ||
1786 | part.SendPropertiesToClient(remoteClient); | ||
1810 | } | 1787 | } |
1811 | } | 1788 | } |
1812 | else | ||
1813 | { | ||
1814 | m_log.WarnFormat( | ||
1815 | "[PRIM INVENTORY]: " + | ||
1816 | "Update with item {0} requested of prim {1} for {2} but this prim does not exist", | ||
1817 | itemID, primLocalID, remoteClient.Name); | ||
1818 | } | ||
1819 | } | 1789 | } |
1820 | 1790 | ||
1821 | /// <summary> | 1791 | /// <summary> |
@@ -1978,6 +1948,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1978 | part.Inventory.AddInventoryItem(taskItem, false); | 1948 | part.Inventory.AddInventoryItem(taskItem, false); |
1979 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); | 1949 | part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0); |
1980 | 1950 | ||
1951 | part.ParentGroup.AggregatePerms(); | ||
1952 | |||
1981 | // tell anyone managing scripts that a new script exists | 1953 | // tell anyone managing scripts that a new script exists |
1982 | EventManager.TriggerNewScript(agentID, part, taskItem.ItemID); | 1954 | EventManager.TriggerNewScript(agentID, part, taskItem.ItemID); |
1983 | 1955 | ||
@@ -2113,13 +2085,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
2113 | /// <param name='action'>DeRezAction</param> | 2085 | /// <param name='action'>DeRezAction</param> |
2114 | /// <param name='destinationID'>User folder ID to place derezzed object</param> | 2086 | /// <param name='destinationID'>User folder ID to place derezzed object</param> |
2115 | public virtual void DeRezObjects( | 2087 | public virtual void DeRezObjects( |
2116 | IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID) | 2088 | IClientAPI remoteClient, List<uint> localIDs, UUID groupID, DeRezAction action, UUID destinationID, bool AddToReturns = true) |
2117 | { | 2089 | { |
2118 | // First, see of we can perform the requested action and | 2090 | // First, see of we can perform the requested action and |
2119 | // build a list of eligible objects | 2091 | // build a list of eligible objects |
2120 | List<uint> deleteIDs = new List<uint>(); | 2092 | List<uint> deleteIDs = new List<uint>(); |
2121 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); | 2093 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); |
2122 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); | 2094 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); |
2095 | List<SceneObjectGroup> takeDeleteGroups = new List<SceneObjectGroup>(); | ||
2096 | |||
2097 | ScenePresence sp = null; | ||
2098 | if(remoteClient != null) | ||
2099 | sp = remoteClient.SceneAgent as ScenePresence; | ||
2100 | else if(action != DeRezAction.Return) | ||
2101 | return; // only Return can be called without a client | ||
2123 | 2102 | ||
2124 | // Start with true for both, then remove the flags if objects | 2103 | // Start with true for both, then remove the flags if objects |
2125 | // that we can't derez are part of the selection | 2104 | // that we can't derez are part of the selection |
@@ -2175,17 +2154,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2175 | { | 2154 | { |
2176 | if (action == DeRezAction.TakeCopy) | 2155 | if (action == DeRezAction.TakeCopy) |
2177 | { | 2156 | { |
2178 | if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) | 2157 | if (!Permissions.CanTakeCopyObject(grp, sp)) |
2179 | permissionToTakeCopy = false; | 2158 | permissionToTakeCopy = false; |
2180 | } | 2159 | } |
2181 | else | 2160 | else |
2182 | { | 2161 | { |
2183 | permissionToTakeCopy = false; | 2162 | permissionToTakeCopy = false; |
2184 | } | 2163 | } |
2185 | if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) | 2164 | if (!Permissions.CanTakeObject(grp, sp)) |
2186 | permissionToTake = false; | 2165 | permissionToTake = false; |
2187 | 2166 | ||
2188 | if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) | 2167 | if (!Permissions.CanDeleteObject(grp, remoteClient)) |
2189 | permissionToDelete = false; | 2168 | permissionToDelete = false; |
2190 | } | 2169 | } |
2191 | 2170 | ||
@@ -2226,13 +2205,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2226 | { | 2205 | { |
2227 | if (Permissions.CanReturnObjects( | 2206 | if (Permissions.CanReturnObjects( |
2228 | null, | 2207 | null, |
2229 | remoteClient.AgentId, | 2208 | remoteClient, |
2230 | new List<SceneObjectGroup>() {grp})) | 2209 | new List<SceneObjectGroup>() {grp})) |
2231 | { | 2210 | { |
2232 | permissionToTake = true; | 2211 | permissionToTake = true; |
2233 | permissionToDelete = true; | 2212 | permissionToDelete = true; |
2234 | 2213 | if(AddToReturns) | |
2235 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); | 2214 | AddReturn(grp.OwnerID == grp.GroupID ? grp.LastOwnerID : grp.OwnerID, grp.Name, grp.AbsolutePosition, |
2215 | "parcel owner return"); | ||
2236 | } | 2216 | } |
2237 | } | 2217 | } |
2238 | else // Auto return passes through here with null agent | 2218 | else // Auto return passes through here with null agent |
@@ -2242,26 +2222,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2242 | } | 2222 | } |
2243 | } | 2223 | } |
2244 | 2224 | ||
2245 | if (permissionToTake && (!permissionToDelete)) | ||
2246 | takeGroups.Add(grp); | ||
2247 | |||
2248 | if (permissionToDelete) | 2225 | if (permissionToDelete) |
2249 | { | 2226 | { |
2250 | if (permissionToTake) | 2227 | if (permissionToTake) |
2228 | takeDeleteGroups.Add(grp); | ||
2229 | else | ||
2251 | deleteGroups.Add(grp); | 2230 | deleteGroups.Add(grp); |
2252 | deleteIDs.Add(grp.LocalId); | 2231 | deleteIDs.Add(grp.LocalId); |
2253 | } | 2232 | } |
2233 | else if(permissionToTake) | ||
2234 | takeGroups.Add(grp); | ||
2254 | } | 2235 | } |
2255 | 2236 | ||
2256 | SendKillObject(deleteIDs); | 2237 | SendKillObject(deleteIDs); |
2257 | 2238 | ||
2258 | if (deleteGroups.Count > 0) | 2239 | if (takeDeleteGroups.Count > 0) |
2259 | { | 2240 | { |
2260 | foreach (SceneObjectGroup g in deleteGroups) | ||
2261 | deleteIDs.Remove(g.LocalId); | ||
2262 | |||
2263 | m_asyncSceneObjectDeleter.DeleteToInventory( | 2241 | m_asyncSceneObjectDeleter.DeleteToInventory( |
2264 | action, destinationID, deleteGroups, remoteClient, | 2242 | action, destinationID, takeDeleteGroups, remoteClient, |
2265 | true); | 2243 | true); |
2266 | } | 2244 | } |
2267 | if (takeGroups.Count > 0) | 2245 | if (takeGroups.Count > 0) |
@@ -2270,7 +2248,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2270 | action, destinationID, takeGroups, remoteClient, | 2248 | action, destinationID, takeGroups, remoteClient, |
2271 | false); | 2249 | false); |
2272 | } | 2250 | } |
2273 | if (deleteIDs.Count > 0) | 2251 | if (deleteGroups.Count > 0) |
2274 | { | 2252 | { |
2275 | foreach (SceneObjectGroup g in deleteGroups) | 2253 | foreach (SceneObjectGroup g in deleteGroups) |
2276 | DeleteSceneObject(g, true); | 2254 | DeleteSceneObject(g, true); |
@@ -2658,6 +2636,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2658 | 2636 | ||
2659 | // We can only call this after adding the scene object, since the scene object references the scene | 2637 | // We can only call this after adding the scene object, since the scene object references the scene |
2660 | // to find out if scripts should be activated at all. | 2638 | // to find out if scripts should be activated at all. |
2639 | group.AggregatePerms(); | ||
2661 | group.CreateScriptInstances(param, true, DefaultScriptEngine, 3); | 2640 | group.CreateScriptInstances(param, true, DefaultScriptEngine, 3); |
2662 | 2641 | ||
2663 | group.ScheduleGroupForFullUpdate(); | 2642 | group.ScheduleGroupForFullUpdate(); |
@@ -2667,7 +2646,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2667 | } | 2646 | } |
2668 | 2647 | ||
2669 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, | 2648 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, |
2670 | UUID AgentId) | 2649 | IClientAPI client) |
2671 | { | 2650 | { |
2672 | List<uint> localIDs = new List<uint>(); | 2651 | List<uint> localIDs = new List<uint>(); |
2673 | 2652 | ||
@@ -2677,8 +2656,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2677 | "parcel owner return"); | 2656 | "parcel owner return"); |
2678 | localIDs.Add(grp.RootPart.LocalId); | 2657 | localIDs.Add(grp.RootPart.LocalId); |
2679 | } | 2658 | } |
2680 | DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, | 2659 | DeRezObjects(client, localIDs, UUID.Zero, DeRezAction.Return, |
2681 | UUID.Zero); | 2660 | UUID.Zero, false); |
2682 | 2661 | ||
2683 | return true; | 2662 | return true; |
2684 | } | 2663 | } |
@@ -2709,9 +2688,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2709 | { | 2688 | { |
2710 | if (ownerID != UUID.Zero) | 2689 | if (ownerID != UUID.Zero) |
2711 | return; | 2690 | return; |
2712 | |||
2713 | if (!Permissions.CanDeedObject(remoteClient.AgentId, groupID)) | ||
2714 | return; | ||
2715 | } | 2691 | } |
2716 | 2692 | ||
2717 | List<SceneObjectGroup> groups = new List<SceneObjectGroup>(); | 2693 | List<SceneObjectGroup> groups = new List<SceneObjectGroup>(); |
@@ -2742,21 +2718,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2742 | child.TriggerScriptChangedEvent(Changed.OWNER); | 2718 | child.TriggerScriptChangedEvent(Changed.OWNER); |
2743 | } | 2719 | } |
2744 | } | 2720 | } |
2745 | else // The object was deeded to the group | 2721 | else // The object deeded to the group |
2746 | { | 2722 | { |
2747 | if (!Permissions.IsGod(remoteClient.AgentId) && sog.OwnerID != remoteClient.AgentId) | 2723 | if (!Permissions.CanDeedObject(remoteClient, sog, groupID)) |
2748 | continue; | 2724 | continue; |
2749 | 2725 | ||
2750 | if (!Permissions.CanTransferObject(sog.UUID, groupID)) | 2726 | sog.SetOwnerId(groupID); |
2751 | continue; | ||
2752 | 2727 | ||
2753 | if (sog.GroupID != groupID) | 2728 | // this is wrong, GroupMask is used for group sharing, still possible to set |
2754 | continue; | 2729 | // this whould give owner rights to users that are member of group but don't have role powers to edit |
2730 | // sog.RootPart.GroupMask = sog.RootPart.OwnerMask; | ||
2755 | 2731 | ||
2756 | sog.SetOwnerId(groupID); | 2732 | // we should keep all permissions on deed to group |
2757 | // Make the group mask be the previous owner mask | 2733 | // and with this comented code, if user does not set next permissions on the object |
2758 | sog.RootPart.GroupMask = sog.RootPart.OwnerMask; | 2734 | // and on ALL contents of ALL prims, he may loose rights, making the object useless |
2759 | sog.ApplyNextOwnerPermissions(); | 2735 | sog.ApplyNextOwnerPermissions(); |
2736 | sog.AggregatePerms(); | ||
2760 | 2737 | ||
2761 | sog.ScheduleGroupForFullUpdate(); | 2738 | sog.ScheduleGroupForFullUpdate(); |
2762 | 2739 | ||
@@ -2766,8 +2743,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2766 | child.Inventory.ChangeInventoryOwner(groupID); | 2743 | child.Inventory.ChangeInventoryOwner(groupID); |
2767 | child.TriggerScriptChangedEvent(Changed.OWNER); | 2744 | child.TriggerScriptChangedEvent(Changed.OWNER); |
2768 | } | 2745 | } |
2769 | |||
2770 | |||
2771 | } | 2746 | } |
2772 | } | 2747 | } |
2773 | 2748 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index e611897..4fef9c3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -183,10 +183,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
183 | part.SendFullUpdate(remoteClient); | 183 | part.SendFullUpdate(remoteClient); |
184 | 184 | ||
185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. | 185 | // A prim is only tainted if it's allowed to be edited by the person clicking it. |
186 | if (Permissions.CanChangeSelectedState(sog.UUID, (ScenePresence)remoteClient.SceneAgent)) | 186 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) |
187 | { | 187 | { |
188 | bool oldsel = part.IsSelected; | ||
188 | part.IsSelected = true; | 189 | part.IsSelected = true; |
189 | EventManager.TriggerParcelPrimCountTainted(); | 190 | if(!oldsel) |
191 | EventManager.TriggerParcelPrimCountTainted(); | ||
190 | } | 192 | } |
191 | 193 | ||
192 | part.SendPropertiesToClient(remoteClient); | 194 | part.SendPropertiesToClient(remoteClient); |
@@ -228,6 +230,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
228 | if (so.OwnerID == remoteClient.AgentId) | 230 | if (so.OwnerID == remoteClient.AgentId) |
229 | { | 231 | { |
230 | so.SetGroup(groupID, remoteClient); | 232 | so.SetGroup(groupID, remoteClient); |
233 | EventManager.TriggerParcelPrimCountTainted(); | ||
231 | } | 234 | } |
232 | } | 235 | } |
233 | } | 236 | } |
@@ -249,7 +252,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
249 | // handled by group, but by prim. Legacy cruft. | 252 | // handled by group, but by prim. Legacy cruft. |
250 | // TODO: Make selection flagging per prim! | 253 | // TODO: Make selection flagging per prim! |
251 | // | 254 | // |
252 | if (Permissions.CanChangeSelectedState(part.ParentGroup.UUID, (ScenePresence)remoteClient.SceneAgent)) | 255 | if (Permissions.CanChangeSelectedState(part, (ScenePresence)remoteClient.SceneAgent)) |
253 | { | 256 | { |
254 | part.IsSelected = false; | 257 | part.IsSelected = false; |
255 | if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) | 258 | if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected) |
@@ -325,7 +328,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
325 | if(group == null || group.IsDeleted) | 328 | if(group == null || group.IsDeleted) |
326 | return; | 329 | return; |
327 | 330 | ||
328 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | 331 | if (Permissions.CanMoveObject(group, remoteClient))// && PermissionsMngr.) |
329 | { | 332 | { |
330 | group.GrabMovement(objectID, offset, pos, remoteClient); | 333 | group.GrabMovement(objectID, offset, pos, remoteClient); |
331 | } | 334 | } |
@@ -386,7 +389,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
386 | SceneObjectGroup group = GetGroupByPrim(objectID); | 389 | SceneObjectGroup group = GetGroupByPrim(objectID); |
387 | if (group != null) | 390 | if (group != null) |
388 | { | 391 | { |
389 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | 392 | if (Permissions.CanMoveObject(group, remoteClient))// && PermissionsMngr.) |
390 | { | 393 | { |
391 | group.SpinStart(remoteClient); | 394 | group.SpinStart(remoteClient); |
392 | } | 395 | } |
@@ -404,7 +407,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
404 | SceneObjectGroup group = GetGroupByPrim(objectID); | 407 | SceneObjectGroup group = GetGroupByPrim(objectID); |
405 | if (group != null) | 408 | if (group != null) |
406 | { | 409 | { |
407 | if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) | 410 | if (Permissions.CanMoveObject(group, remoteClient))// && PermissionsMngr.) |
408 | { | 411 | { |
409 | group.SpinMovement(rotation, remoteClient); | 412 | group.SpinMovement(rotation, remoteClient); |
410 | } | 413 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 8f32b03..6d3b82f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -37,52 +37,57 @@ using OpenSim.Region.Framework.Interfaces; | |||
37 | namespace OpenSim.Region.Framework.Scenes | 37 | namespace OpenSim.Region.Framework.Scenes |
38 | { | 38 | { |
39 | #region Delegates | 39 | #region Delegates |
40 | public delegate uint GenerateClientFlagsHandler(ScenePresence sp, uint curEffectivePerms, UUID objectID); | 40 | public delegate uint GenerateClientFlagsHandler(SceneObjectPart part, ScenePresence sp, uint curEffectivePerms); |
41 | public delegate void SetBypassPermissionsHandler(bool value); | 41 | public delegate void SetBypassPermissionsHandler(bool value); |
42 | public delegate bool BypassPermissionsHandler(); | 42 | public delegate bool BypassPermissionsHandler(); |
43 | public delegate bool PropagatePermissionsHandler(); | 43 | public delegate bool PropagatePermissionsHandler(); |
44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition, Scene scene); | 44 | public delegate bool RezObjectHandler(int objectCount, UUID owner, Vector3 objectPosition); |
45 | public delegate bool DeleteObjectHandler(UUID objectID, UUID deleter, Scene scene); | 45 | public delegate bool DeleteObjectHandlerByIDs(UUID objectID, UUID deleter); |
46 | public delegate bool TransferObjectHandler(UUID objectID, UUID recipient, Scene scene); | 46 | public delegate bool DeleteObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
47 | public delegate bool TakeObjectHandler(UUID objectID, UUID stealer, Scene scene); | 47 | public delegate bool TransferObjectHandler(UUID objectID, UUID recipient); |
48 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID, Scene scene); | 48 | public delegate bool TakeObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
49 | public delegate bool TakeCopyObjectHandler(UUID objectID, UUID userID, Scene inScene); | 49 | public delegate bool SellGroupObjectHandler(UUID userID, UUID groupID); |
50 | public delegate bool DuplicateObjectHandler(int objectCount, UUID objectID, UUID owner, Scene scene, Vector3 objectPosition); | 50 | public delegate bool TakeCopyObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
51 | public delegate bool EditObjectHandler(UUID objectID, UUID editorID, Scene scene); | 51 | public delegate bool DuplicateObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
52 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID, Scene scene); | 52 | public delegate bool EditObjectByIDsHandler(UUID objectID, UUID editorID); |
53 | public delegate bool MoveObjectHandler(UUID objectID, UUID moverID, Scene scene); | 53 | public delegate bool EditObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
54 | public delegate bool ObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); | 54 | public delegate bool EditObjectInventoryHandler(UUID objectID, UUID editorID); |
55 | public delegate bool ReturnObjectsHandler(ILandObject land, UUID user, List<SceneObjectGroup> objects, Scene scene); | 55 | public delegate bool MoveObjectHandler(SceneObjectGroup sog, ScenePresence sp); |
56 | public delegate bool InstantMessageHandler(UUID user, UUID target, Scene startScene); | 56 | public delegate bool ObjectEntryHandler(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint); |
57 | public delegate bool InventoryTransferHandler(UUID user, UUID target, Scene startScene); | 57 | public delegate bool ReturnObjectsHandler(ILandObject land, ScenePresence sp, List<SceneObjectGroup> objects); |
58 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 58 | public delegate bool InstantMessageHandler(UUID user, UUID target); |
59 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user, Scene scene); | 59 | public delegate bool InventoryTransferHandler(UUID user, UUID target); |
60 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 60 | public delegate bool ViewScriptHandler(UUID script, UUID objectID, UUID user); |
61 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user, Scene scene); | 61 | public delegate bool ViewNotecardHandler(UUID script, UUID objectID, UUID user); |
62 | public delegate bool RunScriptHandler(UUID script, UUID objectID, UUID user, Scene scene); | 62 | public delegate bool EditScriptHandler(UUID script, UUID objectID, UUID user); |
63 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType, Scene scene); | 63 | public delegate bool EditNotecardHandler(UUID notecard, UUID objectID, UUID user); |
64 | public delegate bool StartScriptHandler(UUID script, UUID user, Scene scene); | 64 | public delegate bool RunScriptHandlerByIDs(UUID script, UUID objectID, UUID user); |
65 | public delegate bool StopScriptHandler(UUID script, UUID user, Scene scene); | 65 | public delegate bool RunScriptHandler(TaskInventoryItem item, SceneObjectPart part); |
66 | public delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user, Scene scene); | 66 | public delegate bool CompileScriptHandler(UUID ownerUUID, int scriptType); |
67 | public delegate bool TerraformLandHandler(UUID user, Vector3 position, Scene requestFromScene); | 67 | public delegate bool StartScriptHandler(UUID script, UUID user); |
68 | public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); | 68 | public delegate bool StopScriptHandler(UUID script, UUID user); |
69 | public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); | 69 | public delegate bool ResetScriptHandler(UUID prim, UUID script, UUID user); |
70 | public delegate bool IsGodHandler(UUID user, Scene requestFromScene); | 70 | public delegate bool TerraformLandHandler(UUID user, Vector3 position); |
71 | public delegate bool IsGridGodHandler(UUID user, Scene requestFromScene); | 71 | public delegate bool RunConsoleCommandHandler(UUID user); |
72 | public delegate bool IssueEstateCommandHandler(UUID user, bool ownerCommand); | ||
73 | public delegate bool IsGodHandler(UUID user); | ||
74 | public delegate bool IsGridGodHandler(UUID user); | ||
72 | public delegate bool IsAdministratorHandler(UUID user); | 75 | public delegate bool IsAdministratorHandler(UUID user); |
73 | public delegate bool IsEstateManagerHandler(UUID user); | 76 | public delegate bool IsEstateManagerHandler(UUID user); |
74 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); | 77 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel); |
75 | public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, Scene scene, bool allowManager); | 78 | public delegate bool EditParcelPropertiesHandler(UUID user, ILandObject parcel, GroupPowers p, bool allowManager); |
76 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); | 79 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel); |
77 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); | 80 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel); |
78 | public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel, Scene scene); | 81 | public delegate bool ReclaimParcelHandler(UUID user, ILandObject parcel); |
79 | public delegate bool DeedParcelHandler(UUID user, ILandObject parcel, Scene scene); | 82 | public delegate bool DeedParcelHandler(UUID user, ILandObject parcel); |
80 | public delegate bool DeedObjectHandler(UUID user, UUID group, Scene scene); | 83 | public delegate bool DeedObjectHandler(ScenePresence sp, SceneObjectGroup sog, UUID targetGroupID); |
81 | public delegate bool BuyLandHandler(UUID user, ILandObject parcel, Scene scene); | 84 | public delegate bool BuyLandHandler(UUID user, ILandObject parcel); |
82 | public delegate bool LinkObjectHandler(UUID user, UUID objectID); | 85 | public delegate bool LinkObjectHandler(UUID user, UUID objectID); |
83 | public delegate bool DelinkObjectHandler(UUID user, UUID objectID); | 86 | public delegate bool DelinkObjectHandler(UUID user, UUID objectID); |
84 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); | 87 | public delegate bool CreateObjectInventoryHandler(int invType, UUID objectID, UUID userID); |
85 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 88 | public delegate bool CopyObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
89 | public delegate bool DoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart); | ||
90 | public delegate bool DoDropInObjectInv(InventoryItemBase item, ScenePresence sp, SceneObjectPart destPart); | ||
86 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 91 | public delegate bool DeleteObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
87 | public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); | 92 | public delegate bool TransferObjectInventoryHandler(UUID itemID, UUID objectID, UUID userID); |
88 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); | 93 | public delegate bool CreateUserInventoryHandler(int invType, UUID userID); |
@@ -112,12 +117,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
112 | public event BypassPermissionsHandler OnBypassPermissions; | 117 | public event BypassPermissionsHandler OnBypassPermissions; |
113 | public event PropagatePermissionsHandler OnPropagatePermissions; | 118 | public event PropagatePermissionsHandler OnPropagatePermissions; |
114 | public event RezObjectHandler OnRezObject; | 119 | public event RezObjectHandler OnRezObject; |
120 | public event DeleteObjectHandlerByIDs OnDeleteObjectByIDs; | ||
115 | public event DeleteObjectHandler OnDeleteObject; | 121 | public event DeleteObjectHandler OnDeleteObject; |
116 | public event TransferObjectHandler OnTransferObject; | 122 | public event TransferObjectHandler OnTransferObject; |
117 | public event TakeObjectHandler OnTakeObject; | 123 | public event TakeObjectHandler OnTakeObject; |
118 | public event SellGroupObjectHandler OnSellGroupObject; | 124 | public event SellGroupObjectHandler OnSellGroupObject; |
119 | public event TakeCopyObjectHandler OnTakeCopyObject; | 125 | public event TakeCopyObjectHandler OnTakeCopyObject; |
120 | public event DuplicateObjectHandler OnDuplicateObject; | 126 | public event DuplicateObjectHandler OnDuplicateObject; |
127 | public event EditObjectByIDsHandler OnEditObjectByIDs; | ||
121 | public event EditObjectHandler OnEditObject; | 128 | public event EditObjectHandler OnEditObject; |
122 | public event EditObjectInventoryHandler OnEditObjectInventory; | 129 | public event EditObjectInventoryHandler OnEditObjectInventory; |
123 | public event MoveObjectHandler OnMoveObject; | 130 | public event MoveObjectHandler OnMoveObject; |
@@ -129,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
129 | public event ViewNotecardHandler OnViewNotecard; | 136 | public event ViewNotecardHandler OnViewNotecard; |
130 | public event EditScriptHandler OnEditScript; | 137 | public event EditScriptHandler OnEditScript; |
131 | public event EditNotecardHandler OnEditNotecard; | 138 | public event EditNotecardHandler OnEditNotecard; |
139 | public event RunScriptHandlerByIDs OnRunScriptByIDs; | ||
132 | public event RunScriptHandler OnRunScript; | 140 | public event RunScriptHandler OnRunScript; |
133 | public event CompileScriptHandler OnCompileScript; | 141 | public event CompileScriptHandler OnCompileScript; |
134 | public event StartScriptHandler OnStartScript; | 142 | public event StartScriptHandler OnStartScript; |
@@ -137,7 +145,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
137 | public event TerraformLandHandler OnTerraformLand; | 145 | public event TerraformLandHandler OnTerraformLand; |
138 | public event RunConsoleCommandHandler OnRunConsoleCommand; | 146 | public event RunConsoleCommandHandler OnRunConsoleCommand; |
139 | public event IssueEstateCommandHandler OnIssueEstateCommand; | 147 | public event IssueEstateCommandHandler OnIssueEstateCommand; |
140 | public event IsGodHandler OnIsGod; | ||
141 | public event IsGridGodHandler OnIsGridGod; | 148 | public event IsGridGodHandler OnIsGridGod; |
142 | public event IsAdministratorHandler OnIsAdministrator; | 149 | public event IsAdministratorHandler OnIsAdministrator; |
143 | public event IsEstateManagerHandler OnIsEstateManager; | 150 | public event IsEstateManagerHandler OnIsEstateManager; |
@@ -153,6 +160,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
153 | public event DelinkObjectHandler OnDelinkObject; | 160 | public event DelinkObjectHandler OnDelinkObject; |
154 | public event CreateObjectInventoryHandler OnCreateObjectInventory; | 161 | public event CreateObjectInventoryHandler OnCreateObjectInventory; |
155 | public event CopyObjectInventoryHandler OnCopyObjectInventory; | 162 | public event CopyObjectInventoryHandler OnCopyObjectInventory; |
163 | public event DoObjectInvToObjectInv OnDoObjectInvToObjectInv; | ||
164 | public event DoDropInObjectInv OnDropInObjectInv; | ||
156 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; | 165 | public event DeleteObjectInventoryHandler OnDeleteObjectInventory; |
157 | public event TransferObjectInventoryHandler OnTransferObjectInventory; | 166 | public event TransferObjectInventoryHandler OnTransferObjectInventory; |
158 | public event CreateUserInventoryHandler OnCreateUserInventory; | 167 | public event CreateUserInventoryHandler OnCreateUserInventory; |
@@ -167,7 +176,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
167 | 176 | ||
168 | #region Object Permission Checks | 177 | #region Object Permission Checks |
169 | 178 | ||
170 | public uint GenerateClientFlags(ScenePresence sp, UUID objectID) | 179 | public uint GenerateClientFlags( SceneObjectPart part, ScenePresence sp) |
171 | { | 180 | { |
172 | // libomv will moan about PrimFlags.ObjectYouOfficer being | 181 | // libomv will moan about PrimFlags.ObjectYouOfficer being |
173 | // obsolete... | 182 | // obsolete... |
@@ -182,8 +191,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
182 | PrimFlags.ObjectOwnerModify; | 191 | PrimFlags.ObjectOwnerModify; |
183 | #pragma warning restore 0612 | 192 | #pragma warning restore 0612 |
184 | 193 | ||
185 | SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); | ||
186 | |||
187 | if (part == null) | 194 | if (part == null) |
188 | return 0; | 195 | return 0; |
189 | 196 | ||
@@ -195,7 +202,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
195 | Delegate[] list = handlerGenerateClientFlags.GetInvocationList(); | 202 | Delegate[] list = handlerGenerateClientFlags.GetInvocationList(); |
196 | foreach (GenerateClientFlagsHandler check in list) | 203 | foreach (GenerateClientFlagsHandler check in list) |
197 | { | 204 | { |
198 | perms &= check(sp, perms, objectID); | 205 | perms &= check(part, sp, perms); |
199 | } | 206 | } |
200 | } | 207 | } |
201 | return perms; | 208 | return perms; |
@@ -247,7 +254,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
247 | Delegate[] list = handler.GetInvocationList(); | 254 | Delegate[] list = handler.GetInvocationList(); |
248 | foreach (RezObjectHandler h in list) | 255 | foreach (RezObjectHandler h in list) |
249 | { | 256 | { |
250 | if (h(objectCount, owner,objectPosition, m_scene) == false) | 257 | if (h(objectCount, owner,objectPosition) == false) |
251 | return false; | 258 | return false; |
252 | } | 259 | } |
253 | } | 260 | } |
@@ -261,13 +268,39 @@ namespace OpenSim.Region.Framework.Scenes | |||
261 | { | 268 | { |
262 | bool result = true; | 269 | bool result = true; |
263 | 270 | ||
271 | DeleteObjectHandlerByIDs handler = OnDeleteObjectByIDs; | ||
272 | if (handler != null) | ||
273 | { | ||
274 | Delegate[] list = handler.GetInvocationList(); | ||
275 | foreach (DeleteObjectHandlerByIDs h in list) | ||
276 | { | ||
277 | if (h(objectID, deleter) == false) | ||
278 | { | ||
279 | result = false; | ||
280 | break; | ||
281 | } | ||
282 | } | ||
283 | } | ||
284 | |||
285 | return result; | ||
286 | } | ||
287 | |||
288 | public bool CanDeleteObject(SceneObjectGroup sog, IClientAPI client) | ||
289 | { | ||
290 | bool result = true; | ||
291 | |||
264 | DeleteObjectHandler handler = OnDeleteObject; | 292 | DeleteObjectHandler handler = OnDeleteObject; |
265 | if (handler != null) | 293 | if (handler != null) |
266 | { | 294 | { |
295 | if(sog == null || client == null || client.SceneAgent == null) | ||
296 | return false; | ||
297 | |||
298 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
299 | |||
267 | Delegate[] list = handler.GetInvocationList(); | 300 | Delegate[] list = handler.GetInvocationList(); |
268 | foreach (DeleteObjectHandler h in list) | 301 | foreach (DeleteObjectHandler h in list) |
269 | { | 302 | { |
270 | if (h(objectID, deleter, m_scene) == false) | 303 | if (h(sog, sp) == false) |
271 | { | 304 | { |
272 | result = false; | 305 | result = false; |
273 | break; | 306 | break; |
@@ -288,7 +321,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
288 | Delegate[] list = handler.GetInvocationList(); | 321 | Delegate[] list = handler.GetInvocationList(); |
289 | foreach (TransferObjectHandler h in list) | 322 | foreach (TransferObjectHandler h in list) |
290 | { | 323 | { |
291 | if (h(objectID, recipient, m_scene) == false) | 324 | if (h(objectID, recipient) == false) |
292 | { | 325 | { |
293 | result = false; | 326 | result = false; |
294 | break; | 327 | break; |
@@ -302,17 +335,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
302 | #endregion | 335 | #endregion |
303 | 336 | ||
304 | #region TAKE OBJECT | 337 | #region TAKE OBJECT |
305 | public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID) | 338 | public bool CanTakeObject(SceneObjectGroup sog, ScenePresence sp) |
306 | { | 339 | { |
307 | bool result = true; | 340 | bool result = true; |
308 | 341 | ||
309 | TakeObjectHandler handler = OnTakeObject; | 342 | TakeObjectHandler handler = OnTakeObject; |
310 | if (handler != null) | 343 | if (handler != null) |
311 | { | 344 | { |
345 | if(sog == null || sp == null) | ||
346 | return false; | ||
347 | |||
312 | Delegate[] list = handler.GetInvocationList(); | 348 | Delegate[] list = handler.GetInvocationList(); |
313 | foreach (TakeObjectHandler h in list) | 349 | foreach (TakeObjectHandler h in list) |
314 | { | 350 | { |
315 | if (h(objectID, AvatarTakingUUID, m_scene) == false) | 351 | if (h(sog, sp) == false) |
316 | { | 352 | { |
317 | result = false; | 353 | result = false; |
318 | break; | 354 | break; |
@@ -330,7 +366,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
330 | #endregion | 366 | #endregion |
331 | 367 | ||
332 | #region SELL GROUP OBJECT | 368 | #region SELL GROUP OBJECT |
333 | public bool CanSellGroupObject(UUID userID, UUID groupID, Scene scene) | 369 | public bool CanSellGroupObject(UUID userID, UUID groupID) |
334 | { | 370 | { |
335 | bool result = true; | 371 | bool result = true; |
336 | 372 | ||
@@ -340,7 +376,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
340 | Delegate[] list = handler.GetInvocationList(); | 376 | Delegate[] list = handler.GetInvocationList(); |
341 | foreach (SellGroupObjectHandler h in list) | 377 | foreach (SellGroupObjectHandler h in list) |
342 | { | 378 | { |
343 | if (h(userID, groupID, scene) == false) | 379 | if (h(userID, groupID) == false) |
344 | { | 380 | { |
345 | result = false; | 381 | result = false; |
346 | break; | 382 | break; |
@@ -359,17 +395,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
359 | 395 | ||
360 | 396 | ||
361 | #region TAKE COPY OBJECT | 397 | #region TAKE COPY OBJECT |
362 | public bool CanTakeCopyObject(UUID objectID, UUID userID) | 398 | public bool CanTakeCopyObject(SceneObjectGroup sog, ScenePresence sp) |
363 | { | 399 | { |
364 | bool result = true; | 400 | bool result = true; |
365 | 401 | ||
366 | TakeCopyObjectHandler handler = OnTakeCopyObject; | 402 | TakeCopyObjectHandler handler = OnTakeCopyObject; |
367 | if (handler != null) | 403 | if (handler != null) |
368 | { | 404 | { |
405 | if(sog == null || sp == null) | ||
406 | return false; | ||
369 | Delegate[] list = handler.GetInvocationList(); | 407 | Delegate[] list = handler.GetInvocationList(); |
370 | foreach (TakeCopyObjectHandler h in list) | 408 | foreach (TakeCopyObjectHandler h in list) |
371 | { | 409 | { |
372 | if (h(objectID, userID, m_scene) == false) | 410 | if (h(sog, sp) == false) |
373 | { | 411 | { |
374 | result = false; | 412 | result = false; |
375 | break; | 413 | break; |
@@ -387,15 +425,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
387 | #endregion | 425 | #endregion |
388 | 426 | ||
389 | #region DUPLICATE OBJECT | 427 | #region DUPLICATE OBJECT |
390 | public bool CanDuplicateObject(int objectCount, UUID objectID, UUID owner, Vector3 objectPosition) | 428 | public bool CanDuplicateObject(SceneObjectGroup sog, UUID agentID) |
391 | { | 429 | { |
392 | DuplicateObjectHandler handler = OnDuplicateObject; | 430 | DuplicateObjectHandler handler = OnDuplicateObject; |
393 | if (handler != null) | 431 | if (handler != null) |
394 | { | 432 | { |
433 | if(sog == null || sog.IsDeleted) | ||
434 | return false; | ||
435 | ScenePresence sp = m_scene.GetScenePresence(agentID); | ||
436 | if(sp == null || sp.IsDeleted) | ||
437 | return false; | ||
395 | Delegate[] list = handler.GetInvocationList(); | 438 | Delegate[] list = handler.GetInvocationList(); |
396 | foreach (DuplicateObjectHandler h in list) | 439 | foreach (DuplicateObjectHandler h in list) |
397 | { | 440 | { |
398 | if (h(objectCount, objectID, owner, m_scene, objectPosition) == false) | 441 | if (h(sog, sp) == false) |
399 | return false; | 442 | return false; |
400 | } | 443 | } |
401 | } | 444 | } |
@@ -411,9 +454,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
411 | PrimFlags.ObjectOwnerModify | 454 | PrimFlags.ObjectOwnerModify |
412 | ); | 455 | ); |
413 | 456 | ||
414 | public bool CanChangeSelectedState(UUID objectID, ScenePresence sp) | 457 | public bool CanChangeSelectedState(SceneObjectPart part, ScenePresence sp) |
415 | { | 458 | { |
416 | uint perms = GenerateClientFlags(sp , objectID); | 459 | uint perms = GenerateClientFlags(part, sp); |
417 | return (perms & CANSELECTMASK) != 0; | 460 | return (perms & CANSELECTMASK) != 0; |
418 | } | 461 | } |
419 | 462 | ||
@@ -421,13 +464,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
421 | #region EDIT OBJECT | 464 | #region EDIT OBJECT |
422 | public bool CanEditObject(UUID objectID, UUID editorID) | 465 | public bool CanEditObject(UUID objectID, UUID editorID) |
423 | { | 466 | { |
467 | EditObjectByIDsHandler handler = OnEditObjectByIDs; | ||
468 | if (handler != null) | ||
469 | { | ||
470 | Delegate[] list = handler.GetInvocationList(); | ||
471 | foreach (EditObjectByIDsHandler h in list) | ||
472 | { | ||
473 | if (h(objectID, editorID) == false) | ||
474 | return false; | ||
475 | } | ||
476 | } | ||
477 | return true; | ||
478 | } | ||
479 | |||
480 | public bool CanEditObject(SceneObjectGroup sog, IClientAPI client) | ||
481 | { | ||
424 | EditObjectHandler handler = OnEditObject; | 482 | EditObjectHandler handler = OnEditObject; |
425 | if (handler != null) | 483 | if (handler != null) |
426 | { | 484 | { |
485 | if(sog == null || client == null || client.SceneAgent == null) | ||
486 | return false; | ||
487 | |||
488 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
489 | |||
427 | Delegate[] list = handler.GetInvocationList(); | 490 | Delegate[] list = handler.GetInvocationList(); |
428 | foreach (EditObjectHandler h in list) | 491 | foreach (EditObjectHandler h in list) |
429 | { | 492 | { |
430 | if (h(objectID, editorID, m_scene) == false) | 493 | if (h(sog, sp) == false) |
431 | return false; | 494 | return false; |
432 | } | 495 | } |
433 | } | 496 | } |
@@ -442,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
442 | Delegate[] list = handler.GetInvocationList(); | 505 | Delegate[] list = handler.GetInvocationList(); |
443 | foreach (EditObjectInventoryHandler h in list) | 506 | foreach (EditObjectInventoryHandler h in list) |
444 | { | 507 | { |
445 | if (h(objectID, editorID, m_scene) == false) | 508 | if (h(objectID, editorID) == false) |
446 | return false; | 509 | return false; |
447 | } | 510 | } |
448 | } | 511 | } |
@@ -452,15 +515,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
452 | #endregion | 515 | #endregion |
453 | 516 | ||
454 | #region MOVE OBJECT | 517 | #region MOVE OBJECT |
455 | public bool CanMoveObject(UUID objectID, UUID moverID) | 518 | public bool CanMoveObject(SceneObjectGroup sog, IClientAPI client) |
456 | { | 519 | { |
457 | MoveObjectHandler handler = OnMoveObject; | 520 | MoveObjectHandler handler = OnMoveObject; |
458 | if (handler != null) | 521 | if (handler != null) |
459 | { | 522 | { |
523 | if(sog == null || client == null || client.SceneAgent == null) | ||
524 | return false; | ||
525 | |||
526 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
527 | |||
460 | Delegate[] list = handler.GetInvocationList(); | 528 | Delegate[] list = handler.GetInvocationList(); |
461 | foreach (MoveObjectHandler h in list) | 529 | foreach (MoveObjectHandler h in list) |
462 | { | 530 | { |
463 | if (h(objectID, moverID, m_scene) == false) | 531 | if (h(sog, sp) == false) |
464 | return false; | 532 | return false; |
465 | } | 533 | } |
466 | } | 534 | } |
@@ -470,7 +538,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
470 | #endregion | 538 | #endregion |
471 | 539 | ||
472 | #region OBJECT ENTRY | 540 | #region OBJECT ENTRY |
473 | public bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint) | 541 | public bool CanObjectEntry(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint) |
474 | { | 542 | { |
475 | ObjectEntryHandler handler = OnObjectEntry; | 543 | ObjectEntryHandler handler = OnObjectEntry; |
476 | if (handler != null) | 544 | if (handler != null) |
@@ -478,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
478 | Delegate[] list = handler.GetInvocationList(); | 546 | Delegate[] list = handler.GetInvocationList(); |
479 | foreach (ObjectEntryHandler h in list) | 547 | foreach (ObjectEntryHandler h in list) |
480 | { | 548 | { |
481 | if (h(objectID, enteringRegion, newPoint, m_scene) == false) | 549 | if (h(sog, enteringRegion, newPoint) == false) |
482 | return false; | 550 | return false; |
483 | } | 551 | } |
484 | } | 552 | } |
@@ -488,17 +556,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
488 | #endregion | 556 | #endregion |
489 | 557 | ||
490 | #region RETURN OBJECT | 558 | #region RETURN OBJECT |
491 | public bool CanReturnObjects(ILandObject land, UUID user, List<SceneObjectGroup> objects) | 559 | public bool CanReturnObjects(ILandObject land, IClientAPI client, List<SceneObjectGroup> objects) |
492 | { | 560 | { |
493 | bool result = true; | 561 | bool result = true; |
494 | 562 | ||
495 | ReturnObjectsHandler handler = OnReturnObjects; | 563 | ReturnObjectsHandler handler = OnReturnObjects; |
496 | if (handler != null) | 564 | if (handler != null) |
497 | { | 565 | { |
566 | if(objects == null) | ||
567 | return false; | ||
568 | |||
569 | ScenePresence sp = null; | ||
570 | if(client != null && client.SceneAgent != null) | ||
571 | sp = client.SceneAgent as ScenePresence; | ||
572 | |||
498 | Delegate[] list = handler.GetInvocationList(); | 573 | Delegate[] list = handler.GetInvocationList(); |
499 | foreach (ReturnObjectsHandler h in list) | 574 | foreach (ReturnObjectsHandler h in list) |
500 | { | 575 | { |
501 | if (h(land, user, objects, m_scene) == false) | 576 | if (h(land, sp, objects) == false) |
502 | { | 577 | { |
503 | result = false; | 578 | result = false; |
504 | break; | 579 | break; |
@@ -524,7 +599,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
524 | Delegate[] list = handler.GetInvocationList(); | 599 | Delegate[] list = handler.GetInvocationList(); |
525 | foreach (InstantMessageHandler h in list) | 600 | foreach (InstantMessageHandler h in list) |
526 | { | 601 | { |
527 | if (h(user, target, m_scene) == false) | 602 | if (h(user, target) == false) |
528 | return false; | 603 | return false; |
529 | } | 604 | } |
530 | } | 605 | } |
@@ -542,7 +617,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
542 | Delegate[] list = handler.GetInvocationList(); | 617 | Delegate[] list = handler.GetInvocationList(); |
543 | foreach (InventoryTransferHandler h in list) | 618 | foreach (InventoryTransferHandler h in list) |
544 | { | 619 | { |
545 | if (h(user, target, m_scene) == false) | 620 | if (h(user, target) == false) |
546 | return false; | 621 | return false; |
547 | } | 622 | } |
548 | } | 623 | } |
@@ -560,7 +635,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
560 | Delegate[] list = handler.GetInvocationList(); | 635 | Delegate[] list = handler.GetInvocationList(); |
561 | foreach (ViewScriptHandler h in list) | 636 | foreach (ViewScriptHandler h in list) |
562 | { | 637 | { |
563 | if (h(script, objectID, user, m_scene) == false) | 638 | if (h(script, objectID, user) == false) |
564 | return false; | 639 | return false; |
565 | } | 640 | } |
566 | } | 641 | } |
@@ -575,7 +650,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
575 | Delegate[] list = handler.GetInvocationList(); | 650 | Delegate[] list = handler.GetInvocationList(); |
576 | foreach (ViewNotecardHandler h in list) | 651 | foreach (ViewNotecardHandler h in list) |
577 | { | 652 | { |
578 | if (h(script, objectID, user, m_scene) == false) | 653 | if (h(script, objectID, user) == false) |
579 | return false; | 654 | return false; |
580 | } | 655 | } |
581 | } | 656 | } |
@@ -593,7 +668,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
593 | Delegate[] list = handler.GetInvocationList(); | 668 | Delegate[] list = handler.GetInvocationList(); |
594 | foreach (EditScriptHandler h in list) | 669 | foreach (EditScriptHandler h in list) |
595 | { | 670 | { |
596 | if (h(script, objectID, user, m_scene) == false) | 671 | if (h(script, objectID, user) == false) |
597 | return false; | 672 | return false; |
598 | } | 673 | } |
599 | } | 674 | } |
@@ -608,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
608 | Delegate[] list = handler.GetInvocationList(); | 683 | Delegate[] list = handler.GetInvocationList(); |
609 | foreach (EditNotecardHandler h in list) | 684 | foreach (EditNotecardHandler h in list) |
610 | { | 685 | { |
611 | if (h(script, objectID, user, m_scene) == false) | 686 | if (h(script, objectID, user) == false) |
612 | return false; | 687 | return false; |
613 | } | 688 | } |
614 | } | 689 | } |
@@ -620,19 +695,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
620 | #region RUN SCRIPT (When Script Placed in Object) | 695 | #region RUN SCRIPT (When Script Placed in Object) |
621 | public bool CanRunScript(UUID script, UUID objectID, UUID user) | 696 | public bool CanRunScript(UUID script, UUID objectID, UUID user) |
622 | { | 697 | { |
698 | RunScriptHandlerByIDs handler = OnRunScriptByIDs; | ||
699 | if (handler != null) | ||
700 | { | ||
701 | Delegate[] list = handler.GetInvocationList(); | ||
702 | foreach (RunScriptHandlerByIDs h in list) | ||
703 | { | ||
704 | if (h(script, objectID, user) == false) | ||
705 | return false; | ||
706 | } | ||
707 | } | ||
708 | return true; | ||
709 | } | ||
710 | |||
711 | public bool CanRunScript(TaskInventoryItem item, SceneObjectPart part) | ||
712 | { | ||
623 | RunScriptHandler handler = OnRunScript; | 713 | RunScriptHandler handler = OnRunScript; |
624 | if (handler != null) | 714 | if (handler != null) |
625 | { | 715 | { |
716 | if(item == null || part == null) | ||
717 | return false; | ||
626 | Delegate[] list = handler.GetInvocationList(); | 718 | Delegate[] list = handler.GetInvocationList(); |
627 | foreach (RunScriptHandler h in list) | 719 | foreach (RunScriptHandler h in list) |
628 | { | 720 | { |
629 | if (h(script, objectID, user, m_scene) == false) | 721 | if (h(item, part) == false) |
630 | return false; | 722 | return false; |
631 | } | 723 | } |
632 | } | 724 | } |
633 | return true; | 725 | return true; |
634 | } | 726 | } |
635 | 727 | ||
728 | |||
636 | #endregion | 729 | #endregion |
637 | 730 | ||
638 | #region COMPILE SCRIPT (When Script needs to get (re)compiled) | 731 | #region COMPILE SCRIPT (When Script needs to get (re)compiled) |
@@ -644,7 +737,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
644 | Delegate[] list = handler.GetInvocationList(); | 737 | Delegate[] list = handler.GetInvocationList(); |
645 | foreach (CompileScriptHandler h in list) | 738 | foreach (CompileScriptHandler h in list) |
646 | { | 739 | { |
647 | if (h(ownerUUID, scriptType, m_scene) == false) | 740 | if (h(ownerUUID, scriptType) == false) |
648 | return false; | 741 | return false; |
649 | } | 742 | } |
650 | } | 743 | } |
@@ -662,7 +755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
662 | Delegate[] list = handler.GetInvocationList(); | 755 | Delegate[] list = handler.GetInvocationList(); |
663 | foreach (StartScriptHandler h in list) | 756 | foreach (StartScriptHandler h in list) |
664 | { | 757 | { |
665 | if (h(script, user, m_scene) == false) | 758 | if (h(script, user) == false) |
666 | return false; | 759 | return false; |
667 | } | 760 | } |
668 | } | 761 | } |
@@ -680,7 +773,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
680 | Delegate[] list = handler.GetInvocationList(); | 773 | Delegate[] list = handler.GetInvocationList(); |
681 | foreach (StopScriptHandler h in list) | 774 | foreach (StopScriptHandler h in list) |
682 | { | 775 | { |
683 | if (h(script, user, m_scene) == false) | 776 | if (h(script, user) == false) |
684 | return false; | 777 | return false; |
685 | } | 778 | } |
686 | } | 779 | } |
@@ -698,7 +791,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
698 | Delegate[] list = handler.GetInvocationList(); | 791 | Delegate[] list = handler.GetInvocationList(); |
699 | foreach (ResetScriptHandler h in list) | 792 | foreach (ResetScriptHandler h in list) |
700 | { | 793 | { |
701 | if (h(prim, script, user, m_scene) == false) | 794 | if (h(prim, script, user) == false) |
702 | return false; | 795 | return false; |
703 | } | 796 | } |
704 | } | 797 | } |
@@ -716,7 +809,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
716 | Delegate[] list = handler.GetInvocationList(); | 809 | Delegate[] list = handler.GetInvocationList(); |
717 | foreach (TerraformLandHandler h in list) | 810 | foreach (TerraformLandHandler h in list) |
718 | { | 811 | { |
719 | if (h(user, pos, m_scene) == false) | 812 | if (h(user, pos) == false) |
720 | return false; | 813 | return false; |
721 | } | 814 | } |
722 | } | 815 | } |
@@ -734,7 +827,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
734 | Delegate[] list = handler.GetInvocationList(); | 827 | Delegate[] list = handler.GetInvocationList(); |
735 | foreach (RunConsoleCommandHandler h in list) | 828 | foreach (RunConsoleCommandHandler h in list) |
736 | { | 829 | { |
737 | if (h(user, m_scene) == false) | 830 | if (h(user) == false) |
738 | return false; | 831 | return false; |
739 | } | 832 | } |
740 | } | 833 | } |
@@ -752,7 +845,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
752 | Delegate[] list = handler.GetInvocationList(); | 845 | Delegate[] list = handler.GetInvocationList(); |
753 | foreach (IssueEstateCommandHandler h in list) | 846 | foreach (IssueEstateCommandHandler h in list) |
754 | { | 847 | { |
755 | if (h(user, m_scene, ownerCommand) == false) | 848 | if (h(user, ownerCommand) == false) |
756 | return false; | 849 | return false; |
757 | } | 850 | } |
758 | } | 851 | } |
@@ -763,13 +856,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
763 | #region CAN BE GODLIKE | 856 | #region CAN BE GODLIKE |
764 | public bool IsGod(UUID user) | 857 | public bool IsGod(UUID user) |
765 | { | 858 | { |
766 | IsGodHandler handler = OnIsGod; | 859 | IsAdministratorHandler handler = OnIsAdministrator; |
767 | if (handler != null) | 860 | if (handler != null) |
768 | { | 861 | { |
769 | Delegate[] list = handler.GetInvocationList(); | 862 | Delegate[] list = handler.GetInvocationList(); |
770 | foreach (IsGodHandler h in list) | 863 | foreach (IsAdministratorHandler h in list) |
771 | { | 864 | { |
772 | if (h(user, m_scene) == false) | 865 | if (h(user) == false) |
773 | return false; | 866 | return false; |
774 | } | 867 | } |
775 | } | 868 | } |
@@ -784,7 +877,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
784 | Delegate[] list = handler.GetInvocationList(); | 877 | Delegate[] list = handler.GetInvocationList(); |
785 | foreach (IsGridGodHandler h in list) | 878 | foreach (IsGridGodHandler h in list) |
786 | { | 879 | { |
787 | if (h(user, m_scene) == false) | 880 | if (h(user) == false) |
788 | return false; | 881 | return false; |
789 | } | 882 | } |
790 | } | 883 | } |
@@ -832,7 +925,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
832 | Delegate[] list = handler.GetInvocationList(); | 925 | Delegate[] list = handler.GetInvocationList(); |
833 | foreach (EditParcelPropertiesHandler h in list) | 926 | foreach (EditParcelPropertiesHandler h in list) |
834 | { | 927 | { |
835 | if (h(user, parcel, p, m_scene, allowManager) == false) | 928 | if (h(user, parcel, p, allowManager) == false) |
836 | return false; | 929 | return false; |
837 | } | 930 | } |
838 | } | 931 | } |
@@ -849,7 +942,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
849 | Delegate[] list = handler.GetInvocationList(); | 942 | Delegate[] list = handler.GetInvocationList(); |
850 | foreach (SellParcelHandler h in list) | 943 | foreach (SellParcelHandler h in list) |
851 | { | 944 | { |
852 | if (h(user, parcel, m_scene) == false) | 945 | if (h(user, parcel) == false) |
853 | return false; | 946 | return false; |
854 | } | 947 | } |
855 | } | 948 | } |
@@ -866,7 +959,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
866 | Delegate[] list = handler.GetInvocationList(); | 959 | Delegate[] list = handler.GetInvocationList(); |
867 | foreach (AbandonParcelHandler h in list) | 960 | foreach (AbandonParcelHandler h in list) |
868 | { | 961 | { |
869 | if (h(user, parcel, m_scene) == false) | 962 | if (h(user, parcel) == false) |
870 | return false; | 963 | return false; |
871 | } | 964 | } |
872 | } | 965 | } |
@@ -882,7 +975,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
882 | Delegate[] list = handler.GetInvocationList(); | 975 | Delegate[] list = handler.GetInvocationList(); |
883 | foreach (ReclaimParcelHandler h in list) | 976 | foreach (ReclaimParcelHandler h in list) |
884 | { | 977 | { |
885 | if (h(user, parcel, m_scene) == false) | 978 | if (h(user, parcel) == false) |
886 | return false; | 979 | return false; |
887 | } | 980 | } |
888 | } | 981 | } |
@@ -897,22 +990,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
897 | Delegate[] list = handler.GetInvocationList(); | 990 | Delegate[] list = handler.GetInvocationList(); |
898 | foreach (DeedParcelHandler h in list) | 991 | foreach (DeedParcelHandler h in list) |
899 | { | 992 | { |
900 | if (h(user, parcel, m_scene) == false) | 993 | if (h(user, parcel) == false) |
901 | return false; | 994 | return false; |
902 | } | 995 | } |
903 | } | 996 | } |
904 | return true; | 997 | return true; |
905 | } | 998 | } |
906 | 999 | ||
907 | public bool CanDeedObject(UUID user, UUID group) | 1000 | public bool CanDeedObject(IClientAPI client, SceneObjectGroup sog, UUID targetGroupID) |
908 | { | 1001 | { |
909 | DeedObjectHandler handler = OnDeedObject; | 1002 | DeedObjectHandler handler = OnDeedObject; |
910 | if (handler != null) | 1003 | if (handler != null) |
911 | { | 1004 | { |
1005 | if(sog == null || client == null || client.SceneAgent == null || targetGroupID == UUID.Zero) | ||
1006 | return false; | ||
1007 | |||
1008 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
1009 | |||
912 | Delegate[] list = handler.GetInvocationList(); | 1010 | Delegate[] list = handler.GetInvocationList(); |
913 | foreach (DeedObjectHandler h in list) | 1011 | foreach (DeedObjectHandler h in list) |
914 | { | 1012 | { |
915 | if (h(user, group, m_scene) == false) | 1013 | if (h(sp, sog, targetGroupID) == false) |
916 | return false; | 1014 | return false; |
917 | } | 1015 | } |
918 | } | 1016 | } |
@@ -927,7 +1025,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
927 | Delegate[] list = handler.GetInvocationList(); | 1025 | Delegate[] list = handler.GetInvocationList(); |
928 | foreach (BuyLandHandler h in list) | 1026 | foreach (BuyLandHandler h in list) |
929 | { | 1027 | { |
930 | if (h(user, parcel, m_scene) == false) | 1028 | if (h(user, parcel) == false) |
931 | return false; | 1029 | return false; |
932 | } | 1030 | } |
933 | } | 1031 | } |
@@ -1003,6 +1101,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
1003 | return true; | 1101 | return true; |
1004 | } | 1102 | } |
1005 | 1103 | ||
1104 | public bool CanDoObjectInvToObjectInv(TaskInventoryItem item, SceneObjectPart sourcePart, SceneObjectPart destPart) | ||
1105 | { | ||
1106 | DoObjectInvToObjectInv handler = OnDoObjectInvToObjectInv; | ||
1107 | if (handler != null) | ||
1108 | { | ||
1109 | if (sourcePart == null || destPart == null || item == null) | ||
1110 | return false; | ||
1111 | Delegate[] list = handler.GetInvocationList(); | ||
1112 | foreach (DoObjectInvToObjectInv h in list) | ||
1113 | { | ||
1114 | if (h(item, sourcePart, destPart) == false) | ||
1115 | return false; | ||
1116 | } | ||
1117 | } | ||
1118 | return true; | ||
1119 | } | ||
1120 | |||
1121 | public bool CanDropInObjectInv(InventoryItemBase item, IClientAPI client, SceneObjectPart destPart) | ||
1122 | { | ||
1123 | DoDropInObjectInv handler = OnDropInObjectInv; | ||
1124 | if (handler != null) | ||
1125 | { | ||
1126 | if (client == null || client.SceneAgent == null|| destPart == null || item == null) | ||
1127 | return false; | ||
1128 | |||
1129 | ScenePresence sp = client.SceneAgent as ScenePresence; | ||
1130 | if(sp == null || sp.IsDeleted) | ||
1131 | return false; | ||
1132 | |||
1133 | Delegate[] list = handler.GetInvocationList(); | ||
1134 | foreach (DoDropInObjectInv h in list) | ||
1135 | { | ||
1136 | if (h(item, sp, destPart) == false) | ||
1137 | return false; | ||
1138 | } | ||
1139 | } | ||
1140 | return true; | ||
1141 | } | ||
1142 | |||
1006 | public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) | 1143 | public bool CanDeleteObjectInventory(UUID itemID, UUID objectID, UUID userID) |
1007 | { | 1144 | { |
1008 | DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; | 1145 | DeleteObjectInventoryHandler handler = OnDeleteObjectInventory; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2137b42..5f99b73 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2351,6 +2351,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2351 | EventManager.TriggerOnSceneObjectLoaded(group); | 2351 | EventManager.TriggerOnSceneObjectLoaded(group); |
2352 | SceneObjectPart rootPart = group.GetPart(group.UUID); | 2352 | SceneObjectPart rootPart = group.GetPart(group.UUID); |
2353 | rootPart.Flags &= ~PrimFlags.Scripted; | 2353 | rootPart.Flags &= ~PrimFlags.Scripted; |
2354 | group.AggregateDeepPerms(); | ||
2354 | rootPart.TrimPermissions(); | 2355 | rootPart.TrimPermissions(); |
2355 | 2356 | ||
2356 | // Don't do this here - it will get done later on when sculpt data is loaded. | 2357 | // Don't do this here - it will get done later on when sculpt data is loaded. |
@@ -2603,8 +2604,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2603 | { | 2604 | { |
2604 | // Otherwise, use this default creation code; | 2605 | // Otherwise, use this default creation code; |
2605 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | 2606 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); |
2606 | AddNewSceneObject(sceneObject, true); | ||
2607 | sceneObject.SetGroup(groupID, null); | 2607 | sceneObject.SetGroup(groupID, null); |
2608 | AddNewSceneObject(sceneObject, true); | ||
2608 | 2609 | ||
2609 | if (AgentPreferencesService != null) // This will override the brave new full perm world! | 2610 | if (AgentPreferencesService != null) // This will override the brave new full perm world! |
2610 | { | 2611 | { |
@@ -2622,6 +2623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2622 | if (UserManagementModule != null) | 2623 | if (UserManagementModule != null) |
2623 | sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); | 2624 | sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); |
2624 | 2625 | ||
2626 | sceneObject.AggregateDeepPerms(); | ||
2625 | sceneObject.ScheduleGroupForFullUpdate(); | 2627 | sceneObject.ScheduleGroupForFullUpdate(); |
2626 | 2628 | ||
2627 | return sceneObject; | 2629 | return sceneObject; |
@@ -2768,7 +2770,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2768 | SceneObjectGroup sog = (SceneObjectGroup)e; | 2770 | SceneObjectGroup sog = (SceneObjectGroup)e; |
2769 | if (sog != null && !sog.IsAttachment) | 2771 | if (sog != null && !sog.IsAttachment) |
2770 | { | 2772 | { |
2771 | if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0)) | 2773 | if (!exceptNoCopy || ((sog.EffectiveOwnerPerms & (uint)PermissionMask.Copy) != 0)) |
2772 | { | 2774 | { |
2773 | DeleteSceneObject((SceneObjectGroup)e, false); | 2775 | DeleteSceneObject((SceneObjectGroup)e, false); |
2774 | } | 2776 | } |
@@ -2782,7 +2784,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2782 | } | 2784 | } |
2783 | if (toReturn.Count > 0) | 2785 | if (toReturn.Count > 0) |
2784 | { | 2786 | { |
2785 | returnObjects(toReturn.ToArray(), UUID.Zero); | 2787 | returnObjects(toReturn.ToArray(), null); |
2786 | } | 2788 | } |
2787 | } | 2789 | } |
2788 | 2790 | ||
@@ -3603,7 +3605,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3603 | /// <param name="GroupID">Group of new object</param> | 3605 | /// <param name="GroupID">Group of new object</param> |
3604 | public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) | 3606 | public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) |
3605 | { | 3607 | { |
3606 | SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); | 3608 | bool createSelected = (flags & (uint)PrimFlags.CreateSelected) != 0; |
3609 | SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, AgentID, | ||
3610 | GroupID, Quaternion.Identity, createSelected); | ||
3607 | if (copy != null) | 3611 | if (copy != null) |
3608 | EventManager.TriggerObjectAddedToScene(copy); | 3612 | EventManager.TriggerObjectAddedToScene(copy); |
3609 | } | 3613 | } |
@@ -3633,6 +3637,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3633 | SceneObjectPart target = GetSceneObjectPart(localID); | 3637 | SceneObjectPart target = GetSceneObjectPart(localID); |
3634 | SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); | 3638 | SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); |
3635 | 3639 | ||
3640 | bool createSelected = (dupeFlags & (uint)PrimFlags.CreateSelected) != 0; | ||
3641 | |||
3636 | if (target != null && target2 != null) | 3642 | if (target != null && target2 != null) |
3637 | { | 3643 | { |
3638 | Vector3 direction = Vector3.Normalize(RayEnd - RayStart); | 3644 | Vector3 direction = Vector3.Normalize(RayEnd - RayStart); |
@@ -3674,13 +3680,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3674 | Quaternion worldRot = target2.GetWorldRotation(); | 3680 | Quaternion worldRot = target2.GetWorldRotation(); |
3675 | 3681 | ||
3676 | // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); | 3682 | // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); |
3677 | copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); | 3683 | copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, worldRot, createSelected); |
3678 | //obj.Rotation = worldRot; | 3684 | //obj.Rotation = worldRot; |
3679 | //obj.UpdateGroupRotationR(worldRot); | 3685 | //obj.UpdateGroupRotationR(worldRot); |
3680 | } | 3686 | } |
3681 | else | 3687 | else |
3682 | { | 3688 | { |
3683 | copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity); | 3689 | copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, Quaternion.Identity, createSelected); |
3684 | } | 3690 | } |
3685 | 3691 | ||
3686 | if (copy != null) | 3692 | if (copy != null) |
@@ -5077,65 +5083,59 @@ Label_GroupsDone: | |||
5077 | #endregion | 5083 | #endregion |
5078 | 5084 | ||
5079 | #region Script Engine | 5085 | #region Script Engine |
5080 | 5086 | public bool LSLScriptDanger(SceneObjectPart part, Vector3 pos) | |
5081 | private bool ScriptDanger(SceneObjectPart part, Vector3 pos) | ||
5082 | { | 5087 | { |
5088 | |||
5083 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); | 5089 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); |
5084 | if (part != null) | 5090 | if (parcel == null) |
5085 | { | 5091 | return true; |
5086 | if (parcel != null) | 5092 | |
5087 | { | 5093 | LandData ldata = parcel.LandData; |
5088 | if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) | 5094 | if (ldata == null) |
5089 | { | 5095 | return true; |
5090 | return true; | 5096 | |
5091 | } | 5097 | uint landflags = ldata.Flags; |
5092 | else if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID)) | 5098 | |
5093 | { | 5099 | uint mask = (uint)(ParcelFlags.CreateObjects | ParcelFlags.AllowAPrimitiveEntry); |
5094 | return true; | 5100 | if((landflags & mask) != mask) |
5095 | } | 5101 | return true; |
5096 | else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) | 5102 | |
5097 | && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) | 5103 | if((landflags & (uint)ParcelFlags.AllowOtherScripts) != 0) |
5098 | { | 5104 | return false; |
5099 | return true; | ||
5100 | } | ||
5101 | else | ||
5102 | { | ||
5103 | return false; | ||
5104 | } | ||
5105 | } | ||
5106 | else | ||
5107 | { | ||
5108 | 5105 | ||
5109 | if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY) | 5106 | if(part == null) |
5110 | { | 5107 | return true; |
5111 | // The only time parcel != null when an object is inside a region is when | 5108 | if(part.GroupID == ldata.GroupID && (landflags & (uint)ParcelFlags.AllowGroupScripts) != 0) |
5112 | // there is nothing behind the landchannel. IE, no land plugin loaded. | ||
5113 | return true; | ||
5114 | } | ||
5115 | else | ||
5116 | { | ||
5117 | // The object is outside of this region. Stop piping events to it. | ||
5118 | return false; | ||
5119 | } | ||
5120 | } | ||
5121 | } | ||
5122 | else | ||
5123 | { | ||
5124 | return false; | 5109 | return false; |
5125 | } | 5110 | |
5111 | return true; | ||
5126 | } | 5112 | } |
5127 | 5113 | ||
5128 | public bool ScriptDanger(uint localID, Vector3 pos) | 5114 | private bool ScriptDanger(SceneObjectPart part, Vector3 pos) |
5129 | { | 5115 | { |
5130 | SceneObjectPart part = GetSceneObjectPart(localID); | 5116 | if (part == null) |
5131 | if (part != null) | 5117 | return false; |
5118 | |||
5119 | ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); | ||
5120 | if (parcel != null) | ||
5132 | { | 5121 | { |
5133 | return ScriptDanger(part, pos); | 5122 | if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) |
5123 | return true; | ||
5124 | |||
5125 | if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID)) | ||
5126 | return true; | ||
5127 | |||
5128 | if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) | ||
5129 | && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) | ||
5130 | return true; | ||
5134 | } | 5131 | } |
5135 | else | 5132 | else |
5136 | { | 5133 | { |
5137 | return false; | 5134 | if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY) |
5135 | return true; | ||
5138 | } | 5136 | } |
5137 | |||
5138 | return false; | ||
5139 | } | 5139 | } |
5140 | 5140 | ||
5141 | public bool PipeEventsForScript(uint localID) | 5141 | public bool PipeEventsForScript(uint localID) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2f65ce2..49e98e7 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -343,7 +343,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
343 | sceneObject.ForceInventoryPersistence(); | 343 | sceneObject.ForceInventoryPersistence(); |
344 | sceneObject.HasGroupChanged = true; | 344 | sceneObject.HasGroupChanged = true; |
345 | } | 345 | } |
346 | 346 | sceneObject.AggregateDeepPerms(); | |
347 | return ret; | 347 | return ret; |
348 | } | 348 | } |
349 | 349 | ||
@@ -1358,7 +1358,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1358 | SceneObjectGroup grp = part.ParentGroup; | 1358 | SceneObjectGroup grp = part.ParentGroup; |
1359 | if (grp != null) | 1359 | if (grp != null) |
1360 | { | 1360 | { |
1361 | if (m_parentScene.Permissions.CanEditObject(grp.UUID, remoteClient.AgentId)) | 1361 | if (m_parentScene.Permissions.CanEditObject(grp, remoteClient)) |
1362 | { | 1362 | { |
1363 | // These two are exceptions SL makes in the interpretation | 1363 | // These two are exceptions SL makes in the interpretation |
1364 | // of the change flags. Must check them here because otherwise | 1364 | // of the change flags. Must check them here because otherwise |
@@ -1379,7 +1379,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1379 | if ((data.change & (ObjectChangeType.Position | ObjectChangeType.Rotation)) != 0) | 1379 | if ((data.change & (ObjectChangeType.Position | ObjectChangeType.Rotation)) != 0) |
1380 | { | 1380 | { |
1381 | // Are we allowed to move it? | 1381 | // Are we allowed to move it? |
1382 | if (m_parentScene.Permissions.CanMoveObject(grp.UUID, remoteClient.AgentId)) | 1382 | if (m_parentScene.Permissions.CanMoveObject(grp, remoteClient)) |
1383 | { | 1383 | { |
1384 | // Strip all but move and rotation from request | 1384 | // Strip all but move and rotation from request |
1385 | data.change &= (ObjectChangeType.Group | ObjectChangeType.Position | ObjectChangeType.Rotation); | 1385 | data.change &= (ObjectChangeType.Group | ObjectChangeType.Position | ObjectChangeType.Rotation); |
@@ -1406,7 +1406,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1406 | 1406 | ||
1407 | if (part != null) | 1407 | if (part != null) |
1408 | { | 1408 | { |
1409 | if (m_parentScene.Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)) | 1409 | if (m_parentScene.Permissions.CanEditObject(part.ParentGroup, remoteClient)) |
1410 | { | 1410 | { |
1411 | bool physbuild = false; | 1411 | bool physbuild = false; |
1412 | if (part.ParentGroup.RootPart.PhysActor != null) | 1412 | if (part.ParentGroup.RootPart.PhysActor != null) |
@@ -1428,7 +1428,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1428 | SceneObjectGroup group = GetGroupByPrim(localID); | 1428 | SceneObjectGroup group = GetGroupByPrim(localID); |
1429 | if (group != null) | 1429 | if (group != null) |
1430 | { | 1430 | { |
1431 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1431 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1432 | { | 1432 | { |
1433 | bool physbuild = false; | 1433 | bool physbuild = false; |
1434 | if (group.RootPart.PhysActor != null) | 1434 | if (group.RootPart.PhysActor != null) |
@@ -1474,7 +1474,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1474 | SceneObjectGroup group = GetGroupByPrim(localID); | 1474 | SceneObjectGroup group = GetGroupByPrim(localID); |
1475 | if (group != null) | 1475 | if (group != null) |
1476 | { | 1476 | { |
1477 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1477 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1478 | { | 1478 | { |
1479 | group.UpdateSingleRotation(rot, localID); | 1479 | group.UpdateSingleRotation(rot, localID); |
1480 | } | 1480 | } |
@@ -1492,7 +1492,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1492 | SceneObjectGroup group = GetGroupByPrim(localID); | 1492 | SceneObjectGroup group = GetGroupByPrim(localID); |
1493 | if (group != null) | 1493 | if (group != null) |
1494 | { | 1494 | { |
1495 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1495 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1496 | { | 1496 | { |
1497 | group.UpdateSingleRotation(rot, pos, localID); | 1497 | group.UpdateSingleRotation(rot, pos, localID); |
1498 | } | 1498 | } |
@@ -1510,7 +1510,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1510 | SceneObjectGroup group = GetGroupByPrim(localID); | 1510 | SceneObjectGroup group = GetGroupByPrim(localID); |
1511 | if (group != null) | 1511 | if (group != null) |
1512 | { | 1512 | { |
1513 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1513 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1514 | { | 1514 | { |
1515 | group.UpdateGroupRotationR(rot); | 1515 | group.UpdateGroupRotationR(rot); |
1516 | } | 1516 | } |
@@ -1529,7 +1529,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1529 | SceneObjectGroup group = GetGroupByPrim(localID); | 1529 | SceneObjectGroup group = GetGroupByPrim(localID); |
1530 | if (group != null) | 1530 | if (group != null) |
1531 | { | 1531 | { |
1532 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1532 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1533 | { | 1533 | { |
1534 | group.UpdateGroupRotationPR(pos, rot); | 1534 | group.UpdateGroupRotationPR(pos, rot); |
1535 | } | 1535 | } |
@@ -1547,7 +1547,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1547 | SceneObjectGroup group = GetGroupByPrim(localID); | 1547 | SceneObjectGroup group = GetGroupByPrim(localID); |
1548 | if (group != null) | 1548 | if (group != null) |
1549 | { | 1549 | { |
1550 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment) | 1550 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient) || group.IsAttachment) |
1551 | { | 1551 | { |
1552 | group.UpdateSinglePosition(pos, localID); | 1552 | group.UpdateSinglePosition(pos, localID); |
1553 | } | 1553 | } |
@@ -1562,17 +1562,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1562 | /// <param name="remoteClient"></param> | 1562 | /// <param name="remoteClient"></param> |
1563 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, IClientAPI remoteClient) | 1563 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, IClientAPI remoteClient) |
1564 | { | 1564 | { |
1565 | UpdatePrimGroupPosition(localId, pos, remoteClient.AgentId); | ||
1566 | } | ||
1567 | |||
1568 | /// <summary> | ||
1569 | /// Update the position of the given group. | ||
1570 | /// </summary> | ||
1571 | /// <param name="localId"></param> | ||
1572 | /// <param name="pos"></param> | ||
1573 | /// <param name="updatingAgentId"></param> | ||
1574 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, UUID updatingAgentId) | ||
1575 | { | ||
1576 | SceneObjectGroup group = GetGroupByPrim(localId); | 1565 | SceneObjectGroup group = GetGroupByPrim(localId); |
1577 | 1566 | ||
1578 | if (group != null) | 1567 | if (group != null) |
@@ -1580,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1580 | if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) | 1569 | if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) |
1581 | { | 1570 | { |
1582 | // Set the new attachment point data in the object | 1571 | // Set the new attachment point data in the object |
1583 | byte attachmentPoint = group.GetAttachmentPoint(); | 1572 | byte attachmentPoint = (byte)group.AttachmentPoint; |
1584 | group.UpdateGroupPosition(pos); | 1573 | group.UpdateGroupPosition(pos); |
1585 | group.IsAttachment = false; | 1574 | group.IsAttachment = false; |
1586 | group.AbsolutePosition = group.RootPart.AttachedPos; | 1575 | group.AbsolutePosition = group.RootPart.AttachedPos; |
@@ -1589,8 +1578,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1589 | } | 1578 | } |
1590 | else | 1579 | else |
1591 | { | 1580 | { |
1592 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, updatingAgentId) | 1581 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient) |
1593 | && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) | 1582 | && m_parentScene.Permissions.CanObjectEntry(group, false, pos)) |
1594 | { | 1583 | { |
1595 | group.UpdateGroupPosition(pos); | 1584 | group.UpdateGroupPosition(pos); |
1596 | } | 1585 | } |
@@ -1614,7 +1603,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1614 | 1603 | ||
1615 | if (group != null) | 1604 | if (group != null) |
1616 | { | 1605 | { |
1617 | if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId)) | 1606 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1618 | { | 1607 | { |
1619 | group.UpdateTextureEntry(localID, texture); | 1608 | group.UpdateTextureEntry(localID, texture); |
1620 | } | 1609 | } |
@@ -1638,7 +1627,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1638 | SceneObjectGroup group = GetGroupByPrim(localID); | 1627 | SceneObjectGroup group = GetGroupByPrim(localID); |
1639 | if (group != null) | 1628 | if (group != null) |
1640 | { | 1629 | { |
1641 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1630 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1642 | { | 1631 | { |
1643 | // VolumeDetect can't be set via UI and will always be off when a change is made there | 1632 | // VolumeDetect can't be set via UI and will always be off when a change is made there |
1644 | // now only change volume dtc if phantom off | 1633 | // now only change volume dtc if phantom off |
@@ -1685,7 +1674,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1685 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 1674 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
1686 | if (group != null) | 1675 | if (group != null) |
1687 | { | 1676 | { |
1688 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1677 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1689 | { | 1678 | { |
1690 | group.SetPartName(Util.CleanString(name), primLocalID); | 1679 | group.SetPartName(Util.CleanString(name), primLocalID); |
1691 | group.HasGroupChanged = true; | 1680 | group.HasGroupChanged = true; |
@@ -1703,7 +1692,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1703 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 1692 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
1704 | if (group != null) | 1693 | if (group != null) |
1705 | { | 1694 | { |
1706 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1695 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1707 | { | 1696 | { |
1708 | group.SetPartDescription(Util.CleanString(description), primLocalID); | 1697 | group.SetPartDescription(Util.CleanString(description), primLocalID); |
1709 | group.HasGroupChanged = true; | 1698 | group.HasGroupChanged = true; |
@@ -1725,7 +1714,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1725 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 1714 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
1726 | if (group != null) | 1715 | if (group != null) |
1727 | { | 1716 | { |
1728 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1717 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1729 | { | 1718 | { |
1730 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); | 1719 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); |
1731 | if (part != null) | 1720 | if (part != null) |
@@ -1742,7 +1731,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1742 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 1731 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
1743 | if (group != null) | 1732 | if (group != null) |
1744 | { | 1733 | { |
1745 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1734 | if (m_parentScene.Permissions.CanEditObject(group, remoteClient)) |
1746 | { | 1735 | { |
1747 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); | 1736 | SceneObjectPart part = m_parentScene.GetSceneObjectPart(primLocalID); |
1748 | if (part != null) | 1737 | if (part != null) |
@@ -2025,27 +2014,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2025 | 2014 | ||
2026 | protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) | 2015 | protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) |
2027 | { | 2016 | { |
2028 | UUID user = remoteClient.AgentId; | 2017 | SceneObjectGroup sog = GetGroupByPrim(localID); |
2029 | UUID objid = UUID.Zero; | 2018 | if(sog == null) |
2030 | SceneObjectPart obj = null; | 2019 | return; |
2031 | |||
2032 | EntityBase[] entityList = GetEntities(); | ||
2033 | foreach (EntityBase ent in entityList) | ||
2034 | { | ||
2035 | if (ent is SceneObjectGroup) | ||
2036 | { | ||
2037 | SceneObjectGroup sog = ent as SceneObjectGroup; | ||
2038 | |||
2039 | foreach (SceneObjectPart part in sog.Parts) | ||
2040 | { | ||
2041 | if (part.LocalId == localID) | ||
2042 | { | ||
2043 | objid = part.UUID; | ||
2044 | obj = part; | ||
2045 | } | ||
2046 | } | ||
2047 | } | ||
2048 | } | ||
2049 | 2020 | ||
2050 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints | 2021 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints |
2051 | //aka ObjectFlags.JointWheel = IncludeInSearch | 2022 | //aka ObjectFlags.JointWheel = IncludeInSearch |
@@ -2062,15 +2033,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2062 | // libomv will complain about PrimFlags.JointWheel being | 2033 | // libomv will complain about PrimFlags.JointWheel being |
2063 | // deprecated, so we | 2034 | // deprecated, so we |
2064 | #pragma warning disable 0612 | 2035 | #pragma warning disable 0612 |
2065 | if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(objid, user)) | 2036 | if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(sog, remoteClient)) |
2066 | { | 2037 | { |
2067 | obj.ParentGroup.RootPart.AddFlag(PrimFlags.JointWheel); | 2038 | sog.RootPart.AddFlag(PrimFlags.JointWheel); |
2068 | obj.ParentGroup.HasGroupChanged = true; | 2039 | sog.HasGroupChanged = true; |
2069 | } | 2040 | } |
2070 | else if (!IncludeInSearch && m_parentScene.Permissions.CanMoveObject(objid,user)) | 2041 | else if (!IncludeInSearch && m_parentScene.Permissions.CanMoveObject(sog, remoteClient)) |
2071 | { | 2042 | { |
2072 | obj.ParentGroup.RootPart.RemFlag(PrimFlags.JointWheel); | 2043 | sog.RootPart.RemFlag(PrimFlags.JointWheel); |
2073 | obj.ParentGroup.HasGroupChanged = true; | 2044 | sog.HasGroupChanged = true; |
2074 | } | 2045 | } |
2075 | #pragma warning restore 0612 | 2046 | #pragma warning restore 0612 |
2076 | } | 2047 | } |
@@ -2086,7 +2057,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2086 | /// <param name="rot"></param> | 2057 | /// <param name="rot"></param> |
2087 | /// <returns>null if duplication fails, otherwise the duplicated object</returns> | 2058 | /// <returns>null if duplication fails, otherwise the duplicated object</returns> |
2088 | /// <summary> | 2059 | /// <summary> |
2089 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) | 2060 | public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, UUID AgentID, UUID GroupID, Quaternion rot, bool createSelected) |
2090 | { | 2061 | { |
2091 | // m_log.DebugFormat( | 2062 | // m_log.DebugFormat( |
2092 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", | 2063 | // "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", |
@@ -2095,27 +2066,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2095 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); | 2066 | SceneObjectGroup original = GetGroupByPrim(originalPrimID); |
2096 | if (original != null) | 2067 | if (original != null) |
2097 | { | 2068 | { |
2098 | if (m_parentScene.Permissions.CanDuplicateObject( | 2069 | if (m_parentScene.Permissions.CanDuplicateObject(original, AgentID)) |
2099 | original.PrimCount, original.UUID, AgentID, original.AbsolutePosition)) | ||
2100 | { | 2070 | { |
2101 | SceneObjectGroup copy = original.Copy(true); | 2071 | SceneObjectGroup copy = original.Copy(true); |
2102 | copy.AbsolutePosition = copy.AbsolutePosition + offset; | 2072 | copy.AbsolutePosition = copy.AbsolutePosition + offset; |
2103 | 2073 | ||
2074 | SceneObjectPart[] parts = copy.Parts; | ||
2075 | |||
2076 | m_numTotalPrim += parts.Length; | ||
2077 | |||
2104 | if (original.OwnerID != AgentID) | 2078 | if (original.OwnerID != AgentID) |
2105 | { | 2079 | { |
2106 | copy.SetOwnerId(AgentID); | 2080 | copy.SetOwner(AgentID, GroupID); |
2107 | copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID); | ||
2108 | |||
2109 | SceneObjectPart[] partList = copy.Parts; | ||
2110 | 2081 | ||
2111 | if (m_parentScene.Permissions.PropagatePermissions()) | 2082 | if (m_parentScene.Permissions.PropagatePermissions()) |
2112 | { | 2083 | { |
2113 | foreach (SceneObjectPart child in partList) | 2084 | foreach (SceneObjectPart child in parts) |
2114 | { | 2085 | { |
2115 | child.Inventory.ChangeInventoryOwner(AgentID); | 2086 | child.Inventory.ChangeInventoryOwner(AgentID); |
2116 | child.TriggerScriptChangedEvent(Changed.OWNER); | 2087 | child.TriggerScriptChangedEvent(Changed.OWNER); |
2117 | child.ApplyNextOwnerPermissions(); | 2088 | child.ApplyNextOwnerPermissions(); |
2118 | } | 2089 | } |
2090 | copy.AggregatePerms(); | ||
2119 | } | 2091 | } |
2120 | } | 2092 | } |
2121 | 2093 | ||
@@ -2125,10 +2097,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2125 | lock (SceneObjectGroupsByFullID) | 2097 | lock (SceneObjectGroupsByFullID) |
2126 | SceneObjectGroupsByFullID[copy.UUID] = copy; | 2098 | SceneObjectGroupsByFullID[copy.UUID] = copy; |
2127 | 2099 | ||
2128 | SceneObjectPart[] parts = copy.Parts; | ||
2129 | |||
2130 | m_numTotalPrim += parts.Length; | ||
2131 | |||
2132 | foreach (SceneObjectPart part in parts) | 2100 | foreach (SceneObjectPart part in parts) |
2133 | { | 2101 | { |
2134 | if (part.GetPrimType() == PrimType.SCULPT) | 2102 | if (part.GetPrimType() == PrimType.SCULPT) |
@@ -2144,28 +2112,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
2144 | 2112 | ||
2145 | // PROBABLE END OF FIXME | 2113 | // PROBABLE END OF FIXME |
2146 | 2114 | ||
2147 | // Since we copy from a source group that is in selected | 2115 | copy.IsSelected = createSelected; |
2148 | // state, but the copy is shown deselected in the viewer, | ||
2149 | // We need to clear the selection flag here, else that | ||
2150 | // prim never gets persisted at all. The client doesn't | ||
2151 | // think it's selected, so it will never send a deselect... | ||
2152 | copy.IsSelected = false; | ||
2153 | |||
2154 | m_numPrim += copy.Parts.Length; | ||
2155 | 2116 | ||
2156 | if (rot != Quaternion.Identity) | 2117 | if (rot != Quaternion.Identity) |
2157 | { | ||
2158 | copy.UpdateGroupRotationR(rot); | 2118 | copy.UpdateGroupRotationR(rot); |
2159 | } | 2119 | |
2120 | // required for physics to update it's position | ||
2121 | copy.ResetChildPrimPhysicsPositions(); | ||
2160 | 2122 | ||
2161 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1); | 2123 | copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1); |
2162 | copy.HasGroupChanged = true; | ||
2163 | copy.ScheduleGroupForFullUpdate(); | ||
2164 | copy.ResumeScripts(); | 2124 | copy.ResumeScripts(); |
2165 | 2125 | ||
2166 | // required for physics to update it's position | 2126 | copy.HasGroupChanged = true; |
2167 | copy.AbsolutePosition = copy.AbsolutePosition; | 2127 | copy.ScheduleGroupForFullUpdate(); |
2168 | |||
2169 | return copy; | 2128 | return copy; |
2170 | } | 2129 | } |
2171 | } | 2130 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 9f98554..12e53a8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
111 | /// <param name="item">The user inventory item being added.</param> | 111 | /// <param name="item">The user inventory item being added.</param> |
112 | /// <param name="copyItemID">The item UUID that should be used by the new item.</param> | 112 | /// <param name="copyItemID">The item UUID that should be used by the new item.</param> |
113 | /// <returns></returns> | 113 | /// <returns></returns> |
114 | public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID) | 114 | public bool AddInventoryItem(UUID agentID, uint localID, InventoryItemBase item, UUID copyItemID, bool withModRights = true) |
115 | { | 115 | { |
116 | // m_log.DebugFormat( | 116 | // m_log.DebugFormat( |
117 | // "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", | 117 | // "[PRIM INVENTORY]: Adding inventory item {0} from {1} to part with local ID {2}", |
@@ -120,69 +120,72 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; | 120 | UUID newItemId = (copyItemID != UUID.Zero) ? copyItemID : item.ID; |
121 | 121 | ||
122 | SceneObjectPart part = GetPart(localID); | 122 | SceneObjectPart part = GetPart(localID); |
123 | if (part != null) | 123 | if (part == null) |
124 | { | 124 | { |
125 | TaskInventoryItem taskItem = new TaskInventoryItem(); | 125 | m_log.ErrorFormat( |
126 | 126 | "[PRIM INVENTORY]: " + | |
127 | taskItem.ItemID = newItemId; | 127 | "Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}", |
128 | taskItem.AssetID = item.AssetID; | 128 | localID, Name, UUID, newItemId); |
129 | taskItem.Name = item.Name; | 129 | return false; |
130 | taskItem.Description = item.Description; | 130 | } |
131 | taskItem.OwnerID = part.OwnerID; // Transfer ownership | 131 | |
132 | taskItem.CreatorID = item.CreatorIdAsUuid; | 132 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
133 | taskItem.Type = item.AssetType; | ||
134 | taskItem.InvType = item.InvType; | ||
135 | |||
136 | if (agentID != part.OwnerID && m_scene.Permissions.PropagatePermissions()) | ||
137 | { | ||
138 | taskItem.BasePermissions = item.BasePermissions & | ||
139 | item.NextPermissions; | ||
140 | taskItem.CurrentPermissions = item.CurrentPermissions & | ||
141 | item.NextPermissions; | ||
142 | taskItem.EveryonePermissions = item.EveryOnePermissions & | ||
143 | item.NextPermissions; | ||
144 | taskItem.GroupPermissions = item.GroupPermissions & | ||
145 | item.NextPermissions; | ||
146 | taskItem.NextPermissions = item.NextPermissions; | ||
147 | // We're adding this to a prim we don't own. Force | ||
148 | // owner change | ||
149 | taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | ||
150 | } | ||
151 | else | ||
152 | { | ||
153 | taskItem.BasePermissions = item.BasePermissions; | ||
154 | taskItem.CurrentPermissions = item.CurrentPermissions; | ||
155 | taskItem.EveryonePermissions = item.EveryOnePermissions; | ||
156 | taskItem.GroupPermissions = item.GroupPermissions; | ||
157 | taskItem.NextPermissions = item.NextPermissions; | ||
158 | } | ||
159 | 133 | ||
160 | taskItem.Flags = item.Flags; | 134 | taskItem.ItemID = newItemId; |
135 | taskItem.AssetID = item.AssetID; | ||
136 | taskItem.Name = item.Name; | ||
137 | taskItem.Description = item.Description; | ||
138 | taskItem.OwnerID = part.OwnerID; // Transfer ownership | ||
139 | taskItem.CreatorID = item.CreatorIdAsUuid; | ||
140 | taskItem.Type = item.AssetType; | ||
141 | taskItem.InvType = item.InvType; | ||
142 | |||
143 | if (agentID != part.OwnerID && m_scene.Permissions.PropagatePermissions()) | ||
144 | { | ||
145 | taskItem.BasePermissions = item.BasePermissions & | ||
146 | item.NextPermissions; | ||
147 | taskItem.CurrentPermissions = item.CurrentPermissions & | ||
148 | item.NextPermissions; | ||
149 | taskItem.EveryonePermissions = item.EveryOnePermissions & | ||
150 | item.NextPermissions; | ||
151 | taskItem.GroupPermissions = item.GroupPermissions & | ||
152 | item.NextPermissions; | ||
153 | taskItem.NextPermissions = item.NextPermissions; | ||
154 | // We're adding this to a prim we don't own. Force | ||
155 | // owner change | ||
156 | taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; | ||
157 | |||
158 | } | ||
159 | else | ||
160 | { | ||
161 | taskItem.BasePermissions = item.BasePermissions; | ||
162 | taskItem.CurrentPermissions = item.CurrentPermissions; | ||
163 | taskItem.EveryonePermissions = item.EveryOnePermissions; | ||
164 | taskItem.GroupPermissions = item.GroupPermissions; | ||
165 | taskItem.NextPermissions = item.NextPermissions; | ||
166 | } | ||
167 | |||
168 | taskItem.Flags = item.Flags; | ||
161 | 169 | ||
162 | // m_log.DebugFormat( | 170 | // m_log.DebugFormat( |
163 | // "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}", | 171 | // "[PRIM INVENTORY]: Flags are 0x{0:X} for item {1} added to part {2} by {3}", |
164 | // taskItem.Flags, taskItem.Name, localID, remoteClient.Name); | 172 | // taskItem.Flags, taskItem.Name, localID, remoteClient.Name); |
165 | 173 | ||
166 | // TODO: These are pending addition of those fields to TaskInventoryItem | 174 | // TODO: These are pending addition of those fields to TaskInventoryItem |
167 | // taskItem.SalePrice = item.SalePrice; | 175 | // taskItem.SalePrice = item.SalePrice; |
168 | // taskItem.SaleType = item.SaleType; | 176 | // taskItem.SaleType = item.SaleType; |
169 | taskItem.CreationDate = (uint)item.CreationDate; | 177 | taskItem.CreationDate = (uint)item.CreationDate; |
170 | 178 | ||
171 | bool addFromAllowedDrop = agentID != part.OwnerID; | 179 | bool addFromAllowedDrop; |
172 | 180 | if(withModRights) | |
173 | part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop); | 181 | addFromAllowedDrop = false; |
174 | |||
175 | return true; | ||
176 | } | ||
177 | else | 182 | else |
178 | { | 183 | addFromAllowedDrop = (part.ParentGroup.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0; |
179 | m_log.ErrorFormat( | 184 | |
180 | "[PRIM INVENTORY]: " + | 185 | part.Inventory.AddInventoryItem(taskItem, addFromAllowedDrop); |
181 | "Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}", | 186 | part.ParentGroup.AggregatePerms(); |
182 | localID, Name, UUID, newItemId); | 187 | return true; |
183 | } | ||
184 | 188 | ||
185 | return false; | ||
186 | } | 189 | } |
187 | 190 | ||
188 | /// <summary> | 191 | /// <summary> |
@@ -248,6 +251,194 @@ namespace OpenSim.Region.Framework.Scenes | |||
248 | return -1; | 251 | return -1; |
249 | } | 252 | } |
250 | 253 | ||
254 | // new test code, to place in better place later | ||
255 | private object PermissionsLock = new object(); | ||
256 | |||
257 | private uint m_EffectiveEveryOnePerms; | ||
258 | public uint EffectiveEveryOnePerms | ||
259 | { | ||
260 | get | ||
261 | { | ||
262 | // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc) | ||
263 | // bc this is on heavy duty code paths | ||
264 | // but for now we need to test the concept | ||
265 | // AggregateDeepPerms(); | ||
266 | return m_EffectiveEveryOnePerms; | ||
267 | } | ||
268 | } | ||
269 | |||
270 | private uint m_EffectiveGroupPerms; | ||
271 | public uint EffectiveGroupPerms | ||
272 | { | ||
273 | get | ||
274 | { | ||
275 | // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc) | ||
276 | // bc this is on heavy duty code paths | ||
277 | // but for now we need to test the concept | ||
278 | // AggregateDeepPerms(); | ||
279 | return m_EffectiveGroupPerms; | ||
280 | } | ||
281 | } | ||
282 | |||
283 | private uint m_EffectiveGroupOrEveryOnePerms; | ||
284 | public uint EffectiveGroupOrEveryOnePerms | ||
285 | { | ||
286 | get | ||
287 | { | ||
288 | // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc) | ||
289 | // bc this is on heavy duty code paths | ||
290 | // but for now we need to test the concept | ||
291 | // AggregateDeepPerms(); | ||
292 | return m_EffectiveGroupOrEveryOnePerms; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | private uint m_EffectiveOwnerPerms; | ||
297 | public uint EffectiveOwnerPerms | ||
298 | { | ||
299 | get | ||
300 | { | ||
301 | // this can't be done here but on every place where a change may happen (rez, (de)link, contents , perms, etc) | ||
302 | // bc this is on heavy duty code paths | ||
303 | // but for now we need to test the concept | ||
304 | // AggregateDeepPerms(); | ||
305 | return m_EffectiveOwnerPerms; | ||
306 | } | ||
307 | } | ||
308 | |||
309 | // aggregates perms scanning parts and their contents | ||
310 | // AggregatePerms does same using cached parts content perms | ||
311 | public void AggregateDeepPerms() | ||
312 | { | ||
313 | lock(PermissionsLock) | ||
314 | { | ||
315 | // aux | ||
316 | const uint allmask = (uint)PermissionMask.AllEffective; | ||
317 | const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify); | ||
318 | const uint copytransfermast = (uint)(PermissionMask.Copy | PermissionMask.Transfer); | ||
319 | |||
320 | uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move; | ||
321 | bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0; | ||
322 | |||
323 | uint rootOwnerPerms = RootPart.OwnerMask; | ||
324 | uint owner = rootOwnerPerms; | ||
325 | uint rootGroupPerms = RootPart.GroupMask; | ||
326 | uint group = rootGroupPerms; | ||
327 | uint rootEveryonePerms = RootPart.EveryoneMask; | ||
328 | uint everyone = rootEveryonePerms; | ||
329 | |||
330 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
331 | for (int i = 0; i < parts.Length; i++) | ||
332 | { | ||
333 | SceneObjectPart part = parts[i]; | ||
334 | part.AggregateInnerPerms(); | ||
335 | owner &= part.AggregatedInnerOwnerPerms; | ||
336 | group &= part.AggregatedInnerGroupPerms; | ||
337 | everyone &= part.AggregatedInnerEveryonePerms; | ||
338 | } | ||
339 | // recover modify and move | ||
340 | rootOwnerPerms &= movemodmask; | ||
341 | owner |= rootOwnerPerms; | ||
342 | if((owner & copytransfermast) == 0) | ||
343 | owner |= (uint)PermissionMask.Transfer; | ||
344 | |||
345 | owner &= basePerms; | ||
346 | m_EffectiveOwnerPerms = owner; | ||
347 | uint ownertransfermask = owner & (uint)PermissionMask.Transfer; | ||
348 | |||
349 | // recover modify and move | ||
350 | rootGroupPerms &= movemodmask; | ||
351 | group |= rootGroupPerms; | ||
352 | if(noBaseTransfer) | ||
353 | group &=~(uint)PermissionMask.Copy; | ||
354 | else | ||
355 | group |= ownertransfermask; | ||
356 | |||
357 | uint groupOrEveryone = group; | ||
358 | m_EffectiveGroupPerms = group & owner; | ||
359 | |||
360 | // recover move | ||
361 | rootEveryonePerms &= (uint)PermissionMask.Move; | ||
362 | everyone |= rootEveryonePerms; | ||
363 | everyone &= ~(uint)PermissionMask.Modify; | ||
364 | if(noBaseTransfer) | ||
365 | everyone &=~(uint)PermissionMask.Copy; | ||
366 | else | ||
367 | everyone |= ownertransfermask; | ||
368 | |||
369 | groupOrEveryone |= everyone; | ||
370 | |||
371 | m_EffectiveEveryOnePerms = everyone & owner; | ||
372 | m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner; | ||
373 | } | ||
374 | } | ||
375 | |||
376 | // aggregates perms scanning parts, assuming their contents was already aggregated and cached | ||
377 | // ie is AggregateDeepPerms without the part.AggregateInnerPerms() call on parts loop | ||
378 | public void AggregatePerms() | ||
379 | { | ||
380 | lock(PermissionsLock) | ||
381 | { | ||
382 | // aux | ||
383 | const uint allmask = (uint)PermissionMask.AllEffective; | ||
384 | const uint movemodmask = (uint)(PermissionMask.Move | PermissionMask.Modify); | ||
385 | const uint copytransfermast = (uint)(PermissionMask.Copy | PermissionMask.Transfer); | ||
386 | |||
387 | uint basePerms = (RootPart.BaseMask & allmask) | (uint)PermissionMask.Move; | ||
388 | bool noBaseTransfer = (basePerms & (uint)PermissionMask.Transfer) == 0; | ||
389 | |||
390 | uint rootOwnerPerms = RootPart.OwnerMask; | ||
391 | uint owner = rootOwnerPerms; | ||
392 | uint rootGroupPerms = RootPart.GroupMask; | ||
393 | uint group = rootGroupPerms; | ||
394 | uint rootEveryonePerms = RootPart.EveryoneMask; | ||
395 | uint everyone = rootEveryonePerms; | ||
396 | |||
397 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
398 | for (int i = 0; i < parts.Length; i++) | ||
399 | { | ||
400 | SceneObjectPart part = parts[i]; | ||
401 | owner &= part.AggregatedInnerOwnerPerms; | ||
402 | group &= part.AggregatedInnerGroupPerms; | ||
403 | everyone &= part.AggregatedInnerEveryonePerms; | ||
404 | } | ||
405 | // recover modify and move | ||
406 | rootOwnerPerms &= movemodmask; | ||
407 | owner |= rootOwnerPerms; | ||
408 | if((owner & copytransfermast) == 0) | ||
409 | owner |= (uint)PermissionMask.Transfer; | ||
410 | |||
411 | owner &= basePerms; | ||
412 | m_EffectiveOwnerPerms = owner; | ||
413 | uint ownertransfermask = owner & (uint)PermissionMask.Transfer; | ||
414 | |||
415 | // recover modify and move | ||
416 | rootGroupPerms &= movemodmask; | ||
417 | group |= rootGroupPerms; | ||
418 | if(noBaseTransfer) | ||
419 | group &=~(uint)PermissionMask.Copy; | ||
420 | else | ||
421 | group |= ownertransfermask; | ||
422 | |||
423 | uint groupOrEveryone = group; | ||
424 | m_EffectiveGroupPerms = group & owner; | ||
425 | |||
426 | // recover move | ||
427 | rootEveryonePerms &= (uint)PermissionMask.Move; | ||
428 | everyone |= rootEveryonePerms; | ||
429 | everyone &= ~(uint)PermissionMask.Modify; | ||
430 | if(noBaseTransfer) | ||
431 | everyone &=~(uint)PermissionMask.Copy; | ||
432 | else | ||
433 | everyone |= ownertransfermask; | ||
434 | |||
435 | groupOrEveryone |= everyone; | ||
436 | |||
437 | m_EffectiveEveryOnePerms = everyone & owner; | ||
438 | m_EffectiveGroupOrEveryOnePerms = groupOrEveryone & owner; | ||
439 | } | ||
440 | } | ||
441 | |||
251 | public uint GetEffectivePermissions() | 442 | public uint GetEffectivePermissions() |
252 | { | 443 | { |
253 | return GetEffectivePermissions(false); | 444 | return GetEffectivePermissions(false); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3f531be..45196bb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
645 | localIDs.Add(sog.RootPart.LocalId); | 645 | localIDs.Add(sog.RootPart.LocalId); |
646 | sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition, | 646 | sogScene.AddReturn(sog.OwnerID, sog.Name, sog.AbsolutePosition, |
647 | "Returned at region cross"); | 647 | "Returned at region cross"); |
648 | sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero); | 648 | sogScene.DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, UUID.Zero, false); |
649 | } | 649 | } |
650 | catch (Exception) | 650 | catch (Exception) |
651 | { | 651 | { |
@@ -1783,63 +1783,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1783 | } | 1783 | } |
1784 | } | 1784 | } |
1785 | 1785 | ||
1786 | /// <summary> | ||
1787 | /// Attach this scene object to the given avatar. | ||
1788 | /// </summary> | ||
1789 | /// <param name="agentID"></param> | ||
1790 | /// <param name="attachmentpoint"></param> | ||
1791 | /// <param name="AttachOffset"></param> | ||
1792 | private void AttachToAgent( | ||
1793 | ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 attachOffset, bool silent) | ||
1794 | { | ||
1795 | if (avatar != null) | ||
1796 | { | ||
1797 | // don't attach attachments to child agents | ||
1798 | if (avatar.IsChildAgent) return; | ||
1799 | |||
1800 | // Remove from database and parcel prim count | ||
1801 | m_scene.DeleteFromStorage(so.UUID); | ||
1802 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | ||
1803 | |||
1804 | so.AttachedAvatar = avatar.UUID; | ||
1805 | |||
1806 | if (so.RootPart.PhysActor != null) | ||
1807 | { | ||
1808 | m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor); | ||
1809 | so.RootPart.PhysActor = null; | ||
1810 | } | ||
1811 | |||
1812 | so.AbsolutePosition = attachOffset; | ||
1813 | so.RootPart.AttachedPos = attachOffset; | ||
1814 | so.IsAttachment = true; | ||
1815 | so.RootPart.SetParentLocalId(avatar.LocalId); | ||
1816 | so.AttachmentPoint = attachmentpoint; | ||
1817 | |||
1818 | avatar.AddAttachment(this); | ||
1819 | |||
1820 | if (!silent) | ||
1821 | { | ||
1822 | // Killing it here will cause the client to deselect it | ||
1823 | // It then reappears on the avatar, deselected | ||
1824 | // through the full update below | ||
1825 | // | ||
1826 | if (IsSelected) | ||
1827 | { | ||
1828 | m_scene.SendKillObject(new List<uint> { m_rootPart.LocalId }); | ||
1829 | } | ||
1830 | |||
1831 | IsSelected = false; // fudge.... | ||
1832 | ScheduleGroupForFullUpdate(); | ||
1833 | } | ||
1834 | } | ||
1835 | else | ||
1836 | { | ||
1837 | m_log.WarnFormat( | ||
1838 | "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present", | ||
1839 | UUID, avatar.ControllingClient.AgentId, Scene.RegionInfo.RegionName); | ||
1840 | } | ||
1841 | } | ||
1842 | |||
1843 | public byte GetAttachmentPoint() | 1786 | public byte GetAttachmentPoint() |
1844 | { | 1787 | { |
1845 | return m_rootPart.Shape.State; | 1788 | return m_rootPart.Shape.State; |
@@ -2311,7 +2254,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2311 | RootPart.UUID); | 2254 | RootPart.UUID); |
2312 | m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); | 2255 | m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn"); |
2313 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, | 2256 | m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero, |
2314 | DeRezAction.Return, UUID.Zero); | 2257 | DeRezAction.Return, UUID.Zero, false); |
2315 | 2258 | ||
2316 | return; | 2259 | return; |
2317 | } | 2260 | } |
@@ -2441,17 +2384,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2441 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); | 2384 | dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); |
2442 | dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; | 2385 | dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; |
2443 | 2386 | ||
2444 | |||
2445 | if (userExposed) | 2387 | if (userExposed) |
2446 | dupe.m_rootPart.TrimPermissions(); | 2388 | dupe.m_rootPart.TrimPermissions(); |
2447 | 2389 | ||
2448 | List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.GetArray()); | 2390 | List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.GetArray()); |
2449 | 2391 | ||
2450 | partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2) | 2392 | partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2) |
2451 | { | 2393 | { |
2452 | return p1.LinkNum.CompareTo(p2.LinkNum); | 2394 | return p1.LinkNum.CompareTo(p2.LinkNum); |
2453 | } | 2395 | } |
2454 | ); | 2396 | ); |
2455 | 2397 | ||
2456 | foreach (SceneObjectPart part in partList) | 2398 | foreach (SceneObjectPart part in partList) |
2457 | { | 2399 | { |
@@ -2503,10 +2445,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2503 | if (dupe.m_rootPart.PhysActor != null) | 2445 | if (dupe.m_rootPart.PhysActor != null) |
2504 | dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building | 2446 | dupe.m_rootPart.PhysActor.Building = false; // tell physics to finish building |
2505 | 2447 | ||
2448 | dupe.AggregateDeepPerms(); | ||
2449 | |||
2506 | dupe.HasGroupChanged = true; | 2450 | dupe.HasGroupChanged = true; |
2507 | dupe.AttachToBackup(); | 2451 | dupe.AttachToBackup(); |
2508 | 2452 | ||
2509 | ScheduleGroupForFullUpdate(); | 2453 | dupe.ScheduleGroupForFullUpdate(); |
2510 | } | 2454 | } |
2511 | 2455 | ||
2512 | m_dupeInProgress = false; | 2456 | m_dupeInProgress = false; |
@@ -2744,25 +2688,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
2744 | } | 2688 | } |
2745 | 2689 | ||
2746 | /// <summary> | 2690 | /// <summary> |
2747 | /// Set the owner of the root part. | 2691 | /// Set the owner of all linkset. |
2748 | /// </summary> | 2692 | /// </summary> |
2749 | /// <param name="part"></param> | ||
2750 | /// <param name="cAgentID"></param> | 2693 | /// <param name="cAgentID"></param> |
2751 | /// <param name="cGroupID"></param> | 2694 | /// <param name="cGroupID"></param> |
2752 | public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID) | 2695 | public void SetOwner(UUID cAgentID, UUID cGroupID) |
2753 | { | 2696 | { |
2754 | part.LastOwnerID = part.OwnerID; | 2697 | SceneObjectPart rpart = RootPart; |
2755 | part.OwnerID = cAgentID; | 2698 | UUID oldowner = rpart.OwnerID; |
2756 | part.GroupID = cGroupID; | 2699 | ForEachPart(delegate(SceneObjectPart part) |
2700 | { | ||
2701 | if(part.GroupID != part.OwnerID) | ||
2702 | part.LastOwnerID = part.OwnerID; | ||
2703 | part.OwnerID = cAgentID; | ||
2704 | part.GroupID = cGroupID; | ||
2705 | }); | ||
2757 | 2706 | ||
2758 | if (part.OwnerID != cAgentID) | 2707 | if (oldowner != cAgentID) |
2759 | { | 2708 | { |
2760 | // Apply Next Owner Permissions if we're not bypassing permissions | 2709 | // Apply Next Owner Permissions if we're not bypassing permissions |
2761 | if (!m_scene.Permissions.BypassPermissions()) | 2710 | if (!m_scene.Permissions.BypassPermissions()) |
2711 | { | ||
2762 | ApplyNextOwnerPermissions(); | 2712 | ApplyNextOwnerPermissions(); |
2713 | AggregatePerms(); | ||
2714 | } | ||
2763 | } | 2715 | } |
2764 | 2716 | ||
2765 | part.ScheduleFullUpdate(); | 2717 | rpart.ScheduleFullUpdate(); |
2766 | } | 2718 | } |
2767 | 2719 | ||
2768 | /// <summary> | 2720 | /// <summary> |
@@ -3418,6 +3370,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3418 | objectGroup.HasGroupChangedDueToDelink = true; | 3370 | objectGroup.HasGroupChangedDueToDelink = true; |
3419 | 3371 | ||
3420 | InvalidBoundsRadius(); | 3372 | InvalidBoundsRadius(); |
3373 | objectGroup.AggregatePerms(); | ||
3421 | 3374 | ||
3422 | if (sendEvents) | 3375 | if (sendEvents) |
3423 | linkPart.TriggerScriptChangedEvent(Changed.LINK); | 3376 | linkPart.TriggerScriptChangedEvent(Changed.LINK); |
@@ -3956,8 +3909,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3956 | 3909 | ||
3957 | public void AdjustChildPrimPermissions(bool forceTaskInventoryPermissive) | 3910 | public void AdjustChildPrimPermissions(bool forceTaskInventoryPermissive) |
3958 | { | 3911 | { |
3959 | uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff8; // Mask folded bits | 3912 | uint newOwnerMask = (uint)(PermissionMask.All | PermissionMask.Export) & 0xfffffff0; // Mask folded bits |
3960 | uint foldedPerms = RootPart.OwnerMask & 3; | 3913 | uint foldedPerms = RootPart.OwnerMask & (uint)PermissionMask.FoldedMask; |
3961 | 3914 | ||
3962 | ForEachPart(part => | 3915 | ForEachPart(part => |
3963 | { | 3916 | { |
@@ -3968,14 +3921,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3968 | part.Inventory.ApplyGodPermissions(part.BaseMask); | 3921 | part.Inventory.ApplyGodPermissions(part.BaseMask); |
3969 | }); | 3922 | }); |
3970 | 3923 | ||
3971 | uint lockMask = ~(uint)(PermissionMask.Move | PermissionMask.Modify); | 3924 | uint lockMask = ~(uint)(PermissionMask.Move); |
3972 | uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move | PermissionMask.Modify); | 3925 | uint lockBit = RootPart.OwnerMask & (uint)(PermissionMask.Move); |
3973 | RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask); | 3926 | RootPart.OwnerMask = (RootPart.OwnerMask & lockBit) | ((newOwnerMask | foldedPerms) & lockMask); |
3974 | 3927 | ||
3975 | // m_log.DebugFormat( | 3928 | // m_log.DebugFormat( |
3976 | // "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", | 3929 | // "[SCENE OBJECT GROUP]: RootPart.OwnerMask now {0} for {1} in {2}", |
3977 | // (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name); | 3930 | // (OpenMetaverse.PermissionMask)RootPart.OwnerMask, Name, Scene.Name); |
3978 | 3931 | AggregatePerms(); | |
3979 | RootPart.ScheduleFullUpdate(); | 3932 | RootPart.ScheduleFullUpdate(); |
3980 | } | 3933 | } |
3981 | 3934 | ||
@@ -4000,6 +3953,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4000 | { | 3953 | { |
4001 | foreach (SceneObjectPart part in Parts) | 3954 | foreach (SceneObjectPart part in Parts) |
4002 | part.Inventory.ApplyGodPermissions(RootPart.BaseMask); | 3955 | part.Inventory.ApplyGodPermissions(RootPart.BaseMask); |
3956 | AggregatePerms(); | ||
4003 | } | 3957 | } |
4004 | 3958 | ||
4005 | HasGroupChanged = true; | 3959 | HasGroupChanged = true; |
@@ -4645,7 +4599,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4645 | } | 4599 | } |
4646 | if ((change & ObjectChangeType.Position) != 0) | 4600 | if ((change & ObjectChangeType.Position) != 0) |
4647 | { | 4601 | { |
4648 | if (IsAttachment || m_scene.Permissions.CanObjectEntry(group.UUID, false, data.position)) | 4602 | if (IsAttachment || m_scene.Permissions.CanObjectEntry(group, false, data.position)) |
4649 | UpdateGroupPosition(data.position); | 4603 | UpdateGroupPosition(data.position); |
4650 | updateType = updatetype.groupterse; | 4604 | updateType = updatetype.groupterse; |
4651 | } | 4605 | } |
@@ -5215,6 +5169,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5215 | { | 5169 | { |
5216 | part.ResetOwnerChangeFlag(); | 5170 | part.ResetOwnerChangeFlag(); |
5217 | }); | 5171 | }); |
5172 | AggregatePerms(); | ||
5218 | } | 5173 | } |
5219 | 5174 | ||
5220 | // clear some references to easy cg | 5175 | // clear some references to easy cg |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 557b55e..bf0e31b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -244,11 +244,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
244 | 244 | ||
245 | public uint TimeStampTerse; | 245 | public uint TimeStampTerse; |
246 | 246 | ||
247 | // The following two are to hold the attachment data | ||
248 | // while an object is inworld | ||
249 | [XmlIgnore] | ||
250 | public byte AttachPoint = 0; | ||
251 | |||
252 | [XmlIgnore] | 247 | [XmlIgnore] |
253 | public Quaternion AttachRotation = Quaternion.Identity; | 248 | public Quaternion AttachRotation = Quaternion.Identity; |
254 | 249 | ||
@@ -277,7 +272,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
277 | 272 | ||
278 | public scriptEvents AggregateScriptEvents; | 273 | public scriptEvents AggregateScriptEvents; |
279 | 274 | ||
280 | public Vector3 AttachedPos; | 275 | public Vector3 AttachedPos |
276 | { | ||
277 | get; | ||
278 | set; | ||
279 | } | ||
281 | 280 | ||
282 | // rotation locks on local X,Y and or Z axis bit flags | 281 | // rotation locks on local X,Y and or Z axis bit flags |
283 | // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum | 282 | // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum |
@@ -476,8 +475,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
476 | APIDActive = false; | 475 | APIDActive = false; |
477 | Flags = 0; | 476 | Flags = 0; |
478 | CreateSelected = true; | 477 | CreateSelected = true; |
479 | |||
480 | TrimPermissions(); | 478 | TrimPermissions(); |
479 | AggregateInnerPerms(); | ||
481 | } | 480 | } |
482 | 481 | ||
483 | #endregion Constructors | 482 | #endregion Constructors |
@@ -2228,7 +2227,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2228 | dupe.LocalId = plocalID; | 2227 | dupe.LocalId = plocalID; |
2229 | 2228 | ||
2230 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. | 2229 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. |
2231 | dupe.LastOwnerID = OwnerID; | 2230 | if(OwnerID != GroupID) |
2231 | dupe.LastOwnerID = OwnerID; | ||
2232 | else | ||
2233 | dupe.LastOwnerID = LastOwnerID; // redundant ? | ||
2234 | |||
2232 | dupe.RezzerID = RezzerID; | 2235 | dupe.RezzerID = RezzerID; |
2233 | 2236 | ||
2234 | byte[] extraP = new byte[Shape.ExtraParams.Length]; | 2237 | byte[] extraP = new byte[Shape.ExtraParams.Length]; |
@@ -2537,6 +2540,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
2537 | return (uint)Flags | (uint)LocalFlags; | 2540 | return (uint)Flags | (uint)LocalFlags; |
2538 | } | 2541 | } |
2539 | 2542 | ||
2543 | // some of this lines need be moved to other place later | ||
2544 | |||
2545 | // effective permitions considering only this part inventory contents perms | ||
2546 | public uint AggregatedInnerOwnerPerms {get; private set; } | ||
2547 | public uint AggregatedInnerGroupPerms {get; private set; } | ||
2548 | public uint AggregatedInnerEveryonePerms {get; private set; } | ||
2549 | private object InnerPermsLock = new object(); | ||
2550 | |||
2551 | public void AggregateInnerPerms() | ||
2552 | { | ||
2553 | // assuming child prims permissions masks are irrelevant on a linkset | ||
2554 | // root part is handle at SOG since its masks are the sog masks | ||
2555 | const uint mask = (uint)PermissionMask.AllEffective; | ||
2556 | |||
2557 | uint owner = mask; | ||
2558 | uint group = mask; | ||
2559 | uint everyone = mask; | ||
2560 | |||
2561 | lock(InnerPermsLock) // do we really need this? | ||
2562 | { | ||
2563 | if(Inventory != null) | ||
2564 | Inventory.AggregateInnerPerms(ref owner, ref group, ref everyone); | ||
2565 | |||
2566 | AggregatedInnerOwnerPerms = owner & mask; | ||
2567 | AggregatedInnerGroupPerms = group & mask; | ||
2568 | AggregatedInnerEveryonePerms = everyone & mask; | ||
2569 | } | ||
2570 | } | ||
2571 | |||
2540 | public Vector3 GetGeometricCenter() | 2572 | public Vector3 GetGeometricCenter() |
2541 | { | 2573 | { |
2542 | // this is not real geometric center but a average of positions relative to root prim acording to | 2574 | // this is not real geometric center but a average of positions relative to root prim acording to |
@@ -4464,7 +4496,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4464 | 4496 | ||
4465 | break; | 4497 | break; |
4466 | } | 4498 | } |
4467 | 4499 | AggregateInnerPerms(); | |
4468 | SendFullUpdateToAllClients(); | 4500 | SendFullUpdateToAllClients(); |
4469 | } | 4501 | } |
4470 | } | 4502 | } |
@@ -4481,6 +4513,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4481 | EveryoneMask = source.EveryoneMask & BaseMask; | 4513 | EveryoneMask = source.EveryoneMask & BaseMask; |
4482 | NextOwnerMask = source.NextOwnerMask & BaseMask; | 4514 | NextOwnerMask = source.NextOwnerMask & BaseMask; |
4483 | 4515 | ||
4516 | AggregateInnerPerms(); | ||
4517 | |||
4484 | if (OwnerMask != prevOwnerMask || | 4518 | if (OwnerMask != prevOwnerMask || |
4485 | GroupMask != prevGroupMask || | 4519 | GroupMask != prevGroupMask || |
4486 | EveryoneMask != prevEveryoneMask || | 4520 | EveryoneMask != prevEveryoneMask || |
@@ -5212,16 +5246,13 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5212 | 5246 | ||
5213 | if (OwnerID != item.Owner) | 5247 | if (OwnerID != item.Owner) |
5214 | { | 5248 | { |
5215 | //LogPermissions("Before ApplyNextOwnerPermissions"); | 5249 | if(OwnerID != GroupID) |
5250 | LastOwnerID = OwnerID; | ||
5251 | OwnerID = item.Owner; | ||
5252 | Inventory.ChangeInventoryOwner(item.Owner); | ||
5216 | 5253 | ||
5217 | if (scene.Permissions.PropagatePermissions()) | 5254 | if (scene.Permissions.PropagatePermissions()) |
5218 | ApplyNextOwnerPermissions(); | 5255 | ApplyNextOwnerPermissions(); |
5219 | |||
5220 | //LogPermissions("After ApplyNextOwnerPermissions"); | ||
5221 | |||
5222 | LastOwnerID = OwnerID; | ||
5223 | OwnerID = item.Owner; | ||
5224 | Inventory.ChangeInventoryOwner(item.Owner); | ||
5225 | } | 5256 | } |
5226 | } | 5257 | } |
5227 | 5258 | ||
@@ -5245,6 +5276,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5245 | GroupMask = 0; // Giving an object zaps group permissions | 5276 | GroupMask = 0; // Giving an object zaps group permissions |
5246 | 5277 | ||
5247 | Inventory.ApplyNextOwnerPermissions(); | 5278 | Inventory.ApplyNextOwnerPermissions(); |
5279 | AggregateInnerPerms(); | ||
5248 | } | 5280 | } |
5249 | 5281 | ||
5250 | public void UpdateLookAt() | 5282 | public void UpdateLookAt() |
@@ -5306,6 +5338,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5306 | item.OwnerChanged = false; | 5338 | item.OwnerChanged = false; |
5307 | Inventory.UpdateInventoryItem(item, false, false); | 5339 | Inventory.UpdateInventoryItem(item, false, false); |
5308 | } | 5340 | } |
5341 | AggregateInnerPerms(); | ||
5309 | } | 5342 | } |
5310 | 5343 | ||
5311 | /// <summary> | 5344 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index bf56de2..b53c355 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -360,7 +360,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
360 | // m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}", | 360 | // m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}", |
361 | // item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName); | 361 | // item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName); |
362 | 362 | ||
363 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) | 363 | if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item, m_part)) |
364 | { | 364 | { |
365 | StoreScriptError(item.ItemID, "no permission"); | 365 | StoreScriptError(item.ItemID, "no permission"); |
366 | return false; | 366 | return false; |
@@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
807 | else | 807 | else |
808 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 808 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
809 | 809 | ||
810 | m_part.AggregateInnerPerms(); | ||
810 | m_inventorySerial++; | 811 | m_inventorySerial++; |
811 | //m_inventorySerial += 2; | 812 | //m_inventorySerial += 2; |
812 | HasInventoryChanged = true; | 813 | HasInventoryChanged = true; |
@@ -829,7 +830,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
829 | // m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 830 | // m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
830 | } | 831 | } |
831 | m_items.LockItemsForWrite(false); | 832 | m_items.LockItemsForWrite(false); |
832 | 833 | m_part.AggregateInnerPerms(); | |
833 | m_inventorySerial++; | 834 | m_inventorySerial++; |
834 | } | 835 | } |
835 | 836 | ||
@@ -965,7 +966,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
965 | { | 966 | { |
966 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) | 967 | if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & (uint)PermissionMask.Slam) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) |
967 | { | 968 | { |
968 | part.LastOwnerID = part.OwnerID; | 969 | if(part.GroupID != part.OwnerID) |
970 | part.LastOwnerID = part.OwnerID; | ||
969 | part.OwnerID = item.OwnerID; | 971 | part.OwnerID = item.OwnerID; |
970 | part.Inventory.ChangeInventoryOwner(item.OwnerID); | 972 | part.Inventory.ChangeInventoryOwner(item.OwnerID); |
971 | } | 973 | } |
@@ -979,6 +981,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
979 | } | 981 | } |
980 | // old code end | 982 | // old code end |
981 | rootPart.TrimPermissions(); | 983 | rootPart.TrimPermissions(); |
984 | group.AggregateDeepPerms(); | ||
982 | } | 985 | } |
983 | 986 | ||
984 | return true; | 987 | return true; |
@@ -1020,16 +1023,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1020 | item.AssetID = m_items[item.ItemID].AssetID; | 1023 | item.AssetID = m_items[item.ItemID].AssetID; |
1021 | 1024 | ||
1022 | m_items[item.ItemID] = item; | 1025 | m_items[item.ItemID] = item; |
1026 | |||
1023 | m_inventorySerial++; | 1027 | m_inventorySerial++; |
1024 | if (fireScriptEvents) | 1028 | if (fireScriptEvents) |
1025 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 1029 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
1026 | 1030 | ||
1027 | if (considerChanged) | 1031 | if (considerChanged) |
1028 | { | 1032 | { |
1033 | m_part.AggregateInnerPerms(); | ||
1034 | m_part.ParentGroup.AggregatePerms(); | ||
1029 | HasInventoryChanged = true; | 1035 | HasInventoryChanged = true; |
1030 | m_part.ParentGroup.HasGroupChanged = true; | 1036 | m_part.ParentGroup.HasGroupChanged = true; |
1031 | } | 1037 | } |
1032 | m_items.LockItemsForWrite(false); | 1038 | m_items.LockItemsForWrite(false); |
1039 | |||
1033 | return true; | 1040 | return true; |
1034 | } | 1041 | } |
1035 | else | 1042 | else |
@@ -1066,6 +1073,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1066 | m_items.LockItemsForWrite(true); | 1073 | m_items.LockItemsForWrite(true); |
1067 | m_items.Remove(itemID); | 1074 | m_items.Remove(itemID); |
1068 | m_items.LockItemsForWrite(false); | 1075 | m_items.LockItemsForWrite(false); |
1076 | |||
1077 | m_part.AggregateInnerPerms(); | ||
1078 | m_part.ParentGroup.AggregatePerms(); | ||
1079 | |||
1069 | m_inventorySerial++; | 1080 | m_inventorySerial++; |
1070 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); | 1081 | m_part.TriggerScriptChangedEvent(Changed.INVENTORY); |
1071 | 1082 | ||
@@ -1317,6 +1328,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1317 | } | 1328 | } |
1318 | } | 1329 | } |
1319 | 1330 | ||
1331 | public void AggregateInnerPerms(ref uint owner, ref uint group, ref uint everyone) | ||
1332 | { | ||
1333 | foreach (TaskInventoryItem item in m_items.Values) | ||
1334 | { | ||
1335 | owner &= item.CurrentPermissions; | ||
1336 | group &= item.GroupPermissions; | ||
1337 | everyone &= item.EveryonePermissions; | ||
1338 | } | ||
1339 | } | ||
1340 | |||
1320 | public uint MaskEffectivePermissions() | 1341 | public uint MaskEffectivePermissions() |
1321 | { | 1342 | { |
1322 | uint mask=0x7fffffff; | 1343 | uint mask=0x7fffffff; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9545c13..a5af7e1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2029,11 +2029,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2029 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); | 2029 | m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); |
2030 | } | 2030 | } |
2031 | 2031 | ||
2032 | // Tell the client that we're totally ready | ||
2033 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
2034 | |||
2035 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2036 | |||
2037 | if (!string.IsNullOrEmpty(m_callbackURI)) | 2032 | if (!string.IsNullOrEmpty(m_callbackURI)) |
2038 | { | 2033 | { |
2039 | // We cannot sleep here since this would hold up the inbound packet processing thread, as | 2034 | // We cannot sleep here since this would hold up the inbound packet processing thread, as |
@@ -2054,6 +2049,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2054 | 2049 | ||
2055 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); | 2050 | Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); |
2056 | m_callbackURI = null; | 2051 | m_callbackURI = null; |
2052 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2057 | } | 2053 | } |
2058 | // else | 2054 | // else |
2059 | // { | 2055 | // { |
@@ -2062,19 +2058,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2062 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); | 2058 | // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); |
2063 | // } | 2059 | // } |
2064 | 2060 | ||
2065 | m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 2061 | |
2062 | // Tell the client that we're totally ready | ||
2063 | ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); | ||
2064 | m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2065 | |||
2066 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | ||
2067 | |||
2068 | int delayctnr = Util.EnvironmentTickCount(); | ||
2069 | |||
2070 | if (!IsChildAgent) | ||
2071 | { | ||
2072 | // verify baked textures and cache | ||
2073 | bool cachedbaked = false; | ||
2074 | |||
2075 | if (IsNPC) | ||
2076 | cachedbaked = true; | ||
2077 | else | ||
2078 | { | ||
2079 | if (m_scene.AvatarFactory != null && !isHGTP) | ||
2080 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | ||
2081 | |||
2082 | // not sure we need this | ||
2083 | if (!cachedbaked) | ||
2084 | { | ||
2085 | if (m_scene.AvatarFactory != null) | ||
2086 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | ||
2087 | } | ||
2088 | } | ||
2089 | m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | ||
2090 | } | ||
2066 | 2091 | ||
2067 | if(m_teleportFlags > 0) | 2092 | if(m_teleportFlags > 0) |
2068 | { | 2093 | { |
2069 | gotCrossUpdate = false; // sanity check | 2094 | gotCrossUpdate = false; // sanity check |
2070 | Thread.Sleep(500); // let viewers catch us | 2095 | if(Util.EnvironmentTickCountSubtract(delayctnr)< 500) |
2096 | Thread.Sleep(500); // let viewers catch us | ||
2071 | } | 2097 | } |
2072 | 2098 | ||
2073 | if(!gotCrossUpdate) | 2099 | if(!gotCrossUpdate) |
2074 | RotateToLookAt(look); | 2100 | RotateToLookAt(look); |
2075 | 2101 | ||
2076 | // HG | 2102 | // HG |
2077 | bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; | ||
2078 | if(isHGTP) | 2103 | if(isHGTP) |
2079 | { | 2104 | { |
2080 | // ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); | 2105 | // ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); |
@@ -2101,24 +2126,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2101 | 2126 | ||
2102 | if (!IsChildAgent) | 2127 | if (!IsChildAgent) |
2103 | { | 2128 | { |
2104 | // verify baked textures and cache | ||
2105 | bool cachedbaked = false; | ||
2106 | |||
2107 | if (IsNPC) | ||
2108 | cachedbaked = true; | ||
2109 | else | ||
2110 | { | ||
2111 | if (m_scene.AvatarFactory != null && !isHGTP) | ||
2112 | cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); | ||
2113 | |||
2114 | // not sure we need this | ||
2115 | if (!cachedbaked) | ||
2116 | { | ||
2117 | if (m_scene.AvatarFactory != null) | ||
2118 | m_scene.AvatarFactory.QueueAppearanceSave(UUID); | ||
2119 | } | ||
2120 | } | ||
2121 | |||
2122 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); | 2129 | List<ScenePresence> allpresences = m_scene.GetScenePresences(); |
2123 | 2130 | ||
2124 | // send avatar object to all presences including us, so they cross it into region | 2131 | // send avatar object to all presences including us, so they cross it into region |
@@ -3110,6 +3117,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3110 | 3117 | ||
3111 | Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose; | 3118 | Vector3 standPos = sitPartWorldPosition + adjustmentForSitPose; |
3112 | m_pos = standPos; | 3119 | m_pos = standPos; |
3120 | |||
3113 | } | 3121 | } |
3114 | 3122 | ||
3115 | // We need to wait until we have calculated proper stand positions before sitting up the physical | 3123 | // We need to wait until we have calculated proper stand positions before sitting up the physical |
@@ -3124,6 +3132,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3124 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3132 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3125 | 3133 | ||
3126 | SendAvatarDataToAllAgents(); | 3134 | SendAvatarDataToAllAgents(); |
3135 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3127 | } | 3136 | } |
3128 | 3137 | ||
3129 | // reset to default sitAnimation | 3138 | // reset to default sitAnimation |
@@ -3256,6 +3265,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3256 | // Moved here to avoid a race with default sit anim | 3265 | // Moved here to avoid a race with default sit anim |
3257 | // The script event needs to be raised after the default sit anim is set. | 3266 | // The script event needs to be raised after the default sit anim is set. |
3258 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3267 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3268 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3259 | } | 3269 | } |
3260 | } | 3270 | } |
3261 | 3271 | ||
@@ -3405,6 +3415,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3405 | 3415 | ||
3406 | Animator.SetMovementAnimations("SIT"); | 3416 | Animator.SetMovementAnimations("SIT"); |
3407 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | 3417 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); |
3418 | m_scene.EventManager.TriggerParcelPrimCountTainted(); // update select/ sat on | ||
3408 | } | 3419 | } |
3409 | 3420 | ||
3410 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) | 3421 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index b8d210c..a12a401 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
114 | // Script state may, or may not, exist. Not having any, is NOT | 114 | // Script state may, or may not, exist. Not having any, is NOT |
115 | // ever a problem. | 115 | // ever a problem. |
116 | sceneObject.LoadScriptState(reader); | 116 | sceneObject.LoadScriptState(reader); |
117 | 117 | sceneObject.AggregateDeepPerms(); | |
118 | return sceneObject; | 118 | return sceneObject; |
119 | } | 119 | } |
120 | 120 | ||
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
278 | // Script state may, or may not, exist. Not having any, is NOT | 278 | // Script state may, or may not, exist. Not having any, is NOT |
279 | // ever a problem. | 279 | // ever a problem. |
280 | sceneObject.LoadScriptState(doc); | 280 | sceneObject.LoadScriptState(doc); |
281 | 281 | sceneObject.AggregatePerms(); | |
282 | return sceneObject; | 282 | return sceneObject; |
283 | } | 283 | } |
284 | catch (Exception e) | 284 | catch (Exception e) |
@@ -1739,6 +1739,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1739 | 1739 | ||
1740 | reader.ReadEndElement(); // SceneObjectPart | 1740 | reader.ReadEndElement(); // SceneObjectPart |
1741 | 1741 | ||
1742 | obj.AggregateInnerPerms(); | ||
1742 | // m_log.DebugFormat("[SceneObjectSerializer]: parsed SOP {0} {1}", obj.Name, obj.UUID); | 1743 | // m_log.DebugFormat("[SceneObjectSerializer]: parsed SOP {0} {1}", obj.Name, obj.UUID); |
1743 | return obj; | 1744 | return obj; |
1744 | } | 1745 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index 01bc491..0f022dd 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -70,6 +70,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
70 | //obj.RegenerateFullIDs(); | 70 | //obj.RegenerateFullIDs(); |
71 | 71 | ||
72 | scene.AddNewSceneObject(obj, true); | 72 | scene.AddNewSceneObject(obj, true); |
73 | obj.AggregateDeepPerms(); | ||
73 | } | 74 | } |
74 | } | 75 | } |
75 | else | 76 | else |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 56723bf..4d2eb3f 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
67 | 67 | ||
68 | SceneObjectGroup dupeSo | 68 | SceneObjectGroup dupeSo |
69 | = scene.SceneGraph.DuplicateObject( | 69 | = scene.SceneGraph.DuplicateObject( |
70 | part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); | 70 | part1.LocalId, new Vector3(10, 0, 0), ownerId, UUID.Zero, Quaternion.Identity, false); |
71 | Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); | 71 | Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); |
72 | 72 | ||
73 | SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); | 73 | SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs index e1e973c..abf8c48 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectCrossingTests.cs | |||
@@ -157,29 +157,28 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
157 | 157 | ||
158 | // Cross | 158 | // Cross |
159 | sceneA.SceneGraph.UpdatePrimGroupPosition( | 159 | sceneA.SceneGraph.UpdatePrimGroupPosition( |
160 | so1.LocalId, new Vector3(so1StartPos.X, so1StartPos.Y - 20, so1StartPos.Z), userId); | 160 | so1.LocalId, new Vector3(so1StartPos.X, so1StartPos.Y - 20, so1StartPos.Z), sp1SceneA.ControllingClient); |
161 | 161 | ||
162 | // crossing is async | 162 | // crossing is async |
163 | Thread.Sleep(500); | 163 | Thread.Sleep(500); |
164 | 164 | ||
165 | SceneObjectGroup so1PostCross; | 165 | SceneObjectGroup so1PostCross; |
166 | 166 | ||
167 | { | 167 | ScenePresence sp1SceneAPostCross = sceneA.GetScenePresence(userId); |
168 | ScenePresence sp1SceneAPostCross = sceneA.GetScenePresence(userId); | 168 | Assert.IsTrue(sp1SceneAPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly false"); |
169 | Assert.IsTrue(sp1SceneAPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly false"); | ||
170 | 169 | ||
171 | ScenePresence sp1SceneBPostCross = sceneB.GetScenePresence(userId); | 170 | ScenePresence sp1SceneBPostCross = sceneB.GetScenePresence(userId); |
172 | TestClient sceneBTc = ((TestClient)sp1SceneBPostCross.ControllingClient); | 171 | TestClient sceneBTc = ((TestClient)sp1SceneBPostCross.ControllingClient); |
173 | sceneBTc.CompleteMovement(); | 172 | sceneBTc.CompleteMovement(); |
174 | 173 | ||
175 | Assert.IsFalse(sp1SceneBPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly true"); | 174 | Assert.IsFalse(sp1SceneBPostCross.IsChildAgent, "sp1SceneAPostCross.IsChildAgent unexpectedly true"); |
176 | Assert.IsTrue(sp1SceneBPostCross.IsSatOnObject); | 175 | Assert.IsTrue(sp1SceneBPostCross.IsSatOnObject); |
176 | |||
177 | Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id), "uck"); | ||
178 | so1PostCross = sceneB.GetSceneObjectGroup(so1Id); | ||
179 | Assert.NotNull(so1PostCross); | ||
180 | Assert.AreEqual(1, so1PostCross.GetSittingAvatarsCount()); | ||
177 | 181 | ||
178 | Assert.IsNull(sceneA.GetSceneObjectGroup(so1Id), "uck"); | ||
179 | so1PostCross = sceneB.GetSceneObjectGroup(so1Id); | ||
180 | Assert.NotNull(so1PostCross); | ||
181 | Assert.AreEqual(1, so1PostCross.GetSittingAvatarsCount()); | ||
182 | } | ||
183 | 182 | ||
184 | Vector3 so1PostCrossPos = so1PostCross.AbsolutePosition; | 183 | Vector3 so1PostCrossPos = so1PostCross.AbsolutePosition; |
185 | 184 | ||
@@ -187,7 +186,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
187 | 186 | ||
188 | // Recross | 187 | // Recross |
189 | sceneB.SceneGraph.UpdatePrimGroupPosition( | 188 | sceneB.SceneGraph.UpdatePrimGroupPosition( |
190 | so1PostCross.LocalId, new Vector3(so1PostCrossPos.X, so1PostCrossPos.Y + 20, so1PostCrossPos.Z), userId); | 189 | so1PostCross.LocalId, new Vector3(so1PostCrossPos.X, so1PostCrossPos.Y + 20, so1PostCrossPos.Z), sp1SceneBPostCross.ControllingClient); |
191 | 190 | ||
192 | // crossing is async | 191 | // crossing is async |
193 | Thread.Sleep(500); | 192 | Thread.Sleep(500); |
@@ -255,13 +254,19 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
255 | lmmA.EventManagerOnNoLandDataFromStorage(); | 254 | lmmA.EventManagerOnNoLandDataFromStorage(); |
256 | lmmB.EventManagerOnNoLandDataFromStorage(); | 255 | lmmB.EventManagerOnNoLandDataFromStorage(); |
257 | 256 | ||
257 | AgentCircuitData acd = SceneHelpers.GenerateAgentData(userId); | ||
258 | TestClient tc = new TestClient(acd, sceneA); | ||
259 | List<TestClient> destinationTestClients = new List<TestClient>(); | ||
260 | EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients); | ||
261 | ScenePresence sp1SceneA = SceneHelpers.AddScenePresence(sceneA, tc, acd); | ||
262 | |||
258 | SceneObjectGroup so1 = SceneHelpers.AddSceneObject(sceneA, 1, userId, "", sceneObjectIdTail); | 263 | SceneObjectGroup so1 = SceneHelpers.AddSceneObject(sceneA, 1, userId, "", sceneObjectIdTail); |
259 | UUID so1Id = so1.UUID; | 264 | UUID so1Id = so1.UUID; |
260 | so1.AbsolutePosition = new Vector3(128, 10, 20); | 265 | so1.AbsolutePosition = new Vector3(128, 10, 20); |
261 | 266 | ||
262 | // Cross with a negative value. We must make this call rather than setting AbsolutePosition directly | 267 | // Cross with a negative value. We must make this call rather than setting AbsolutePosition directly |
263 | // because only this will execute permission checks in the source region. | 268 | // because only this will execute permission checks in the source region. |
264 | sceneA.SceneGraph.UpdatePrimGroupPosition(so1.LocalId, new Vector3(128, -10, 20), userId); | 269 | sceneA.SceneGraph.UpdatePrimGroupPosition(so1.LocalId, new Vector3(128, -10, 20), sp1SceneA.ControllingClient); |
265 | 270 | ||
266 | // crossing is async | 271 | // crossing is async |
267 | Thread.Sleep(500); | 272 | Thread.Sleep(500); |