Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llGiveInventoryList C# (CSharp) Method

llGiveInventoryList() public method

public llGiveInventoryList ( string destination, string category, Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list inventory ) : void
destination string
category string
inventory Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.list
return void
        public void llGiveInventoryList(string destination, string category, LSL_List inventory)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return;


            UUID destID;
            if (!UUID.TryParse(destination, out destID))
                return;

            List<UUID> itemList = new List<UUID>();

            foreach (Object item in inventory.Data)
            {
                UUID itemID;
                if (UUID.TryParse(item.ToString(), out itemID))
                {
                    itemList.Add(itemID);
                }
                else
                {
                    itemID = GetTaskInventoryItem(item.ToString());
                    if (itemID != UUID.Zero)
                        itemList.Add(itemID);
                }
            }

            if (itemList.Count == 0)
                return;
            UUID folderID = UUID.Zero;
            ILLClientInventory inventoryModule = World.RequestModuleInterface<ILLClientInventory>();
            if (inventoryModule != null)
                folderID = inventoryModule.MoveTaskInventoryItemsToUserInventory(destID, category, m_host, itemList);

            if (folderID == UUID.Zero)
                return;

            byte[] bucket = new byte[17];
            bucket[0] = (byte)AssetType.Folder;
            byte[] objBytes = folderID.GetBytes();
            Array.Copy(objBytes, 0, bucket, 1, 16);

            GridInstantMessage msg = new GridInstantMessage(World,
                    m_host.UUID, m_host.Name + ", an object owned by " +
                    resolveName(m_host.OwnerID) + ",", destID,
                    (byte)InstantMessageDialog.InventoryOffered,
                    false, category + "\n" + m_host.Name + " is located at " +
                    World.RegionInfo.RegionName + " " +
                    m_host.AbsolutePosition.ToString(),
                    folderID, true, m_host.AbsolutePosition,
                    bucket);

            if (m_TransferModule != null)
                m_TransferModule.SendInstantMessage(msg);
        }
LSL_Api