public void AddMapDta(int id, MapData data) { dFbDta[id] = data; }
// private void get_lvl_info_res(Variant msgData) { int levelId; MapData mapdata; int res = msgData["res"]; if (res < 0) { Globle.err_output(res); return; } debug.Log("KKKKKKKK" + msgData.dump()); // debug.Log("<color=#00ff00>"+ msgData.dump() +"</color>"); MapModel m = MapModel.getInstance(); MapData d; switch (res) { case 1: //表示请求副本信息的结果 //int time = -1; //if (msgData.ContainsKey("refresh_time_left")) // time = msgData["refresh_time_left"]; int maxid0 = 0; int maxid1 = 0; //m.beginTimer = time + Time.time; if (msgData.ContainsKey("lvls")) { List <Variant> lv = msgData["lvls"]._arr; foreach (Variant v in lv) { d = m.getMapDta(v["lvlid"]); if (d == null) { d = new MapData(); } d.starNum = v["score"]; if (v.ContainsKey("last_enter_time")) { d.enterTime = v["last_enter_time"]; } if (v.ContainsKey("enter_times")) { d.cycleCount = v["enter_times"]; } if (v.ContainsKey("limit_tm")) { d.limit_tm = v["limit_tm"]; } if (v.ContainsKey("vip_cnt")) { d.vip_buycount = v["vip_cnt"]; } m.AddMapDta(v["lvlid"], d); d = m.getMapDta(v["lvlid"]); if (d.type == 1) { if (d.starNum > 0 && d.id > maxid0) { maxid0 = d.id; } } else if (d.type == 2) { if (d.starNum > 0 && d.id > maxid1) { maxid1 = d.id; } } //if (v["lvlid"] == 104) //{ // if (v.ContainsKey ("diff_lvl")) // { // A3_ActiveModel.getInstance().nowlvl = v["diff_lvl"]; // } //} } m.setLastMapId(0, maxid0); m.setLastMapId(1, maxid1); m.inited = true; } if (msgData.ContainsKey("mlzd_info")) { Variant mlzd = msgData["mlzd_info"]; if (mlzd.ContainsKey("mlzd_diff")) { A3_ActiveModel.getInstance().maxlvl = mlzd["mlzd_diff"]; } if (mlzd.ContainsKey("diff_floor")) { A3_ActiveModel.getInstance().nowlvl = mlzd["diff_floor"]; } if (mlzd.ContainsKey("times")) { A3_ActiveModel.getInstance().count_mlzd = mlzd["times"]; } if (mlzd.ContainsKey("sweep_type")) { A3_ActiveModel.getInstance().sweep_type = mlzd["sweep_type"]; } if (mlzd.ContainsKey("tm")) { A3_ActiveModel.getInstance().Time = mlzd["tm"]; } if (a3_active_mlzd.instans != null) { a3_active_mlzd.instans.RefreshLeftTimes(); } } MapModel mapM = MapModel.getInstance(); //凌晨界面打开时数据要刷新(单/组队人副本) if (a3_counterpart._instance) { a3_counterpart._instance.refreshGoldTimes(); a3_counterpart._instance.refreshExpTimes(); a3_counterpart._instance.refreshMateTimes(); } break; case 2: // <!--扫荡了多少次,客户端按此值对rewards数组进行分组--> levelId = msgData["lvlid"]; mapdata = MapModel.getInstance().getMapDta(levelId); mapdata.count = msgData["left_times"]; List <Variant> rewards = msgData["rewards"]._arr; int len = rewards.Count / 3; int idx = 0; List <List <MapItemData> > ll = new List <List <MapItemData> >(); List <MapItemData> l; MapItemData mapitemdata; for (int i = 0; i < len; i++) { l = new List <MapItemData>(); for (int j = 0; j < 3; j++) { mapitemdata = new MapItemData(); mapitemdata.id = rewards[idx]["tpid"]; mapitemdata.count = rewards[idx]["cnt"]; l.Add(mapitemdata); idx++; } ll.Add(l); } //fb_wipeout.showIt(ll, mapdata); break; case 3: // <!--3表示重置副本--> levelId = msgData["lvlid"]; mapdata = MapModel.getInstance().getMapDta(levelId); mapdata.count = msgData["left_times"]; mapdata.resetCount = msgData["left_reset_times"]; //if (fb_info.instance != null) // fb_info.instance.onRefresh(levelId); break; case 4: // <!--4表示有新的最高分产生,同步给客户端--> int id = msgData["lvlid"]; if (id == 104) { if (msgData.ContainsKey("mlzd_diff")) { A3_ActiveModel.getInstance().maxlvl = msgData["mlzd_diff"]; } if (msgData.ContainsKey("diff_floor")) { A3_ActiveModel.getInstance().nowlvl = msgData["diff_floor"]; } } if (m.containerID(id)) { break; } d = m.getMapDta(id); if (d == null) { return; } d.starNum = msgData["score"]; d.count = msgData["left_times"]; d.resetCount = msgData["left_reset_times"]; break; //vip购买增加次数返回 case 5: MapData data = m.getMapDta(msgData["ltpid"]); if (data == null) { data = new MapData(); data.vip_buycount = msgData["vip_cnt"]; MapModel.getInstance().AddMapDta(msgData["ltpid"], data); } else { MapModel.getInstance().dFbDta[msgData["ltpid"]].vip_buycount = msgData["vip_cnt"]; } if (a3_counterpart._instance) { a3_counterpart._instance.refreshGoldTimes(); a3_counterpart._instance.refreshExpTimes(); a3_counterpart._instance.refreshMateTimes(); } //MJJDModel.getInstance().GetBuyRefresh(msgData); break; case 6: //MJJDModel.getInstance().GetMJJDTimes(msgData); break; case 7: //刷新墨家境地波数 //if (float_mjjd.instance != null && msgData.ContainsKey("current_wave")) // float_mjjd.instance.refreshBo(msgData["current_wave"]); break; default: break; } //NetClient.instance.dispatchEvent( // GameEvent.Create(PKG_NAME.S2C_GET_LVL_INFO_RES, this, GameTools.CreateSwitchData("get_lvl_info_res", msgData)) // ); //GameSession(this.session).logicClient.logicInGame.lgGD_levels.get_lvl_info_res(msgData); }
public override void onStart(Variant svr) { base.onStart(svr); showHpBtn = a1_gamejoy.inst_skillbar.m_skillbar_hp_Add_btn.gameObject.activeSelf; a1_gamejoy.inst_skillbar.m_skillbar_hp_Add_btn.gameObject.SetActive(false); instan = this; a3_insideui_fb.room = this; isOpen = true; data = MapModel.getInstance().getMapDta(107); if (data == null) { data = new MapData(); } MapModel.getInstance().AddMapDta(107, data); //data.OnKillNumChange = (int i) => { // if (a3_insideui_fb.instance != null) // { // a3_insideui_fb.instance.SetKillNum(i); // } //}; startExp = PlayerModel.getInstance().exp; entertimer = muNetCleint.instance.CurServerTimeStamp; a3_insideui_fb.begintime = entertimer; enterdata = muLGClient.instance.g_levelsCT.get_curr_lvl_info(); MapModel.getInstance().curLevelId = 107; // InterfaceMgr.doCommandByLua("MapModel:getInstance().getcurLevelId", "model/MapModel", 107); a3_insideui_fb.ShowInUI(a3_insideui_fb.e_room.PVP); if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.updateUICseth(); } if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.refreshByUIState(); } if (a1_gamejoy.inst_skillbar) { a1_gamejoy.inst_skillbar.clearCD(); } Variant v = new Variant(); InterfaceMgr.doCommandByLua("MapModel:getInstance().getcurLevelId", "model/MapModel", MapModel.getInstance().curLevelId); InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_map_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_btn_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_high_fightgame.close_heroih_ani", "ui/interfaces/high/a1_high_fightgame"); if (tragethead.instance != null) { tragethead.instance.inFB = true; } if (data != null) { data.cycleCount++; } if (a3_expbar.instance) { a3_expbar.instance.showBtnIcon(false); } if (a3_equipup.instance) { a3_equipup.instance.showbtnIcom(false); } if (a1_gamejoy.inst_joystick) { a1_gamejoy.inst_joystick.show_btnIcon(false); } if (a3_liteMinimap.instance) { a3_liteMinimap.instance.showbtnIcon(false); } }
public override void onShowed() { uint up_lvl = ModelBase <PlayerModel> .getInstance().up_lvl; foreach (KeyValuePair <uint, uint> current in this.diff_lvl_zhaun) { bool flag = current.Value == up_lvl; if (flag) { this.diff_lvl = current.Key; } } bool flag2 = up_lvl > this.diff_lvl_zhaun[4u]; if (flag2) { this.diff_lvl = 4u; } int minutes = this.data["tm"]; TimeSpan timeSpan = new TimeSpan(0, minutes, 0); base.getTransformByPath("cue/time").gameObject.SetActive(false); bool flag3 = MapModel.getInstance().dFbDta.ContainsKey(105); if (flag3) { MapData mapData = MapModel.getInstance().dFbDta[105]; TimeSpan timeSpan2 = new TimeSpan(0, 0, mapData.limit_tm); base.getTransformByPath("cue/limit").GetComponent <Text>().text = string.Concat(new object[] { "剩余时间: ", timeSpan2.Hours, "时", timeSpan2.Minutes, "分", timeSpan2.Seconds, "秒" }); bool flag4 = mapData.limit_tm <= 0; if (flag4) { this.enterbtn.interactable = false; } else { this.enterbtn.interactable = true; } } else { base.getTransformByPath("cue/limit").GetComponent <Text>().text = string.Concat(new object[] { "剩余时间: ", 1, "时", 0, "分", 0, "秒" }); this.enterbtn.interactable = true; } base.getTransformByPath("cue/reword").GetComponent <Text>().text = "副本奖励: <color=#ff9900>召唤兽宝宝</color>"; this.RefreshLeftTimes(); }
private void get_lvl_info_res(Variant msgData) { int num = msgData["res"]; bool flag = num < 0; if (flag) { Globle.err_output(num); } else { debug.Log("KKKKKKKK" + msgData.dump()); MapModel instance = MapModel.getInstance(); switch (num) { case 1: { int num2 = 0; int num3 = 0; bool flag2 = msgData.ContainsKey("lvls"); if (flag2) { List <Variant> arr = msgData["lvls"]._arr; foreach (Variant current in arr) { MapData mapData = instance.getMapDta(current["lvlid"]); bool flag3 = mapData == null; if (flag3) { mapData = new MapData(); } instance.AddMapDta(current["lvlid"], mapData); mapData = instance.getMapDta(current["lvlid"]); mapData.starNum = current["score"]; bool flag4 = current.ContainsKey("last_enter_time"); if (flag4) { mapData.enterTime = current["last_enter_time"]; } bool flag5 = current.ContainsKey("enter_times"); if (flag5) { mapData.cycleCount = current["enter_times"]; } bool flag6 = current.ContainsKey("limit_tm"); if (flag6) { mapData.limit_tm = current["limit_tm"]; } bool flag7 = mapData.type == 1; if (flag7) { bool flag8 = mapData.starNum > 0 && mapData.id > num2; if (flag8) { num2 = mapData.id; } } else { bool flag9 = mapData.type == 2; if (flag9) { bool flag10 = mapData.starNum > 0 && mapData.id > num3; if (flag10) { num3 = mapData.id; } } } } instance.setLastMapId(0, num2); instance.setLastMapId(1, num3); instance.inited = true; } bool flag11 = msgData.ContainsKey("mlzd_diff"); if (flag11) { ModelBase <A3_ActiveModel> .getInstance().nowlvl = msgData["mlzd_diff"]; } MapModel instance2 = MapModel.getInstance(); break; } case 2: { int id = msgData["lvlid"]; MapData mapDta = MapModel.getInstance().getMapDta(id); mapDta.count = msgData["left_times"]; List <Variant> arr2 = msgData["rewards"]._arr; int num4 = arr2.Count / 3; int num5 = 0; List <List <MapItemData> > list = new List <List <MapItemData> >(); for (int i = 0; i < num4; i++) { List <MapItemData> list2 = new List <MapItemData>(); for (int j = 0; j < 3; j++) { list2.Add(new MapItemData { id = arr2[num5]["tpid"], count = arr2[num5]["cnt"] }); num5++; } list.Add(list2); } break; } case 3: { int id = msgData["lvlid"]; MapData mapDta = MapModel.getInstance().getMapDta(id); mapDta.count = msgData["left_times"]; mapDta.resetCount = msgData["left_reset_times"]; break; } case 4: { int num6 = msgData["lvlid"]; bool flag12 = instance.containerID(num6); if (!flag12) { MapData mapData = instance.getMapDta(num6); bool flag13 = mapData == null; if (!flag13) { mapData.starNum = msgData["score"]; mapData.count = msgData["left_times"]; mapData.resetCount = msgData["left_reset_times"]; bool flag14 = num6 == 104; if (flag14) { bool flag15 = msgData.ContainsKey("diff_lvl"); if (flag15) { ModelBase <A3_ActiveModel> .getInstance().nowlvl = msgData["diff_lvl"]; } } } } break; } } } }
public override void onStart(Variant svr) { base.onStart(svr); debug.Log("++++++++++++++++++进入城战"); a3_insideui_fb.room = this; isOpen = true; data = MapModel.getInstance().getMapDta(8000); if (data == null) { data = new MapData(); } MapModel.getInstance().AddMapDta(9000, data); if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.updateUICseth(); } if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.refreshByUIState(); } Variant v = new Variant(); v["curLevelId"] = MapModel.getInstance().curLevelId; InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_map_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_btn_ByUIState", "ui/interfaces/low/a1_low_fightgame", v); InterfaceMgr.doCommandByLua("a1_low_fightgame.showbtnIcon", "ui/interfaces/low/a1_low_fightgame", false); InterfaceMgr.doCommandByLua("a1_high_fightgame.showbtnIcon", "ui/interfaces/high/a1_high_fightgame", false); entertimer = muNetCleint.instance.CurServerTimeStamp; a3_insideui_fb.begintime = entertimer; enterdata = muLGClient.instance.g_levelsCT.get_curr_lvl_info(); a3_insideui_fb.ShowInUI(a3_insideui_fb.e_room.CITYWAR); A3_cityOfWarProxy.getInstance().sendGetFb_info(); if (a3_expbar.instance) { a3_expbar.instance.showBtnIcon(false); } if (a3_liteMinimap.instance) { a3_liteMinimap.instance.showbtnIcon(false); } if (a1_gamejoy.inst_joystick) { a1_gamejoy.inst_joystick.show_btnIcon(false); } if (a3_herohead.instance) { a3_herohead.instance.showbtnIcon(false); } if (a3_equipup.instance) { a3_equipup.instance.showbtnIcom(false); } InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_LITEMINIBASEMAP); if (data != null) { data.cycleCount++; } }
public override void onStart(Variant svr) { base.onStart(svr); a3_insideui_fb.room = this; isOpen = true; data = MapModel.getInstance().getMapDta(104); if (data == null) { data = new MapData(); } MapModel.getInstance().AddMapDta(104, data); data.OnKillNumChange = (int i) => { if (a3_insideui_fb.instance != null) { Variant d = SvrLevelConfig.instacne.get_level_data(104); foreach (var a in d["fin_check"]._arr) { foreach (var v in a["km"]._arr) { int id = v["cnt"]; data.total_enemyNum = id; } } a3_insideui_fb.instance.SetKillNum(i, data.total_enemyNum); } }; int ic = 0; Variant sdc = SvrLevelConfig.instacne.get_level_data(104); foreach (var a in sdc["diff_lvl"]._arr) { if (a != null) { foreach (var m in a["map"]._arr) { foreach (var v in m["trigger"]._arr) { foreach (var s in v["addmon"]._arr) { foreach (var z in s["m"]._arr) { uint id = z["mid"]; ic++; } } } } } } data.total_enemyNum = ic; startExp = PlayerModel.getInstance().exp; if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.updateUICseth(); } if (a3_liteMinimap.instance != null) { a3_liteMinimap.instance.refreshByUIState(); } Variant vv = new Variant(); vv["curLevelId"] = MapModel.getInstance().curLevelId; InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_map_ByUIState", "ui/interfaces/low/a1_low_fightgame", vv); InterfaceMgr.doCommandByLua("a1_low_fightgame.refresh_btn_ByUIState", "ui/interfaces/low/a1_low_fightgame", vv); //InterfaceMgr.getInstance().close(InterfaceMgr.BROADCASTING); entertimer = muNetCleint.instance.CurServerTimeStamp; a3_insideui_fb.begintime = entertimer; enterdata = muLGClient.instance.g_levelsCT.get_curr_lvl_info(); a3_insideui_fb.ShowInUI(a3_insideui_fb.e_room.MLZD); if (data != null) { data.cycleCount++; } }