public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
 {
     Console.WriteLine("updating inventory item details");
     if (this.InventoryItems.ContainsKey(itemID))
     {
         Console.WriteLine("changing name to " + Util.FieldToString(packet.Name));
         InventoryItem Item = this.InventoryItems[itemID];
         Item.Name = Util.FieldToString(packet.Name);
         Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
         //TODO need to update the rest of the info
     }
     return(true);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="items"></param>
        /// <param name="transactionID"></param>
        public void RequestUpdateItems(ICollection<ItemData> items, UUID transactionID)
        {
            UpdateInventoryItemPacket update = new UpdateInventoryItemPacket();
            update.AgentData.AgentID = _Agents.AgentID;
            update.AgentData.SessionID = _Agents.SessionID;
            update.AgentData.TransactionID = transactionID;

            update.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[items.Count];
            int index = 0;
            foreach (ItemData item in items)
            {
                UpdateInventoryItemPacket.InventoryDataBlock block = new UpdateInventoryItemPacket.InventoryDataBlock();
                block.BaseMask = (uint)item.Permissions.BaseMask;
                block.CRC = ItemCRC(item);
                block.CreationDate = (int)Utils.DateTimeToUnixTime(item.CreationDate);
                block.CreatorID = item.CreatorID;
                block.Description = Utils.StringToBytes(item.Description);
                block.EveryoneMask = (uint)item.Permissions.EveryoneMask;
                block.Flags = (uint)item.Flags;
                block.FolderID = item.ParentUUID;
                block.GroupID = item.GroupID;
                block.GroupMask = (uint)item.Permissions.GroupMask;
                block.GroupOwned = item.GroupOwned;
                block.InvType = (sbyte)item.InventoryType;
                block.ItemID = item.UUID;
                block.Name = Utils.StringToBytes(item.Name);
                block.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
                block.OwnerID = item.OwnerID;
                block.OwnerMask = (uint)item.Permissions.OwnerMask;
                block.SalePrice = item.SalePrice;
                block.SaleType = (byte)item.SaleType;
                block.TransactionID = UUID.Zero;
                block.Type = (sbyte)item.AssetType;

                update.InventoryData[index] = block;
                ++index;
            }

            _Network.SendPacket(update);
        }
Exemple #3
0
        public void RequestUpdateItems(List<InventoryItem> items, LLUUID transactionID)
        {
            UpdateInventoryItemPacket update = new UpdateInventoryItemPacket();
            update.AgentData.AgentID = _Client.Self.AgentID;
            update.AgentData.SessionID = _Client.Self.SessionID;
            update.AgentData.TransactionID = transactionID;

            update.InventoryData = new UpdateInventoryItemPacket.InventoryDataBlock[items.Count];
            for (int i = 0; i < items.Count; i++)
            {
                InventoryItem item = items[i];

                UpdateInventoryItemPacket.InventoryDataBlock block = new UpdateInventoryItemPacket.InventoryDataBlock();
                block.BaseMask = (uint)item.Permissions.BaseMask;
                block.CRC = ItemCRC(item);
                block.CreationDate = (int)Helpers.DateTimeToUnixTime(item.CreationDate);
                block.CreatorID = item.CreatorID;
                block.Description = Helpers.StringToField(item.Description);
                block.EveryoneMask = (uint)item.Permissions.EveryoneMask;
                block.Flags = item.Flags;
                block.FolderID = item.ParentUUID;
                block.GroupID = item.GroupID;
                block.GroupMask = (uint)item.Permissions.GroupMask;
                block.GroupOwned = item.GroupOwned;
                block.InvType = (sbyte)item.InventoryType;
                block.ItemID = item.UUID;
                block.Name = Helpers.StringToField(item.Name);
                block.NextOwnerMask = (uint)item.Permissions.NextOwnerMask;
                block.OwnerID = item.OwnerID;
                block.OwnerMask = (uint)item.Permissions.OwnerMask;
                block.SalePrice = item.SalePrice;
                block.SaleType = (byte)item.SaleType;
                block.TransactionID = LLUUID.Zero;
                block.Type = (sbyte)item.AssetType;

                update.InventoryData[i] = block;
            }

            _Client.Network.SendPacket(update);
        }
        public bool UpdateInventoryItemDetails(SimClient remoteClient, LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
        {
            if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
            {
                bool res = _agentsInventory[remoteClient.AgentID].UpdateItemDetails(itemID, packet);
                if (res)
                {
                    InventoryItem Item = this._agentsInventory[remoteClient.AgentID].InventoryItems[itemID];
                    this.SendItemUpdateCreate(remoteClient, Item);
                }
                return(res);
            }

            return(false);
        }