예제 #1
0
        private void lvl_get_prize_res(Variant msgData)
        {
            //prize.Clear();
            bool b = GameRoomMgr.getInstance().onPrizeFinish(msgData);

            if (b)
            {
                return;
            }
            // Debug.LogError("KKKKK"+ msgData.dump());
            PVPRoom.instan?.refGet(msgData["ach_point"], msgData["exp"]);
            List <MapItemData> ld = new List <MapItemData>();

            if (msgData.ContainsKey("rewards"))
            {
                List <Variant> lv = msgData["rewards"]._arr;
                MapItemData    d;

                foreach (Variant v in lv)
                {
                    d       = new MapItemData();
                    d.count = v["cnt"];
                    d.id    = v["tpid"];
                    ld.Add(d);

                    //Rewards l = new Rewards();
                    //l.tpid = v["tpid"];
                    //l.cnt = v["cnt"];
                    //prize.Add(l);
                    //Debug.LogError(l.cnt);
                }
            }

            //if (PVPRoom.instan != null)
            //{

            // }

            //fb_win.lItemData = ld;
            // InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FB_WIN);
            // GameCameraMgr.getInstance().useCamera("fb_win");
        }
예제 #2
0
        //

        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);
        }