From 5b103aab896eef4ca8d538d12728fdc1929e34d1 Mon Sep 17 00:00:00 2001 From: diva Date: Sun, 5 Apr 2009 22:39:19 +0000 Subject: Changed the asynchronous call to get inventory in HG, so that it properly reports problems. OGS1 should also be changed, but I'm leaving it as is for now. RestSessionObjectPosterResponse is fairly broken and should not be used. Minor changes in Get inventory item in HGAssetMapper. --- .../Framework/Scenes/Hypergrid/HGAssetMapper.cs | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs index b192101..48ea519 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs @@ -333,29 +333,26 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid public InventoryItemBase Get(InventoryItemBase item, UUID rootFolder, CachedUserInfo userInfo) { - if (!IsLocalUser(item.Owner)) + InventoryClient invCli = null; + string inventoryURL = UserInventoryURL(item.Owner); + if (!m_inventoryServers.TryGetValue(inventoryURL, out invCli)) { - 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); - } + 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) + 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) { - // 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; - } - + userInfo.RootFolder.Items[item.ID] = item; } + } return item; } -- cgit v1.1