コード例 #1
0
ファイル: TaskInventory.cs プロジェクト: jhurliman/simian
        private void RemoveTaskInventoryHandler(Packet packet, LLAgent agent)
        {
            RemoveTaskInventoryPacket remove = (RemoveTaskInventoryPacket)packet;

            ISceneEntity targetObj;

            if (m_scene.TryGetEntity(remove.InventoryData.LocalID, out targetObj) && targetObj is LLPrimitive)
            {
                RemoveTaskInventory(agent, (LLPrimitive)targetObj, remove.InventoryData.ItemID);
            }
            else
            {
                m_log.Warn(agent.Name + " attempted to remove task inventory item " + remove.InventoryData.ItemID +
                           " from unknown prim " + remove.InventoryData.LocalID);
            }
        }
コード例 #2
0
ファイル: InventoryManager.cs プロジェクト: RavenB/gridsearch
        /// <summary>
        /// Remove an item from an objects (Prim) Inventory
        /// </summary>
        /// <param name="objectLocalID">LocalID of the object in the simulator</param>
        /// <param name="taskItemID">UUID of the task item to remove</param>
        /// <param name="simulator">Simulator Object</param>
        /// <remarks>You can confirm the removal by comparing the tasks inventory serial before and after the 
        /// request with the <see cref="RequestTaskInventory"/> request combined with
        /// the <seealso cref="TaskInventoryReply"/> event</remarks>
        public void RemoveTaskInventory(uint objectLocalID, UUID taskItemID, Simulator simulator)
        {
            RemoveTaskInventoryPacket remove = new RemoveTaskInventoryPacket();
            remove.AgentData.AgentID = Client.Self.AgentID;
            remove.AgentData.SessionID = Client.Self.SessionID;

            remove.InventoryData.ItemID = taskItemID;
            remove.InventoryData.LocalID = objectLocalID;

            Client.Network.SendPacket(remove, simulator);
        }