예제 #1
0
        public Packet RezSingleAttachmentFromInv(InventoryItem item, ObjectManager.AttachmentPoint AttachmentPt)
        {
            RezSingleAttachmentFromInvPacket p = new RezSingleAttachmentFromInvPacket();

            p.AgentData.AgentID   = AgentID;
            p.AgentData.SessionID = SessionID;

            p.ObjectData.Description   = Helpers.StringToField(item.Description);
            p.ObjectData.EveryoneMask  = item.EveryoneMask;
            p.ObjectData.GroupMask     = item.GroupMask;
            p.ObjectData.ItemFlags     = item.Flags;
            p.ObjectData.ItemID        = item.ItemID;
            p.ObjectData.Name          = Helpers.StringToField(item.Name);
            p.ObjectData.NextOwnerMask = item.NextOwnerMask;
            p.ObjectData.OwnerID       = item.OwnerID;

            p.ObjectData.AttachmentPt = (byte)AttachmentPt; // Default;


            return(p);
        }
예제 #2
0
        /// <summary>
        /// Attach an item to our agent specifying attachment details
        /// </summary>
        /// <param name="itemID">The <seealso cref="OpenMetaverse.UUID"/> of the item to attach</param>
        /// <param name="ownerID">The <seealso cref="OpenMetaverse.UUID"/> 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="OpenMetaverse.Permissions"/> to apply when attached</param>
        /// <param name="itemFlags">The <seealso cref="OpenMetaverse.InventoryItemFlags"/> of the attachment</param>
        /// <param name="attachPoint">The <seealso cref="OpenMetaverse.AttachmentPoint"/> on the agent
        /// <param name="replace">If true replace existing attachment on this attachment point, otherwise add to it (multi-attachments)</param>
        /// to attach the item to</param>
        public void Attach(UUID itemID, UUID ownerID, string name, string description,
            Permissions perms, uint itemFlags, AttachmentPoint attachPoint, bool replace)
        {
            // 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 = replace ? (byte)attachPoint : (byte)(ATTACHMENT_ADD | (byte)attachPoint);
            attach.ObjectData.Description = Utils.StringToBytes(description);
            attach.ObjectData.EveryoneMask = (uint)perms.EveryoneMask;
            attach.ObjectData.GroupMask = (uint)perms.GroupMask;
            attach.ObjectData.ItemFlags = itemFlags;
            attach.ObjectData.ItemID = itemID;
            attach.ObjectData.Name = Utils.StringToBytes(name);
            attach.ObjectData.NextOwnerMask = (uint)perms.NextOwnerMask;
            attach.ObjectData.OwnerID = ownerID;

            Client.Network.SendPacket(attach);
        }
예제 #3
0
        public Packet RezSingleAttachmentFromInv(InventoryItem item, ObjectManager.AttachmentPoint AttachmentPt)
        {
            RezSingleAttachmentFromInvPacket p = new RezSingleAttachmentFromInvPacket();
            p.AgentData.AgentID = AgentID;
            p.AgentData.SessionID = SessionID;

            p.ObjectData.Description = Helpers.StringToField(item.Description);
            p.ObjectData.EveryoneMask = item.EveryoneMask;
            p.ObjectData.GroupMask = item.GroupMask;
            p.ObjectData.ItemFlags = item.Flags;
            p.ObjectData.ItemID = item.ItemID;
            p.ObjectData.Name = Helpers.StringToField(item.Name);
            p.ObjectData.NextOwnerMask = item.NextOwnerMask;
            p.ObjectData.OwnerID = item.OwnerID;

            p.ObjectData.AttachmentPt = (byte)AttachmentPt; // Default;


            return p;
        }
예제 #4
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);
        }