public void OnAddOnClick() { new BaseButton(this.transform.FindChild("help_btn")).onClick = (GameObject go) => { helpcon.SetActive(true); }; new BaseButton(helpcon.transform.FindChild("close")).onClick = (GameObject go) => { helpcon.SetActive(false); }; _btn.onClick = (go) => { if (_btn.interactable == false) { return; } if (needNum > haveNum) { Globle.err_output(-1104); ArrayList data = new ArrayList(); data.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeGiftItemId())); data.Add(InterfaceMgr.RIDE_A3); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data); return; } _btn.interactable = false; A3_RideProxy.getInstance().SendC2S(3, "type", (uint)defaulSelect + 1); }; }
public void on_begin_change_map_res(Variant v) { debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>on_begin_change_map_res>" + v.dump()); if (v["res"] == 1) { Variant var = new Variant(); var["gto"] = v["gto"]; var["gate"] = v["gate"]; if (v.ContainsKey("line")) { var["line"] = v["line"]; } if (loading_cloud.instance == null) { loading_cloud.showhandle = () => { sendRPC(PKG_NAME.C2S_ONMAPCHANGE, var); }; InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.LOADING_CLOUD); } else { sendRPC(PKG_NAME.C2S_ONMAPCHANGE, var); } change_map = true; } else { InterfaceMgr.getInstance().DisposeUI(InterfaceMgr.LOADING_CLOUD); changingMap = false; SelfRole.fsm.Stop(); Globle.err_output(v["res"]); } }
public void ChangeRideDressS2cData(Variant s2cData) { rideInfo.dress = s2cData.getValue("dress")._uint; if (s2cData.ContainsKey("lock_dress")) { var lockdress = s2cData.getValue("lock_dress")._uint; rideInfo.ridedressMapiping.Remove(lockdress); // 限时坐骑 移除 Globle.err_output(-5704); } rideInfo.configVo = GetValueByType <RideConfigVo>((int)rideInfo.dress); if (SelfRole._inst != null && rideInfo.mount == ( uint )RIDESTATE.UP && A3_RideProxy.IsCanChangeRide(SelfRole._inst.dianjiTime)) { if (SelfRole._inst.invisible) { return; //隐身状态 } SelfRole._inst.set_Ride(( int )rideInfo.dress, true); } }
private void dartinfo(Variant data) { debug.Log("镖车信息:" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { switch (num) { case 1: this.info(data); break; case 2: this.wannaGo(data); break; case 3: this.itemNum(data); break; case 4: this.dartHP(data); break; } } }
public void onNPCShop(Variant data) { debug.Log("NPCSHOP============" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); bool flag2 = num == -5100; if (flag2) { this.sendShowFloat((uint)ModelBase <A3_NPCShopModel> .getInstance().listNPCShop[0].getInt("shop_id")); } } else { switch (num) { case 1: this.onFloat(data); break; case 2: this.onBuy(data); break; case 3: this.onRefresh(data); break; } } }
//删除角色 private void onDeleteChar(GameEvent e) { if (e.data["res"] < 0) { Globle.err_output(e.data["res"]); } else { flytxt.instance.fly(ContMgr.getCont("role_delete")); } Variant data = e.data; if (data["res"]._int > 0) { uint cid = data["cid"]._uint; for (int i = 0; i < _chas.Count; i++) { if (_chas[i].ContainsKey("cid") && _chas[i]["cid"]._uint == cid) { _chas._arr.RemoveAt(i); } } this.dispatchEvent(GameEvent.Create(UI_EVENT.UI_ACT_DELETE_CHAR, this, data)); //if (selchar.instance) // selchar.instance.onDelChar(data); } }
private void onDeleteChar(GameEvent e) { bool flag = e.data["res"] < 0; if (flag) { Globle.err_output(e.data["res"]); } else { flytxt.instance.fly(ContMgr.getCont("role_delete", null), 0, default(Color), null); } Variant data = e.data; bool flag2 = data["res"]._int > 0; if (flag2) { uint @uint = data["cid"]._uint; for (int i = 0; i < this._chas.Count; i++) { bool flag3 = this._chas[i].ContainsKey("cid") && this._chas[i]["cid"]._uint == @uint; if (flag3) { this._chas._arr.RemoveAt(i); } } base.dispatchEvent(GameEvent.Create(4032u, this, data, false)); } }
private void onErrorRes(Variant data) { int res = data["res"]; if (res < 0) { Globle.err_output(res); } }
private void onActive(Variant data) { debug.Log("奖励信息:" + data.dump()); int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { switch (num) { case 0: this.setClose(data); break; case 1: this.setWelfare(data); break; case 2: this.setGetFirstRechargeAward(data); break; case 3: this.setOnlineTime(data); break; case 4: this.setTotalLoginAward(data); break; case 5: this.setLvlAward(data); break; case 6: this.setAccumulateRecharge(data); break; case 7: this.setAccumulateConsumption(data); break; case 8: this.setDayRechargeAward(data); break; case 9: this.setTotalData(data); break; } } }
void onBuyTime(Variant data) { int res = data["res"]; if (res != 1) { Globle.err_output(res); return; } }
private void onBuyTime(Variant data) { int num = data["res"]; bool flag = num != 1; if (flag) { Globle.err_output(num); } }
private void S2CHandle(Variant s2cData) { int res = s2cData["res"];; //Debug.LogError( "==============坐骑消息" + s2cData.dump().ToString() ); switch (res) { case ( int )S2Cenum.RIDE_INFO: A3_RideModel.getInstance().SetRideInfoS2cData(s2cData); break; case ( int )S2Cenum.RIDE_UPGRADE: A3_RideModel.getInstance().ChangeRideLvlS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPGRADE, this, s2cData)); break; case ( int )S2Cenum.RIDE_UPGRADEGIFT: A3_RideModel.getInstance().ChangRideGiftLvlS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPGRADEGIFT, this, s2cData)); break; case ( int )S2Cenum.RIDE_UPDOWN: A3_RideModel.getInstance().ChangeRideStateS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_UPDOWN, this, s2cData)); Debug.LogError(s2cData.getValue("mount")._uint == 0 ? "下坐骑" : "上坐骑"); break; case ( int )S2Cenum.RIDE_CHANGE: A3_RideModel.getInstance().ChangeRideDressS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_CHANGE, this, s2cData)); if (s2cData.ContainsKey("lock_dress")) { dispatchEvent(GameEvent.Create((int)S2Cenum.RIDE_LIMIT, this, s2cData)); // 限时过期 } break; case ( int )S2Cenum.RIDE_ADD: A3_RideModel.getInstance().AddRideDressS2cData(s2cData); dispatchEvent(GameEvent.Create(( int )S2Cenum.RIDE_ADD, this, s2cData)); break; case ( int )S2Cenum.RIDE_GIFTPOINT: break; default: Globle.err_output(res); break; } }
public void OnWings(Variant data) { debug.Log("wing::" + data.dump()); int res = data["res"]; switch (res) { case 1: ModelBase <A3_WingModel> .getInstance().InitWingInfo(data); break; case 2: ModelBase <A3_WingModel> .getInstance().SetLevelExp(data); base.dispatchEvent(GameEvent.Create(0u, this, data, false)); break; case 3: { ModelBase <A3_WingModel> .getInstance().SetStageInfo(data); bool stageUp = ModelBase <A3_WingModel> .getInstance().stageUp; if (stageUp) { base.dispatchEvent(GameEvent.Create(1u, this, data, false)); ModelBase <A3_WingModel> .getInstance().SetShowStage(data); base.dispatchEvent(GameEvent.Create(3u, this, data, false)); } else { base.dispatchEvent(GameEvent.Create(4u, this, data, false)); } break; } case 4: ModelBase <A3_WingModel> .getInstance().SetLevelExp(data); base.dispatchEvent(GameEvent.Create(2u, this, data, false)); break; case 5: ModelBase <A3_WingModel> .getInstance().SetShowStage(data); base.dispatchEvent(GameEvent.Create(3u, this, data, false)); break; default: Globle.err_output(res); break; } }
private void onHttpCallback(string str) { bool flag = this.curTransing == null; if (flag) { this.curTransing = null; this.getCardsCode(); } else { bool flag2 = str == ""; if (flag2) { this.curTransing = null; this.getCardsCode(); } else { Variant variant = JsonManager.StringToVariant(str, true); bool flag3 = variant["r"] == 1; if (flag3) { debug.Log(string.Concat(new object[] { "获得激活码:", this.curTransing.id, " ", str })); GiftCardData giftCardData = new GiftCardData(); giftCardData.id = this.curTransing.id; giftCardData.code = variant["res"]; giftCardData.cardType = this.curTransing; giftCardData.initTimer(); bool flag4 = this.dGiftCardData.ContainsKey(giftCardData.id); if (flag4) { GiftCardData item = this.dGiftCardData[giftCardData.id]; this.lGiftCards.Remove(item); } this.dGiftCardData[giftCardData.id] = giftCardData; this.lGiftCards.Add(giftCardData); debug.Log("lGiftCards.clount::" + this.lGiftCards.Count); } else { Globle.err_output(variant["r"]); debug.Log("激活码领取的错误码:" + variant["r"]); } this.curTransing = null; this.getCardsCode(); } } }
void onPlayerAddPoint(Variant msgData) { int res = msgData["res"]; if (res < 0) { Globle.err_output(res); return; } dispatchEvent(GameEvent.Create(EVENT_ADD_POINT, this, msgData)); }
private void OnTask(Variant data) { debug.Log("任务::" + data.dump()); bool flag = SelfRole._inst != null; if (flag) { SelfRole._inst.m_LockRole = null; } bool flag2 = data.ContainsKey("res"); if (flag2) { int res = data["res"]; switch (res) { case 1: this.OnSyncTaskInfo(data); FunctionOpenMgr.instance.onFinshedMainTask(ModelBase <A3_TaskModel> .getInstance().main_task_id, false, false); base.dispatchEvent(GameEvent.alloc(0u, this, data, false, true)); goto IL_10F; case 2: this.OnGetTaskAward(data); base.dispatchEvent(GameEvent.alloc(1u, this, data, false, true)); goto IL_10F; case 5: goto IL_10F; case 7: this.OnAddTaskInfo(data); base.dispatchEvent(GameEvent.alloc(2u, this, data, false, true)); goto IL_10F; case 8: this.OnRefreshTaskCount(data); base.dispatchEvent(GameEvent.alloc(3u, this, data, false, true)); goto IL_10F; } Globle.err_output(res); IL_10F :; } bool flag3 = data.ContainsKey("mlmis"); if (flag3) { ModelBase <A3_TaskModel> .getInstance().main_task_id = data["mlmis"]["id"]; } }
private void onPlayerAddPoint(Variant msgData) { int num = msgData["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { base.dispatchEvent(GameEvent.Create(PlayerInfoProxy.EVENT_ADD_POINT, this, msgData, false)); } }
private void onChangeLine(Variant data) { int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { Variant variant = new Variant(); } }
public void onloadlottery(Variant data) { int num = data["res"]; debug.Log("C#::" + data.dump()); bool flag = num == 1; if (flag) { IconAddLightMgr.getInstance().showOrHideFire("ShowFreeDrawAvaible", data); base.dispatchEvent(GameEvent.Create(LotteryProxy.LOADLOTTERY, this, data, false)); } else { bool flag2 = num == 2; if (flag2) { base.dispatchEvent(GameEvent.Create(LotteryProxy.LOTTERYOK_FREEDRAW, this, data, false)); } else { bool flag3 = num == 3; if (flag3) { base.dispatchEvent(GameEvent.Create(LotteryProxy.LOTTERYOK_ICEDRAWONCE, this, data, false)); } else { bool flag4 = num == 4; if (flag4) { base.dispatchEvent(GameEvent.Create(LotteryProxy.LOTTERYOK_ICEDRAWTENTH, this, data, false)); } else { bool flag5 = num == 5; if (flag5) { base.dispatchEvent(GameEvent.Create(LotteryProxy.LOTTERYOK_ICED_NEWBIE, this, data, false)); } else { Globle.err_output(num); } } } } } }
void onHttpCallback(string str) { if (curTransing == null) { curTransing = null; getCardsCode(); return; } if (str == "") { curTransing = null; getCardsCode(); return; } Variant v = JsonManager.StringToVariant(str); if (v["r"] == 1) { debug.Log("获得激活码:" + curTransing.id + " " + str); GiftCardData cardta = new GiftCardData(); cardta.id = curTransing.id; cardta.code = v["res"]; cardta.cardType = curTransing; cardta.initTimer(); if (dGiftCardData.ContainsKey(cardta.id)) { GiftCardData temp = dGiftCardData[cardta.id]; lGiftCards.Remove(temp); } dGiftCardData[cardta.id] = cardta; lGiftCards.Add(cardta); debug.Log("lGiftCards.clount::" + lGiftCards.Count); } else { Globle.err_output(v["r"]); debug.Log("激活码领取的错误码:" + v["r"]); } curTransing = null; getCardsCode(); }
private void OnBtnFeedHandle(GameObject go) { if (haveNum >= num && isAutoState == false) { A3_RideProxy.getInstance().SendC2S(2, "num", 1); } else { Globle.err_output(-1104); ArrayList data1 = new ArrayList(); data1.Add(a3_BagModel.getInstance().getItemDataById(A3_RideModel.getInstance().GetUpGradeRideItemId())); data1.Add(InterfaceMgr.RIDE_A3); InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1); } }
public void onloadlottery(Variant data) { int res = data["res"]; debug.Log("C#::" + data.dump()); if (res == (int)LotteryType.CurrentInfo)//获取当前抽奖信息 { IconAddLightMgr.getInstance().showOrHideFire("ShowFreeDrawAvaible", data); //InterfaceMgr.doCommandByLua("a1_low_fightgame.ShowFreeDrawAvaible", "ui/interfaces/low/a1_low_fightgame", data); dispatchEvent(GameEvent.Create(LOADLOTTERY, this, data)); } else if (res == (int)LotteryType.FreeDraw)//免费抽奖 { dispatchEvent(GameEvent.Create(LOTTERYOK_FREEDRAW, this, data)); } else if (res == (int)LotteryType.IceDrawOnce)//钻石抽奖 { dispatchEvent(GameEvent.Create(LOTTERYOK_ICEDRAWONCE, this, data)); } else if (res == (int)LotteryType.IceDrawTenth)//钻石十连抽 { dispatchEvent(GameEvent.Create(LOTTERYOK_ICEDRAWTENTH, this, data)); } else if (res == (int)LotteryType.FreeTenth) { dispatchEvent(GameEvent.Create(LOTTERYOK_FREE_TENTH, this, data)); } else if (res == (int)LotteryType.NewBieDraw) { dispatchEvent(GameEvent.Create(LOTTERYOK_ICED_NEWBIE, this, data)); } else if (res == (int)LotteryType.NewDrawInfo) { dispatchEvent(GameEvent.Create(LOTTERYNEW_ITEM, this, data)); } else if (res == (int)LotteryType.newDraw) { dispatchEvent(GameEvent.Create(NEWDRAW, this, data)); } else { if (res < 0) { Globle.err_output(res); } return; } }
private void on_pickitem(Variant msg_data) { int res = msg_data["res"]; debug.Log("dddddd-------------" + msg_data.dump()); if (res == 1) { if (BaseRoomItem.instance != null) { if (msg_data["cid"] == PlayerModel.getInstance().cid) { BaseRoomItem.instance.flyGetItmTxt(msg_data["id"], false); //if (LevelProxy.getInstance().is_open == true) //{ // int aa = BaseRoomItem.instance.drop_id(msg_data["id"]); // drop.Add(aa); //} } BaseRoomItem.instance.removeDropItm(msg_data["id"], false); } } else if (res == -824) { flytxt.instance.fly(ContMgr.getCont("worldmap_cangetitem")); } else if (res == -1101) { flytxt.instance.fly(ContMgr.getCont("worldmap_fullbag")); DropItem.cantGetTimer = NetClient.instance.CurServerTimeStampMS + 1500; } else if (res == -825) { int tm = msg_data["tm"]; if (tm <= 0) { tm = 1; } flytxt.instance.fly(ContMgr.getCont("worldmap_cangetitem_tm", new List <string> { tm.ToString() })); } else if (res == -827) { Globle.err_output(-825); } }
public void OnBlessing(Variant data) { //debug.Log(data.dump()); int res = data["res"]; if (res < 0) { Globle.err_output(res); return; } A3_ActiveModel.getInstance().blessnum_yb = data["yb_cnt"]; A3_ActiveModel.getInstance().blessnum_ybbd = data["bndyb_cnt"]; flytxt.instance.fly(ContMgr.getCont("uilayer_a3_blessing_7")); dispatchEvent(GameEvent.Create(EVENT_ONBLESS, this, null)); }
public void onLoadRune(Variant data) { switch (data["res"]) { case 1: debug.Log("符文的信息:" + data.dump()); base.dispatchEvent(GameEvent.Create(Skill_a3Proxy.RUNEINFOS, this, data, false)); break; case 2: { debug.Log("符文开始研究结果:" + data.dump()); ModelBase <Skill_a3Model> .getInstance().Reshreinfos(data["id"], -1, data["upgrade_count_down"]); base.dispatchEvent(GameEvent.Create(Skill_a3Proxy.RUNERESEARCH, this, data, false)); bool flag = data["upgrade_count_down"] == 0; if (flag) { bool flag2 = a3_runeopen.instance != null; if (flag2) { a3_runeopen.instance.open_id = data["id"]; a3_runeopen.instance.refreshInfo(); } } break; } case 3: debug.Log("符文加速结果:" + data.dump()); ModelBase <Skill_a3Model> .getInstance().Reshreinfos(data["id"], data["lvl"], 0); base.dispatchEvent(GameEvent.Create(Skill_a3Proxy.RUNEADDSPEED, this, data, false)); break; case 4: debug.Log("升级完成给客户端数据:" + data.dump()); ModelBase <Skill_a3Model> .getInstance().Reshreinfos(data["id"], data["lvl"], 0); base.dispatchEvent(GameEvent.Create(Skill_a3Proxy.RUNERESEARCHOVER, this, data, false)); break; default: Globle.err_output(data["res"]); break; } }
private void onLoadinfo(Variant data) { int num = data["res"]; bool flag = num < 0; if (flag) { Globle.err_output(data["res"]); } else { Debug.Log(data.dump()); bool flag2 = data["level"] > this.HudunModel.Level; if (flag2) { bool flag3 = a3_hudun._instance; if (flag3) { a3_hudun._instance.AniUpLvl(); } this.isUplvl = true; } int nowCount = this.HudunModel.NowCount; this.HudunModel.Level = data["level"]; this.HudunModel.NowCount = data["holy_shield"]; this.isshow = true; bool flag4 = data["auto"] == 0; if (flag4) { this.HudunModel.is_auto = false; } bool flag5 = a3_hudun._instance; if (flag5) { bool flag6 = this.isUplvl; if (flag6) { a3_hudun._instance.updata_hd(0); this.isUplvl = false; } else { a3_hudun._instance.updata_hd(nowCount); } } } }
private void onGetMerisRes(Variant data) { bool flag = data["res"] == 1; if (flag) { debug.Log(data.dump()); Variant variant = new Variant(); variant["zhuan"] = data["zhuan"]; variant["att_pt"] = data["att_pt"]; bool flag2 = data.ContainsKey("lvl"); if (flag2) { variant["lvl"] = data["lvl"]; } ModelBase <PlayerModel> .getInstance().lvUp(variant); ModelBase <PlayerModel> .getInstance().up_lvl = data["zhuan"]._uint; ModelBase <PlayerModel> .getInstance().pt_att = data["att_pt"]._int; ModelBase <PlayerModel> .getInstance().lvl = ((data["lvl"] == null) ? ModelBase <PlayerModel> .getInstance().lvl : data["lvl"]._uint); this.resetLvL(); Variant variant2 = new Variant(); bool flag3 = data.ContainsKey("lvl"); if (flag3) { data["lvl"] = data["lvl"]; } bool flag4 = data.ContainsKey("zhuan"); if (flag4) { data["zhuan"] = data["zhuan"]; } InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modInfo", "model/PlayerModel", new object[] { variant2 }); base.dispatchEvent(GameEvent.Create(ResetLvLProxy.EVENT_RESETLVL, this, variant, false)); } else { Globle.err_output(data["res"]); } }
private void OnOneKeyBless(Variant data) { A3_PetModel cpet = A3_PetModel.getInstance(); if (data.ContainsKey("multi_res")) { int res = data["multi_res"]; if (res < 0) { Globle.err_output(res); } } cpet.Tpid = data["id"]; cpet.Level = data["level"]; cpet.Exp = data["exp"]; }
public void OnWings(Variant data) { debug.Log("wing::" + data.dump()); int res = data["res"]; switch (res) { case 1: //获得翅膀信息 A3_WingModel.getInstance().InitWingInfo(data); break; case 2: //获得升级强化结果 A3_WingModel.getInstance().SetLevelExp(data); dispatchEvent(GameEvent.Create(ON_LEVEL_EXP_CHANGE, this, data)); break; case 3: //获得进阶结果 A3_WingModel.getInstance().SetStageInfo(data); if (A3_WingModel.getInstance().stageUp) { dispatchEvent(GameEvent.Create(ON_STAGE_CHANGE, this, data)); A3_WingModel.getInstance().SetShowStage(data); dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data)); } else { dispatchEvent(GameEvent.Create(ON_STAGE_DIFT, this, data)); } break; case 4: //获得自动升级结果 A3_WingModel.getInstance().SetLevelExp(data); dispatchEvent(GameEvent.Create(ON_LEVEL_AUTO_UPGRADE, this, data)); break; case 5: A3_WingModel.getInstance().SetShowStage(data); dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data)); break; default: Globle.err_output(res); break; } }
void onSetUpSkill(Variant data) { int res = data["res"]; if (res != 1) { Globle.err_output(res); return; } Variant skill = new Variant(); skill["skill_id"] = data["skill_id"]; skill["skill_level"] = data["skill_level"]; SkillModel.getInstance().changeSkillList(skill); dispatchEvent(GameEvent.Create(EVENT_SKILL_UP, this, skill)); }