diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index 05f11a491c..1869d48f90 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -78,6 +78,12 @@ namespace OpenSim.Framework ID = id; } + public InventoryFolderBase(UUID id, UUID owner) + { + ID = id; + Owner = owner; + } + public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) { ID = id; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 06bea3dc38..16ce9e0d5c 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6633,9 +6633,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else // Agent { - //InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID); IInventoryService invService = m_scene.RequestModuleInterface(); - InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); + assetRequestItem = invService.GetItem(assetRequestItem); if (assetRequestItem == null) { assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 582beeead8..35c59aa6d7 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -130,7 +130,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } else { - InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); + InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); + baseItem = invService.GetItem(baseItem); if (baseItem != null) { diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index a68db1b7c5..ff1236104a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs @@ -65,7 +65,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures { IInventoryService invService = m_scene.InventoryService; - InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); + InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); + item = invService.GetItem(item); if (item != null) { item.Flags = 1; @@ -80,7 +81,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures { IInventoryService invService = m_scene.InventoryService; - InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); + InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); + item = invService.GetItem(item); if (item != null) { item.Flags = 0; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5315c119a4..3a6533686e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -257,8 +257,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip - - InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); + + InventoryItemBase item = new InventoryItemBase(inventoryEntityID, client.AgentId); + item = invService.GetItem(item); InventoryFolderBase folder = null; if (item != null && trashFolder != null) @@ -271,7 +272,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer } else { - folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); + folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); + folder = invService.GetFolder(folder); if (folder != null & trashFolder != null) { @@ -451,10 +453,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer else { UUID itemID = new UUID(msg.binaryBucket, 1); - InventoryItemBase item = new InventoryItemBase(); - - item.ID = itemID; - item.Owner = user.ControllingClient.AgentId; + InventoryItemBase item = new InventoryItemBase(itemID, user.ControllingClient.AgentId); // Fetch from service // diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index dd451ef94f..492598ea70 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -483,12 +483,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); string uri = m_LocalGridInventoryURI.TrimEnd('/'); - m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri); - if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) { return true; } + m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user is foreign({0} - {1})", userInventoryServerURI, uri); return false; } diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 9c71b41d79..f3605779f9 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -966,7 +966,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (objectID == UUID.Zero) // User inventory { IInventoryService invService = m_scene.InventoryService; - InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); + InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); + assetRequestItem = invService.GetItem(assetRequestItem); if (assetRequestItem == null) // Library item { assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); @@ -1385,7 +1386,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (objectID == UUID.Zero) // User inventory { IInventoryService invService = m_scene.InventoryService; - InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); + InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); + assetRequestItem = invService.GetItem(assetRequestItem); if (assetRequestItem == null) // Library item { assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); @@ -1479,7 +1481,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (objectID == UUID.Zero) // User inventory { IInventoryService invService = m_scene.InventoryService; - InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); + InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); + assetRequestItem = invService.GetItem(assetRequestItem); if (assetRequestItem == null) // Library item { assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 46777e120e..48c7f4efa8 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 /// public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) { - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) { @@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, UUID itemID, InventoryItemBase itemUpd) { - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) { @@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes { Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId)); + InventoryItemBase item = new InventoryItemBase(itemId, senderId); + item = InventoryService.GetItem(item); if ((item != null) && (item.Owner == senderId)) { @@ -558,7 +561,8 @@ namespace OpenSim.Region.Framework.Scenes if (item == null) { - item = InventoryService.GetItem(new InventoryItemBase(oldItemID)); + item = new InventoryItemBase(oldItemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item == null) { @@ -636,7 +640,8 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat( "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) { @@ -1224,7 +1229,8 @@ namespace OpenSim.Region.Framework.Scenes UUID copyID = UUID.Random(); if (itemID != UUID.Zero) { - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); // Try library if (null == item) @@ -1287,7 +1293,8 @@ namespace OpenSim.Region.Framework.Scenes if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory { - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); // Try library // XXX clumsy, possibly should be one call @@ -1672,7 +1679,7 @@ namespace OpenSim.Region.Framework.Scenes if (DeRezAction.SaveToExistingUserInventoryItem == action) { - item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID); + item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID); item = InventoryService.GetItem(item); //item = userInfo.RootFolder.FindItem( @@ -1834,7 +1841,8 @@ namespace OpenSim.Region.Framework.Scenes string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) { @@ -1984,7 +1992,8 @@ namespace OpenSim.Region.Framework.Scenes BypassRayCast, bRayEndIsIntersection,true,scale, false); // Rez object - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) { @@ -2309,7 +2318,8 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence presence; if (TryGetAvatar(remoteClient.AgentId, out presence)) { - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); IAvatarFactory ava = RequestModuleInterface(); @@ -2360,7 +2370,8 @@ namespace OpenSim.Region.Framework.Scenes if (TryGetAvatar(remoteClient.AgentId, out presence)) { // XXYY!! - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); IAvatarFactory ava = RequestModuleInterface(); if (ava != null) diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index fde922f04d..1bbca4987e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -404,7 +404,8 @@ namespace OpenSim.Region.Framework.Scenes return; } - InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = InventoryService.GetItem(item); if (item != null) {