예제 #1
0
        /// <summary>
        /// Sets the sale properties of a single object
        /// </summary>
        /// <param name="simulator">The <see cref="Simulator"/> the object is located</param>        
        /// <param name="localID">The Local ID of the object</param>        
        /// <param name="saleType">One of the options from the <see cref="SaleType"/> enum</param>
        /// <param name="price">The price of the object</param>
        public void SetSaleInfo(Simulator simulator, uint localID, SaleType saleType, int price)
        {
            ObjectSaleInfoPacket sale = new ObjectSaleInfoPacket();
            sale.AgentData.AgentID = Client.Self.AgentID;
            sale.AgentData.SessionID = Client.Self.SessionID;
            sale.ObjectData = new ObjectSaleInfoPacket.ObjectDataBlock[1];
            sale.ObjectData[0] = new ObjectSaleInfoPacket.ObjectDataBlock();
            sale.ObjectData[0].LocalID = localID;
            sale.ObjectData[0].SalePrice = price;
            sale.ObjectData[0].SaleType = (byte)saleType;

            Client.Network.SendPacket(sale, simulator);
        }
예제 #2
0
        /// <summary>
        /// Sets the sale properties of multiple objects
        /// </summary>        
        /// <param name="simulator">The <see cref="Simulator"/> the objects are located</param> 
        /// <param name="localIDs">An array containing the Local IDs of the objects</param>
        /// <param name="saleType">One of the options from the <see cref="SaleType"/> enum</param>
        /// <param name="price">The price of the object</param>
        public void SetSaleInfo(Simulator simulator, List<uint> localIDs, SaleType saleType, int price)
        {
            ObjectSaleInfoPacket sale = new ObjectSaleInfoPacket();
            sale.AgentData.AgentID = Client.Self.AgentID;
            sale.AgentData.SessionID = Client.Self.SessionID;
            sale.ObjectData = new ObjectSaleInfoPacket.ObjectDataBlock[localIDs.Count];

            for (int i = 0; i < localIDs.Count; i++)
            {
                sale.ObjectData[i] = new ObjectSaleInfoPacket.ObjectDataBlock();
                sale.ObjectData[i].LocalID = localIDs[i];
                sale.ObjectData[i].SalePrice = price;
                sale.ObjectData[i].SaleType = (byte)saleType;
            }

            Client.Network.SendPacket(sale, simulator);
        }
예제 #3
0
        /// <summary>
        /// Sets an object's sale information
        /// </summary>
        /// <param name="localID"></param>
        /// <param name="saleType"></param>
        /// <param name="price"></param>
        public void SetSaleInfo(uint localID, SaleType saleType, int price)
        {
            ObjectSaleInfoPacket sale = new ObjectSaleInfoPacket();
            sale.AgentData.AgentID = Network.AgentID;
            sale.AgentData.SessionID = Network.SessionID;
            sale.ObjectData = new ObjectSaleInfoPacket.ObjectDataBlock[1];
            sale.ObjectData[0] = new ObjectSaleInfoPacket.ObjectDataBlock();
            sale.ObjectData[0].LocalID = localID;
            sale.ObjectData[0].SalePrice = price;
            sale.ObjectData[0].SaleType = (byte)saleType;

            Network.SendPacket(sale);
        }