diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 46777e1..5e2eb73 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -140,7 +140,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | /// <returns></returns> | 140 | /// <returns></returns> |
141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
142 | { | 142 | { |
143 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 143 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
144 | item = InventoryService.GetItem(item); | ||
144 | 145 | ||
145 | if (item != null) | 146 | if (item != null) |
146 | { | 147 | { |
@@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
315 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 316 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
316 | UUID itemID, InventoryItemBase itemUpd) | 317 | UUID itemID, InventoryItemBase itemUpd) |
317 | { | 318 | { |
318 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 319 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
320 | item = InventoryService.GetItem(item); | ||
319 | 321 | ||
320 | if (item != null) | 322 | if (item != null) |
321 | { | 323 | { |
@@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
408 | { | 410 | { |
409 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 411 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
410 | 412 | ||
411 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId)); | 413 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
414 | item = InventoryService.GetItem(item); | ||
412 | 415 | ||
413 | if ((item != null) && (item.Owner == senderId)) | 416 | if ((item != null) && (item.Owner == senderId)) |
414 | { | 417 | { |
@@ -474,7 +477,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
474 | if (!Permissions.BypassPermissions()) | 477 | if (!Permissions.BypassPermissions()) |
475 | { | 478 | { |
476 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 479 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
477 | InventoryService.DeleteItem(new InventoryItemBase(itemId)); | 480 | { |
481 | List<UUID> items = new List<UUID>(); | ||
482 | items.Add(itemId); | ||
483 | InventoryService.DeleteItems(senderId, items); | ||
484 | } | ||
478 | } | 485 | } |
479 | 486 | ||
480 | return itemCopy; | 487 | return itemCopy; |
@@ -558,7 +565,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
558 | 565 | ||
559 | if (item == null) | 566 | if (item == null) |
560 | { | 567 | { |
561 | item = InventoryService.GetItem(new InventoryItemBase(oldItemID)); | 568 | item = new InventoryItemBase(oldItemID, remoteClient.AgentId); |
569 | item = InventoryService.GetItem(item); | ||
562 | 570 | ||
563 | if (item == null) | 571 | if (item == null) |
564 | { | 572 | { |
@@ -636,7 +644,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
636 | m_log.DebugFormat( | 644 | m_log.DebugFormat( |
637 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); | 645 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); |
638 | 646 | ||
639 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 647 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
648 | item = InventoryService.GetItem(item); | ||
640 | 649 | ||
641 | if (item != null) | 650 | if (item != null) |
642 | { | 651 | { |
@@ -647,7 +656,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
647 | item.Folder = folderID; | 656 | item.Folder = folderID; |
648 | 657 | ||
649 | // Diva comment: can't we just update? | 658 | // Diva comment: can't we just update? |
650 | InventoryService.DeleteItem(item); | 659 | List<UUID> uuids = new List<UUID>(); |
660 | uuids.Add(item.ID); | ||
661 | InventoryService.DeleteItems(item.Owner, uuids); | ||
651 | 662 | ||
652 | AddInventoryItem(remoteClient, item); | 663 | AddInventoryItem(remoteClient, item); |
653 | } | 664 | } |
@@ -794,9 +805,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
794 | /// </summary> | 805 | /// </summary> |
795 | /// <param name="remoteClient"></param> | 806 | /// <param name="remoteClient"></param> |
796 | /// <param name="itemID"></param> | 807 | /// <param name="itemID"></param> |
797 | private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID) | 808 | private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) |
798 | { | 809 | { |
799 | InventoryService.DeleteItem(new InventoryItemBase(itemID)); | 810 | //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId); |
811 | InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); | ||
800 | } | 812 | } |
801 | 813 | ||
802 | /// <summary> | 814 | /// <summary> |
@@ -1224,7 +1236,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1224 | UUID copyID = UUID.Random(); | 1236 | UUID copyID = UUID.Random(); |
1225 | if (itemID != UUID.Zero) | 1237 | if (itemID != UUID.Zero) |
1226 | { | 1238 | { |
1227 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1239 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1240 | item = InventoryService.GetItem(item); | ||
1228 | 1241 | ||
1229 | // Try library | 1242 | // Try library |
1230 | if (null == item) | 1243 | if (null == item) |
@@ -1242,7 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1242 | if (!Permissions.BypassPermissions()) | 1255 | if (!Permissions.BypassPermissions()) |
1243 | { | 1256 | { |
1244 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1257 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1245 | RemoveInventoryItem(remoteClient, itemID); | 1258 | { |
1259 | List<UUID> uuids = new List<UUID>(); | ||
1260 | uuids.Add(itemID); | ||
1261 | RemoveInventoryItem(remoteClient, uuids); | ||
1262 | } | ||
1246 | } | 1263 | } |
1247 | } | 1264 | } |
1248 | else | 1265 | else |
@@ -1287,7 +1304,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1287 | 1304 | ||
1288 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory | 1305 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory |
1289 | { | 1306 | { |
1290 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1307 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1308 | item = InventoryService.GetItem(item); | ||
1291 | 1309 | ||
1292 | // Try library | 1310 | // Try library |
1293 | // XXX clumsy, possibly should be one call | 1311 | // XXX clumsy, possibly should be one call |
@@ -1672,7 +1690,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1672 | 1690 | ||
1673 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1691 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1674 | { | 1692 | { |
1675 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID); | 1693 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID); |
1676 | item = InventoryService.GetItem(item); | 1694 | item = InventoryService.GetItem(item); |
1677 | 1695 | ||
1678 | //item = userInfo.RootFolder.FindItem( | 1696 | //item = userInfo.RootFolder.FindItem( |
@@ -1834,7 +1852,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1834 | 1852 | ||
1835 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); | 1853 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); |
1836 | 1854 | ||
1837 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1855 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1856 | item = InventoryService.GetItem(item); | ||
1838 | 1857 | ||
1839 | if (item != null) | 1858 | if (item != null) |
1840 | { | 1859 | { |
@@ -1984,7 +2003,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1984 | BypassRayCast, bRayEndIsIntersection,true,scale, false); | 2003 | BypassRayCast, bRayEndIsIntersection,true,scale, false); |
1985 | 2004 | ||
1986 | // Rez object | 2005 | // Rez object |
1987 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 2006 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2007 | item = InventoryService.GetItem(item); | ||
1988 | 2008 | ||
1989 | if (item != null) | 2009 | if (item != null) |
1990 | { | 2010 | { |
@@ -2135,7 +2155,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2135 | // copy ones will be lost, so avoid it | 2155 | // copy ones will be lost, so avoid it |
2136 | // | 2156 | // |
2137 | if (!attachment) | 2157 | if (!attachment) |
2138 | InventoryService.DeleteItem(item); | 2158 | { |
2159 | List<UUID> uuids = new List<UUID>(); | ||
2160 | uuids.Add(item.ID); | ||
2161 | InventoryService.DeleteItems(item.Owner, uuids); | ||
2162 | } | ||
2139 | } | 2163 | } |
2140 | } | 2164 | } |
2141 | 2165 | ||
@@ -2309,7 +2333,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2309 | ScenePresence presence; | 2333 | ScenePresence presence; |
2310 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2334 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2311 | { | 2335 | { |
2312 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId)); | 2336 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2337 | item = InventoryService.GetItem(item); | ||
2313 | 2338 | ||
2314 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2339 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2315 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2340 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
@@ -2360,7 +2385,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2360 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2385 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2361 | { | 2386 | { |
2362 | // XXYY!! | 2387 | // XXYY!! |
2363 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 2388 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2389 | item = InventoryService.GetItem(item); | ||
2364 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2390 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2365 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2391 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
2366 | if (ava != null) | 2392 | if (ava != null) |
@@ -2393,7 +2419,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2393 | } | 2419 | } |
2394 | part.ParentGroup.DetachToGround(); | 2420 | part.ParentGroup.DetachToGround(); |
2395 | 2421 | ||
2396 | InventoryService.DeleteItem(new InventoryItemBase(inventoryID)); | 2422 | List<UUID> uuids = new List<UUID>(); |
2423 | uuids.Add(inventoryID); | ||
2424 | InventoryService.DeleteItems(remoteClient.AgentId, uuids); | ||
2397 | remoteClient.SendRemoveInventoryItem(inventoryID); | 2425 | remoteClient.SendRemoveInventoryItem(inventoryID); |
2398 | } | 2426 | } |
2399 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); | 2427 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); |