コード例 #1
0
ファイル: LevelProxy.cs プロジェクト: atom-chen/rongyaojt
        private void lvl_fin(Variant msgData)
        {
            this.reward.Clear();
            debug.Log("Fin Level ===============================" + msgData.dump());
            bool flag = msgData != null;

            if (flag)
            {
                bool flag2 = msgData["rewards"] != null;
                if (flag2)
                {
                    List <Variant> arr = msgData["rewards"]._arr;
                    foreach (Variant current in arr)
                    {
                        Rewards rewards = new Rewards();
                        rewards.tpid = current["tpid"];
                        rewards.cnt  = current["cnt"];
                        this.reward.Add(rewards);
                    }
                }
            }
            bool flag3 = GameRoomMgr.getInstance().onLevelFinish(msgData);

            if (!flag3)
            {
                bool flag4 = msgData.ContainsKey("ply_res");
                if (flag4)
                {
                    int  num   = msgData["ply_res"]._arr[0]["score"];
                    bool flag5 = num == 0;
                    if (flag5)
                    {
                        InterfaceMgr.getInstance().open(InterfaceMgr.FB_LOSE, null, false);
                    }
                }
                else
                {
                    BaseProxy <LevelProxy> .getInstance().sendLeave_lvl();
                }
            }
        }
コード例 #2
0
        private void lvl_fin(Variant msgData)
        {
            if (GameRoomMgr.getInstance().curRoom != null)
            {
                GameRoomMgr.getInstance().curRoom.clear();
            }

            //if (BaseRoomItem.instance != null ) {
            //    BaseRoomItem.instance.clearlist();
            //}
            reward.Clear();
            debug.Log("Fin Level ===============================" + msgData.dump());

            if (msgData != null)
            {
                if (msgData["rewards"] != null)
                {
                    List <Variant> l = msgData["rewards"]._arr;
                    foreach (var v in l)
                    {
                        Rewards d = new Rewards();
                        d.tpid = v["tpid"];
                        d.cnt  = v["cnt"];

                        reward.Add(d);
                    }
                }
                if (msgData.ContainsKey("item_drop"))
                {
                    List <Variant> l = msgData["item_drop"]._arr;
                    foreach (var v in l)
                    {
                        Rewards d = new Rewards();
                        d.tpid = v["tpid"];
                        d.cnt  = v["cnt"];
                        fbDrogward.Add(d);
                    }
                }

                //if (msgData.ContainsKey("kill_exp"))
                //{
                //    a3_fb_finish.allEXP = msgData["kill_exp"];//直接显示服务器发的数据
                //}
            }
            if (GameRoomMgr.getInstance().onLevelFinish(msgData))
            {
                return;
            }

            if (msgData.ContainsKey("ply_res"))
            {
                //int starNum = msgData["ply_res"]._arr[0]["score"];
                //if (starNum == 0)
                //    InterfaceMgr.getInstance().open(InterfaceMgr.FB_LOSE);
                //else
                //fb_win.star = starNum;
            }
            else
            {
                LevelProxy.getInstance().sendLeave_lvl();
            }
            //NetClient.instance.dispatchEvent(
            //     GameEvent.Create(PKG_NAME.S2C_LVL_FIN, this, GameTools.CreateSwitchData("on_lvl_fin", msgData))
            // );
            // GameSession(this.session).logicClient.logicInGame.lgGD_levels.on_lvl_fin(msgData);
        }