Exemplo n.º 1
0
    void SendBuyGoodsPacket()
    {
        int  curNum    = 0;
        bool bCanParse = int.TryParse(m_NumInput.value, out curNum);

        if (!bCanParse)
        {
            return;
        }

        if (m_CurNum <= 0)
        {
            return;
        }

        //PlayGoodsSoundEffect();

        CG_BUY_YUANBAOGOODS packet = (CG_BUY_YUANBAOGOODS)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_YUANBAOGOODS);

        packet.GoodID    = m_GoodsId;
        packet.BuyNum    = curNum;
        packet.IsUseBind = m_bChooseBind ? 1 : 0;
        packet.Deadline  = (int)m_eDeadlineType;
        packet.SendPacket();
    }
Exemplo n.º 2
0
 void BuyViewOK()
 {
     int[] viewGoods = { m_FitOnVisual.FashionGoodsID, m_FitOnVisual.ArmorGoodsID, m_FitOnVisual.WeaponGoodsID, m_FitOnVisual.FellowGoodsID, m_FitOnVisual.MountGoodsID };
     for (int i = 0; i < 5; i++)
     {
         if (viewGoods[i] != GlobeVar.INVALID_ID)
         {
             CG_BUY_YUANBAOGOODS packet = (CG_BUY_YUANBAOGOODS)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_YUANBAOGOODS);
             packet.GoodID    = viewGoods[i];
             packet.BuyNum    = 1;
             packet.IsUseBind = m_eCurBuyType == BUY_TYPE.TYPE_BIND ? 1 : 0;
             if (i == 0)
             {
                 // 时装按照选择的期限
                 packet.Deadline = (int)m_FitOnVisual.FashionDeadline;
             }
             else
             {
                 // 其他的按永久
                 packet.Deadline = (int)YuanBaoShopItemLogic.DEADLINE_PRICE.PRICE_FOREVER;
             }
             packet.SendPacket();
         }
     }
 }