//出售物品
    public void SaleItem(GameItem saleItem, int nItemCount, int nItemPrice)
    {
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        //校验物品
        if (ConsignSaleBag.isCanConsignSale(saleItem) == false)
        {
            return;
        }
        if (nItemCount <= 0 || nItemCount > saleItem.StackCount)
        {
            //提示 数量输入错误
            _mainPlayer.SendNoticMsg(false, "#{1691}");
            return;
        }
        if (nItemPrice < 2)
        {
            //提示 价格输入错误
            _mainPlayer.SendNoticMsg(false, "#{1692}");
            return;
        }
        //发包购买
        CG_CONSIGNSALEITEM salePak = (CG_CONSIGNSALEITEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_CONSIGNSALEITEM);

        salePak.SetItemguid(saleItem.Guid);
        salePak.SetItemcount(nItemCount);
        salePak.SetItemprice(nItemPrice);
        salePak.SetCurpage(m_nCurBuyPage);
        salePak.SendPacket();
    }
Beispiel #2
0
        public uint Execute(PacketDistributed ipacket)
        {
            CG_CONSIGNSALEITEM packet = (CG_CONSIGNSALEITEM )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }