OpenMetaverse.InventoryManager.GiveItem C# (CSharp) Method

GiveItem() public method

Give an inventory item to another avatar
public GiveItem ( UUID itemID, string itemName, AssetType assetType, UUID recipient, bool doEffect ) : void
itemID UUID The of the item to give
itemName string The name of the item
assetType AssetType The type of the item from the enum
recipient UUID The of the recipient
doEffect bool true to generate a beameffect during transfer
return void
        public void GiveItem(UUID itemID, string itemName, AssetType assetType, UUID recipient,
            bool doEffect)
        {
            byte[] bucket;

                bucket = new byte[17];
                bucket[0] = (byte)assetType;
                Buffer.BlockCopy(itemID.GetBytes(), 0, bucket, 1, 16);

            _Client.Self.InstantMessage(
                    _Client.Self.Name,
                    recipient,
                    itemName,
                    UUID.Random(),
                    InstantMessageDialog.InventoryOffered,
                    InstantMessageOnline.Online,
                    _Client.Self.SimPosition,
                    _Client.Network.CurrentSim.ID,
                    bucket);

            if (doEffect)
            {
                _Client.Self.BeamEffect(_Client.Self.AgentID, recipient, Vector3d.Zero,
                    _Client.Settings.DEFAULT_EFFECT_COLOR, 1f, UUID.Random());
            }
        }