コード例 #1
0
ファイル: InventoryManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Request a copy of an asset embedded within a notecard
        /// </summary>
        /// <param name="objectID">Usually UUID.Zero for copying an asset from a notecard</param>
        /// <param name="notecardID">UUID of the notecard to request an asset from</param>
        /// <param name="folderID">Target folder for asset to go to in your inventory</param>
        /// <param name="itemID">UUID of the embedded asset</param>
        /// <param name="callback">callback to run when item is copied to inventory</param>
        public void RequestCopyItemFromNotecard(UUID objectID, UUID notecardID, UUID folderID, UUID itemID, ItemCopiedCallback callback)
        {
            _ItemCopiedCallbacks[0] = callback; //Notecards always use callback ID 0

            Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("CopyInventoryFromNotecard");

            if (url != null)
            {
                CopyInventoryFromNotecardMessage message = new CopyInventoryFromNotecardMessage();
                message.CallbackID = 0;
                message.FolderID = folderID;
                message.ItemID = itemID;
                message.NotecardID = notecardID;
                message.ObjectID = objectID;

                CapsClient request = new CapsClient(url);
                request.BeginGetResponse(message.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
            }
            else
            {
                CopyInventoryFromNotecardPacket copy = new CopyInventoryFromNotecardPacket();
                copy.AgentData.AgentID = Client.Self.AgentID;
                copy.AgentData.SessionID = Client.Self.SessionID;

                copy.NotecardData.ObjectID = objectID;
                copy.NotecardData.NotecardItemID = notecardID;

                copy.InventoryData = new CopyInventoryFromNotecardPacket.InventoryDataBlock[1];
                copy.InventoryData[0] = new CopyInventoryFromNotecardPacket.InventoryDataBlock();
                copy.InventoryData[0].FolderID = folderID;
                copy.InventoryData[0].ItemID = itemID;

                Client.Network.SendPacket(copy);
            }
        }
コード例 #2
0
ファイル: InventoryManager.cs プロジェクト: Belxjander/Asuna
        public void RequestCopyItemFromNotecard(LLUUID objectID, LLUUID notecardID, LLUUID folderID, LLUUID itemID)
        {
            CopyInventoryFromNotecardPacket copy = new CopyInventoryFromNotecardPacket();
            copy.AgentData.AgentID = _Client.Self.AgentID;
            copy.AgentData.SessionID = _Client.Self.SessionID;

            copy.NotecardData.ObjectID = objectID;
            copy.NotecardData.NotecardItemID = notecardID;

            copy.InventoryData = new CopyInventoryFromNotecardPacket.InventoryDataBlock[1];
            copy.InventoryData[0] = new CopyInventoryFromNotecardPacket.InventoryDataBlock();
            copy.InventoryData[0].FolderID = folderID;
            copy.InventoryData[0].ItemID = itemID;

            _Client.Network.SendPacket(copy);
        }
コード例 #3
0
ファイル: InventoryManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Request a copy of an asset embedded within a notecard
        /// </summary>
        /// <param name="objectID">Usually UUID.Zero for copying an asset from a notecard</param>
        /// <param name="notecardID">UUID of the notecard to request an asset from</param>
        /// <param name="folderID">Target folder for asset to go to in your inventory</param>
        /// <param name="itemID">UUID of the embedded asset</param>
        /// <param name="callback">callback to run when item is copied to inventory</param>
        public void RequestCopyItemFromNotecard(UUID objectID, UUID notecardID, UUID folderID, UUID itemID, ItemCopiedCallback callback)
        {
            CopyInventoryFromNotecardPacket copy = new CopyInventoryFromNotecardPacket();
            copy.AgentData.AgentID = _Network.AgentID;
            copy.AgentData.SessionID = _Network.SessionID;

            copy.NotecardData.ObjectID = objectID;
            copy.NotecardData.NotecardItemID = notecardID;

            copy.InventoryData = new CopyInventoryFromNotecardPacket.InventoryDataBlock[1];
            copy.InventoryData[0] = new CopyInventoryFromNotecardPacket.InventoryDataBlock();
            copy.InventoryData[0].FolderID = folderID;
            copy.InventoryData[0].ItemID = itemID;
           
            _ItemCopiedCallbacks[0] = callback; //Notecards always use callback ID 0

            _Network.SendPacket(copy);
        }