Ejemplo n.º 1
0
        protected override void _onProcess()
        {
            Variant variant = new Variant();

            variant.pushBack(this.msgData["itmid"]);
            lgGDItems   g_itemsCT   = ((this.session as ClientSession).g_mgr.g_gameM as muLGClient).g_itemsCT;
            lgGDGeneral g_generalCT = ((this.session as ClientSession).g_mgr.g_gameM as muLGClient).g_generalCT;
            bool        flag        = this.msgData.ContainsKey("gld_cost");

            if (flag)
            {
                g_generalCT.sub_gold(this.msgData["gld_cost"]);
                g_itemsCT.set_gold((uint)g_generalCT.gold);
            }
            bool flag2 = this.msgData.ContainsKey("yb_cost");

            if (flag2)
            {
                g_generalCT.sub_yb(this.msgData["yb_cost"], true);
                g_itemsCT.set_yb((uint)g_generalCT.yb);
            }
            bool flag3 = this.msgData.ContainsKey("readd") && this.msgData["readd"]._bool;

            if (flag3)
            {
                ((this.session as ClientSession).g_mgr.g_gameM as muLGClient).g_vendorCT.ReaddVendorItem(this.msgData);
                g_itemsCT.pshop_updexpire_items(variant);
            }
            else
            {
                g_itemsCT.pshop_add_items(this.msgData);
            }
        }
Ejemplo n.º 2
0
        public void OnUpgradeNobRes(Variant data)
        {
            lgGDGeneral g_generalCT = (this.g_mgr.g_gameM as muLGClient).g_generalCT;

            g_generalCT.noblv = data["noblv"];
            g_generalCT.nobpt = data["nobpt"];
            (this.g_mgr.g_gameM as muLGClient).g_selfPlayer.updateNetData(data);
            (this.g_mgr.g_gameM as muLGClient).g_missionCT.player_change();
            LGIUINobility lGIUINobility = this.g_mgr.g_uiM.getLGUI("UI_NOBILITY") as LGIUINobility;
            bool          flag          = lGIUINobility != null;

            if (flag)
            {
                lGIUINobility.UpdateNobInfo(data);
            }
        }
Ejemplo n.º 3
0
        protected void gotoBuyItem()
        {
            bool flag = this._needBuyItems.Length > 0;

            if (flag)
            {
                for (int i = 0; i < this._needBuyItems.Length; i++)
                {
                    Variant variant       = this._needBuyItems[i];
                    Variant variant2      = variant["itm"];
                    uint    tpid          = variant2["tpid"];
                    Variant buyItemByTpid = this.getBuyItemByTpid(tpid);
                    bool    flag2         = buyItemByTpid == null;
                    if (flag2)
                    {
                        break;
                    }
                    lgGDGeneral g_generalCT = (this.g_mgr.g_gameM as muLGClient).g_generalCT;
                    int         yb          = g_generalCT.yb;
                    uint        num         = variant2.ContainsKey("cnt") ? variant2["cnt"]._uint : 1u;
                    int         num2        = (int)(this.g_mgr.g_gameM as muLGClient).g_itemsCT.pkg_get_grid();
                    int         num3        = (this.g_mgr.g_gameM as muLGClient).g_itemsCT.pkg_occupy_grid();
                    bool        flag3       = yb < variant["yb"]._int || num2 - num3 < 1;
                    if (flag3)
                    {
                        this._needBuyItems._arr.Clear();
                        this.deleteBuyItem(buyItemByTpid);
                        this._need_buy_arr = new Variant();
                        LGIUIMarket lGIUIMarket = this.g_mgr.g_uiM.getLGUI("UI_MARKET") as LGIUIMarket;
                        lGIUIMarket.refreshAutoBuyList(this._need_buy_arr);
                    }
                    else
                    {
                        bool flag4 = buyItemByTpid["cnt"]._uint >= num && buyItemByTpid["up_max"]._int >= variant["yb"] / variant2["cnt"];
                        if (flag4)
                        {
                            this._hadBuyItems._arr.Add(variant);
                            this._needBuyItems._arr.RemoveAt(i);
                            (this.g_mgr.g_netM as muNetCleint).igItemMsg.buy_auc_itm(variant["cid"], variant2["id"], 0);
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private bool is_need_yb(int tp, int cnt)
        {
            Variant variant  = (this.g_mgr.g_gameConfM as muCLientConfig).svrGeneralConf.get_lottery(tp);
            Variant variant2 = variant["lot_cnt"];
            Variant variant3 = null;

            foreach (string current in variant2.Keys)
            {
                variant3 = variant2[current];
                bool flag = variant3["cnt"] == cnt;
                if (flag)
                {
                    break;
                }
            }
            bool flag2 = variant3 == null;
            bool result;

            if (flag2)
            {
                result = false;
            }
            else
            {
                lgGDGeneral g_generalCT = (this.g_mgr as muLGClient).g_generalCT;
                bool        flag3       = variant3["ybcost"] > g_generalCT.yb;
                if (flag3)
                {
                    string languageText = LanguagePack.getLanguageText("UI_Class_npc_carry", "t_moneyNotEnough");
                    this._lgMainUi.systemmsg(languageText, 1024u);
                    result = false;
                }
                else
                {
                    result = true;
                }
            }
            return(result);
        }