diff options
author | UbitUmarov | 2016-07-04 08:30:07 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-04 08:30:07 +0100 |
commit | 1d9e343b7ea5a8b36751fc334cd51b5573a1bb15 (patch) | |
tree | 628b676a51022801ad25c83c4ecfbd0a90d7977a | |
parent | add OSSL osGetPhysicsEngineName(). this returns a string with name and versio... (diff) | |
parent | Merge branch 'master' of opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-1d9e343b7ea5a8b36751fc334cd51b5573a1bb15.zip opensim-SC-1d9e343b7ea5a8b36751fc334cd51b5573a1bb15.tar.gz opensim-SC-1d9e343b7ea5a8b36751fc334cd51b5573a1bb15.tar.bz2 opensim-SC-1d9e343b7ea5a8b36751fc334cd51b5573a1bb15.tar.xz |
Merge branch 'master' of opensimulator.org:/var/git/opensim
33 files changed, 147 insertions, 228 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 11a2a12..1afdd0f 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs | |||
@@ -445,8 +445,7 @@ namespace OpenSim.Groups | |||
445 | 445 | ||
446 | UUID itemID = binBucketMap["item_id"].AsUUID(); | 446 | UUID itemID = binBucketMap["item_id"].AsUUID(); |
447 | UUID ownerID = binBucketMap["owner_id"].AsUUID(); | 447 | UUID ownerID = binBucketMap["owner_id"].AsUUID(); |
448 | item = new InventoryItemBase(itemID, ownerID); | 448 | item = m_sceneList[0].InventoryService.GetItem(ownerID, itemID); |
449 | item = m_sceneList[0].InventoryService.GetItem(item); | ||
450 | } | 449 | } |
451 | else | 450 | else |
452 | m_log.DebugFormat("[Groups]: Received OSD with unexpected type: {0}", binBucketOSD.GetType()); | 451 | m_log.DebugFormat("[Groups]: Received OSD with unexpected type: {0}", binBucketOSD.GetType()); |
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index bae1582..1a7c698 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -2836,8 +2836,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2836 | if (wearable[0].ItemID != UUID.Zero) | 2836 | if (wearable[0].ItemID != UUID.Zero) |
2837 | { | 2837 | { |
2838 | // Get inventory item and copy it | 2838 | // Get inventory item and copy it |
2839 | InventoryItemBase item = new InventoryItemBase(wearable[0].ItemID, source); | 2839 | InventoryItemBase item = inventoryService.GetItem(source, wearable[0].ItemID); |
2840 | item = inventoryService.GetItem(item); | ||
2841 | 2840 | ||
2842 | if (item != null) | 2841 | if (item != null) |
2843 | { | 2842 | { |
@@ -2890,8 +2889,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2890 | if (itemID != UUID.Zero) | 2889 | if (itemID != UUID.Zero) |
2891 | { | 2890 | { |
2892 | // Get inventory item and copy it | 2891 | // Get inventory item and copy it |
2893 | InventoryItemBase item = new InventoryItemBase(itemID, source); | 2892 | InventoryItemBase item = inventoryService.GetItem(source, itemID); |
2894 | item = inventoryService.GetItem(item); | ||
2895 | 2893 | ||
2896 | if (item != null) | 2894 | if (item != null) |
2897 | { | 2895 | { |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index 4da6c3d..e3a9a22 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | |||
@@ -403,10 +403,7 @@ namespace OpenSim.Capabilities.Handlers | |||
403 | return contents; | 403 | return contents; |
404 | } | 404 | } |
405 | contents = fetchedContents; | 405 | contents = fetchedContents; |
406 | InventoryFolderBase containingFolder = new InventoryFolderBase(); | 406 | InventoryFolderBase containingFolder = m_InventoryService.GetFolder(agentID, folderID); |
407 | containingFolder.ID = folderID; | ||
408 | containingFolder.Owner = agentID; | ||
409 | containingFolder = m_InventoryService.GetFolder(containingFolder); | ||
410 | 407 | ||
411 | if (containingFolder != null) | 408 | if (containingFolder != null) |
412 | { | 409 | { |
@@ -429,7 +426,7 @@ namespace OpenSim.Capabilities.Handlers | |||
429 | { | 426 | { |
430 | if (item.AssetType == (int)AssetType.Link) | 427 | if (item.AssetType == (int)AssetType.Link) |
431 | { | 428 | { |
432 | InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | 429 | InventoryItemBase linkedItem = m_InventoryService.GetItem(agentID, item.AssetID); |
433 | 430 | ||
434 | // Take care of genuinely broken links where the target doesn't exist | 431 | // Take care of genuinely broken links where the target doesn't exist |
435 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | 432 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, |
@@ -659,10 +656,7 @@ from docs seems this was never a spec | |||
659 | // Must fetch it individually | 656 | // Must fetch it individually |
660 | else if (contents.FolderID == UUID.Zero) | 657 | else if (contents.FolderID == UUID.Zero) |
661 | { | 658 | { |
662 | InventoryFolderBase containingFolder = new InventoryFolderBase(); | 659 | InventoryFolderBase containingFolder = m_InventoryService.GetFolder(freq.owner_id, freq.folder_id); |
663 | containingFolder.ID = freq.folder_id; | ||
664 | containingFolder.Owner = freq.owner_id; | ||
665 | containingFolder = m_InventoryService.GetFolder(containingFolder); | ||
666 | 660 | ||
667 | if (containingFolder != null) | 661 | if (containingFolder != null) |
668 | { | 662 | { |
@@ -759,12 +753,9 @@ from docs seems this was never a spec | |||
759 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); | 753 | m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); |
760 | linked = new InventoryItemBase[itemIDs.Count]; | 754 | linked = new InventoryItemBase[itemIDs.Count]; |
761 | int i = 0; | 755 | int i = 0; |
762 | InventoryItemBase item = new InventoryItemBase(); | ||
763 | item.Owner = freq.owner_id; | ||
764 | foreach (UUID id in itemIDs) | 756 | foreach (UUID id in itemIDs) |
765 | { | 757 | { |
766 | item.ID = id; | 758 | linked[i++] = m_InventoryService.GetItem(freq.owner_id, id); |
767 | linked[i++] = m_InventoryService.GetItem(item); | ||
768 | } | 759 | } |
769 | } | 760 | } |
770 | 761 | ||
@@ -850,4 +841,4 @@ from docs seems this was never a spec | |||
850 | public InventoryCollection Collection; | 841 | public InventoryCollection Collection; |
851 | public int Descendents; | 842 | public int Descendents; |
852 | } | 843 | } |
853 | } \ No newline at end of file | 844 | } |
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs index 1753f60..8200a96 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInventory2Handler.cs | |||
@@ -81,24 +81,15 @@ namespace OpenSim.Capabilities.Handlers | |||
81 | // OMG!!! One by one!!! This is fallback code, in case the backend isn't updated | 81 | // OMG!!! One by one!!! This is fallback code, in case the backend isn't updated |
82 | m_log.WarnFormat("[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); | 82 | m_log.WarnFormat("[FETCH INVENTORY HANDLER]: GetMultipleItems failed. Falling back to fetching inventory items one by one."); |
83 | items = new InventoryItemBase[itemsRequested.Count]; | 83 | items = new InventoryItemBase[itemsRequested.Count]; |
84 | InventoryItemBase item = new InventoryItemBase(); | ||
85 | item.Owner = m_agentID; | ||
86 | foreach (UUID id in itemIDs) | 84 | foreach (UUID id in itemIDs) |
87 | { | 85 | items[i++] = m_inventoryService.GetItem(m_agentID, id); |
88 | item.ID = id; | ||
89 | items[i++] = m_inventoryService.GetItem(item); | ||
90 | } | ||
91 | } | 86 | } |
92 | } | 87 | } |
93 | else | 88 | else |
94 | { | 89 | { |
95 | items = new InventoryItemBase[itemsRequested.Count]; | 90 | items = new InventoryItemBase[itemsRequested.Count]; |
96 | InventoryItemBase item = new InventoryItemBase(); | ||
97 | foreach (UUID id in itemIDs) | 91 | foreach (UUID id in itemIDs) |
98 | { | 92 | items[i++] = m_inventoryService.GetItem(UUID.Zero, id); |
99 | item.ID = id; | ||
100 | items[i++] = m_inventoryService.GetItem(item); | ||
101 | } | ||
102 | } | 93 | } |
103 | 94 | ||
104 | foreach (InventoryItemBase item in items) | 95 | foreach (InventoryItemBase item in items) |
@@ -152,4 +143,4 @@ namespace OpenSim.Capabilities.Handlers | |||
152 | return llsdItem; | 143 | return llsdItem; |
153 | } | 144 | } |
154 | } | 145 | } |
155 | } \ No newline at end of file | 146 | } |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 39ba708..19619c1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -1386,7 +1386,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
1386 | IClientAPI client = null; | 1386 | IClientAPI client = null; |
1387 | 1387 | ||
1388 | m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); | 1388 | m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); |
1389 | item = m_Scene.InventoryService.GetItem(new InventoryItemBase(itemID)); | 1389 | item = m_Scene.InventoryService.GetItem(m_HostCapsObj.AgentID, itemID); |
1390 | if (item != null) | 1390 | if (item != null) |
1391 | { | 1391 | { |
1392 | string message; | 1392 | string message; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 0cc630f..8f03a0a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -898,8 +898,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
898 | 898 | ||
899 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, scriptedState); | 899 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, scriptedState); |
900 | 900 | ||
901 | InventoryItemBase item = new InventoryItemBase(grp.FromItemID, sp.UUID); | 901 | InventoryItemBase item = m_scene.InventoryService.GetItem(sp.UUID, grp.FromItemID); |
902 | item = m_scene.InventoryService.GetItem(item); | ||
903 | 902 | ||
904 | if (item != null) | 903 | if (item != null) |
905 | { | 904 | { |
@@ -1223,8 +1222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1223 | return; | 1222 | return; |
1224 | } | 1223 | } |
1225 | 1224 | ||
1226 | InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID); | 1225 | InventoryItemBase item = m_scene.InventoryService.GetItem(sp.UUID, itemID); |
1227 | item = m_scene.InventoryService.GetItem(item); | ||
1228 | if (item == null) | 1226 | if (item == null) |
1229 | return; | 1227 | return; |
1230 | 1228 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 10b2ff6..a83342c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
219 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), | 219 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), |
220 | // Is.EqualTo((int)AttachmentPoint.Chest)); | 220 | // Is.EqualTo((int)AttachmentPoint.Chest)); |
221 | 221 | ||
222 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(new InventoryItemBase(attSo.FromItemID)); | 222 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(sp.UUID, attSo.FromItemID); |
223 | Assert.That(attachmentItem, Is.Not.Null); | 223 | Assert.That(attachmentItem, Is.Not.Null); |
224 | Assert.That(attachmentItem.Name, Is.EqualTo(attName)); | 224 | Assert.That(attachmentItem.Name, Is.EqualTo(attName)); |
225 | 225 | ||
@@ -266,7 +266,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
266 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), | 266 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), |
267 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); | 267 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); |
268 | 268 | ||
269 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(new InventoryItemBase(attSo.FromItemID)); | 269 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(sp.UUID, attSo.FromItemID); |
270 | Assert.That(attachmentItem, Is.Not.Null); | 270 | Assert.That(attachmentItem, Is.Not.Null); |
271 | Assert.That(attachmentItem.Name, Is.EqualTo(so.Name)); | 271 | Assert.That(attachmentItem.Name, Is.EqualTo(so.Name)); |
272 | 272 | ||
@@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
299 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), | 299 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), |
300 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); | 300 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); |
301 | 301 | ||
302 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(new InventoryItemBase(attSo.FromItemID)); | 302 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(sp.UUID, attSo.FromItemID); |
303 | Assert.That(attachmentItem, Is.Not.Null); | 303 | Assert.That(attachmentItem, Is.Not.Null); |
304 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); | 304 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); |
305 | 305 | ||
@@ -332,7 +332,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
332 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), | 332 | // sp.Appearance.GetAttachpoint(attSo.FromItemID), |
333 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); | 333 | // Is.EqualTo((int)AttachmentPoint.LeftHand)); |
334 | 334 | ||
335 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(new InventoryItemBase(attSo.FromItemID)); | 335 | InventoryItemBase attachmentItem = scene.InventoryService.GetItem(sp.UUID, attSo.FromItemID); |
336 | Assert.That(attachmentItem, Is.Not.Null); | 336 | Assert.That(attachmentItem, Is.Not.Null); |
337 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); | 337 | Assert.That(attachmentItem.Name, Is.EqualTo(so2.Name)); |
338 | 338 | ||
@@ -600,7 +600,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
600 | // Assert.That(sp.Appearance.GetAttachments().Count, Is.EqualTo(0)); | 600 | // Assert.That(sp.Appearance.GetAttachments().Count, Is.EqualTo(0)); |
601 | 601 | ||
602 | // Check item status | 602 | // Check item status |
603 | Assert.That(scene.InventoryService.GetItem(new InventoryItemBase(attItem.ID)), Is.Null); | 603 | Assert.That(scene.InventoryService.GetItem(sp.UUID, attItem.ID), Is.Null); |
604 | 604 | ||
605 | // Check object in scene | 605 | // Check object in scene |
606 | SceneObjectGroup soInScene = scene.GetSceneObjectGroup("att"); | 606 | SceneObjectGroup soInScene = scene.GetSceneObjectGroup("att"); |
@@ -679,7 +679,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
679 | 679 | ||
680 | scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, rezzedSo); | 680 | scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, rezzedSo); |
681 | 681 | ||
682 | InventoryItemBase userItemUpdated = scene.InventoryService.GetItem(userItem); | 682 | InventoryItemBase userItemUpdated = scene.InventoryService.GetItem(userItem.Owner, userItem.ID); |
683 | AssetBase asset = scene.AssetService.Get(userItemUpdated.AssetID.ToString()); | 683 | AssetBase asset = scene.AssetService.Get(userItemUpdated.AssetID.ToString()); |
684 | 684 | ||
685 | // TODO: It would probably be better here to check script state via the saving and retrieval of state | 685 | // TODO: It would probably be better here to check script state via the saving and retrieval of state |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index c800383..08b276d 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -904,8 +904,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
904 | continue; | 904 | continue; |
905 | } | 905 | } |
906 | 906 | ||
907 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); | 907 | InventoryItemBase baseItem = invService.GetItem(userID, appearance.Wearables[i][j].ItemID); |
908 | baseItem = invService.GetItem(baseItem); | ||
909 | 908 | ||
910 | if (baseItem != null) | 909 | if (baseItem != null) |
911 | { | 910 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index eb23e83..e5bf919 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs | |||
@@ -239,8 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
239 | InventoryFolderBase trashFolder = | 239 | InventoryFolderBase trashFolder = |
240 | invService.GetFolderForType(client.AgentId, FolderType.Trash); | 240 | invService.GetFolderForType(client.AgentId, FolderType.Trash); |
241 | 241 | ||
242 | InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId); | 242 | InventoryItemBase item = invService.GetItem(client.AgentId, transactionID); |
243 | item = invService.GetItem(item); | ||
244 | 243 | ||
245 | if (item != null && trashFolder != null) | 244 | if (item != null && trashFolder != null) |
246 | { | 245 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 095c57b..4efcd3b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -86,8 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
86 | { | 86 | { |
87 | IInventoryService invService = m_scene.InventoryService; | 87 | IInventoryService invService = m_scene.InventoryService; |
88 | 88 | ||
89 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); | 89 | InventoryItemBase item = invService.GetItem(client.AgentId, gestureId); |
90 | item = invService.GetItem(item); | ||
91 | if (item != null) | 90 | if (item != null) |
92 | { | 91 | { |
93 | item.Flags |= 1; | 92 | item.Flags |= 1; |
@@ -102,8 +101,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
102 | { | 101 | { |
103 | IInventoryService invService = m_scene.InventoryService; | 102 | IInventoryService invService = m_scene.InventoryService; |
104 | 103 | ||
105 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); | 104 | InventoryItemBase item = invService.GetItem(client.AgentId, gestureId); |
106 | item = invService.GetItem(item); | ||
107 | if (item != null) | 105 | if (item != null) |
108 | { | 106 | { |
109 | item.Flags &= ~(uint)1; | 107 | item.Flags &= ~(uint)1; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 085328c..6c2cf0a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -270,8 +270,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
270 | // RLV uses this | 270 | // RLV uses this |
271 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) | 271 | if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) |
272 | { | 272 | { |
273 | InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId); | 273 | InventoryFolderBase folder = invService.GetFolder(client.AgentId, inventoryID); |
274 | folder = invService.GetFolder(folder); | ||
275 | 274 | ||
276 | if (folder != null) | 275 | if (folder != null) |
277 | { | 276 | { |
@@ -280,8 +279,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
280 | UUID destFolderID = new UUID(im.binaryBucket, 0); | 279 | UUID destFolderID = new UUID(im.binaryBucket, 0); |
281 | if (destFolderID != UUID.Zero) | 280 | if (destFolderID != UUID.Zero) |
282 | { | 281 | { |
283 | InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId); | 282 | InventoryFolderBase destFolder = invService.GetFolder(client.AgentId, destFolderID); |
284 | destFolder = invService.GetFolder(destFolder); | ||
285 | if (destFolder != null) | 283 | if (destFolder != null) |
286 | { | 284 | { |
287 | if (folder.ParentID != destFolder.ID) | 285 | if (folder.ParentID != destFolder.ID) |
@@ -339,8 +337,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
339 | 337 | ||
340 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 338 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
341 | 339 | ||
342 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 340 | InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); |
343 | item = invService.GetItem(item); | ||
344 | InventoryFolderBase folder = null; | 341 | InventoryFolderBase folder = null; |
345 | UUID? previousParentFolderID = null; | 342 | UUID? previousParentFolderID = null; |
346 | 343 | ||
@@ -354,8 +351,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
354 | } | 351 | } |
355 | else | 352 | else |
356 | { | 353 | { |
357 | folder = new InventoryFolderBase(inventoryID, client.AgentId); | 354 | folder = invService.GetFolder(client.AgentId, inventoryID); |
358 | folder = invService.GetFolder(folder); | ||
359 | 355 | ||
360 | if (folder != null) // It's a folder | 356 | if (folder != null) // It's a folder |
361 | { | 357 | { |
@@ -368,9 +364,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
368 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | 364 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). |
369 | if (previousParentFolderID != null) | 365 | if (previousParentFolderID != null) |
370 | { | 366 | { |
371 | InventoryFolderBase previousParentFolder | 367 | InventoryFolderBase previousParentFolder = invService.GetFolder(client.AgentId, (UUID)previousParentFolderID); |
372 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
373 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
374 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | 368 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); |
375 | 369 | ||
376 | scene.SendInventoryUpdate(client, destinationFolder, true, true); | 370 | scene.SendInventoryUpdate(client, destinationFolder, true, true); |
@@ -392,8 +386,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
392 | 386 | ||
393 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 387 | UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
394 | 388 | ||
395 | InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); | 389 | InventoryItemBase item = invService.GetItem(client.AgentId, inventoryID); |
396 | item = invService.GetItem(item); | ||
397 | InventoryFolderBase folder = null; | 390 | InventoryFolderBase folder = null; |
398 | UUID? previousParentFolderID = null; | 391 | UUID? previousParentFolderID = null; |
399 | 392 | ||
@@ -410,8 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
410 | } | 403 | } |
411 | else | 404 | else |
412 | { | 405 | { |
413 | folder = new InventoryFolderBase(inventoryID, client.AgentId); | 406 | folder = invService.GetFolder(client.AgentId, inventoryID); |
414 | folder = invService.GetFolder(folder); | ||
415 | 407 | ||
416 | if (folder != null & trashFolder != null) | 408 | if (folder != null & trashFolder != null) |
417 | { | 409 | { |
@@ -439,9 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
439 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). | 431 | // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code). |
440 | else if (previousParentFolderID != null) | 432 | else if (previousParentFolderID != null) |
441 | { | 433 | { |
442 | InventoryFolderBase previousParentFolder | 434 | InventoryFolderBase previousParentFolder = invService.GetFolder(client.AgentId, (UUID)previousParentFolderID); |
443 | = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId); | ||
444 | previousParentFolder = invService.GetFolder(previousParentFolder); | ||
445 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); | 435 | scene.SendInventoryUpdate(client, previousParentFolder, true, true); |
446 | 436 | ||
447 | scene.SendInventoryUpdate(client, trashFolder, true, true); | 437 | scene.SendInventoryUpdate(client, trashFolder, true, true); |
@@ -500,10 +490,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
500 | { | 490 | { |
501 | UUID folderID = new UUID(im.binaryBucket, 1); | 491 | UUID folderID = new UUID(im.binaryBucket, 1); |
502 | 492 | ||
503 | InventoryFolderBase given = | ||
504 | new InventoryFolderBase(folderID, recipientID); | ||
505 | InventoryFolderBase folder = | 493 | InventoryFolderBase folder = |
506 | scene.InventoryService.GetFolder(given); | 494 | scene.InventoryService.GetFolder(recipientID, folderID); |
507 | 495 | ||
508 | if (folder != null) | 496 | if (folder != null) |
509 | user.ControllingClient.SendBulkUpdateInventory(folder); | 497 | user.ControllingClient.SendBulkUpdateInventory(folder); |
@@ -512,10 +500,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
512 | { | 500 | { |
513 | UUID itemID = new UUID(im.binaryBucket, 1); | 501 | UUID itemID = new UUID(im.binaryBucket, 1); |
514 | 502 | ||
515 | InventoryItemBase given = | ||
516 | new InventoryItemBase(itemID, recipientID); | ||
517 | InventoryItemBase item = | 503 | InventoryItemBase item = |
518 | scene.InventoryService.GetItem(given); | 504 | scene.InventoryService.GetItem(recipientID, itemID); |
519 | 505 | ||
520 | if (item != null) | 506 | if (item != null) |
521 | { | 507 | { |
@@ -538,10 +524,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
538 | { | 524 | { |
539 | UUID folderID = new UUID(im.imSessionID); | 525 | UUID folderID = new UUID(im.imSessionID); |
540 | 526 | ||
541 | InventoryFolderBase given = | ||
542 | new InventoryFolderBase(folderID, recipientID); | ||
543 | InventoryFolderBase folder = | 527 | InventoryFolderBase folder = |
544 | scene.InventoryService.GetFolder(given); | 528 | scene.InventoryService.GetFolder(recipientID, folderID); |
545 | 529 | ||
546 | if (folder != null) | 530 | if (folder != null) |
547 | user.ControllingClient.SendBulkUpdateInventory(folder); | 531 | user.ControllingClient.SendBulkUpdateInventory(folder); |
@@ -550,10 +534,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
550 | { | 534 | { |
551 | UUID itemID = new UUID(im.imSessionID); | 535 | UUID itemID = new UUID(im.imSessionID); |
552 | 536 | ||
553 | InventoryItemBase given = | ||
554 | new InventoryItemBase(itemID, recipientID); | ||
555 | InventoryItemBase item = | 537 | InventoryItemBase item = |
556 | scene.InventoryService.GetItem(given); | 538 | scene.InventoryService.GetItem(recipientID, itemID); |
557 | 539 | ||
558 | if (item != null) | 540 | if (item != null) |
559 | { | 541 | { |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index dfc880a..a9aaf12 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -95,8 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
95 | 95 | ||
96 | foreach (AvatarAttachment att in a.GetAttachments()) | 96 | foreach (AvatarAttachment att in a.GetAttachments()) |
97 | { | 97 | { |
98 | InventoryItemBase item = new InventoryItemBase(att.ItemID, account.PrincipalID); | 98 | InventoryItemBase item = Scene.InventoryService.GetItem(account.PrincipalID, att.ItemID); |
99 | item = Scene.InventoryService.GetItem(item); | ||
100 | if (item != null) | 99 | if (item != null) |
101 | a.SetAttachment(att.AttachPoint, att.ItemID, item.AssetID); | 100 | a.SetAttachment(att.AttachPoint, att.ItemID, item.AssetID); |
102 | else | 101 | else |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 06a8f25..4119f90 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -314,9 +314,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
314 | 314 | ||
315 | //if (fromTaskID.Equals(UUID.Zero)) | 315 | //if (fromTaskID.Equals(UUID.Zero)) |
316 | //{ | 316 | //{ |
317 | InventoryItemBase item = new InventoryItemBase(itemID); | 317 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
318 | item.Owner = remoteClient.AgentId; | ||
319 | item = m_Scene.InventoryService.GetItem(item); | ||
320 | //if (item == null) | 318 | //if (item == null) |
321 | //{ // Fetch the item | 319 | //{ // Fetch the item |
322 | // item = new InventoryItemBase(); | 320 | // item = new InventoryItemBase(); |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 64233d5..781b9ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -184,8 +184,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
184 | if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 184 | if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
185 | return; | 185 | return; |
186 | 186 | ||
187 | InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId); | 187 | InventoryFolderBase folder = m_Scene.InventoryService.GetFolder(remoteClient.AgentId, folderID); |
188 | InventoryFolderBase folder = m_Scene.InventoryService.GetFolder(f); | ||
189 | 188 | ||
190 | if (folder == null && Enum.IsDefined(typeof(FolderType), (sbyte)invType)) | 189 | if (folder == null && Enum.IsDefined(typeof(FolderType), (sbyte)invType)) |
191 | { | 190 | { |
@@ -260,8 +259,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
260 | /// <returns></returns> | 259 | /// <returns></returns> |
261 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 260 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
262 | { | 261 | { |
263 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 262 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
264 | item = m_Scene.InventoryService.GetItem(item); | ||
265 | 263 | ||
266 | if (item.Owner != remoteClient.AgentId) | 264 | if (item.Owner != remoteClient.AgentId) |
267 | return UUID.Zero; | 265 | return UUID.Zero; |
@@ -719,8 +717,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
719 | 717 | ||
720 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 718 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
721 | { | 719 | { |
722 | item = new InventoryItemBase(so.RootPart.FromUserInventoryItemID, userID); | 720 | item = m_Scene.InventoryService.GetItem(userID, so.RootPart.FromUserInventoryItemID); |
723 | item = m_Scene.InventoryService.GetItem(item); | ||
724 | 721 | ||
725 | //item = userInfo.RootFolder.FindItem( | 722 | //item = userInfo.RootFolder.FindItem( |
726 | // objectGroup.RootPart.FromUserInventoryItemID); | 723 | // objectGroup.RootPart.FromUserInventoryItemID); |
@@ -792,9 +789,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
792 | { | 789 | { |
793 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) | 790 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) |
794 | { | 791 | { |
795 | InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID); | 792 | folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID); |
796 | if (f != null) | ||
797 | folder = m_Scene.InventoryService.GetFolder(f); | ||
798 | 793 | ||
799 | if(folder.Type == 14 || folder.Type == 16) | 794 | if(folder.Type == 14 || folder.Type == 16) |
800 | { | 795 | { |
@@ -830,8 +825,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
830 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 825 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
831 | { | 826 | { |
832 | // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); | 827 | // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); |
833 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 828 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
834 | item = m_Scene.InventoryService.GetItem(item); | ||
835 | 829 | ||
836 | if (item == null) | 830 | if (item == null) |
837 | { | 831 | { |
@@ -1289,8 +1283,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1289 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) | 1283 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) |
1290 | { | 1284 | { |
1291 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | 1285 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); |
1292 | InventoryItemBase item = new InventoryItemBase(itemID, agentID); | 1286 | InventoryItemBase item = invService.GetItem(agentID, itemID); |
1293 | item = invService.GetItem(item); | ||
1294 | 1287 | ||
1295 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) | 1288 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) |
1296 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 1289 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs index e1e1838..21e00b2 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs | |||
@@ -103,13 +103,8 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
103 | { | 103 | { |
104 | InventoryItemBase[] itemColl = new InventoryItemBase[itemIDs.Length]; | 104 | InventoryItemBase[] itemColl = new InventoryItemBase[itemIDs.Length]; |
105 | int i = 0; | 105 | int i = 0; |
106 | InventoryItemBase item = new InventoryItemBase(); | ||
107 | item.Owner = principalID; | ||
108 | foreach (UUID fid in itemIDs) | 106 | foreach (UUID fid in itemIDs) |
109 | { | 107 | itemColl[i++] = GetItem(principalID, fid); |
110 | item.ID = fid; | ||
111 | itemColl[i++] = GetItem(item); | ||
112 | } | ||
113 | 108 | ||
114 | return itemColl; | 109 | return itemColl; |
115 | } | 110 | } |
@@ -239,14 +234,14 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
239 | /// </summary> | 234 | /// </summary> |
240 | /// <param name="item"></param> | 235 | /// <param name="item"></param> |
241 | /// <returns></returns> | 236 | /// <returns></returns> |
242 | public InventoryItemBase GetItem(InventoryItemBase item) { return null; } | 237 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) { return null; } |
243 | 238 | ||
244 | /// <summary> | 239 | /// <summary> |
245 | /// Get a folder, given by its UUID | 240 | /// Get a folder, given by its UUID |
246 | /// </summary> | 241 | /// </summary> |
247 | /// <param name="folder"></param> | 242 | /// <param name="folder"></param> |
248 | /// <returns></returns> | 243 | /// <returns></returns> |
249 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } | 244 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) { return null; } |
250 | 245 | ||
251 | /// <summary> | 246 | /// <summary> |
252 | /// Does the given user have an inventory structure? | 247 | /// Does the given user have an inventory structure? |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 48f228a..863560b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -598,21 +598,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
598 | return connector.DeleteItems(ownerID, itemIDs); | 598 | return connector.DeleteItems(ownerID, itemIDs); |
599 | } | 599 | } |
600 | 600 | ||
601 | public InventoryItemBase GetItem(InventoryItemBase item) | 601 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) |
602 | { | 602 | { |
603 | if (item == null) | ||
604 | return null; | ||
605 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); | 603 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID); |
606 | 604 | ||
607 | string invURL = GetInventoryServiceURL(item.Owner); | 605 | string invURL = GetInventoryServiceURL(principalID); |
608 | 606 | ||
609 | if (invURL == null) // not there, forward to local inventory connector to resolve | 607 | if (invURL == null) // not there, forward to local inventory connector to resolve |
610 | lock (m_Lock) | 608 | lock (m_Lock) |
611 | return m_LocalGridInventoryService.GetItem(item); | 609 | return m_LocalGridInventoryService.GetItem(principalID, itemID); |
612 | 610 | ||
613 | IInventoryService connector = GetConnector(invURL); | 611 | IInventoryService connector = GetConnector(invURL); |
614 | 612 | ||
615 | return connector.GetItem(item); | 613 | return connector.GetItem(principalID, itemID); |
616 | } | 614 | } |
617 | 615 | ||
618 | public InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs) | 616 | public InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs) |
@@ -632,22 +630,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
632 | return connector.GetMultipleItems(userID, itemIDs); | 630 | return connector.GetMultipleItems(userID, itemIDs); |
633 | } | 631 | } |
634 | 632 | ||
635 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 633 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
636 | { | 634 | { |
637 | if (folder == null) | ||
638 | return null; | ||
639 | |||
640 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); | 635 | //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID); |
641 | 636 | ||
642 | string invURL = GetInventoryServiceURL(folder.Owner); | 637 | string invURL = GetInventoryServiceURL(principalID); |
643 | 638 | ||
644 | if (invURL == null) // not there, forward to local inventory connector to resolve | 639 | if (invURL == null) // not there, forward to local inventory connector to resolve |
645 | lock (m_Lock) | 640 | lock (m_Lock) |
646 | return m_LocalGridInventoryService.GetFolder(folder); | 641 | return m_LocalGridInventoryService.GetFolder(principalID, folderID); |
647 | 642 | ||
648 | IInventoryService connector = GetConnector(invURL); | 643 | IInventoryService connector = GetConnector(invURL); |
649 | 644 | ||
650 | return connector.GetFolder(folder); | 645 | return connector.GetFolder(principalID, folderID); |
651 | } | 646 | } |
652 | 647 | ||
653 | public bool HasInventoryForUser(UUID userID) | 648 | public bool HasInventoryForUser(UUID userID) |
@@ -710,4 +705,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
710 | return connector; | 705 | return connector; |
711 | } | 706 | } |
712 | } | 707 | } |
713 | } \ No newline at end of file | 708 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 20d4e02..0d36725 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -292,13 +292,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
292 | return m_InventoryService.DeleteItems(ownerID, itemIDs); | 292 | return m_InventoryService.DeleteItems(ownerID, itemIDs); |
293 | } | 293 | } |
294 | 294 | ||
295 | public InventoryItemBase GetItem(InventoryItemBase item) | 295 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) |
296 | { | 296 | { |
297 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); | 297 | // m_log.DebugFormat("[LOCAL INVENTORY SERVICES CONNECTOR]: Requesting inventory item {0}", item.ID); |
298 | 298 | ||
299 | // UUID requestedItemId = item.ID; | 299 | // UUID requestedItemId = item.ID; |
300 | 300 | ||
301 | item = m_InventoryService.GetItem(item); | 301 | InventoryItemBase item = m_InventoryService.GetItem(principalID, itemID); |
302 | 302 | ||
303 | // if (null == item) | 303 | // if (null == item) |
304 | // m_log.ErrorFormat( | 304 | // m_log.ErrorFormat( |
@@ -312,9 +312,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
312 | return m_InventoryService.GetMultipleItems(userID, itemIDs); | 312 | return m_InventoryService.GetMultipleItems(userID, itemIDs); |
313 | } | 313 | } |
314 | 314 | ||
315 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 315 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
316 | { | 316 | { |
317 | return m_InventoryService.GetFolder(folder); | 317 | return m_InventoryService.GetFolder(principalID, folderID); |
318 | } | 318 | } |
319 | 319 | ||
320 | /// <summary> | 320 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 978b9d9..62b44b1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -292,15 +292,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
292 | return m_RemoteConnector.DeleteItems(ownerID, itemIDs); | 292 | return m_RemoteConnector.DeleteItems(ownerID, itemIDs); |
293 | } | 293 | } |
294 | 294 | ||
295 | public InventoryItemBase GetItem(InventoryItemBase item) | 295 | public InventoryItemBase GetItem(UUID userID, UUID itemID) |
296 | { | 296 | { |
297 | //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); | 297 | //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); |
298 | if (item == null) | ||
299 | return null; | ||
300 | 298 | ||
301 | if (m_RemoteConnector == null) | 299 | if (m_RemoteConnector == null) |
302 | m_log.DebugFormat("[XINVENTORY CONNECTOR]: connector stub is null!!!"); | 300 | m_log.DebugFormat("[XINVENTORY CONNECTOR]: connector stub is null!!!"); |
303 | return m_RemoteConnector.GetItem(item); | 301 | return m_RemoteConnector.GetItem(userID, itemID); |
304 | } | 302 | } |
305 | 303 | ||
306 | public InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs) | 304 | public InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs) |
@@ -311,13 +309,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
311 | return m_RemoteConnector.GetMultipleItems(userID, itemIDs); | 309 | return m_RemoteConnector.GetMultipleItems(userID, itemIDs); |
312 | } | 310 | } |
313 | 311 | ||
314 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 312 | public InventoryFolderBase GetFolder(UUID userID, UUID folderID) |
315 | { | 313 | { |
316 | //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); | 314 | //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); |
317 | if (folder == null) | ||
318 | return null; | ||
319 | 315 | ||
320 | return m_RemoteConnector.GetFolder(folder); | 316 | return m_RemoteConnector.GetFolder(userID, folderID); |
321 | } | 317 | } |
322 | 318 | ||
323 | public bool HasInventoryForUser(UUID userID) | 319 | public bool HasInventoryForUser(UUID userID) |
@@ -337,4 +333,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
337 | 333 | ||
338 | #endregion | 334 | #endregion |
339 | } | 335 | } |
340 | } \ No newline at end of file | 336 | } |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 303f8a8..06900f0 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -1100,8 +1100,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1100 | if (objectID == UUID.Zero) // User inventory | 1100 | if (objectID == UUID.Zero) // User inventory |
1101 | { | 1101 | { |
1102 | IInventoryService invService = m_scene.InventoryService; | 1102 | IInventoryService invService = m_scene.InventoryService; |
1103 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); | 1103 | InventoryItemBase assetRequestItem = invService.GetItem(user, notecard); |
1104 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1105 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item | 1104 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1106 | { | 1105 | { |
1107 | assetRequestItem = LibraryRootFolder.FindItem(notecard); | 1106 | assetRequestItem = LibraryRootFolder.FindItem(notecard); |
@@ -1629,8 +1628,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1629 | if (objectID == UUID.Zero) // User inventory | 1628 | if (objectID == UUID.Zero) // User inventory |
1630 | { | 1629 | { |
1631 | IInventoryService invService = m_scene.InventoryService; | 1630 | IInventoryService invService = m_scene.InventoryService; |
1632 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); | 1631 | InventoryItemBase assetRequestItem = invService.GetItem(user, script); |
1633 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1634 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item | 1632 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1635 | { | 1633 | { |
1636 | assetRequestItem = LibraryRootFolder.FindItem(script); | 1634 | assetRequestItem = LibraryRootFolder.FindItem(script); |
@@ -1726,8 +1724,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1726 | if (objectID == UUID.Zero) // User inventory | 1724 | if (objectID == UUID.Zero) // User inventory |
1727 | { | 1725 | { |
1728 | IInventoryService invService = m_scene.InventoryService; | 1726 | IInventoryService invService = m_scene.InventoryService; |
1729 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); | 1727 | InventoryItemBase assetRequestItem = invService.GetItem(user, notecard); |
1730 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1731 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item | 1728 | if (assetRequestItem == null && LibraryRootFolder != null) // Library item |
1732 | { | 1729 | { |
1733 | assetRequestItem = LibraryRootFolder.FindItem(notecard); | 1730 | assetRequestItem = LibraryRootFolder.FindItem(notecard); |
diff --git a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs index d9d2e64..4362e28 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncInventorySender.cs | |||
@@ -143,8 +143,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
143 | // m_log.DebugFormat( | 143 | // m_log.DebugFormat( |
144 | // "[ASYNC INVENTORY SENDER]: Handling request from {0} for {1} on queue", fh.Client.Name, fh.ItemID); | 144 | // "[ASYNC INVENTORY SENDER]: Handling request from {0} for {1} on queue", fh.Client.Name, fh.ItemID); |
145 | 145 | ||
146 | InventoryItemBase item = new InventoryItemBase(fh.ItemID, fh.Client.AgentId); | 146 | InventoryItemBase item = m_scene.InventoryService.GetItem(fh.Client.AgentId, fh.ItemID); |
147 | item = m_scene.InventoryService.GetItem(item); | ||
148 | 147 | ||
149 | if (item != null) | 148 | if (item != null) |
150 | fh.Client.SendInventoryItemDetails(item.Owner, item); | 149 | fh.Client.SendInventoryItemDetails(item.Owner, item); |
@@ -153,4 +152,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
153 | } | 152 | } |
154 | } | 153 | } |
155 | } | 154 | } |
156 | } \ No newline at end of file | 155 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 30bc75b..f2df364 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -223,8 +223,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
223 | 223 | ||
224 | if (core.TryGet<IClientInventory>(out inv)) | 224 | if (core.TryGet<IClientInventory>(out inv)) |
225 | { | 225 | { |
226 | InventoryFolderBase parent = new InventoryFolderBase(f.ParentID, f.Owner); | 226 | InventoryFolderBase parent = InventoryService.GetFolder(f.Owner, f.ParentID); |
227 | parent = InventoryService.GetFolder(parent); | ||
228 | inv.SendRemoveInventoryItems(new UUID[] { item.ID }); | 227 | inv.SendRemoveInventoryItems(new UUID[] { item.ID }); |
229 | inv.SendBulkUpdateInventory(new InventoryFolderBase[0], new InventoryItemBase[] { item }); | 228 | inv.SendBulkUpdateInventory(new InventoryFolderBase[0], new InventoryItemBase[] { item }); |
230 | string message = "The item was placed in folder " + f.Name; | 229 | string message = "The item was placed in folder " + f.Name; |
@@ -407,8 +406,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
407 | // inventory. Rut-Roh. Whatever. Make this secure. Yeah. | 406 | // inventory. Rut-Roh. Whatever. Make this secure. Yeah. |
408 | // | 407 | // |
409 | // Passing something to another avatar or a an object will already | 408 | // Passing something to another avatar or a an object will already |
410 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 409 | InventoryItemBase item = InventoryService.GetItem(remoteClient.AgentId, itemID); |
411 | item = InventoryService.GetItem(item); | ||
412 | 410 | ||
413 | if (item != null) | 411 | if (item != null) |
414 | { | 412 | { |
@@ -585,8 +583,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
585 | return null; | 583 | return null; |
586 | } | 584 | } |
587 | 585 | ||
588 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); | 586 | InventoryItemBase item = InventoryService.GetItem(senderId, itemId); |
589 | item = InventoryService.GetItem(item); | ||
590 | 587 | ||
591 | if (item == null) | 588 | if (item == null) |
592 | { | 589 | { |
@@ -807,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
807 | UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId) | 804 | UUID recipientId, UUID senderId, UUID folderId, UUID recipientParentFolderId) |
808 | { | 805 | { |
809 | //// Retrieve the folder from the sender | 806 | //// Retrieve the folder from the sender |
810 | InventoryFolderBase folder = InventoryService.GetFolder(new InventoryFolderBase(folderId, senderId)); | 807 | InventoryFolderBase folder = InventoryService.GetFolder(senderId, folderId); |
811 | if (null == folder) | 808 | if (null == folder) |
812 | { | 809 | { |
813 | m_log.ErrorFormat( | 810 | m_log.ErrorFormat( |
@@ -868,8 +865,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
868 | 865 | ||
869 | if (item == null) | 866 | if (item == null) |
870 | { | 867 | { |
871 | item = new InventoryItemBase(oldItemID, remoteClient.AgentId); | 868 | item = InventoryService.GetItem(remoteClient.AgentId, oldItemID); |
872 | item = InventoryService.GetItem(item); | ||
873 | 869 | ||
874 | if (item == null) | 870 | if (item == null) |
875 | { | 871 | { |
@@ -953,7 +949,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
953 | foreach (InventoryItemBase b in items) | 949 | foreach (InventoryItemBase b in items) |
954 | { | 950 | { |
955 | CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null); | 951 | CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null); |
956 | InventoryItemBase n = InventoryService.GetItem(b); | 952 | InventoryItemBase n = InventoryService.GetItem(b.Owner, b.ID); |
957 | n.Folder = destfolder; | 953 | n.Folder = destfolder; |
958 | moveitems.Add(n); | 954 | moveitems.Add(n); |
959 | remoteClient.SendInventoryItemCreateUpdate(n, 0); | 955 | remoteClient.SendInventoryItemCreateUpdate(n, 0); |
@@ -1605,8 +1601,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1605 | InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID); | 1601 | InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID); |
1606 | 1602 | ||
1607 | // Fetch the folder itself to get its current version | 1603 | // Fetch the folder itself to get its current version |
1608 | InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId); | 1604 | InventoryFolderBase containingFolder = InventoryService.GetFolder(client.AgentId, folder.ID); |
1609 | containingFolder = InventoryService.GetFolder(containingFolder); | ||
1610 | 1605 | ||
1611 | // m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", | 1606 | // m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", |
1612 | // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); | 1607 | // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); |
@@ -1620,7 +1615,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1620 | { | 1615 | { |
1621 | if (item.AssetType == (int)AssetType.Link) | 1616 | if (item.AssetType == (int)AssetType.Link) |
1622 | { | 1617 | { |
1623 | InventoryItemBase linkedItem = InventoryService.GetItem(new InventoryItemBase(item.AssetID)); | 1618 | InventoryItemBase linkedItem = InventoryService.GetItem(client.AgentId, item.AssetID); |
1624 | 1619 | ||
1625 | // Take care of genuinely broken links where the target doesn't exist | 1620 | // Take care of genuinely broken links where the target doesn't exist |
1626 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, | 1621 | // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate, |
@@ -1680,8 +1675,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1680 | UUID copyID = UUID.Random(); | 1675 | UUID copyID = UUID.Random(); |
1681 | if (itemID != UUID.Zero) | 1676 | if (itemID != UUID.Zero) |
1682 | { | 1677 | { |
1683 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 1678 | InventoryItemBase item = InventoryService.GetItem(remoteClient.AgentId, itemID); |
1684 | item = InventoryService.GetItem(item); | ||
1685 | 1679 | ||
1686 | // Try library | 1680 | // Try library |
1687 | if (null == item && LibraryService != null && LibraryService.LibraryRootFolder != null) | 1681 | if (null == item && LibraryService != null && LibraryService.LibraryRootFolder != null) |
@@ -1836,8 +1830,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1836 | public SceneObjectPart RezScriptFromAgentInventory(UUID agentID, UUID fromItemID, uint localID) | 1830 | public SceneObjectPart RezScriptFromAgentInventory(UUID agentID, UUID fromItemID, uint localID) |
1837 | { | 1831 | { |
1838 | UUID copyID = UUID.Random(); | 1832 | UUID copyID = UUID.Random(); |
1839 | InventoryItemBase item = new InventoryItemBase(fromItemID, agentID); | 1833 | InventoryItemBase item = InventoryService.GetItem(agentID, fromItemID); |
1840 | item = InventoryService.GetItem(item); | ||
1841 | 1834 | ||
1842 | // Try library | 1835 | // Try library |
1843 | // XXX clumsy, possibly should be one call | 1836 | // XXX clumsy, possibly should be one call |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 34b9c5f..c49edd1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -627,8 +627,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
627 | // m_log.DebugFormat( | 627 | // m_log.DebugFormat( |
628 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); | 628 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); |
629 | 629 | ||
630 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); | 630 | InventoryFolderBase folder = InventoryService.GetFolder(remoteClient.AgentId, folderID); |
631 | folder = InventoryService.GetFolder(folder); | ||
632 | if (folder != null) | 631 | if (folder != null) |
633 | { | 632 | { |
634 | folder.Name = name; | 633 | folder.Name = name; |
@@ -645,8 +644,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
645 | 644 | ||
646 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) | 645 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) |
647 | { | 646 | { |
648 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); | 647 | InventoryFolderBase folder = InventoryService.GetFolder(remoteClient.AgentId, folderID); |
649 | folder = InventoryService.GetFolder(folder); | ||
650 | if (folder != null) | 648 | if (folder != null) |
651 | { | 649 | { |
652 | folder.ParentID = parentID; | 650 | folder.ParentID = parentID; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index cb6ceb5..ddeac66 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -505,8 +505,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
505 | //variable will be set to null and attachment will | 505 | //variable will be set to null and attachment will |
506 | //not be included with the group notice. | 506 | //not be included with the group notice. |
507 | Scene scene = (Scene)remoteClient.Scene; | 507 | Scene scene = (Scene)remoteClient.Scene; |
508 | item = new InventoryItemBase(itemID, ownerID); | 508 | item = scene.InventoryService.GetItem(ownerID, itemID); |
509 | item = scene.InventoryService.GetItem(item); | ||
510 | 509 | ||
511 | if (item != null) | 510 | if (item != null) |
512 | { | 511 | { |
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs index b295446..0bab5aa 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs | |||
@@ -114,12 +114,12 @@ namespace OpenSim.Server.Handlers.Inventory | |||
114 | "POST", "/DeleteItem/", DeleteItems, CheckAuthSession)); | 114 | "POST", "/DeleteItem/", DeleteItems, CheckAuthSession)); |
115 | 115 | ||
116 | m_httpServer.AddStreamHandler( | 116 | m_httpServer.AddStreamHandler( |
117 | new RestDeserialiseSecureHandler<InventoryItemBase, InventoryItemBase>( | 117 | new RestDeserialiseSecureHandler<Guid, InventoryItemBase>( |
118 | "POST", "/QueryItem/", m_InventoryService.GetItem, CheckAuthSession)); | 118 | "POST", "/QueryItem/", GetItem, CheckAuthSession)); |
119 | 119 | ||
120 | m_httpServer.AddStreamHandler( | 120 | m_httpServer.AddStreamHandler( |
121 | new RestDeserialiseSecureHandler<InventoryFolderBase, InventoryFolderBase>( | 121 | new RestDeserialiseSecureHandler<Guid, InventoryFolderBase>( |
122 | "POST", "/QueryFolder/", m_InventoryService.GetFolder, CheckAuthSession)); | 122 | "POST", "/QueryFolder/", GetFolder, CheckAuthSession)); |
123 | 123 | ||
124 | m_httpServer.AddStreamHandler( | 124 | m_httpServer.AddStreamHandler( |
125 | new RestDeserialiseTrustedHandler<Guid, bool>( | 125 | new RestDeserialiseTrustedHandler<Guid, bool>( |
@@ -205,6 +205,16 @@ namespace OpenSim.Server.Handlers.Inventory | |||
205 | return new Dictionary<AssetType, InventoryFolderBase>(); | 205 | return new Dictionary<AssetType, InventoryFolderBase>(); |
206 | } | 206 | } |
207 | 207 | ||
208 | public InventoryItemBase GetItem(Guid guid) | ||
209 | { | ||
210 | return m_InventoryService.GetItem(UUID.Zero, new UUID(guid)); | ||
211 | } | ||
212 | |||
213 | public InventoryFolderBase GetFolder(Guid guid) | ||
214 | { | ||
215 | return m_InventoryService.GetFolder(UUID.Zero, new UUID(guid)); | ||
216 | } | ||
217 | |||
208 | public InventoryCollection GetFolderContent(Guid guid) | 218 | public InventoryCollection GetFolderContent(Guid guid) |
209 | { | 219 | { |
210 | return m_InventoryService.GetFolderContent(UUID.Zero, new UUID(guid)); | 220 | return m_InventoryService.GetFolderContent(UUID.Zero, new UUID(guid)); |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 5c4e7a9..96d6451 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -566,9 +566,11 @@ namespace OpenSim.Server.Handlers.Inventory | |||
566 | Dictionary<string,object> result = new Dictionary<string,object>(); | 566 | Dictionary<string,object> result = new Dictionary<string,object>(); |
567 | UUID id = UUID.Zero; | 567 | UUID id = UUID.Zero; |
568 | UUID.TryParse(request["ID"].ToString(), out id); | 568 | UUID.TryParse(request["ID"].ToString(), out id); |
569 | UUID user = UUID.Zero; | ||
570 | if (request.ContainsKey("PRINCIPAL")) | ||
571 | UUID.TryParse(request["PRINCIPAL"].ToString(), out user); | ||
569 | 572 | ||
570 | InventoryItemBase item = new InventoryItemBase(id); | 573 | InventoryItemBase item = m_InventoryService.GetItem(user, id); |
571 | item = m_InventoryService.GetItem(item); | ||
572 | if (item != null) | 574 | if (item != null) |
573 | result["item"] = EncodeItem(item); | 575 | result["item"] = EncodeItem(item); |
574 | 576 | ||
@@ -617,9 +619,11 @@ namespace OpenSim.Server.Handlers.Inventory | |||
617 | Dictionary<string, object> result = new Dictionary<string, object>(); | 619 | Dictionary<string, object> result = new Dictionary<string, object>(); |
618 | UUID id = UUID.Zero; | 620 | UUID id = UUID.Zero; |
619 | UUID.TryParse(request["ID"].ToString(), out id); | 621 | UUID.TryParse(request["ID"].ToString(), out id); |
622 | UUID user = UUID.Zero; | ||
623 | if (request.ContainsKey("PRINCIPAL")) | ||
624 | UUID.TryParse(request["PRINCIPAL"].ToString(), out user); | ||
620 | 625 | ||
621 | InventoryFolderBase folder = new InventoryFolderBase(id); | 626 | InventoryFolderBase folder = m_InventoryService.GetFolder(user, id); |
622 | folder = m_InventoryService.GetFolder(folder); | ||
623 | if (folder != null) | 627 | if (folder != null) |
624 | result["folder"] = EncodeFolder(folder); | 628 | result["folder"] = EncodeFolder(folder); |
625 | 629 | ||
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index c7d658a..d80e660 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | |||
@@ -520,10 +520,10 @@ namespace OpenSim.Services.Connectors | |||
520 | return CheckReturn(ret); | 520 | return CheckReturn(ret); |
521 | } | 521 | } |
522 | 522 | ||
523 | public InventoryItemBase GetItem(InventoryItemBase item) | 523 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) |
524 | { | 524 | { |
525 | InventoryItemBase retrieved = null; | 525 | InventoryItemBase retrieved = null; |
526 | if (m_ItemCache.TryGetValue(item.ID, out retrieved)) | 526 | if (m_ItemCache.TryGetValue(itemID, out retrieved)) |
527 | { | 527 | { |
528 | return retrieved; | 528 | return retrieved; |
529 | } | 529 | } |
@@ -532,7 +532,8 @@ namespace OpenSim.Services.Connectors | |||
532 | { | 532 | { |
533 | Dictionary<string, object> ret = MakeRequest("GETITEM", | 533 | Dictionary<string, object> ret = MakeRequest("GETITEM", |
534 | new Dictionary<string, object> { | 534 | new Dictionary<string, object> { |
535 | { "ID", item.ID.ToString() } | 535 | { "ID", itemID.ToString() }, |
536 | { "PRINCIPAL", principalID.ToString() } | ||
536 | }); | 537 | }); |
537 | 538 | ||
538 | if (!CheckReturn(ret)) | 539 | if (!CheckReturn(ret)) |
@@ -545,7 +546,7 @@ namespace OpenSim.Services.Connectors | |||
545 | m_log.Error("[XINVENTORY SERVICES CONNECTOR]: Exception in GetItem: ", e); | 546 | m_log.Error("[XINVENTORY SERVICES CONNECTOR]: Exception in GetItem: ", e); |
546 | } | 547 | } |
547 | 548 | ||
548 | m_ItemCache.AddOrUpdate(item.ID, retrieved, CACHE_EXPIRATION_SECONDS); | 549 | m_ItemCache.AddOrUpdate(itemID, retrieved, CACHE_EXPIRATION_SECONDS); |
549 | 550 | ||
550 | return retrieved; | 551 | return retrieved; |
551 | } | 552 | } |
@@ -613,13 +614,14 @@ namespace OpenSim.Services.Connectors | |||
613 | return itemArr; | 614 | return itemArr; |
614 | } | 615 | } |
615 | 616 | ||
616 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 617 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
617 | { | 618 | { |
618 | try | 619 | try |
619 | { | 620 | { |
620 | Dictionary<string, object> ret = MakeRequest("GETFOLDER", | 621 | Dictionary<string, object> ret = MakeRequest("GETFOLDER", |
621 | new Dictionary<string, object> { | 622 | new Dictionary<string, object> { |
622 | { "ID", folder.ID.ToString() } | 623 | { "ID", folderID.ToString() }, |
624 | { "PRINCIPAL", principalID.ToString() } | ||
623 | }); | 625 | }); |
624 | 626 | ||
625 | if (!CheckReturn(ret)) | 627 | if (!CheckReturn(ret)) |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index e793420..3d35834 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -277,17 +277,17 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
277 | /// </summary> | 277 | /// </summary> |
278 | /// <param name="item"></param> | 278 | /// <param name="item"></param> |
279 | /// <returns></returns> | 279 | /// <returns></returns> |
280 | public InventoryItemBase GetItem(InventoryItemBase item) | 280 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) |
281 | { | 281 | { |
282 | InventoryItemBase retrieved = null; | 282 | InventoryItemBase retrieved = null; |
283 | if (m_ItemCache.TryGetValue(item.ID, out retrieved)) | 283 | if (m_ItemCache.TryGetValue(itemID, out retrieved)) |
284 | return retrieved; | 284 | return retrieved; |
285 | 285 | ||
286 | NameValueCollection requestArgs = new NameValueCollection | 286 | NameValueCollection requestArgs = new NameValueCollection |
287 | { | 287 | { |
288 | { "RequestMethod", "GetInventoryNode" }, | 288 | { "RequestMethod", "GetInventoryNode" }, |
289 | { "ItemID", item.ID.ToString() }, | 289 | { "ItemID", itemID.ToString() }, |
290 | { "OwnerID", item.Owner.ToString() }, | 290 | { "OwnerID", principalID.ToString() }, |
291 | { "IncludeFolders", "1" }, | 291 | { "IncludeFolders", "1" }, |
292 | { "IncludeItems", "1" }, | 292 | { "IncludeItems", "1" }, |
293 | { "ChildrenOnly", "1" } | 293 | { "ChildrenOnly", "1" } |
@@ -303,17 +303,17 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
303 | // and sanity check just in case | 303 | // and sanity check just in case |
304 | for (int i = 0; i < items.Count; i++) | 304 | for (int i = 0; i < items.Count; i++) |
305 | { | 305 | { |
306 | if (items[i].ID == item.ID) | 306 | if (items[i].ID == itemID) |
307 | { | 307 | { |
308 | retrieved = items[i]; | 308 | retrieved = items[i]; |
309 | m_ItemCache.AddOrUpdate(item.ID, retrieved, CACHE_EXPIRATION_SECONDS); | 309 | m_ItemCache.AddOrUpdate(itemID, retrieved, CACHE_EXPIRATION_SECONDS); |
310 | return retrieved; | 310 | return retrieved; |
311 | } | 311 | } |
312 | } | 312 | } |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Item " + item.ID + " owned by " + item.Owner + " not found"); | 316 | m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Item " + itemID + " owned by " + principalID + " not found"); |
317 | return null; | 317 | return null; |
318 | } | 318 | } |
319 | 319 | ||
@@ -321,13 +321,8 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
321 | { | 321 | { |
322 | InventoryItemBase[] result = new InventoryItemBase[itemIDs.Length]; | 322 | InventoryItemBase[] result = new InventoryItemBase[itemIDs.Length]; |
323 | int i = 0; | 323 | int i = 0; |
324 | InventoryItemBase item = new InventoryItemBase(); | ||
325 | item.Owner = principalID; | ||
326 | foreach (UUID id in itemIDs) | 324 | foreach (UUID id in itemIDs) |
327 | { | 325 | result[i++] = GetItem(principalID, id); |
328 | item.ID = id; | ||
329 | result[i++] = GetItem(item); | ||
330 | } | ||
331 | 326 | ||
332 | return result; | 327 | return result; |
333 | } | 328 | } |
@@ -337,13 +332,13 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
337 | /// </summary> | 332 | /// </summary> |
338 | /// <param name="folder"></param> | 333 | /// <param name="folder"></param> |
339 | /// <returns></returns> | 334 | /// <returns></returns> |
340 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 335 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
341 | { | 336 | { |
342 | NameValueCollection requestArgs = new NameValueCollection | 337 | NameValueCollection requestArgs = new NameValueCollection |
343 | { | 338 | { |
344 | { "RequestMethod", "GetInventoryNode" }, | 339 | { "RequestMethod", "GetInventoryNode" }, |
345 | { "ItemID", folder.ID.ToString() }, | 340 | { "ItemID", folderID.ToString() }, |
346 | { "OwnerID", folder.Owner.ToString() }, | 341 | { "OwnerID", principalID.ToString() }, |
347 | { "IncludeFolders", "1" }, | 342 | { "IncludeFolders", "1" }, |
348 | { "IncludeItems", "0" }, | 343 | { "IncludeItems", "0" }, |
349 | { "ChildrenOnly", "1" } | 344 | { "ChildrenOnly", "1" } |
@@ -353,7 +348,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
353 | if (response["Success"].AsBoolean() && response["Items"] is OSDArray) | 348 | if (response["Success"].AsBoolean() && response["Items"] is OSDArray) |
354 | { | 349 | { |
355 | OSDArray items = (OSDArray)response["Items"]; | 350 | OSDArray items = (OSDArray)response["Items"]; |
356 | List<InventoryFolderBase> folders = GetFoldersFromResponse(items, folder.ID, true); | 351 | List<InventoryFolderBase> folders = GetFoldersFromResponse(items, folderID, true); |
357 | 352 | ||
358 | if (folders.Count > 0) | 353 | if (folders.Count > 0) |
359 | return folders[0]; | 354 | return folders[0]; |
diff --git a/OpenSim/Services/HypergridService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index 9158b41..a0d25e3 100644 --- a/OpenSim/Services/HypergridService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs | |||
@@ -291,9 +291,9 @@ namespace OpenSim.Services.HypergridService | |||
291 | //{ | 291 | //{ |
292 | //} | 292 | //} |
293 | 293 | ||
294 | public override InventoryItemBase GetItem(InventoryItemBase item) | 294 | public override InventoryItemBase GetItem(UUID principalID, UUID itemID) |
295 | { | 295 | { |
296 | InventoryItemBase it = base.GetItem(item); | 296 | InventoryItemBase it = base.GetItem(principalID, itemID); |
297 | if (it != null) | 297 | if (it != null) |
298 | { | 298 | { |
299 | UserAccount user = m_Cache.GetUser(it.CreatorId); | 299 | UserAccount user = m_Cache.GetUser(it.CreatorId); |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 40eb6d4..7f14e8e 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -383,7 +383,7 @@ namespace OpenSim.Services.HypergridService | |||
383 | // Check the items' current folders | 383 | // Check the items' current folders |
384 | foreach (InventoryItemBase item in items) | 384 | foreach (InventoryItemBase item in items) |
385 | { | 385 | { |
386 | InventoryItemBase originalItem = base.GetItem(item); | 386 | InventoryItemBase originalItem = base.GetItem(item.Owner, item.ID); |
387 | if (!IsWithinSuitcaseTree(originalItem.Owner, originalItem.Folder)) | 387 | if (!IsWithinSuitcaseTree(originalItem.Owner, originalItem.Folder)) |
388 | { | 388 | { |
389 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner); | 389 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: MoveItems: folder {0} (user {1}) is not within Suitcase tree", item.Folder, item.Owner); |
@@ -401,7 +401,7 @@ namespace OpenSim.Services.HypergridService | |||
401 | 401 | ||
402 | public new InventoryItemBase GetItem(InventoryItemBase item) | 402 | public new InventoryItemBase GetItem(InventoryItemBase item) |
403 | { | 403 | { |
404 | InventoryItemBase it = base.GetItem(item); | 404 | InventoryItemBase it = base.GetItem(item.Owner, item.ID); |
405 | if (it == null) | 405 | if (it == null) |
406 | { | 406 | { |
407 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve item {0} ({1}) in folder {2}", | 407 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve item {0} ({1}) in folder {2}", |
@@ -426,9 +426,9 @@ namespace OpenSim.Services.HypergridService | |||
426 | return it; | 426 | return it; |
427 | } | 427 | } |
428 | 428 | ||
429 | public new InventoryFolderBase GetFolder(InventoryFolderBase folder) | 429 | public new InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
430 | { | 430 | { |
431 | InventoryFolderBase f = base.GetFolder(folder); | 431 | InventoryFolderBase f = base.GetFolder(principalID, folderID); |
432 | 432 | ||
433 | if (f != null) | 433 | if (f != null) |
434 | { | 434 | { |
diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 4289bba..c0c9ba8 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs | |||
@@ -161,7 +161,7 @@ namespace OpenSim.Services.Interfaces | |||
161 | /// </summary> | 161 | /// </summary> |
162 | /// <param name="item"></param> | 162 | /// <param name="item"></param> |
163 | /// <returns>null if no item was found, otherwise the found item</returns> | 163 | /// <returns>null if no item was found, otherwise the found item</returns> |
164 | InventoryItemBase GetItem(InventoryItemBase item); | 164 | InventoryItemBase GetItem(UUID userID, UUID itemID); |
165 | 165 | ||
166 | /// <summary> | 166 | /// <summary> |
167 | /// Get multiple items, given by their UUIDs | 167 | /// Get multiple items, given by their UUIDs |
@@ -175,7 +175,7 @@ namespace OpenSim.Services.Interfaces | |||
175 | /// </summary> | 175 | /// </summary> |
176 | /// <param name="folder"></param> | 176 | /// <param name="folder"></param> |
177 | /// <returns></returns> | 177 | /// <returns></returns> |
178 | InventoryFolderBase GetFolder(InventoryFolderBase folder); | 178 | InventoryFolderBase GetFolder(UUID userID, UUID folderID); |
179 | 179 | ||
180 | /// <summary> | 180 | /// <summary> |
181 | /// Does the given user have an inventory structure? | 181 | /// Does the given user have an inventory structure? |
diff --git a/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs index 9e3fa69..3cfd125 100644 --- a/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs +++ b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs | |||
@@ -90,8 +90,7 @@ namespace OpenSim.Services.InventoryService.Tests | |||
90 | 90 | ||
91 | Assert.That(xis.AddItem(itemToStore), Is.True); | 91 | Assert.That(xis.AddItem(itemToStore), Is.True); |
92 | 92 | ||
93 | InventoryItemBase itemRetrieved = new InventoryItemBase(itemId); | 93 | InventoryItemBase itemRetrieved = xis.GetItem(UUID.Zero, itemId); |
94 | itemRetrieved = xis.GetItem(itemRetrieved); | ||
95 | 94 | ||
96 | Assert.That(itemRetrieved, Is.Not.Null); | 95 | Assert.That(itemRetrieved, Is.Not.Null); |
97 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); | 96 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); |
@@ -139,8 +138,7 @@ namespace OpenSim.Services.InventoryService.Tests | |||
139 | 138 | ||
140 | Assert.That(xis.UpdateItem(itemToStore), Is.True); | 139 | Assert.That(xis.UpdateItem(itemToStore), Is.True); |
141 | 140 | ||
142 | InventoryItemBase itemRetrieved = new InventoryItemBase(itemId); | 141 | InventoryItemBase itemRetrieved = xis.GetItem(UUID.Zero, itemId); |
143 | itemRetrieved = xis.GetItem(itemRetrieved); | ||
144 | 142 | ||
145 | Assert.That(itemRetrieved, Is.Not.Null); | 143 | Assert.That(itemRetrieved, Is.Not.Null); |
146 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName2)); | 144 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName2)); |
@@ -162,7 +160,7 @@ namespace OpenSim.Services.InventoryService.Tests | |||
162 | 160 | ||
163 | Assert.That(xis.UpdateItem(itemToStore), Is.True); | 161 | Assert.That(xis.UpdateItem(itemToStore), Is.True); |
164 | 162 | ||
165 | itemRetrieved = xis.GetItem(itemRetrieved); | 163 | itemRetrieved = xis.GetItem(itemRetrieved.Owner, itemRetrieved.ID); |
166 | 164 | ||
167 | Assert.That(itemRetrieved, Is.Not.Null); | 165 | Assert.That(itemRetrieved, Is.Not.Null); |
168 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); | 166 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); |
@@ -174,4 +172,4 @@ namespace OpenSim.Services.InventoryService.Tests | |||
174 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName3)); | 172 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName3)); |
175 | } | 173 | } |
176 | } | 174 | } |
177 | } \ No newline at end of file | 175 | } |
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index b75193f..004c4bf 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -315,8 +315,7 @@ namespace OpenSim.Services.InventoryService | |||
315 | inventory.Items.Add(ConvertToOpenSim(i)); | 315 | inventory.Items.Add(ConvertToOpenSim(i)); |
316 | } | 316 | } |
317 | 317 | ||
318 | InventoryFolderBase f = new InventoryFolderBase(folderID, principalID); | 318 | InventoryFolderBase f = GetFolder(principalID, folderID); |
319 | f = GetFolder(f); | ||
320 | if (f != null) | 319 | if (f != null) |
321 | { | 320 | { |
322 | inventory.Version = f.Version; | 321 | inventory.Version = f.Version; |
@@ -359,7 +358,7 @@ namespace OpenSim.Services.InventoryService | |||
359 | { | 358 | { |
360 | // m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID); | 359 | // m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID); |
361 | 360 | ||
362 | InventoryFolderBase check = GetFolder(folder); | 361 | InventoryFolderBase check = GetFolder(folder.Owner, folder.ID); |
363 | if (check != null) | 362 | if (check != null) |
364 | return false; | 363 | return false; |
365 | 364 | ||
@@ -402,7 +401,7 @@ namespace OpenSim.Services.InventoryService | |||
402 | // m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID); | 401 | // m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID); |
403 | 402 | ||
404 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); | 403 | XInventoryFolder xFolder = ConvertFromOpenSim(folder); |
405 | InventoryFolderBase check = GetFolder(folder); | 404 | InventoryFolderBase check = GetFolder(folder.Owner, folder.ID); |
406 | 405 | ||
407 | if (check == null) | 406 | if (check == null) |
408 | return AddFolder(folder); | 407 | return AddFolder(folder); |
@@ -512,7 +511,7 @@ namespace OpenSim.Services.InventoryService | |||
512 | // m_log.InfoFormat( | 511 | // m_log.InfoFormat( |
513 | // "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | 512 | // "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); |
514 | 513 | ||
515 | InventoryItemBase retrievedItem = GetItem(item); | 514 | InventoryItemBase retrievedItem = GetItem(item.Owner, item.ID); |
516 | 515 | ||
517 | if (retrievedItem == null) | 516 | if (retrievedItem == null) |
518 | { | 517 | { |
@@ -598,11 +597,11 @@ namespace OpenSim.Services.InventoryService | |||
598 | return true; | 597 | return true; |
599 | } | 598 | } |
600 | 599 | ||
601 | public virtual InventoryItemBase GetItem(InventoryItemBase item) | 600 | public virtual InventoryItemBase GetItem(UUID principalID, UUID itemID) |
602 | { | 601 | { |
603 | XInventoryItem[] items = m_Database.GetItems( | 602 | XInventoryItem[] items = m_Database.GetItems( |
604 | new string[] { "inventoryID" }, | 603 | new string[] { "inventoryID" }, |
605 | new string[] { item.ID.ToString() }); | 604 | new string[] { itemID.ToString() }); |
606 | 605 | ||
607 | if (items.Length == 0) | 606 | if (items.Length == 0) |
608 | return null; | 607 | return null; |
@@ -614,22 +613,17 @@ namespace OpenSim.Services.InventoryService | |||
614 | { | 613 | { |
615 | InventoryItemBase[] items = new InventoryItemBase[ids.Length]; | 614 | InventoryItemBase[] items = new InventoryItemBase[ids.Length]; |
616 | int i = 0; | 615 | int i = 0; |
617 | InventoryItemBase item = new InventoryItemBase(); | ||
618 | item.Owner = userID; | ||
619 | foreach (UUID id in ids) | 616 | foreach (UUID id in ids) |
620 | { | 617 | items[i++] = GetItem(userID, id); |
621 | item.ID = id; | ||
622 | items[i++] = GetItem(item); | ||
623 | } | ||
624 | 618 | ||
625 | return items; | 619 | return items; |
626 | } | 620 | } |
627 | 621 | ||
628 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) | 622 | public virtual InventoryFolderBase GetFolder(UUID principalID, UUID folderID) |
629 | { | 623 | { |
630 | XInventoryFolder[] folders = m_Database.GetFolders( | 624 | XInventoryFolder[] folders = m_Database.GetFolders( |
631 | new string[] { "folderID"}, | 625 | new string[] { "folderID"}, |
632 | new string[] { folder.ID.ToString() }); | 626 | new string[] { folderID.ToString() }); |
633 | 627 | ||
634 | if (folders.Length == 0) | 628 | if (folders.Length == 0) |
635 | return null; | 629 | return null; |
diff --git a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs index 0280b73..d5c7dcb 100644 --- a/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs +++ b/OpenSim/Tests/Robust/Clients/Inventory/InventoryClient.cs | |||
@@ -159,8 +159,7 @@ namespace Robust.Tests | |||
159 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); | 159 | XInventoryServicesConnector m_Connector = new XInventoryServicesConnector(DemonServer.Address); |
160 | 160 | ||
161 | // Prefetch Notecard 1, will be cached from here on | 161 | // Prefetch Notecard 1, will be cached from here on |
162 | InventoryItemBase item = new InventoryItemBase(new UUID("10000000-0000-0000-0000-000000000001"), m_userID); | 162 | InventoryItemBase item = m_Connector.GetItem(m_userID, new UUID("10000000-0000-0000-0000-000000000001")); |
163 | item = m_Connector.GetItem(item); | ||
164 | Assert.NotNull(item, "Failed to get Notecard 1"); | 163 | Assert.NotNull(item, "Failed to get Notecard 1"); |
165 | Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); | 164 | Assert.AreEqual("Test Notecard 1", item.Name, "Wrong name for Notecard 1"); |
166 | 165 | ||