Example #1
0
        public static void OnRelayStatePick(ref CSPkg msg)
        {
            Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState");

            CSDT_RECONN_PICKINFO stPickInfo = msg.stPkgData.stReconnGameNtf.stStateData.stPickInfo;

            if (msg.stPkgData.stReconnGameNtf.stStateData.stPickInfo.stDeskInfo.bMapType != 3)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                masterRoleInfo.SetFreeHeroInfo(stPickInfo.stFreeHero);
                masterRoleInfo.SetFreeHeroSymbol(stPickInfo.stFreeHeroSymbol);
            }
            Singleton <LobbyLogic> .GetInstance().inMultiRoom = true;

            Singleton <CRoomSystem> .GetInstance().UpdateRoomInfoReconnectPick(stPickInfo.stDeskInfo, stPickInfo.astCampInfo);

            Singleton <CHeroSelectSystem> .GetInstance().SetPvpDataByRoomInfo(Singleton <CRoomSystem> .GetInstance().roomInfo, 1);
        }
Example #2
0
        private void HeroSelectReconectPickStep(CSDT_RECONN_PICKINFO pickInfo)
        {
            DebugHelper.CustomLog("HeroSelectReconectPickStep");
            Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState");

            Singleton <CRoomSystem> .instance.SetRoomType(1);

            CSDT_CAMPINFO[] campInfo = new CSDT_CAMPINFO[pickInfo.astCampInfo.Length];
            for (int i = 0; i < pickInfo.astCampInfo.Length; i++)
            {
                campInfo[i]                   = new CSDT_CAMPINFO();
                campInfo[i].dwPlayerNum       = pickInfo.astCampInfo[i].dwPlayerNum;
                campInfo[i].astCampPlayerInfo = new CSDT_CAMPPLAYERINFO[pickInfo.astCampInfo[i].astPlayerInfo.Length];
                for (int k = 0; k < pickInfo.astCampInfo[i].astPlayerInfo.Length; k++)
                {
                    campInfo[i].astCampPlayerInfo[k] = pickInfo.astCampInfo[i].astPlayerInfo[k].stPickHeroInfo;
                }
            }
            CHeroSelectBaseSystem.StartPvpHeroSelectSystem(pickInfo.stDeskInfo, campInfo, pickInfo.stFreeHero, pickInfo.stFreeHeroSymbol);
            Singleton <CHeroSelectBaseSystem> .instance.m_banPickStep = enBanPickStep.enPick;
            for (int j = 0; j < pickInfo.astCampInfo.Length; j++)
            {
                for (int m = 0; m < pickInfo.astCampInfo[j].astPlayerInfo.Length; m++)
                {
                    uint       dwObjId    = pickInfo.astCampInfo[j].astPlayerInfo[m].stPickHeroInfo.stPlayerInfo.dwObjId;
                    byte       bIsPickOK  = pickInfo.astCampInfo[j].astPlayerInfo[m].bIsPickOK;
                    MemberInfo memberInfo = Singleton <CHeroSelectBaseSystem> .instance.roomInfo.GetMemberInfo(dwObjId);

                    if (memberInfo != null)
                    {
                        memberInfo.isPrepare = bIsPickOK == 1;
                    }
                }
            }
            MemberInfo masterMemberInfo = Singleton <CRoomSystem> .instance.roomInfo.GetMasterMemberInfo();

            if (masterMemberInfo != null)
            {
                Singleton <CHeroSelectBaseSystem> .instance.SetPvpHeroSelect(masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID);

                if (masterMemberInfo.isPrepare)
                {
                    Singleton <CHeroSelectBaseSystem> .instance.m_isSelectConfirm = true;
                }
            }
            else
            {
                return;
            }
            if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enNormal)
            {
                Singleton <CHeroSelectNormalSystem> .GetInstance().m_showHeroID = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;

                if (Singleton <CHeroSelectBaseSystem> .instance.selectType == enSelectType.enRandom)
                {
                    Singleton <CHeroSelectNormalSystem> .instance.SwitchSkinMenuSelect();
                }
                Singleton <CHeroSelectNormalSystem> .GetInstance().RefreshHeroPanel(false, true);
            }
            else if (Singleton <CHeroSelectBaseSystem> .instance.uiType == enUIType.enBanPick)
            {
                CSDT_RECONN_BAN_PICK_STATE_INFO stBanPickInfo = pickInfo.stPickStateExtra.stPickDetail.stBanPickInfo;
                Singleton <CHeroSelectBaseSystem> .instance.ClearBanHero();

                if (stBanPickInfo != null)
                {
                    Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_1, stBanPickInfo.Camp1BanList);

                    Singleton <CHeroSelectBaseSystem> .instance.AddBanHero(COM_PLAYERCAMP.COM_PLAYERCAMP_2, stBanPickInfo.Camp2BanList);

                    Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState  = stBanPickInfo.stCurState;
                    Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stNextState = stBanPickInfo.stNextState;
                    Singleton <CHeroSelectBaseSystem> .instance.m_banHeroTeamMaxCount        = stBanPickInfo.bBanPosNum;
                    Singleton <CHeroSelectBanPickSystem> .instance.InitMenu(false);

                    Singleton <CHeroSelectBanPickSystem> .instance.RefreshAll();

                    Singleton <CHeroSelectBanPickSystem> .instance.PlayStepTitleAnimation();

                    Singleton <CHeroSelectBanPickSystem> .instance.PlayCurrentBgAnimation();

                    MemberInfo info3 = Singleton <CHeroSelectBaseSystem> .instance.roomInfo.GetMemberInfo((COM_PLAYERCAMP)Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState.bCamp, Singleton <CHeroSelectBaseSystem> .instance.m_curBanPickInfo.stCurState.bPos);

                    if (info3 != null)
                    {
                        if (masterMemberInfo == info3)
                        {
                            Utility.VibrateHelper();
                            Singleton <CSoundManager> .GetInstance().PostEvent("UI_MyTurn", null);

                            Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment2", null);
                        }
                        else
                        {
                            Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment1", null);
                        }
                    }
                }
            }
        }
