Пример #1
0
    private void ExitMatch()
    {
        GameSystem.Instance.mClient.pause = false;
        if (GlobalConst.IS_NETWORKING)
        {
            //ExitGameReq req = new ExitGameReq();
            //req.session_id = m_config.session_id;
            //GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            EndSectionMatch career = new EndSectionMatch();
            career.session_id = m_config.session_id;

            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_CAREER;
            req.exit_type = ExitMatchType.EMT_OPTION;
            req.career    = career;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            GameSystem.Instance.mClient.mUIManager.curLeagueType = leagueType;
        }
        else
        {
            GameSystem.Instance.mClient.Reset();
            GameSystem.Instance.mClient.mUIManager.curLeagueType = leagueType;
            SceneManager.Instance.ChangeScene(GlobalConst.SCENE_HALL);
        }
        m_stateMachine.m_curState.OnExit();
    }
Пример #2
0
    private void ExitMatch()
    {
        GameMatch curMatch = GameSystem.Instance.mClient.mCurMatch;

        GameMatch.LeagueType type = curMatch.leagueType;
        if (type == GameMatch.LeagueType.eCareer)
        {
            EndSectionMatch career = new EndSectionMatch();
            career.session_id = curMatch.m_config.session_id;

            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_CAREER;
            req.exit_type = ExitMatchType.EMT_OPTION;
            req.career    = career;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            GameSystem.Instance.mClient.mUIManager.curLeagueType = curMatch.leagueType;
        }
        else if (type == GameMatch.LeagueType.eTour)
        {
            TourExitReq req = new TourExitReq();
            req.session_id = curMatch.m_config.session_id;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.TourExitReqID);
            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", curMatch.leagueType);
        }
        else
        {
            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", curMatch.leagueType);
        }

        curMatch.m_stateMachine.m_curState.OnExit();
        GameSystem.Instance.mClient.pause = false;
    }
Пример #3
0
    //关卡比赛结束请求
    public void EndSectionMatchReq(EndSectionMatch career)
    {
        Debug.Log("---------------------EndSectionMatchReq");

        if (GlobalConst.IS_NETWORKING)
        {
            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_CAREER;
            req.exit_type = ExitMatchType.EMT_END;
            req.career    = career;
            SendExitGameReq(req);
        }
        else
        {
            //GameSystem.Instance.mClient.mUIManager.CareerCtrl.showMatchResult = true;
        }
    }
