OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llGiveInventoryList C# (CSharp) Method

llGiveInventoryList() public method

public llGiveInventoryList ( string destination, string category, OpenSim.Region.ScriptEngine.Shared.LSL_Types.list inventory ) : void
destination string
category string
inventory OpenSim.Region.ScriptEngine.Shared.LSL_Types.list
return void
        public void llGiveInventoryList(string destination, string category, LSL_List inventory)
        {
            m_host.AddScriptLPS(1);

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

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

            foreach (Object item in inventory.Data)
            {
                string rawItemString = item.ToString();

                UUID itemID;
                if (UUID.TryParse(rawItemString, out itemID))
                {
                    itemList.Add(itemID);
                }
                else
                {
                    TaskInventoryItem taskItem = m_host.Inventory.GetInventoryItem(rawItemString);

                    if (taskItem != null)
                        itemList.Add(taskItem.ItemID);
                }
            }

            if (itemList.Count == 0)
                return;

            UUID folderID = m_ScriptEngine.World.MoveTaskInventoryItems(destID, category, m_host, itemList);

            if (folderID == UUID.Zero)
                return;

            if (m_TransferModule != null)
            {
                byte[] bucket = new byte[] { (byte)AssetType.Folder };

                Vector3 pos = m_host.AbsolutePosition;

                GridInstantMessage msg = new GridInstantMessage(World,
                        m_host.OwnerID, m_host.Name, destID,
                        (byte)InstantMessageDialog.TaskInventoryOffered,
                        false, string.Format("'{0}'", category),
// We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06
// false, string.Format("'{0}'  ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z),
                        folderID, false, pos,
                        bucket, false);

                m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
            }
        }
LSL_Api