Example #3
0
        private void HeroSelectReconectPickStep(CSDT_RECONN_PICKINFO pickInfo)
        {
            Singleton <GameStateCtrl> .GetInstance().GotoState("LobbyState");

            Singleton <CRoomSystem> .get_instance().SetRoomType(1);

            CSDT_CAMPINFO[] array = new CSDT_CAMPINFO[pickInfo.astCampInfo.Length];
            for (int i = 0; i < pickInfo.astCampInfo.Length; i++)
            {
                array[i]                   = new CSDT_CAMPINFO();
                array[i].dwPlayerNum       = pickInfo.astCampInfo[i].dwPlayerNum;
                array[i].astCampPlayerInfo = new CSDT_CAMPPLAYERINFO[pickInfo.astCampInfo[i].astPlayerInfo.Length];
                for (int j = 0; j < pickInfo.astCampInfo[i].astPlayerInfo.Length; j++)
                {
                    array[i].astCampPlayerInfo[j] = pickInfo.astCampInfo[i].astPlayerInfo[j].stPickHeroInfo;
                }
            }
            CHeroSelectBaseSystem.StartPvpHeroSelectSystem(pickInfo.stDeskInfo, array, pickInfo.stFreeHero, pickInfo.stFreeHeroSymbol);
            Singleton <CHeroSelectBaseSystem> .get_instance().m_banPickStep = enBanPickStep.enPick;

            for (int k = 0; k < pickInfo.astCampInfo.Length; k++)
            {
                for (int l = 0; l < pickInfo.astCampInfo[k].astPlayerInfo.Length; l++)
                {
                    uint       dwObjId    = pickInfo.astCampInfo[k].astPlayerInfo[l].stPickHeroInfo.stPlayerInfo.dwObjId;
                    byte       bIsPickOK  = pickInfo.astCampInfo[k].astPlayerInfo[l].bIsPickOK;
                    MemberInfo memberInfo = Singleton <CHeroSelectBaseSystem> .get_instance().roomInfo.GetMemberInfo(dwObjId);

                    if (memberInfo != null)
                    {
                        memberInfo.isPrepare = (bIsPickOK == 1);
                    }
                }
            }
            MemberInfo masterMemberInfo = Singleton <CRoomSystem> .get_instance().roomInfo.GetMasterMemberInfo();

            if (masterMemberInfo != null)
            {
                Singleton <CHeroSelectBaseSystem> .get_instance().SetPvpHeroSelect(masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID);

                if (masterMemberInfo.isPrepare)
                {
                    Singleton <CHeroSelectBaseSystem> .get_instance().m_isSelectConfirm = true;
                }
                if (Singleton <CHeroSelectBaseSystem> .get_instance().uiType == enUIType.enNormal)
                {
                    Singleton <CHeroSelectNormalSystem> .GetInstance().m_showHeroID = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;

                    if (Singleton <CHeroSelectBaseSystem> .get_instance().selectType == enSelectType.enRandom)
                    {
                        Singleton <CHeroSelectNormalSystem> .get_instance().SwitchSkinMenuSelect();
                    }
                    Singleton <CHeroSelectNormalSystem> .GetInstance().RefreshHeroPanel(true, true);
                }
                else if (Singleton <CHeroSelectBaseSystem> .get_instance().uiType == enUIType.enBanPick)
                {
                    CSDT_RECONN_BAN_PICK_STATE_INFO stBanPickInfo = pickInfo.stPickStateExtra.stPickDetail.get_stBanPickInfo();
                    if (stBanPickInfo == null)
                    {
                        return;
                    }
                    Singleton <CHeroSelectBaseSystem> .get_instance().AddBanHero(1, stBanPickInfo.Camp1BanList);

                    Singleton <CHeroSelectBaseSystem> .get_instance().AddBanHero(2, stBanPickInfo.Camp2BanList);

                    Singleton <CHeroSelectBaseSystem> .get_instance().m_curBanPickInfo.stCurState = stBanPickInfo.stCurState;

                    Singleton <CHeroSelectBaseSystem> .get_instance().m_curBanPickInfo.stNextState = stBanPickInfo.stNextState;

                    Singleton <CHeroSelectBaseSystem> .get_instance().m_banHeroTeamMaxCount = (int)stBanPickInfo.bBanPosNum;

                    Singleton <CHeroSelectBanPickSystem> .get_instance().InitMenu(false);

                    Singleton <CHeroSelectBanPickSystem> .get_instance().RefreshAll();

                    Singleton <CHeroSelectBanPickSystem> .get_instance().PlayStepTitleAnimation();

                    Singleton <CHeroSelectBanPickSystem> .get_instance().PlayCurrentBgAnimation();

                    if (Singleton <CHeroSelectBaseSystem> .get_instance().IsCurBanOrPickMember(masterMemberInfo))
                    {
                        Utility.VibrateHelper();
                        Singleton <CSoundManager> .GetInstance().PostEvent("UI_MyTurn", null);

                        Singleton <CSoundManager> .GetInstance().PostEvent("Play_sys_ban_4", null);

                        Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment2", null);
                    }
                    else
                    {
                        if (Singleton <CHeroSelectBaseSystem> .get_instance().IsCurOpByCamp(masterMemberInfo))
                        {
                            Singleton <CSoundManager> .GetInstance().PostEvent("Play_sys_ban_7", null);
                        }
                        else if (masterMemberInfo.camp != null)
                        {
                            Singleton <CSoundManager> .GetInstance().PostEvent("Play_sys_ban_6", null);
                        }
                        Singleton <CSoundManager> .GetInstance().PostEvent("Set_Segment1", null);
                    }
                }
                return;
            }
        }