Add QueryItem method to secure inventory and HG inventory, change method sig to

provide additional information the HG needs.
This commit is contained in:
Melanie Thielker
2009-03-22 15:42:22 +00:00
parent 73a982babe
commit e6bb86a224
5 changed files with 61 additions and 9 deletions

View File

@@ -773,23 +773,30 @@ namespace OpenSim.Framework.Communications.Cache
// The item will be added tot he local cache. Returns true if the item
// was found and can be sent to the client
//
public bool QueryItem(UUID itemID)
public bool QueryItem(InventoryItemBase item)
{
if (m_hasReceivedInventory)
{
InventoryItemBase item = RootFolder.FindItem(itemID);
InventoryItemBase invItem = RootFolder.FindItem(item.ID);
if (item != null)
if (invItem != null)
{
// Item is in local cache, just update client
//
return true;
}
item = new InventoryItemBase();
item.ID = itemID;
InventoryItemBase itemInfo = null;
if (m_commsManager.SecureInventoryService != null)
{
m_commsManager.SecureInventoryService.QueryItem(item, m_session_id);
}
else
{
m_commsManager.InventoryService.QueryItem(item);
}
InventoryItemBase itemInfo = m_commsManager.InventoryService.QueryItem(item);
if (itemInfo != null)
{
InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
@@ -804,7 +811,7 @@ namespace OpenSim.Framework.Communications.Cache
AddRequest(
new InventoryRequest(
Delegate.CreateDelegate(typeof(QueryItemDelegate), this, "QueryItem"),
new object[] { itemID }));
new object[] { item.ID }));
return true;
}

View File

@@ -96,6 +96,8 @@ namespace OpenSim.Framework.Communications
/// <returns>true if the item was successfully deleted</returns>
bool DeleteItem(InventoryItemBase item, UUID session_id);
InventoryItemBase QueryItem(InventoryItemBase item, UUID session_id);
/// <summary>
/// Does the given user have an inventory structure?
/// </summary>