From 6b9cc6c48d7b49cc4bce5dce4e66d7856a093b75 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 13 Aug 2009 11:30:29 -0700 Subject: Inventory redirects from CachedUserInfo to InventoryService COMPLETE! --- .../Framework/Scenes/Hypergrid/HGAssetMapper.cs | 50 +++++++++++----------- .../Scenes/Hypergrid/HGScene.Inventory.cs | 31 ++++++-------- 2 files changed, 38 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index 4224198..5d65f98 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs @@ -201,31 +201,31 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid } } - public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo) - { - InventoryClient invCli = null; - string inventoryURL = UserInventoryURL(item.Owner); - if (!m_inventoryServers.TryGetValue(inventoryURL, out invCli)) - { - m_log.Debug("[HGScene]: Starting new InventorytClient for " + inventoryURL); - invCli = new InventoryClient(inventoryURL); - m_inventoryServers.Add(inventoryURL, invCli); - } - - item = invCli.GetInventoryItem(item); - if (item != null) - { - // Change the folder, stick it in root folder, all items flattened out here in this region cache - item.Folder = rootFolder; - //userInfo.AddItem(item); don't use this, it calls back to the inventory server - lock (userInfo.RootFolder.Items) - { - userInfo.RootFolder.Items[item.ID] = item; - } - - } - return item; - } + //public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo) + //{ + // InventoryClient invCli = null; + // string inventoryURL = UserInventoryURL(item.Owner); + // if (!m_inventoryServers.TryGetValue(inventoryURL, out invCli)) + // { + // m_log.Debug("[HGScene]: Starting new InventorytClient for " + inventoryURL); + // invCli = new InventoryClient(inventoryURL); + // m_inventoryServers.Add(inventoryURL, invCli); + // } + + // item = invCli.GetInventoryItem(item); + // if (item != null) + // { + // // Change the folder, stick it in root folder, all items flattened out here in this region cache + // item.Folder = rootFolder; + // //userInfo.AddItem(item); don't use this, it calls back to the inventory server + // lock (userInfo.RootFolder.Items) + // { + // userInfo.RootFolder.Items[item.ID] = item; + // } + + // } + // return item; + //} public void Post(UUID assetID, UUID ownerID) { diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs index cb6794e..1b93f46 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGScene.Inventory.cs @@ -117,25 +117,20 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid if (fromTaskID.Equals(UUID.Zero)) { - CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); - if (userInfo != null) + InventoryItemBase item = new InventoryItemBase(itemID); + item.Owner = remoteClient.AgentId; + item = InventoryService.QueryItem(item); + //if (item == null) + //{ // Fetch the item + // item = new InventoryItemBase(); + // item.Owner = remoteClient.AgentId; + // item.ID = itemID; + // item = m_assMapper.Get(item, userInfo.RootFolder.ID, userInfo); + //} + if (item != null) { - if (userInfo.RootFolder != null) - { - InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); - if (item == null) - { // Fetch the item - item = new InventoryItemBase(); - item.Owner = remoteClient.AgentId; - item.ID = itemID; - item = m_assMapper.Get(item, userInfo.RootFolder.ID, userInfo); - } - if (item != null) - { - m_assMapper.Get(item.AssetID, remoteClient.AgentId); - - } - } + m_assMapper.Get(item.AssetID, remoteClient.AgentId); + } } -- cgit v1.1