コード例 #1
0
 public InventoryItem(uint itemId, ushort equippedSlot, ushort technique, InventoryItemFlags flags)
 {
     EquippedSlot = equippedSlot;
     Technique    = technique;
     Flags        = flags;
     ItemId       = itemId;
 }
コード例 #2
0
 public InventoryItem(uint itemId, ushort equippedSlot, ushort technique, InventoryItemFlags flags, byte[] itemData1, byte[] itemData2)
 {
     EquippedSlot = equippedSlot;
     Technique    = technique;
     Flags        = flags;
     ItemData1    = itemData1 ?? throw new ArgumentNullException(nameof(itemData1));
     ItemData2    = itemData2 ?? throw new ArgumentNullException(nameof(itemData2));
     ItemId       = itemId;
 }
コード例 #3
0
        /// <summary>
        /// Attach an item to an avatar specifying attachment details
        /// </summary>
        /// <param name="itemID">The <seealso cref="libsecondlife.LLUUID"/> of the item to attach</param>
        /// <param name="ownerID">The <seealso cref="libsecondlife.LLUUID"/> attachments owner</param>
        /// <param name="name">The name of the attachment</param>
        /// <param name="description">The description of the attahment</param>
        /// <param name="perms">The <seealso cref="libsecondlife.Permissions"/> to apply when attached</param>
        /// <param name="itemFlags">The <seealso cref="libsecondlife.InventoryItemFlags"/> of the attachment</param>
        /// <param name="attachPoint">the <seealso cref="libsecondlife.AttachmentPoint"/> on the avatar 
        /// to attach the item to</param>
        public void Attach(LLUUID itemID, LLUUID ownerID, string name, string description,
            Permissions perms, InventoryItemFlags itemFlags, AttachmentPoint attachPoint)
        {
            // TODO: At some point it might be beneficial to have AppearanceManager track what we
            // are currently wearing for attachments to make enumeration and detachment easier

            RezSingleAttachmentFromInvPacket attach = new RezSingleAttachmentFromInvPacket();

            attach.AgentData.AgentID = Client.Self.AgentID;
            attach.AgentData.SessionID = Client.Self.SessionID;

            attach.ObjectData.AttachmentPt = (byte)attachPoint;
            attach.ObjectData.Description = Helpers.StringToField(description);
            attach.ObjectData.EveryoneMask = (uint)perms.EveryoneMask;
            attach.ObjectData.GroupMask = (uint)perms.GroupMask;
            attach.ObjectData.ItemFlags = (uint)itemFlags;
            attach.ObjectData.ItemID = itemID;
            attach.ObjectData.Name = Helpers.StringToField(name);
            attach.ObjectData.NextOwnerMask = (uint)perms.NextOwnerMask;
            attach.ObjectData.OwnerID = ownerID;

            Client.Network.SendPacket(attach);
        }