Exemplo n.º 1
0
    void OnSlotBuy(C2G.SlotBuy packet, C2G.SlotBuyAck ack)
    {
        Network.PlayerInfo.UseGoodsValue(pe_GoodsType.token_gem, ack.use_gem);
        switch (packet.buy_type)
        {
        case pe_SlotBuy.Creature:
            Tooltip.Instance.ShowMessageKey("HeroSlotAdded");
            Network.PlayerInfo.creature_count_max       = ack.count_max;
            Network.PlayerInfo.creature_count_buy_count = ack.count_buy_count;
            break;

        case pe_SlotBuy.Rune:
            Tooltip.Instance.ShowMessageKey("RuneSlotAdded");
            Network.PlayerInfo.rune_count_max       = ack.count_max;
            Network.PlayerInfo.rune_count_buy_count = ack.count_buy_count;
            break;
        }
        GameMain.Instance.UpdatePlayerInfo();

        parent.Close(true, true);

        if (_OnOK != null)
        {
            _OnOK();
        }
    }
Exemplo n.º 2
0
    public void OnClickOK()
    {
        if (Network.Instance.CheckGoods(pe_GoodsType.token_gem, Network.PlayerInfo.GetSlotBuyCash(m_slot)) == false)
        {
            return;
        }

        C2G.SlotBuy packet = new C2G.SlotBuy();
        switch (m_BuyType)
        {
        case pe_SlotBuy.Creature:
            packet.buy_type        = pe_SlotBuy.Creature;
            packet.count_buy_count = Network.PlayerInfo.creature_count_buy_count;
            break;

        case pe_SlotBuy.Rune:
            packet.buy_type        = pe_SlotBuy.Rune;
            packet.count_buy_count = Network.PlayerInfo.rune_count_buy_count;
            break;
        }
        Network.GameServer.JsonAsync <C2G.SlotBuy, C2G.SlotBuyAck>(packet, OnSlotBuy);
    }