diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 61ea8ac..e3ccf96 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
164 | m_log.DebugFormat( | 164 | m_log.DebugFormat( |
165 | "[AGENT INVENTORY]: Found folder {0} type {1} for item {2}", | 165 | "[AGENT INVENTORY]: Found folder {0} type {1} for item {2}", |
166 | f.Name, (AssetType)f.Type, item.Name); | 166 | f.Name, (AssetType)f.Type, item.Name); |
167 | 167 | ||
168 | item.Folder = f.ID; | 168 | item.Folder = f.ID; |
169 | } | 169 | } |
170 | else | 170 | else |
@@ -338,7 +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 | 341 | ||
342 | part.SendPropertiesToClient(remoteClient); | 342 | part.SendPropertiesToClient(remoteClient); |
343 | 343 | ||
344 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) | 344 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) |
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
519 | // needs to be found. If inventory item flags are updated | 519 | // needs to be found. If inventory item flags are updated |
520 | // the viewer's notion of the item needs to be refreshed. | 520 | // the viewer's notion of the item needs to be refreshed. |
521 | // | 521 | // |
522 | // In other situations we cannot send out a bulk update here, since this will cause editing of clothing to start | 522 | // In other situations we cannot send out a bulk update here, since this will cause editing of clothing to start |
523 | // failing frequently. Possibly this is a race with a separate transaction that uploads the asset. | 523 | // failing frequently. Possibly this is a race with a separate transaction that uploads the asset. |
524 | if (sendUpdate) | 524 | if (sendUpdate) |
525 | remoteClient.SendBulkUpdateInventory(item); | 525 | remoteClient.SendBulkUpdateInventory(item); |
@@ -734,7 +734,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
734 | itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; | 734 | itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; |
735 | itemCopy.BasePermissions = item.BasePermissions; | 735 | itemCopy.BasePermissions = item.BasePermissions; |
736 | } | 736 | } |
737 | 737 | ||
738 | if (itemCopy.Folder == UUID.Zero) | 738 | if (itemCopy.Folder == UUID.Zero) |
739 | { | 739 | { |
740 | InventoryFolderBase folder = null; | 740 | InventoryFolderBase folder = null; |
@@ -826,7 +826,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
826 | } | 826 | } |
827 | 827 | ||
828 | UUID newFolderId = UUID.Random(); | 828 | UUID newFolderId = UUID.Random(); |
829 | InventoryFolderBase newFolder | 829 | InventoryFolderBase newFolder |
830 | = new InventoryFolderBase( | 830 | = new InventoryFolderBase( |
831 | newFolderId, folder.Name, recipientId, folder.Type, recipientParentFolderId, folder.Version); | 831 | newFolderId, folder.Name, recipientId, folder.Type, recipientParentFolderId, folder.Version); |
832 | InventoryService.AddFolder(newFolder); | 832 | InventoryService.AddFolder(newFolder); |
@@ -906,7 +906,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
906 | item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch(), false); | 906 | item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch(), false); |
907 | } | 907 | } |
908 | else | 908 | else |
909 | { | 909 | { |
910 | // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item. | 910 | // If item is transfer or permissions are off or calling agent is allowed to copy item owner's inventory item. |
911 | if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) | 911 | if (((item.CurrentPermissions & (uint)PermissionMask.Transfer) != 0) |
912 | && (m_permissions.BypassPermissions() | 912 | && (m_permissions.BypassPermissions() |
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
954 | moveitems.Add(n); | 954 | moveitems.Add(n); |
955 | remoteClient.SendInventoryItemCreateUpdate(n, 0); | 955 | remoteClient.SendInventoryItemCreateUpdate(n, 0); |
956 | } | 956 | } |
957 | 957 | ||
958 | MoveInventoryItem(remoteClient, moveitems); | 958 | MoveInventoryItem(remoteClient, moveitems); |
959 | } | 959 | } |
960 | 960 | ||
@@ -1308,9 +1308,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1308 | public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId, out string message) | 1308 | public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId, out string message) |
1309 | { | 1309 | { |
1310 | m_log.DebugFormat( | 1310 | m_log.DebugFormat( |
1311 | "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", | 1311 | "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", |
1312 | itemId, part.Name, folderId, remoteClient.Name); | 1312 | itemId, part.Name, folderId, remoteClient.Name); |
1313 | 1313 | ||
1314 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId, out message); | 1314 | InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId, out message); |
1315 | if (agentItem == null) | 1315 | if (agentItem == null) |
1316 | return null; | 1316 | return null; |
@@ -1377,7 +1377,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1377 | 1377 | ||
1378 | string message; | 1378 | string message; |
1379 | InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); | 1379 | InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out message); |
1380 | 1380 | ||
1381 | if (item == null) | 1381 | if (item == null) |
1382 | remoteClient.SendAgentAlertMessage(message, false); | 1382 | remoteClient.SendAgentAlertMessage(message, false); |
1383 | } | 1383 | } |
@@ -1712,7 +1712,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1712 | else // Updating existing item with new perms etc | 1712 | else // Updating existing item with new perms etc |
1713 | { | 1713 | { |
1714 | // m_log.DebugFormat( | 1714 | // m_log.DebugFormat( |
1715 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", | 1715 | // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()", |
1716 | // currentItem.Name, part.Name); | 1716 | // currentItem.Name, part.Name); |
1717 | 1717 | ||
1718 | // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the | 1718 | // Only look for an uploaded updated asset if we are passed a transaction ID. This is only the |
@@ -1924,12 +1924,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1924 | return null; | 1924 | return null; |
1925 | } | 1925 | } |
1926 | 1926 | ||
1927 | AssetBase asset | 1927 | AssetBase asset |
1928 | = CreateAsset( | 1928 | = CreateAsset( |
1929 | itemBase.Name, | 1929 | itemBase.Name, |
1930 | itemBase.Description, | 1930 | itemBase.Description, |
1931 | (sbyte)itemBase.AssetType, | 1931 | (sbyte)itemBase.AssetType, |
1932 | Encoding.ASCII.GetBytes(scriptText), | 1932 | Encoding.ASCII.GetBytes(scriptText), |
1933 | agentID); | 1933 | agentID); |
1934 | 1934 | ||
1935 | AssetService.Store(asset); | 1935 | AssetService.Store(asset); |
@@ -2008,8 +2008,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2008 | if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || | 2008 | if ((destPart.GroupID == UUID.Zero) || (destPart.GroupID != srcPart.GroupID) || |
2009 | ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0)) | 2009 | ((destPart.GroupMask & (uint)PermissionMask.Modify) == 0)) |
2010 | return; | 2010 | return; |
2011 | } | 2011 | } |
2012 | else | 2012 | else |
2013 | { | 2013 | { |
2014 | if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) | 2014 | if ((destPart.OwnerMask & (uint)PermissionMask.Modify) == 0) |
2015 | return; | 2015 | return; |
@@ -2102,7 +2102,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2102 | List<uint> deleteIDs = new List<uint>(); | 2102 | List<uint> deleteIDs = new List<uint>(); |
2103 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); | 2103 | List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>(); |
2104 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); | 2104 | List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>(); |
2105 | 2105 | ||
2106 | // Start with true for both, then remove the flags if objects | 2106 | // Start with true for both, then remove the flags if objects |
2107 | // that we can't derez are part of the selection | 2107 | // that we can't derez are part of the selection |
2108 | bool permissionToTake = true; | 2108 | bool permissionToTake = true; |
@@ -2146,7 +2146,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2146 | if (action != DeRezAction.Return) | 2146 | if (action != DeRezAction.Return) |
2147 | { | 2147 | { |
2148 | m_log.WarnFormat( | 2148 | m_log.WarnFormat( |
2149 | "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", | 2149 | "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", |
2150 | action, grp.Name, grp.UUID); | 2150 | action, grp.Name, grp.UUID); |
2151 | return; | 2151 | return; |
2152 | } | 2152 | } |
@@ -2166,7 +2166,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2166 | } | 2166 | } |
2167 | if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) | 2167 | if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) |
2168 | permissionToTake = false; | 2168 | permissionToTake = false; |
2169 | 2169 | ||
2170 | if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) | 2170 | if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) |
2171 | permissionToDelete = false; | 2171 | permissionToDelete = false; |
2172 | } | 2172 | } |
@@ -2471,9 +2471,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2471 | bool RezSelected, bool RemoveItem, UUID fromTaskID) | 2471 | bool RezSelected, bool RemoveItem, UUID fromTaskID) |
2472 | { | 2472 | { |
2473 | // m_log.DebugFormat( | 2473 | // m_log.DebugFormat( |
2474 | // "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", | 2474 | // "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", |
2475 | // remoteClient.Name, itemID, fromTaskID); | 2475 | // remoteClient.Name, itemID, fromTaskID); |
2476 | 2476 | ||
2477 | if (fromTaskID == UUID.Zero) | 2477 | if (fromTaskID == UUID.Zero) |
2478 | { | 2478 | { |
2479 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 2479 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); |
@@ -2483,37 +2483,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
2483 | RezSelected, RemoveItem, fromTaskID, false); | 2483 | RezSelected, RemoveItem, fromTaskID, false); |
2484 | } | 2484 | } |
2485 | else | 2485 | else |
2486 | { | 2486 | { |
2487 | SceneObjectPart part = GetSceneObjectPart(fromTaskID); | 2487 | SceneObjectPart part = GetSceneObjectPart(fromTaskID); |
2488 | if (part == null) | 2488 | if (part == null) |
2489 | { | 2489 | { |
2490 | m_log.ErrorFormat( | 2490 | m_log.ErrorFormat( |
2491 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", | 2491 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", |
2492 | remoteClient.Name, itemID, fromTaskID); | 2492 | remoteClient.Name, itemID, fromTaskID); |
2493 | 2493 | ||
2494 | return; | 2494 | return; |
2495 | } | 2495 | } |
2496 | 2496 | ||
2497 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); | 2497 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); |
2498 | if (item == null) | 2498 | if (item == null) |
2499 | { | 2499 | { |
2500 | m_log.ErrorFormat( | 2500 | m_log.ErrorFormat( |
2501 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", | 2501 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", |
2502 | remoteClient.Name, itemID, fromTaskID); | 2502 | remoteClient.Name, itemID, fromTaskID); |
2503 | 2503 | ||
2504 | return; | 2504 | return; |
2505 | } | 2505 | } |
2506 | 2506 | ||
2507 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | 2507 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); |
2508 | Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); | 2508 | Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); |
2509 | Vector3 pos = GetNewRezLocation( | 2509 | Vector3 pos = GetNewRezLocation( |
2510 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | 2510 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, |
2511 | BypassRayCast, bRayEndIsIntersection, true, scale, false); | 2511 | BypassRayCast, bRayEndIsIntersection, true, scale, false); |
2512 | 2512 | ||
2513 | RezObject(part, item, pos, null, Vector3.Zero, 0, false); | 2513 | RezObject(part, item, pos, null, Vector3.Zero, 0, false); |
2514 | } | 2514 | } |
2515 | } | 2515 | } |
2516 | 2516 | ||
2517 | /// <summary> | 2517 | /// <summary> |
2518 | /// Rez an object into the scene from a prim's inventory. | 2518 | /// Rez an object into the scene from a prim's inventory. |
2519 | /// </summary> | 2519 | /// </summary> |
@@ -2691,7 +2691,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2691 | { | 2691 | { |
2692 | if (ownerID != UUID.Zero) | 2692 | if (ownerID != UUID.Zero) |
2693 | return; | 2693 | return; |
2694 | 2694 | ||
2695 | if (!Permissions.CanDeedObject(remoteClient.AgentId, groupID)) | 2695 | if (!Permissions.CanDeedObject(remoteClient.AgentId, groupID)) |
2696 | return; | 2696 | return; |
2697 | } | 2697 | } |
@@ -2701,8 +2701,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2701 | foreach (uint localID in localIDs) | 2701 | foreach (uint localID in localIDs) |
2702 | { | 2702 | { |
2703 | SceneObjectPart part = GetSceneObjectPart(localID); | 2703 | SceneObjectPart part = GetSceneObjectPart(localID); |
2704 | if (part == null) | 2704 | if (part == null) |
2705 | continue; | 2705 | continue; |
2706 | 2706 | ||
2707 | if (!groups.Contains(part.ParentGroup)) | 2707 | if (!groups.Contains(part.ParentGroup)) |
2708 | groups.Add(part.ParentGroup); | 2708 | groups.Add(part.ParentGroup); |
@@ -2717,7 +2717,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2717 | sog.ScheduleGroupForFullUpdate(); | 2717 | sog.ScheduleGroupForFullUpdate(); |
2718 | 2718 | ||
2719 | SceneObjectPart[] partList = sog.Parts; | 2719 | SceneObjectPart[] partList = sog.Parts; |
2720 | 2720 | ||
2721 | foreach (SceneObjectPart child in partList) | 2721 | foreach (SceneObjectPart child in partList) |
2722 | { | 2722 | { |
2723 | child.Inventory.ChangeInventoryOwner(ownerID); | 2723 | child.Inventory.ChangeInventoryOwner(ownerID); |
@@ -2756,8 +2756,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2756 | foreach (uint localID in localIDs) | 2756 | foreach (uint localID in localIDs) |
2757 | { | 2757 | { |
2758 | SceneObjectPart part = GetSceneObjectPart(localID); | 2758 | SceneObjectPart part = GetSceneObjectPart(localID); |
2759 | if (part == null) | 2759 | if (part == null) |
2760 | continue; | 2760 | continue; |
2761 | part.SendPropertiesToClient(remoteClient); | 2761 | part.SendPropertiesToClient(remoteClient); |
2762 | } | 2762 | } |
2763 | } | 2763 | } |