//购买物品
    public void BuyItem()
    {
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (m_nSelBuyIndex >= 0 && m_nSelBuyIndex < m_buyItemInfo.Count)
        {
            //金钱是否足够
            int nMoney = GameManager.gameManager.PlayerDataPool.Money.GetMoney_YuanBao();
            if (nMoney < m_buyItemInfo[m_nSelBuyIndex].Price)
            {
                // 元宝不足
                MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{1848}"), "", BuyChargeOK, BuyChargeCancel);
                return;
            }
            //发包购买
            CG_BUY_CONSIGNSALEITEMINFO buyPak = (CG_BUY_CONSIGNSALEITEMINFO)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_CONSIGNSALEITEMINFO);
            buyPak.SetSearchclass(m_nSearchClass);
            buyPak.SetSearchsubclass(m_nSearchSubClass);
            buyPak.SetSearchquality(m_nSearchQuality);
            buyPak.SetSortclass(m_nSortClass);
            buyPak.SetSorttype(m_nSortType);
            buyPak.SetKeyword(m_keyWord);
            buyPak.SetPage(m_nCurBuyPage);
            buyPak.SetItemguid(m_buyItemInfo[m_nSelBuyIndex].ItemInfo.Guid);
            buyPak.SendPacket();
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            CG_BUY_CONSIGNSALEITEMINFO packet = (CG_BUY_CONSIGNSALEITEMINFO )ipacket;

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