Added MoveItems, which is most useful upon viewer-delete inventory operation. Moving a batch of items is a 1-time operation. Made it async anyway, so that the viewer doesn't wait in case the DB layer is dumb (which is the case currently).

This commit is contained in:
Diva Canto
2009-08-19 10:56:08 -07:00
parent 4382f28efc
commit d519f1885f
16 changed files with 162 additions and 38 deletions

View File

@@ -7027,14 +7027,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (OnMoveInventoryItem != null)
{
handlerMoveInventoryItem = null;
InventoryItemBase itm = null;
List<InventoryItemBase> items = new List<InventoryItemBase>();
foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
{
handlerMoveInventoryItem = OnMoveInventoryItem;
if (handlerMoveInventoryItem != null)
{
handlerMoveInventoryItem(this, datablock.FolderID, datablock.ItemID, datablock.Length,
Util.FieldToString(datablock.NewName));
}
itm = new InventoryItemBase(datablock.ItemID, AgentId);
itm.Folder = datablock.FolderID;
itm.Name = Util.FieldToString(datablock.NewName);
// weird, comes out as empty string
//m_log.DebugFormat("[XXX] new name: {0}", itm.Name);
items.Add(itm);
}
handlerMoveInventoryItem = OnMoveInventoryItem;
if (handlerMoveInventoryItem != null)
{
handlerMoveInventoryItem(this, items);
}
}
break;