コード例 #1
0
    static int HandleChallengeExComplete(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        obj.HandleChallengeExComplete();
        return(0);
    }
コード例 #2
0
    static int OnExit(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        obj.OnExit();
        return(0);
    }
コード例 #3
0
    static int SendPractiseResult(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        obj.SendPractiseResult();
        return(0);
    }
コード例 #4
0
    static int PracticePveCompleteHandler(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        fogs.proto.msg.EndPracticePveResp arg0 = (fogs.proto.msg.EndPracticePveResp)LuaScriptMgr.GetNetObject(L, 2, typeof(fogs.proto.msg.EndPracticePveResp));
        obj.PracticePveCompleteHandler(arg0);
        return(0);
    }
コード例 #5
0
    static int SendEnterGame(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        fogs.proto.msg.MatchType arg0 = (fogs.proto.msg.MatchType)LuaScriptMgr.GetNetObject(L, 2, typeof(fogs.proto.msg.MatchType));
        obj.SendEnterGame(arg0);
        return(0);
    }
コード例 #6
0
    static int SendCareerResult(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj  = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");
        GameMatch      arg0 = (GameMatch)LuaScriptMgr.GetNetObject(L, 2, typeof(GameMatch));

        obj.SendCareerResult(arg0);
        return(0);
    }
コード例 #7
0
    static int ViewUpdate(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj  = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");
        float          arg0 = (float)LuaScriptMgr.GetNumber(L, 2);

        obj.ViewUpdate(arg0);
        return(0);
    }
コード例 #8
0
    static int OnEnter(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj  = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");
        MatchState     arg0 = (MatchState)LuaScriptMgr.GetNetObject(L, 2, typeof(MatchState));

        obj.OnEnter(arg0);
        return(0);
    }
コード例 #9
0
    static int IsCommandValid(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MatchStateOver obj  = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");
        Command        arg0 = (Command)LuaScriptMgr.GetNetObject(L, 2, typeof(Command));
        bool           o    = obj.IsCommandValid(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
コード例 #10
0
    static int RegularCompleteHandler(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        fogs.proto.msg.PVPEndRegularResp   arg0 = (fogs.proto.msg.PVPEndRegularResp)LuaScriptMgr.GetNetObject(L, 2, typeof(fogs.proto.msg.PVPEndRegularResp));
        List <fogs.proto.msg.KeyValueData> arg1 = (List <fogs.proto.msg.KeyValueData>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <fogs.proto.msg.KeyValueData>));

        obj.RegularCompleteHandler(arg0, arg1);
        return(0);
    }
コード例 #11
0
    static int QualifyingNewCompleteHandler(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 4);
        MatchStateOver obj = (MatchStateOver)LuaScriptMgr.GetNetObjectSelf(L, 1, "MatchStateOver");

        fogs.proto.msg.PVPEndQualifyingResp arg0 = (fogs.proto.msg.PVPEndQualifyingResp)LuaScriptMgr.GetNetObject(L, 2, typeof(fogs.proto.msg.PVPEndQualifyingResp));
        int arg1 = (int)LuaScriptMgr.GetNumber(L, 3);
        List <fogs.proto.msg.KeyValueData> arg2 = (List <fogs.proto.msg.KeyValueData>)LuaScriptMgr.GetNetObject(L, 4, typeof(List <fogs.proto.msg.KeyValueData>));

        obj.QualifyingNewCompleteHandler(arg0, arg1, arg2);
        return(0);
    }
コード例 #12
0
    static int _CreateMatchStateOver(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            MatchStateMachine arg0 = (MatchStateMachine)LuaScriptMgr.GetNetObject(L, 1, typeof(MatchStateMachine));
            MatchStateOver    obj  = new MatchStateOver(arg0);
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: MatchStateOver.New");
        }

        return(0);
    }
コード例 #13
0
    static int get_matchResultSent(IntPtr L)
    {
        object         o   = LuaScriptMgr.GetLuaObject(L, 1);
        MatchStateOver obj = (MatchStateOver)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name matchResultSent");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index matchResultSent on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.matchResultSent);
        return(1);
    }
