示例#1
0
        public static void SetConfirmFakeData()
        {
            CFakePvPHelper.RemoveAllFakeTimer();
            CFakePvPHelper.DatabinCheck();
            CFakePvPHelper.RealPlayerConfirmNum = 0;
            CFakePvPHelper.FakePlayerConfirmNum = 0;
            CFakePvPHelper.FakePlayerList.Clear();
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            DebugHelper.Assert(roomInfo != null);
            DebugHelper.Assert(roomInfo.roomAttrib.bWarmBattle);
            for (COM_PLAYERCAMP cOM_PLAYERCAMP = 1; cOM_PLAYERCAMP < 3; cOM_PLAYERCAMP++)
            {
                ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP];
                for (int i = 0; i < listView.get_Count(); i++)
                {
                    MemberInfo memberInfo = listView.get_Item(i);
                    if (memberInfo.RoomMemberType == 2u)
                    {
                        CFakePvPHelper.FakePlayerConfirm fakePlayerConfirm = new CFakePvPHelper.FakePlayerConfirm();
                        fakePlayerConfirm.FakePlayer      = memberInfo.WarmNpc;
                        fakePlayerConfirm.confirmWaitTime = Random.Range(2, 11);
                        CFakePvPHelper.FakePlayerList.Add(fakePlayerConfirm);
                    }
                }
            }
        }
示例#2
0
        private static void ReqStartSingleWarmBattle()
        {
            CFakePvPHelper.bInFakeSelect = false;
            Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));

            CFakePvPHelper.RemoveAllFakeTimer();
            CSPkg    cSPkg    = NetworkModule.CreateDefaultCSPKG(1050u);
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo == null)
            {
                DebugHelper.Assert(roomInfo != null, "RoomInfo Should not be NULL!!!");
                return;
            }
            if (roomInfo != null)
            {
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.bGameType = 1;
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.stGameDetail.set_stGameOfCombat(Singleton <CHeroSelectBaseSystem> .get_instance().m_stGameOfCombat);
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleList.stBattleList.wHeroCnt = 1;
                if (cSPkg.stPkgData.get_stStartSingleGameReq().stBattleParam.stGameDetail.get_stGameOfCombat() == null)
                {
                    return;
                }
                MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                if (masterMemberInfo == null)
                {
                    DebugHelper.Assert(roomInfo != null, "selfInfo Should not be NULL!!!");
                    return;
                }
                cSPkg.stPkgData.get_stStartSingleGameReq().stBattleList.stBattleList.BattleHeroList[0] = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(roomInfo.roomAttrib.bMapType, roomInfo.roomAttrib.dwMapId);
                if (pvpMapCommonInfo != null)
                {
                    COM_PLAYERCAMP cOM_PLAYERCAMP = 1;
                    int            dwHeroID       = 0;
                    for (COM_PLAYERCAMP cOM_PLAYERCAMP2 = 1; cOM_PLAYERCAMP2 < 3; cOM_PLAYERCAMP2++)
                    {
                        ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP2];
                        for (int i = 0; i < listView.get_Count(); i++)
                        {
                            if (listView.get_Item(i).ullUid == roomInfo.selfInfo.ullUid)
                            {
                                cOM_PLAYERCAMP = listView.get_Item(i).camp;
                                dwHeroID       = (int)listView.get_Item(i).ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                break;
                            }
                        }
                    }
                    CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer = cSPkg.stPkgData.get_stStartSingleGameReq().stBattlePlayer;
                    int num = 0;
                    for (COM_PLAYERCAMP cOM_PLAYERCAMP3 = 1; cOM_PLAYERCAMP3 < 3; cOM_PLAYERCAMP3++)
                    {
                        ListView <MemberInfo> listView2 = roomInfo[cOM_PLAYERCAMP3];
                        for (int j = 0; j < listView2.get_Count(); j++)
                        {
                            MemberInfo memberInfo = listView2.get_Item(j);
                            if (memberInfo != null)
                            {
                                if (memberInfo.RoomMemberType == 2u)
                                {
                                    stBattlePlayer.astFighter[num].bObjType   = 2;
                                    stBattlePlayer.astFighter[num].bPosOfCamp = (byte)j;
                                    stBattlePlayer.astFighter[num].bObjCamp   = cOM_PLAYERCAMP3;
                                    stBattlePlayer.astFighter[num].dwLevel    = memberInfo.dwMemberPvpLevel;
                                    CFakePvPHelper.FakeHeroSelect fakeHeroSelect = CFakePvPHelper.GetFakeHeroSelect(memberInfo.ullUid);
                                    if (fakeHeroSelect != null)
                                    {
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID             = fakeHeroSelect.selectedHero;
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.stSkill.dwSelSkillID = fakeHeroSelect.selectedPlayerSkill;
                                        stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo.stCommonInfo.wSkinID = (ushort)fakeHeroSelect.selectedSkin;
                                        stBattlePlayer.astFighter[num].szName = fakeHeroSelect.FakePlayer.szUserName;
                                        stBattlePlayer.astFighter[num].stDetail.set_stPlayerOfNpc(new COMDT_PLAYERINFO_OF_NPC());
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().ullFakeUid         = fakeHeroSelect.FakePlayer.ullUid;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakePvpLevel     = fakeHeroSelect.FakePlayer.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID = fakeHeroSelect.FakePlayer.dwLogicWorldId;
                                    }
                                    else
                                    {
                                        CFakePvPHelper.SelectHeroForEnemyPlayer(ref stBattlePlayer.astFighter[num].astChoiceHero[0].stBaseInfo, stBattlePlayer.astFighter[num].dwLevel);
                                        stBattlePlayer.astFighter[num].szName = memberInfo.WarmNpc.szUserName;
                                        stBattlePlayer.astFighter[num].stDetail.set_stPlayerOfNpc(new COMDT_PLAYERINFO_OF_NPC());
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().ullFakeUid         = memberInfo.WarmNpc.ullUid;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakePvpLevel     = memberInfo.WarmNpc.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[num].stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID = memberInfo.WarmNpc.dwLogicWorldId;
                                    }
                                }
                                else if (memberInfo.RoomMemberType == 1u)
                                {
                                    stBattlePlayer.astFighter[num].bObjType   = 1;
                                    stBattlePlayer.astFighter[num].bPosOfCamp = (byte)j;
                                    stBattlePlayer.astFighter[num].bObjCamp   = cOM_PLAYERCAMP;
                                    for (int k = 0; k < (int)pvpMapCommonInfo.bHeroNum; k++)
                                    {
                                        stBattlePlayer.astFighter[num].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID = (uint)dwHeroID;
                                    }
                                }
                                num++;
                            }
                        }
                    }
                    stBattlePlayer.bNum             = (byte)num;
                    roomInfo.roomAttrib.bWarmBattle = false;
                    roomInfo.roomAttrib.npcAILevel  = 2;
                    Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref cSPkg, true);

                    Singleton <WatchController> .GetInstance().Stop();
                }
            }
        }