Пример #4
0
    private void ExitMatch()
    {
        PlatNetwork.Instance.onReconnected -= ExitMatch;

        GameMatch curMatch = GameSystem.Instance.mClient.mCurMatch;

        GameMatch.LeagueType type = curMatch.leagueType;
        if (type == GameMatch.LeagueType.eCareer)
        {
            EndSectionMatch career = new EndSectionMatch();
            career.session_id = curMatch.m_config.session_id;

            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_CAREER;
            req.exit_type = ExitMatchType.EMT_OPTION;
            req.career    = career;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            GameSystem.Instance.mClient.mUIManager.curLeagueType = curMatch.leagueType;
        }
        else if (type == GameMatch.LeagueType.ePractise1vs1)
        {
            EndPracticePve endPracticePve = new EndPracticePve();
            endPracticePve.session_id     = curMatch.m_config.session_id;
            endPracticePve.main_role_side = 0;                          //Ö÷¶ÓOr¿Í¶Ó
            endPracticePve.score_home     = (uint)curMatch.m_homeScore; //Ö÷¶ÓµÃ·Ö
            endPracticePve.score_away     = (uint)curMatch.m_awayScore; //¿Í¶ÓµÃ·Ö

            ExitGameReq req = new ExitGameReq();
            req.acc_id       = MainPlayer.Instance.AccountID;
            req.type         = MatchType.MT_PRACTICE_1V1;
            req.exit_type    = ExitMatchType.EMT_OPTION;
            req.practice_pve = endPracticePve;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            GameSystem.Instance.mClient.mUIManager.curLeagueType = curMatch.leagueType;
        }
        else if (type == GameMatch.LeagueType.eQualifying)
        {
            QualifyingEndReq qualifying = new QualifyingEndReq();
            qualifying.session_id = curMatch.m_config.session_id;
            qualifying.type       = MatchType.MT_QUALIFYING;

            ExitGameReq req = new ExitGameReq();
            req.acc_id     = MainPlayer.Instance.AccountID;
            req.type       = MatchType.MT_QUALIFYING;
            req.exit_type  = ExitMatchType.EMT_OPTION;
            req.qualifying = qualifying;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            GameSystem.Instance.mClient.mUIManager.curLeagueType = curMatch.leagueType;
        }
        else if (type == GameMatch.LeagueType.eTour)
        {
            //TourExitReq req = new TourExitReq();
            //req.session_id = curMatch.m_config.session_id;
            TourEndReq tour = new TourEndReq();
            tour.session_id = curMatch.m_config.session_id;
            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_TOUR;
            req.exit_type = ExitMatchType.EMT_OPTION;
            req.tour      = tour;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            MainPlayer.Instance.TourFailTimes++;
            LuaInterface.LuaTable table = LuaScriptMgr.Instance.lua.NewTable();
            table.Set("uiBack", (object)"UICompetition");
            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { curMatch.leagueType, null, table });
        }
        else if (type == GameMatch.LeagueType.ePVP)
        {
            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = GameMatch_PVP.ToMatchType(curMatch.leagueType, curMatch.m_config.type);
            req.exit_type = ExitMatchType.EMT_OPTION;

            if (GameSystem.Instance.mNetworkManager.m_gameConn != null)
            {
                Debug.Log("send exit game req");
                GameSystem.Instance.mNetworkManager.m_gameConn.SendPack(0, req, MsgID.ExitGameReqID);
            }

            GameSystem.Instance.mClient.mUIManager.curLeagueType = curMatch.leagueType;
            LuaInterface.LuaTable table = LuaScriptMgr.Instance.lua.NewTable();
            if (req.type == MatchType.MT_PVP_1V1_PLUS)
            {
                if (GameSystem.Instance.mNetworkManager.m_gameConn == null)
                {
                    table.Set("uiBack", (object)"UIPVPEntrance");
                    LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { "UI1V1Plus", null, table });
                }
            }
            else if (req.type == MatchType.MT_PVP_3V3)
            {
                table.Set("nextShowUI", (object)"UIPVPEntrance");
                LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { "UIChallenge", null, table });
            }
        }
        else if (type == GameMatch.LeagueType.eRegular1V1)
        {
            ExitGameReq req = new ExitGameReq();
            req.acc_id             = MainPlayer.Instance.AccountID;
            req.type               = MatchType.MT_REGULAR_RACE;
            req.exit_type          = ExitMatchType.EMT_OPTION;
            req.regular            = new PVPEndRegularReq();
            req.regular.session_id = curMatch.m_config.session_id;

            if (curMatch.GetMatchType() == GameMatch.Type.ePVP_1PLUS)
            {
                if (GameSystem.Instance.mNetworkManager.m_gameConn != null)
                {
                    Debug.Log("send exit game req to game server");
                    GameSystem.Instance.mNetworkManager.m_gameConn.SendPack(0, req, MsgID.ExitGameReqID);
                }
            }
            else if (curMatch.GetMatchType() == GameMatch.Type.eAsynPVP3On3)
            {
                req.regular.rival_score = (curMatch as GameMatch_AsynPVP3ON3).GetRivalScore();
                GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            }
            else
            {
                Debug.Log("send exit game req to plat server");
                GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            }
        }
        else if (type == GameMatch.LeagueType.eQualifyingNew)
        {
            ExitGameReq req = new ExitGameReq();
            req.acc_id                    = MainPlayer.Instance.AccountID;
            req.type                      = MatchType.MT_QUALIFYING_NEW;
            req.exit_type                 = ExitMatchType.EMT_OPTION;
            req.qualifying_new            = new PVPEndQualifyingReq();
            req.qualifying_new.session_id = curMatch.m_config.session_id;

            if (curMatch.GetMatchType() == GameMatch.Type.ePVP_1PLUS)
            {
                if (GameSystem.Instance.mNetworkManager.m_gameConn != null)
                {
                    Debug.Log("send exit game req to game server");
                    GameSystem.Instance.mNetworkManager.m_gameConn.SendPack(0, req, MsgID.ExitGameReqID);
                }
            }
            else if (curMatch.GetMatchType() == GameMatch.Type.eAsynPVP3On3)
            {
                req.qualifying_new.rival_score = (curMatch as GameMatch_AsynPVP3ON3).GetRivalScore();
                GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            }
            else
            {
                Debug.Log("send exit game req to plat server");
                GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
            }
        }
        else if (type == GameMatch.LeagueType.ePractise)
        {
            EndPractice practice = new EndPractice();
            practice.session_id = curMatch.m_config.session_id;

            ExitGameReq req = new ExitGameReq();
            req.acc_id    = MainPlayer.Instance.AccountID;
            req.type      = MatchType.MT_PRACTICE;
            req.exit_type = ExitMatchType.EMT_OPTION;
            req.practice  = practice;
            GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.ExitGameReqID);
        }
        else if (type == GameMatch.LeagueType.eBullFight)
        {
            LuaInterface.LuaTable table = LuaScriptMgr.Instance.lua.NewTable();
            table.Set("uiBack", (object)"UICompetition");
            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { curMatch.leagueType, null, table });
        }
        else
        {
            LuaInterface.LuaTable table = LuaScriptMgr.Instance.lua.NewTable();
            table.Set("uiBack", (object)"UICompetition");
            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { curMatch.leagueType, null, table });
        }

        curMatch.m_stateMachine.m_curState.OnExit();
        GameSystem.Instance.mClient.pause = false;
    }