* Add ability to defer item actions for AddItem() and DeleteItem(). This won't be useful until we let the client cache (again?)
parent
56827894e9
commit
27a7391d6b
|
@ -35,6 +35,8 @@ using log4net;
|
|||
|
||||
namespace OpenSim.Framework.Communications.Cache
|
||||
{
|
||||
internal delegate void AddItemDelegate(InventoryItemBase itemInfo);
|
||||
internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
|
||||
internal delegate void DeleteItemDelegate(LLUUID itemID);
|
||||
|
||||
internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID);
|
||||
|
@ -532,13 +534,20 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
/// Add an item to the user's inventory
|
||||
/// </summary>
|
||||
/// <param name="itemInfo"></param>
|
||||
public void AddItem(InventoryItemBase itemInfo)
|
||||
public void AddItem(InventoryItemBase item)
|
||||
{
|
||||
if (HasInventory)
|
||||
{
|
||||
ItemReceive(itemInfo);
|
||||
m_commsManager.InventoryService.AddItem(itemInfo);
|
||||
ItemReceive(item);
|
||||
m_commsManager.InventoryService.AddItem(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRequest(
|
||||
new InventoryRequest(
|
||||
Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"),
|
||||
new object[] { item }));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -546,12 +555,19 @@ namespace OpenSim.Framework.Communications.Cache
|
|||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="itemInfo"></param>
|
||||
public void UpdateItem(InventoryItemBase itemInfo)
|
||||
public void UpdateItem(InventoryItemBase item)
|
||||
{
|
||||
if (HasInventory)
|
||||
{
|
||||
m_commsManager.InventoryService.UpdateItem(itemInfo);
|
||||
m_commsManager.InventoryService.UpdateItem(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRequest(
|
||||
new InventoryRequest(
|
||||
Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"),
|
||||
new object[] { item }));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Grid.InventoryServer
|
|||
m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID);
|
||||
|
||||
// uncomment me to simulate an overloaded inventory server
|
||||
Thread.Sleep(18000);
|
||||
//Thread.Sleep(18000);
|
||||
|
||||
InventoryCollection invCollection = new InventoryCollection();
|
||||
|
||||
|
|
|
@ -486,6 +486,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
if (userInfo == null)
|
||||
{
|
||||
m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -509,12 +510,14 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
else
|
||||
{
|
||||
m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString());
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue