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.
This commit is contained in:
diva
2009-04-05 22:39:19 +00:00
parent f73d4f9735
commit 5b103aab89
3 changed files with 68 additions and 41 deletions

View File

@@ -91,11 +91,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// <summary>
/// Create an object from the user's inventory in the destination region.
/// This message is used primarily for prim crossing.
/// This message is used primarily by clients.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="sog"></param>
/// <param name="isLocalCall"></param>
/// <param name="userID"></param>
/// <param name="itemID"></param>
/// <returns></returns>
bool SendCreateObject(ulong regionHandle, UUID userID, UUID itemID);

View File

@@ -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);
}
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)
{
m_log.Debug("[HGScene]: Starting new InventorytClient for " + inventoryURL);
invCli = new InventoryClient(inventoryURL);
m_inventoryServers.Add(inventoryURL, invCli);
userInfo.RootFolder.Items[item.ID] = item;
}
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;
}