コード例 #14
0
    public void EnterGame()
    {
        if (respInfo == null)
        {
            Debug.LogError("Enter game failed with empty info");
            return;
        }

        MainPlayer.Instance.AccountID  = respInfo.acc_id;
        MainPlayer.Instance.CreateStep = respInfo.create_step;
        MainPlayer.Instance.SetBaseInfo(respInfo.info);

        Debug.Log("EnterGame, create_step:" + respInfo.create_step);
        Debug.Log("EnterGame, loadedLevel:" + Application.loadedLevel);
        if (Application.loadedLevelName == GlobalConst.SCENE_STARTUP)   // scene startup
        {
            GameSystem.Instance.mClient.Reset();
            if (respInfo.create_step == 1)              //进入基础操作练习
            {
                PractiseData practise = GameSystem.Instance.PractiseConfig.GetConfig(20001);
                GameSystem.Instance.mClient.CreateMatch(practise, 0ul);
                GameMatch_Practise match = GameSystem.Instance.mClient.mCurMatch as GameMatch_Practise;
                match.onBehaviourCreated = () =>
                {
                    PractiseBehaviourGuide behaviour = match.practise_behaviour as PractiseBehaviourGuide;
                    behaviour.onOver = () =>
                    {
                        CreateStepIn req = new CreateStepIn();
                        req.acc_id = respInfo.acc_id;
                        GameSystem.Instance.mNetworkManager.m_platConn.SendPack(0, req, MsgID.CreateStepInID);
                    };
                };
            }
            else
            {
                MainPlayer.Instance.HpRestoreTime = DateTime.Now + new TimeSpan(0, 0, (int)respInfo.hp_restore_remain);

                //老玩家,进入大厅界面
                LuaTable tScene = LuaScriptMgr.Instance.GetLuaTable("Scene");
                tScene.Set("targetUI", "UIHall");
                tScene.Set("subID", null);
                tScene.Set("params", null);
                SceneManager.Instance.ChangeScene(GlobalConst.SCENE_HALL);
            }
        }
        else
        {
            GameMatch curMatch = GameSystem.Instance.mClient.mCurMatch;
            if (curMatch == null)
            {
                GameSystem.Instance.mClient.Reset();
            }
            else                // In match, resend EnterGameReq
            {
                Debug.Log("EnterGame, Curr league type:" + curMatch.GetConfig().leagueType);
                if (curMatch.GetConfig().leagueType == GameMatch.LeagueType.eQualifying)
                {
                    GameSystem.Instance.mClient.Reset();
                    LuaTable tScene = LuaScriptMgr.Instance.GetLuaTable("Scene");
                    tScene.Set("targetUI", "UIQualifying");
                    tScene.Set("subID", null);
                    tScene.Set("params", null);
                    SceneManager.Instance.ChangeScene(GlobalConst.SCENE_MATCH);
                }
                else if (curMatch.GetConfig().leagueType == GameMatch.LeagueType.ePVP)
                {
                    LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { "UIHall", null, null });
                }
                else if (curMatch.GetConfig().leagueType == GameMatch.LeagueType.eQualifyingNewer)
                {
                    LuaTable tQualifyingNewer = LuaScriptMgr.Instance.GetLuaTable("QualifyingNewer");
                    tQualifyingNewer.Set("inBackToLadder", false);
                    tQualifyingNewer.Set("isJoinLadder", false);
                    tQualifyingNewer.Set("isWinShowIncStarAnim", false);


                    LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { "UIHall", null, null });
                }
                else if (curMatch.leagueType == GameMatch.LeagueType.eRegular1V1 ||
                         curMatch.leagueType == GameMatch.LeagueType.eQualifyingNew ||
                         curMatch.leagueType == GameMatch.LeagueType.ePractise1vs1)
                {
                    MatchStateOver over = curMatch.m_stateMachine.m_curState as MatchStateOver;
                    if (over == null)
                    {
                        GameSystem.Instance.mClient.Reset();
                        if (curMatch.leagueType == GameMatch.LeagueType.eRegular1V1)
                        {
                            SceneManager.Instance.ChangeScene(GlobalConst.SCENE_HALL);
                        }
                        else if (curMatch.leagueType == GameMatch.LeagueType.eQualifyingNew)
                        {
                            LuaScriptMgr.Instance.CallLuaFunction("jumpToUI", new object[] { "UIHall", null, null });
                        }
                    }
                    else
                    {
                        if (curMatch.m_stateMachine.m_curState.m_eState != MatchState.State.eOver ||
                            (over != null && !over.matchResultSent)
                            )
                        {
                            Debug.Log("Resend cached EnterGameReq from new");
                            MatchType type = GameMatch_PVP.ToMatchType(curMatch.leagueType, curMatch.m_config.type);
                            if (curMatch.leagueType == GameMatch.LeagueType.ePractise1vs1)
                            {
                                EnterGameReq req = new EnterGameReq();
                                req.acc_id                            = MainPlayer.Instance.AccountID;
                                req.type                              = type;
                                req.game_mode                         = fogs.proto.msg.GameMode.GM_Practice1On1;
                                req.practice_pve                      = new BeginPracticePve();
                                req.practice_pve.id                   = 1;
                                req.practice_pve.fight_list           = new FightRoleInfo();
                                req.practice_pve.fight_list.game_mode = fogs.proto.msg.GameMode.GM_Practice1On1;
                                FightRole fr = new FightRole();
                                fr.role_id = curMatch.mainRole.m_id;
                                fr.status  = FightStatus.FS_MAIN;
                                req.practice_pve.fight_list.fighters.Add(fr);
                                over.SendEnterGamePractise1vs1(req);
                            }
                            else
                            {
                                over.SendEnterGame(type);
                            }
                        }
                    }
                }
                else if (PlatNetwork.Instance.cachedEnterGameReq != null)
                {
                    if (curMatch.m_stateMachine.m_curState.m_eState != MatchState.State.eOver ||
                        !(curMatch.m_stateMachine.m_curState as MatchStateOver).matchResultSent)
                    {
                        Debug.Log("Resend cached EnterGameReq");
                        LuaHelper.SendPlatMsgFromLua((uint)MsgID.EnterGameReqID, PlatNetwork.Instance.cachedEnterGameReq);
                    }
                }
            }
        }

        if (respInfo.create_step >= GameSystem.Instance.CommonConfig.GetUInt("gMaxCreateStep"))
        {
            // after renaming step( the last step), mark as login.
            MainPlayer.Instance.AddCreateNewRoleLog(true);
        }
        else
        {
            MainPlayer.Instance.AddCreateNewRoleLog(false);
        }
    }
コード例 #15
0
    public void OnEndResult()
    {
        MatchStateOver match = m_stateMachine.GetState(MatchState.State.eOver) as MatchStateOver;

        match.HandleSectionComplete();
    }