Ejemplo n.º 1
0
 public void InitPvpData(ResDT_LevelCommonInfo levelCommonInfo, uint mapID)
 {
     this.m_isMobaType         = true;
     this.m_pvpLevelCommonInfo = levelCommonInfo;
     this.m_mapID               = (int)mapID;
     this.m_selectHeroType      = (enSelectType)this.m_pvpLevelCommonInfo.stPickRuleInfo.bPickType;
     this.m_levelName           = this.m_pvpLevelCommonInfo.szName;
     this.m_levelDesignFileName = this.m_pvpLevelCommonInfo.szDesignFileName;
     if (this.m_pvpLevelCommonInfo.szArtistFileName != null)
     {
         this.m_levelArtistFileName = this.m_pvpLevelCommonInfo.szArtistFileName;
     }
     this.m_mapWidth                   = this.m_pvpLevelCommonInfo.iMapWidth;
     this.m_mapHeight                  = this.m_pvpLevelCommonInfo.iMapHeight;
     this.m_bigMapWidth                = this.m_pvpLevelCommonInfo.iBigMapWidth;
     this.m_bigMapHeight               = this.m_pvpLevelCommonInfo.iBigMapHeight;
     this.m_miniMapPath                = this.m_pvpLevelCommonInfo.szThumbnailPath;
     this.m_bigMapPath                 = this.m_pvpLevelCommonInfo.szBigMapPath;
     this.m_mapFowScale                = this.m_pvpLevelCommonInfo.fMapFowScale;
     this.m_bigMapFowScale             = this.m_pvpLevelCommonInfo.fBigMapFowScale;
     this.m_heroAiType                 = this.m_pvpLevelCommonInfo.iHeroAIType;
     this.m_pvpPlayerNum               = (int)this.m_pvpLevelCommonInfo.bMaxAcntNum;
     this.m_isBattleEquipLimit         = (this.m_pvpLevelCommonInfo.bBattleEquipLimit > 0);
     this.m_headPtsUpperLimit          = (int)this.m_pvpLevelCommonInfo.bHeadPtsUpperLimit;
     this.m_birthLevelConfig           = (int)this.m_pvpLevelCommonInfo.bBirthLevelConfig;
     this.m_isShowHonor                = (this.m_pvpLevelCommonInfo.bShowHonor > 0);
     this.m_cooldownReduceUpperLimit   = this.m_pvpLevelCommonInfo.dwCooldownReduceUpperLimit;
     this.m_dynamicPropertyConfig      = this.m_pvpLevelCommonInfo.dwDynamicPropertyCfg;
     this.m_originalGoldCoinInBattle   = this.m_pvpLevelCommonInfo.wOriginalGoldCoinInBattle;
     this.m_battleTaskOfCamps[1]       = this.m_pvpLevelCommonInfo.dwBattleTaskOfCamp1;
     this.m_battleTaskOfCamps[2]       = this.m_pvpLevelCommonInfo.dwBattleTaskOfCamp2;
     this.m_musicStartEvent            = this.m_pvpLevelCommonInfo.szMusicStartEvent;
     this.m_musicEndEvent              = this.m_pvpLevelCommonInfo.szMusicEndEvent;
     this.m_musicBankResName           = this.m_pvpLevelCommonInfo.szBankResourceName;
     this.m_ambientSoundEvent          = this.m_pvpLevelCommonInfo.szAmbientSoundEvent;
     this.m_isOpenExpCompensate        = this.m_pvpLevelCommonInfo.bIsOpenExpCompensate;
     this.m_expCompensateInfo          = this.m_pvpLevelCommonInfo.astExpCompensateDetail;
     this.m_soldierActivateDelay       = this.m_pvpLevelCommonInfo.iSoldierActivateDelay;
     this.m_soldierActivateCountDelay1 = this.m_pvpLevelCommonInfo.iSoldierActivateCountDelay1;
     this.m_soldierActivateCountDelay2 = this.m_pvpLevelCommonInfo.iSoldierActivateCountDelay2;
     this.m_timeDuration               = this.m_pvpLevelCommonInfo.dwTimeDuration;
     this.m_addWinCondStarId           = this.m_pvpLevelCommonInfo.dwAddWinCondStarId;
     this.m_addLoseCondStarId          = this.m_pvpLevelCommonInfo.dwAddLoseCondStarId;
     this.m_soulID                       = this.m_pvpLevelCommonInfo.dwSoulID;
     this.m_soulAllocId                  = this.m_pvpLevelCommonInfo.dwSoulAllocId;
     this.m_extraSkillId                 = this.m_pvpLevelCommonInfo.iExtraSkillId;
     this.m_extraSkill2Id                = this.m_pvpLevelCommonInfo.iExtraSkill2Id;
     this.m_extraPassiveSkillId          = this.m_pvpLevelCommonInfo.iExtraPassiveSkillId;
     this.m_ornamentSkillId              = this.m_pvpLevelCommonInfo.iOrnamentSkillId;
     this.m_ornamentSwitchCD             = this.m_pvpLevelCommonInfo.iOrnamentSwitchCD;
     this.m_bEnableFow                   = (this.m_pvpLevelCommonInfo.bIsEnableFow > 0);
     this.m_bEnableOrnamentSlot          = (this.m_pvpLevelCommonInfo.bIsEnableOrnamentSlot > 0);
     this.m_bEnableShopHorizonTab        = (this.m_pvpLevelCommonInfo.bIsEnableShopHorizonTab > 0);
     this.m_ornamentFirstSwitchCd        = this.m_pvpLevelCommonInfo.iOrnamentFirstSwitchCD;
     this.m_ornamentFirstSwitchCdEftTime = this.m_pvpLevelCommonInfo.iOrnamentFirstSwitchCDEftTime;
     this.m_isCanRightJoyStickCameraDrag = (this.m_pvpLevelCommonInfo.bSupportCameraDrag > 0);
     this.m_gameMatchName                = this.m_pvpLevelCommonInfo.szGameMatchName;
     this.m_pauseTimes                   = this.m_pvpLevelCommonInfo.bPauseNum;
     this.m_isCameraFlip                 = (this.m_pvpLevelCommonInfo.bCameraFlip > 0);
 }
Ejemplo n.º 2
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            SetStartBtnStatus(root, data);
            UpdateBtnStatus(root, data);
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = pvpMapCommonInfo.bMaxAcntNum / 2;

            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().text = pvpMapCommonInfo.szName;
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().text    = Singleton <CTextManager> .instance.GetText(string.Format("Common_Team_Player_Type_{0}", num));

            GameObject item             = null;
            MemberInfo memberInfo       = null;
            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            for (int i = 1; i <= 5; i++)
            {
                item       = root.transform.Find(string.Format("Panel_Main/Left_Player{0}", i)).gameObject;
                memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1);
                SetPlayerSlotData(item, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1, num >= i);
            }
            for (int j = 1; j <= 5; j++)
            {
                item       = root.transform.Find(string.Format("Panel_Main/Right_Player{0}", j)).gameObject;
                memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1);
                SetPlayerSlotData(item, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1, num >= j);
            }
            SetComEnable(CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId).stPickRuleInfo.bPickType != 3);
        }
Ejemplo n.º 3
0
        public static SLevelContext CreatePvpLevelContext(byte mapType, uint mapID, COM_GAME_TYPE GameType, int difficult)
        {
            SLevelContext sLevelContext = new SLevelContext();

            sLevelContext.SetGameType(GameType);
            sLevelContext.m_mapType             = (int)mapType;
            sLevelContext.m_levelDifficulty     = difficult;
            sLevelContext.m_horizonEnableMethod = Horizon.EnableMethod.EnableAll;
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapID);

            sLevelContext.InitPvpData(pvpMapCommonInfo, mapID);
            if (mapType != 1)
            {
                if (mapType != 3)
                {
                    if (mapType == 4)
                    {
                        ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_entertainmentSubMapType = (int)dataByKey.bEntertainmentSubType;
                    }
                    else if (mapType == 5)
                    {
                        ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_SecondName = dataByKey2.szMatchName;
                    }
                    else if (mapType == 2)
                    {
                    }
                }
            }
            return(sLevelContext);
        }
Ejemplo n.º 4
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            CRoomView.SetStartBtnStatus(root, data);
            CRoomView.UpdateBtnStatus(root, data);
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().text = pvpMapCommonInfo.szName;
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().text    = Singleton <CTextManager> .get_instance().GetText(string.Format("Common_Team_Player_Type_{0}", num));

            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 1, i - 1, num >= i);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 2, j - 1, num >= j);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
        }
Ejemplo n.º 5
0
        public void Startup()
        {
            if (MTileHandlerHelper.Instance != null)
            {
                MTileHandlerHelper.Instance.UpdateLogic();
            }
            ListView <SoldierRegion> .Enumerator enumerator = this.soldierAreas.GetEnumerator();
            while (enumerator.MoveNext())
            {
                enumerator.Current.Startup();
            }
            ListView <CommonSpawnGroup> .Enumerator enumerator2 = this.commonSpawnGroups.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                enumerator2.Current.Startup();
            }
            ListView <SpawnGroup> .Enumerator enumerator3 = this.spawnGroups.GetEnumerator();
            while (enumerator3.MoveNext())
            {
                enumerator3.Current.Startup();
            }
            ListView <AreaEventTrigger> .Enumerator enumerator4 = this.triggerList.GetEnumerator();
            while (enumerator4.MoveNext())
            {
                enumerator4.Current.Startup();
            }
            ListView <DynamicChannel> .Enumerator enumerator5 = this.channelList.GetEnumerator();
            while (enumerator5.MoveNext())
            {
                enumerator5.Current.Startup();
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            this.ClearSoldierActivateTimers();
            if (((curLvelContext != null) && curLvelContext.isPVPLevel) && (curLvelContext.isPVPMode && (curLvelContext.GameType != COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)))
            {
                ResDT_LevelCommonInfo info = CLevelCfgLogicManager.FindLevelConfigMultiGame(curLvelContext.iLevelID);
                if (info != null)
                {
                    this.SoldierActivateDelay       = info.iSoldierActivateDelay;
                    this.SoldierActivateCountDelay1 = info.iSoldierActivateCountDelay1;
                    this.SoldierActivateCountDelay2 = info.iSoldierActivateCountDelay2;
                }
                this.WelcomeDelaySeq = Singleton <CTimerManager> .instance.AddTimer(500, 1, new CTimer.OnTimeUpHandler(this.OnWelcomeDelay), true);
            }
            if (this.SoldierActivateDelay > 0)
            {
                this.SoldierActivateDelaySeq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateDelay, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateDelay), true);
            }
            if (this.SoldierActivateCountDelay1 > 0)
            {
                this.SoldierActivateCountDelay1Seq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateCountDelay1, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay1), true);
            }
            if (this.SoldierActivateCountDelay2 > 0)
            {
                this.SoldierActivateCountDelay2Seq = Singleton <CTimerManager> .instance.AddTimer(this.SoldierActivateCountDelay2, 1, new CTimer.OnTimeUpHandler(this.OnSoldierActivateCountDelay2), true);
            }
        }
Ejemplo n.º 6
0
        public static void UpdateBtnStatus(GameObject root, RoomInfo data)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int  bMaxAcntNum     = (int)pvpMapCommonInfo.bMaxAcntNum;
            bool isSelfRoomOwner = Singleton <CRoomSystem> .GetInstance().IsSelfRoomOwner;

            GameObject gameObject  = root.transform.Find("Panel_Main/bg1/LeftRobot").gameObject;
            GameObject gameObject2 = root.transform.Find("Panel_Main/bg2/RightRobot").gameObject;

            gameObject.CustomSetActive(false);
            gameObject2.CustomSetActive(false);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (isSelfRoomOwner && masterRoleInfo != null)
            {
                MemberInfo memberInfo = data.GetMemberInfo(masterRoleInfo.playerUllUID);
                if (memberInfo != null)
                {
                    COM_PLAYERCAMP cOM_PLAYERCAMP = (memberInfo.camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? COM_PLAYERCAMP.COM_PLAYERCAMP_2 : COM_PLAYERCAMP.COM_PLAYERCAMP_1;
                    if (data.GetFreePos(memberInfo.camp, bMaxAcntNum) >= 0)
                    {
                        if (memberInfo.camp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                        {
                            gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            gameObject2.CustomSetActive(true);
                        }
                    }
                    if (data.GetFreePos(cOM_PLAYERCAMP, bMaxAcntNum) >= 0)
                    {
                        if (cOM_PLAYERCAMP == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                        {
                            gameObject.CustomSetActive(true);
                        }
                        else
                        {
                            gameObject2.CustomSetActive(true);
                        }
                    }
                }
            }
            CUIEventScript component = gameObject.GetComponent <CUIEventScript>();

            component.m_onClickEventID         = enUIEventID.Room_AddRobot;
            component.m_onClickEventParams.tag = 1;
            component = gameObject2.GetComponent <CUIEventScript>();
            component.m_onClickEventID         = enUIEventID.Room_AddRobot;
            component.m_onClickEventParams.tag = 2;
        }
Ejemplo n.º 7
0
        public static ResDT_LevelCommonInfo FindLevelConfigMultiGame(int levelId)
        {
            ResDT_LevelCommonInfo stLevelCommonInfo = null;
            SLevelContext         curLvelContext    = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext != null)
            {
                if (((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH) || (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)) || ((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT)))
                {
                    ResAcntBattleLevelInfo  dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(levelId);
                    ResCounterPartLevelInfo info4     = null;
                    if (dataByKey == null)
                    {
                        info4 = GameDataMgr.cpLevelDatabin.GetDataByKey(levelId);
                        object[] inParameters = new object[] { levelId };
                        DebugHelper.Assert(info4 != null, "Failed find counterpart level config for id {0}", inParameters);
                        return(info4.stLevelCommonInfo);
                    }
                    return(dataByKey.stLevelCommonInfo);
                }
                if (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER)
                {
                    ResRankLevelInfo info5 = GameDataMgr.rankLevelDatabin.GetDataByKey(levelId);
                    if (info5 != null)
                    {
                        stLevelCommonInfo = info5.stLevelCommonInfo;
                    }
                    return(stLevelCommonInfo);
                }
                if (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH)
                {
                    ResRewardMatchLevelInfo info6 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(levelId);
                    if (info6 != null)
                    {
                        stLevelCommonInfo = info6.stLevelCommonInfo;
                    }
                    return(stLevelCommonInfo);
                }
                if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)
                {
                    ResLevelCfgInfo info7 = GameDataMgr.levelDatabin.GetDataByKey(levelId);
                    stLevelCommonInfo = new ResDT_LevelCommonInfo {
                        bMaxAcntNum = info7.bMaxAcntNum
                    };
                }
            }
            return(stLevelCommonInfo);
        }
Ejemplo n.º 8
0
        public void FightStart()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo((byte)curLvelContext.m_mapType, (uint)curLvelContext.m_mapID);

            this._supportHighTowerSoldier = (pvpMapCommonInfo != null && pvpMapCommonInfo.bSupportHighTowerSoldier != 0);
            Singleton <GameEventSys> .instance.RmvEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.OnOrganDead));

            Singleton <GameEventSys> .instance.AddEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.OnOrganDead));

            for (int i = 0; i < this._soldierAddAttrs.Length; i++)
            {
                this._soldierAddAttrs[i].Reset();
            }
        }
Ejemplo n.º 9
0
        public ResDT_LevelCommonInfo GetPvpMapCommonInfo(int mapType, uint mapId)
        {
            ResDT_LevelCommonInfo resDT_LevelCommonInfo = null;

            switch (mapType)
            {
            case 1:
            {
                ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId);
                resDT_LevelCommonInfo = dataByKey.stLevelCommonInfo;
                break;
            }

            case 2:
            {
                ResCounterPartLevelInfo dataByKey2 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId);
                resDT_LevelCommonInfo = dataByKey2.stLevelCommonInfo;
                break;
            }

            case 3:
            {
                ResRankLevelInfo dataByKey3 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId);
                resDT_LevelCommonInfo = dataByKey3.stLevelCommonInfo;
                break;
            }

            case 4:
            {
                ResEntertainmentLevelInfo dataByKey4 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId);
                resDT_LevelCommonInfo = dataByKey4.stLevelCommonInfo;
                break;
            }

            case 5:
            {
                ResRewardMatchLevelInfo dataByKey5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId);
                resDT_LevelCommonInfo = dataByKey5.stLevelCommonInfo;
                break;
            }
            }
            if (resDT_LevelCommonInfo == null)
            {
            }
            return(resDT_LevelCommonInfo);
        }
Ejemplo n.º 10
0
        private static void GotoHeroSelectPage()
        {
            bInFakeConfirm       = false;
            RealPlayerConfirmNum = 0;
            FakePlayerConfirmNum = 0;
            Singleton <LobbyLogic> .GetInstance().inMultiRoom = false;

            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo != null)
            {
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(roomInfo.roomAttrib.bMapType, roomInfo.roomAttrib.dwMapId);
                Singleton <CHeroSelectBaseSystem> .instance.OpenForm(enSelectGameType.enPVE_Computer, pvpMapCommonInfo.bHeroNum, roomInfo.roomAttrib.dwMapId, roomInfo.roomAttrib.bMapType, pvpMapCommonInfo.bIsAllowHeroDup);

                Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnConfirmTimout));
            }
        }
Ejemplo n.º 11
0
        public static ResDT_LevelCommonInfo GetPvpMapCommonInfo(byte mapType, uint mapId)
        {
            ResDT_LevelCommonInfo resDT_LevelCommonInfo = new ResDT_LevelCommonInfo();

            if (mapType == 1)
            {
                ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey != null);
                resDT_LevelCommonInfo = dataByKey.stLevelCommonInfo;
            }
            else if (mapType == 3)
            {
                ResRankLevelInfo dataByKey2 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey2 != null);
                resDT_LevelCommonInfo = dataByKey2.stLevelCommonInfo;
            }
            else if (mapType == 4)
            {
                ResEntertainmentLevelInfo dataByKey3 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey3 != null);
                resDT_LevelCommonInfo = dataByKey3.stLevelCommonInfo;
            }
            else if (mapType == 5)
            {
                ResRewardMatchLevelInfo dataByKey4 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey4 != null);
                resDT_LevelCommonInfo = dataByKey4.stLevelCommonInfo;
            }
            else if (mapType == 6)
            {
                ResGuildMatchLevelInfo dataByKey5 = GameDataMgr.guildMatchLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey5 != null);
                resDT_LevelCommonInfo = dataByKey5.stLevelCommonInfo;
            }
            else if (mapType == 2)
            {
                ResCounterPartLevelInfo dataByKey6 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey6 != null);
                resDT_LevelCommonInfo = dataByKey6.stLevelCommonInfo;
            }
            if (resDT_LevelCommonInfo == null)
            {
                resDT_LevelCommonInfo = new ResDT_LevelCommonInfo();
            }
            return(resDT_LevelCommonInfo);
        }
Ejemplo n.º 12
0
        public bool Reset(int LevelID, bool bMultiGame)
        {
            this.Clear();
            ResDT_LevelCommonInfo outLevelComInfo = null;

            if (bMultiGame)
            {
                outLevelComInfo = CLevelCfgLogicManager.FindLevelConfigMultiGame(LevelID);
            }
            else
            {
                ResLevelCfgInfo outLevelCfg = null;
                CLevelCfgLogicManager.FindLevelConfigSingleGame(LevelID, out outLevelCfg, out outLevelComInfo);
            }
            bool flag = false;

            if (outLevelComInfo != null)
            {
                this.CurLevelTimeDuration = outLevelComInfo.dwTimeDuration;
                if (outLevelComInfo.dwAddWinCondStarId != 0)
                {
                    ResEvaluateStarInfo dataByKey = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddWinCondStarId);
                    DebugHelper.Assert(dataByKey != null);
                    if (dataByKey != null)
                    {
                        this.WinnerEvaluation = this.CreateStar(dataByKey);
                        DebugHelper.Assert(this.WinnerEvaluation != null, "我擦,怎会没有?");
                        flag = true;
                    }
                }
                if (outLevelComInfo.dwAddLoseCondStarId != 0)
                {
                    ResEvaluateStarInfo conditionDetail = GameDataMgr.addWinLoseCondDatabin.GetDataByKey(outLevelComInfo.dwAddLoseCondStarId);
                    DebugHelper.Assert(conditionDetail != null);
                    if (conditionDetail != null)
                    {
                        this.LoserEvaluation = this.CreateStar(conditionDetail);
                        DebugHelper.Assert(this.LoserEvaluation != null, "我擦,怎会没有?");
                        flag = true;
                    }
                }
            }
            return(flag);
        }
Ejemplo n.º 13
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            CRoomView.SetStartBtnStatus(root, data, (int)pvpMapCommonInfo.bMaxAcntNum);
            CRoomView.UpdateBtnStatus(root, data);
            if (data.fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                Transform transform = root.transform.Find("Btn_Back");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().set_text(pvpMapCommonInfo.szName);
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText(string.Format("Common_Team_Player_Type_{0}", num)));
            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            COM_ROOM_FROMTYPE fromType = data.fromType;

            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1, num >= i, fromType);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject2 = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo2 = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject2, memberInfo2, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1, num >= j, fromType);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
            if (fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                CRoomView.DontShowComEnable(false);
            }
        }
Ejemplo n.º 14
0
        public static void FindLevelConfigSingleGame(int levelId, out ResLevelCfgInfo outLevelCfg, out ResDT_LevelCommonInfo outLevelComInfo)
        {
            outLevelCfg     = null;
            outLevelComInfo = null;
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)
            {
                ResAcntBattleLevelInfo  dataByKey         = GameDataMgr.pvpLevelDatabin.GetDataByKey(levelId);
                ResDT_LevelCommonInfo   stLevelCommonInfo = null;
                ResCounterPartLevelInfo info3             = null;
                if (dataByKey == null)
                {
                    info3 = GameDataMgr.cpLevelDatabin.GetDataByKey(levelId);
                    object[] inParameters = new object[] { levelId };
                    DebugHelper.Assert(info3 != null, "Failed find counterpart level config for id {0}", inParameters);
                    stLevelCommonInfo = info3.stLevelCommonInfo;
                }
                else
                {
                    stLevelCommonInfo = dataByKey.stLevelCommonInfo;
                }
                outLevelComInfo = stLevelCommonInfo;
            }
            else if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ARENA)
            {
                ResLevelCfgInfo info4 = GameDataMgr.arenaLevelDatabin.GetDataByKey(levelId);
                outLevelCfg = info4;
            }
            else if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_BURNING)
            {
                ResLevelCfgInfo info5 = GameDataMgr.burnMap.GetDataByKey(levelId);
                outLevelCfg = info5;
            }
            else
            {
                ResLevelCfgInfo info6 = GameDataMgr.levelDatabin.GetDataByKey(levelId);
                outLevelCfg = info6;
            }
        }
Ejemplo n.º 15
0
        public static ResDT_LevelCommonInfo GetPvpMapCommonInfo(byte mapType, uint mapId)
        {
            ResDT_LevelCommonInfo stLevelCommonInfo = new ResDT_LevelCommonInfo();

            if (mapType == 1)
            {
                ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(dataByKey != null);
                stLevelCommonInfo = dataByKey.stLevelCommonInfo;
            }
            else if (mapType == 3)
            {
                ResRankLevelInfo info3 = GameDataMgr.rankLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(info3 != null);
                stLevelCommonInfo = info3.stLevelCommonInfo;
            }
            else if (mapType == 4)
            {
                ResEntertainmentLevelInfo info4 = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(info4 != null);
                stLevelCommonInfo = info4.stLevelCommonInfo;
            }
            else if (mapType == 5)
            {
                ResRewardMatchLevelInfo info5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(info5 != null);
                stLevelCommonInfo = info5.stLevelCommonInfo;
            }
            else if (mapType == 2)
            {
                ResCounterPartLevelInfo info6 = GameDataMgr.cpLevelDatabin.GetDataByKey(mapId);
                DebugHelper.Assert(info6 != null);
                stLevelCommonInfo = info6.stLevelCommonInfo;
            }
            if (stLevelCommonInfo == null)
            {
                stLevelCommonInfo = new ResDT_LevelCommonInfo();
            }
            return(stLevelCommonInfo);
        }
Ejemplo n.º 16
0
        public override void Init()
        {
            base.Init();
            this.talentSystem = new TalentSystem();
            this.talentSystem.Init(base.actorPtr);
            this.stSkillStat = new CSkillStat();
            if (this.stSkillStat != null)
            {
                this.stSkillStat.Initialize(base.actorPtr);
                this.InitRandomSkill();
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                IGameActorDataProvider provider2 = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

                ActorStaticSkillData skillData = new ActorStaticSkillData();
                for (int i = 0; i < 7; i++)
                {
                    ResDT_LevelCommonInfo info4;
                    if (i == 6)
                    {
                        SLevelContext context = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                        if (context.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)
                        {
                            if (context.iLevelID == CBattleGuideManager.GuideLevelID5v5)
                            {
                                goto Label_00DF;
                            }
                            continue;
                        }
                        ResDT_LevelCommonInfo info = null;
                        info = CLevelCfgLogicManager.FindLevelConfigMultiGame(context.iLevelID);
                        if ((info == null) || (info.bMaxAcntNum != 10))
                        {
                            continue;
                        }
                    }
Label_00DF:
                    if (((i != 4) && (i != 6)) || (base.actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero))
                    {
                        goto Label_0284;
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                    if (curLvelContext == null)
                    {
                        continue;
                    }
                    int iLevelID = curLvelContext.iLevelID;
                    if (iLevelID <= 0)
                    {
                        continue;
                    }
                    if (Singleton <LobbyLogic> .instance.inMultiGame)
                    {
                        goto Label_0214;
                    }
                    ResLevelCfgInfo       outLevelCfg     = null;
                    ResDT_LevelCommonInfo outLevelComInfo = null;
                    CLevelCfgLogicManager.FindLevelConfigSingleGame(iLevelID, out outLevelCfg, out outLevelComInfo);
                    if (outLevelComInfo == null)
                    {
                        goto Label_01AD;
                    }
                    int iExtraSkillId = outLevelComInfo.iExtraSkillId;
                    if (i == 6)
                    {
                        iExtraSkillId = outLevelComInfo.iExtraSkill2Id;
                        if (iExtraSkillId > 0)
                        {
                            goto Label_0185;
                        }
                        continue;
                    }
                    this.CreateTalent(outLevelComInfo.iExtraPassiveSkillId);
Label_0185:
                    this.InitSkillSlot(i, iExtraSkillId, 0);
                    SkillSlot slot = this.SkillSlotArray[i];
                    if (slot != null)
                    {
                        slot.SetSkillLevel(1);
                    }
                    continue;
Label_01AD:
                    if (outLevelCfg == null)
                    {
                        continue;
                    }
                    int num4 = outLevelCfg.iExtraSkillId;
                    if (i == 6)
                    {
                        num4 = outLevelCfg.iExtraSkill2Id;
                        if (num4 > 0)
                        {
                            goto Label_01EC;
                        }
                        continue;
                    }
                    this.CreateTalent(outLevelCfg.iExtraPassiveSkillId);
Label_01EC:
                    this.InitSkillSlot(i, num4, 0);
                    SkillSlot slot2 = this.SkillSlotArray[i];
                    if (slot2 != null)
                    {
                        slot2.SetSkillLevel(1);
                    }
                    continue;
Label_0214:
                    info4 = CLevelCfgLogicManager.FindLevelConfigMultiGame(iLevelID);
                    if (info4 == null)
                    {
                        continue;
                    }
                    int num5 = info4.iExtraSkillId;
                    if (i == 6)
                    {
                        num5 = info4.iExtraSkill2Id;
                        if (num5 > 0)
                        {
                            goto Label_025C;
                        }
                        continue;
                    }
                    this.CreateTalent(info4.iExtraPassiveSkillId);
Label_025C:
                    this.InitSkillSlot(i, num5, 0);
                    SkillSlot slot3 = this.SkillSlotArray[i];
                    if (slot3 != null)
                    {
                        slot3.SetSkillLevel(1);
                    }
                    continue;
Label_0284:
                    if (actorDataProvider.GetActorStaticSkillData(ref base.actor.TheActorMeta, (ActorSkillSlot)i, ref skillData))
                    {
                        this.InitSkillSlot(i, skillData.SkillId, skillData.PassiveSkillId);
                        if (((i > 3) || (i < 1)) || (!Singleton <BattleLogic> .GetInstance().m_GameInfo.gameContext.IsSoulGrow() || (base.actor.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)))
                        {
                            SkillSlot slot4 = this.SkillSlotArray[i];
                            if (slot4 != null)
                            {
                                slot4.SetSkillLevel(1);
                            }
                        }
                    }
                }
                uint skillID = 0;
                if (provider2.GetActorServerCommonSkillData(ref base.actor.TheActorMeta, out skillID))
                {
                    int num7 = 5;
                    if (skillID != 0)
                    {
                        this.InitSkillSlot(num7, (int)skillID, 0);
                        SkillSlot slot5 = this.SkillSlotArray[num7];
                        if (slot5 != null)
                        {
                            slot5.SetSkillLevel(1);
                        }
                    }
                }
                if (base.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    this.SkillUseCache = new SkillCache();
                }
            }
        }
Ejemplo n.º 17
0
        public static void InitMapDataInfo()
        {
            Assets.Scripts.GameSystem.RoomInfo roomInfo = Singleton <CHeroSelectSystem> .GetInstance().m_roomInfo;

            ResDT_LevelCommonInfo mapData = Singleton <CHeroSelectSystem> .GetInstance().m_mapData;

            DebugHelper.Assert(roomInfo != null);
            uint dwMapId = roomInfo.roomAttrib.dwMapId;

            if (roomInfo.roomAttrib.bMapType == 1)
            {
                ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(dwMapId);
                DebugHelper.Assert(dataByKey != null);
                mapData.szName           = dataByKey.stLevelCommonInfo.szName;
                mapData.szDesignFileName = dataByKey.stLevelCommonInfo.szDesignFileName;
                mapData.szArtistFileName = dataByKey.stLevelCommonInfo.szArtistFileName;
                mapData.szThumbnailPath  = dataByKey.stLevelCommonInfo.szThumbnailPath;
                mapData.bMaxAcntNum      = dataByKey.stLevelCommonInfo.bMaxAcntNum;
                mapData.bValidRoomType   = dataByKey.stLevelCommonInfo.bValidRoomType;
                mapData.bHeroNum         = dataByKey.stLevelCommonInfo.bHeroNum;
                mapData.bIsAllowHeroDup  = dataByKey.stLevelCommonInfo.bIsAllowHeroDup;
                mapData.dwHeroFormId     = dataByKey.stLevelCommonInfo.dwHeroFormId;
                mapData.iHeroAIType      = dataByKey.stLevelCommonInfo.iHeroAIType;
            }
            else if (roomInfo.roomAttrib.bMapType == 3)
            {
                ResRankLevelInfo info4 = GameDataMgr.rankLevelDatabin.GetDataByKey(dwMapId);
                DebugHelper.Assert(info4 != null);
                mapData.szName           = info4.stLevelCommonInfo.szName;
                mapData.szDesignFileName = info4.stLevelCommonInfo.szDesignFileName;
                mapData.szArtistFileName = info4.stLevelCommonInfo.szArtistFileName;
                mapData.szThumbnailPath  = info4.stLevelCommonInfo.szThumbnailPath;
                mapData.bMaxAcntNum      = info4.stLevelCommonInfo.bMaxAcntNum;
                mapData.bValidRoomType   = info4.stLevelCommonInfo.bValidRoomType;
                mapData.bHeroNum         = info4.stLevelCommonInfo.bHeroNum;
                mapData.bIsAllowHeroDup  = info4.stLevelCommonInfo.bIsAllowHeroDup;
                mapData.dwHeroFormId     = info4.stLevelCommonInfo.dwHeroFormId;
                mapData.iHeroAIType      = info4.stLevelCommonInfo.iHeroAIType;
            }
            else if (roomInfo.roomAttrib.bMapType == 2)
            {
                ResCounterPartLevelInfo info5 = GameDataMgr.cpLevelDatabin.GetDataByKey(dwMapId);
                DebugHelper.Assert(info5 != null);
                mapData.szName           = info5.stLevelCommonInfo.szName;
                mapData.szDesignFileName = info5.stLevelCommonInfo.szDesignFileName;
                mapData.szArtistFileName = info5.stLevelCommonInfo.szArtistFileName;
                mapData.szThumbnailPath  = info5.stLevelCommonInfo.szThumbnailPath;
                mapData.bMaxAcntNum      = info5.stLevelCommonInfo.bMaxAcntNum;
                mapData.bValidRoomType   = info5.stLevelCommonInfo.bValidRoomType;
                mapData.bHeroNum         = info5.stLevelCommonInfo.bHeroNum;
                mapData.bIsAllowHeroDup  = info5.stLevelCommonInfo.bIsAllowHeroDup;
                mapData.dwHeroFormId     = info5.stLevelCommonInfo.dwHeroFormId;
                mapData.iHeroAIType      = info5.stLevelCommonInfo.iHeroAIType;
            }
            else if (roomInfo.roomAttrib.bMapType == 4)
            {
                ResAcntBattleLevelInfo info6 = GameDataMgr.pvpLevelDatabin.GetDataByKey(dwMapId);
                DebugHelper.Assert(info6 != null);
                mapData.szName           = info6.stLevelCommonInfo.szName;
                mapData.szDesignFileName = info6.stLevelCommonInfo.szDesignFileName;
                mapData.szArtistFileName = info6.stLevelCommonInfo.szArtistFileName;
                mapData.szThumbnailPath  = info6.stLevelCommonInfo.szThumbnailPath;
                mapData.bMaxAcntNum      = info6.stLevelCommonInfo.bMaxAcntNum;
                mapData.bValidRoomType   = info6.stLevelCommonInfo.bValidRoomType;
                mapData.bHeroNum         = info6.stLevelCommonInfo.bHeroNum;
                mapData.bIsAllowHeroDup  = info6.stLevelCommonInfo.bIsAllowHeroDup;
                mapData.dwHeroFormId     = info6.stLevelCommonInfo.dwHeroFormId;
                mapData.iHeroAIType      = info6.stLevelCommonInfo.iHeroAIType;
            }
            else if (roomInfo.roomAttrib.bMapType == 5)
            {
                ResRewardMatchLevelInfo info7 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(dwMapId);
                DebugHelper.Assert(info7 != null);
                mapData.szName           = info7.stLevelCommonInfo.szName;
                mapData.szDesignFileName = info7.stLevelCommonInfo.szDesignFileName;
                mapData.szArtistFileName = info7.stLevelCommonInfo.szArtistFileName;
                mapData.szThumbnailPath  = info7.stLevelCommonInfo.szThumbnailPath;
                mapData.bMaxAcntNum      = info7.stLevelCommonInfo.bMaxAcntNum;
                mapData.bValidRoomType   = info7.stLevelCommonInfo.bValidRoomType;
                mapData.bHeroNum         = info7.stLevelCommonInfo.bHeroNum;
                mapData.bIsAllowHeroDup  = info7.stLevelCommonInfo.bIsAllowHeroDup;
                mapData.dwHeroFormId     = info7.stLevelCommonInfo.dwHeroFormId;
                mapData.iHeroAIType      = info7.stLevelCommonInfo.iHeroAIType;
                Singleton <CHeroSelectSystem> .GetInstance().m_mapSubType = (int)info7.dwSubType;
            }
            CSDT_SINGLE_GAME_OF_COMBAT reportInfo = new CSDT_SINGLE_GAME_OF_COMBAT {
                bRoomType = (byte)Singleton <CHeroSelectSystem> .GetInstance().m_roomType,
                dwMapId   = roomInfo.roomAttrib.dwMapId,
                bMapType  = roomInfo.roomAttrib.bMapType,
                bAILevel  = roomInfo.roomAttrib.npcAILevel
            };
            byte bHeroNum     = mapData.bHeroNum;
            uint dwHeroFormId = mapData.dwHeroFormId;

            Singleton <CHeroSelectSystem> .GetInstance().SetPVEDataWithCombat(bHeroNum, dwHeroFormId, reportInfo, "Room Type");
        }
Ejemplo n.º 18
0
        public static SLevelContext MakeMobaContext(uint LevelId, COM_GAME_TYPE GameType, int difficult)
        {
            SLevelContext context = new SLevelContext {
                isPVPLevel          = true,
                GameType            = GameType,
                isPVPMode           = true,
                difficulty          = difficult,
                horizonEnableMethod = Horizon.EnableMethod.EnableAll
            };

            if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT)
            {
                context.MapType = 4;
            }
            if ((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH) && IsLuanDouRuleWithUnion(LevelId))
            {
                context.MapType = 4;
            }
            if (((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH) || (GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)) || ((GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT)))
            {
                ResAcntBattleLevelInfo  info = GameDataMgr.pvpLevelDatabin.GetDataByKey(LevelId);
                ResDT_LevelCommonInfo   stLevelCommonInfo = null;
                ResCounterPartLevelInfo info3             = null;
                if (info == null)
                {
                    info3 = GameDataMgr.cpLevelDatabin.GetDataByKey(LevelId);
                    object[] inParameters = new object[] { LevelId };
                    DebugHelper.Assert(info3 != null, "Failed find counterpart level config for id {0}", inParameters);
                    stLevelCommonInfo = info3.stLevelCommonInfo;
                }
                else
                {
                    stLevelCommonInfo = info.stLevelCommonInfo;
                }
                context.LevelName           = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szName);
                context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szDesignFileName);
                if (stLevelCommonInfo.szArtistFileName != null)
                {
                    context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szArtistFileName);
                }
                context.mapWidth     = stLevelCommonInfo.iMapWidth;
                context.mapHeight    = stLevelCommonInfo.iMapHeight;
                context.bigMapWidth  = stLevelCommonInfo.iBigMapWidth;
                context.bigMapHeight = stLevelCommonInfo.iBigMapHeight;
                context.miniMapPath  = stLevelCommonInfo.szThumbnailPath;
                context.bigMapPath   = stLevelCommonInfo.szBigMapPath;
                context.mapPath      = StringHelper.UTF8BytesToString(ref stLevelCommonInfo.szMapPath);
                context.AIModeType   = (RES_LEVEL_HEROAITYPE)stLevelCommonInfo.iHeroAIType;
                if (info == null)
                {
                    context.iLevelID              = (int)info3.dwMapId;
                    context.dwAttackOrder         = info3.dwAttackOrderID;
                    context.dynamicPropertyConfig = info3.dwDynamicPropertyCfg;
                    context.battleTaskOfCamps[1]  = info3.dwBattleTaskOfCamp1;
                    context.battleTaskOfCamps[2]  = info3.dwBattleTaskOfCamp2;
                    context.musicStartEvent       = StringHelper.UTF8BytesToString(ref info3.szMusicStartEvent);
                    context.musicEndEvent         = StringHelper.UTF8BytesToString(ref info3.szMusicEndEvent);
                    context.bankResName           = StringHelper.UTF8BytesToString(ref info3.szBankResourceName);
                    context.ambientSoundEvent     = StringHelper.UTF8BytesToString(ref info3.szAmbientSoundEvent);
                }
                else
                {
                    context.iLevelID              = (int)info.dwMapId;
                    context.dwAttackOrder         = info.dwAttackOrderID;
                    context.dynamicPropertyConfig = info.dwDynamicPropertyCfg;
                    context.battleTaskOfCamps[1]  = info.dwBattleTaskOfCamp1;
                    context.battleTaskOfCamps[2]  = info.dwBattleTaskOfCamp2;
                    context.musicStartEvent       = StringHelper.UTF8BytesToString(ref info.szMusicStartEvent);
                    context.musicEndEvent         = StringHelper.UTF8BytesToString(ref info.szMusicEndEvent);
                    context.bankResName           = StringHelper.UTF8BytesToString(ref info.szBankResourceName);
                    context.ambientSoundEvent     = StringHelper.UTF8BytesToString(ref info.szAmbientSoundEvent);
                    context.pvpLevelPlayerNum     = info.stLevelCommonInfo.bMaxAcntNum;
                }
            }
            else if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER)
            {
                ResRankLevelInfo info4 = GameDataMgr.rankLevelDatabin.GetDataByKey(LevelId);
                DebugHelper.Assert(info4 != null);
                context.LevelName           = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szName);
                context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szDesignFileName);
                if (info4.stLevelCommonInfo.szArtistFileName != null)
                {
                    context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref info4.stLevelCommonInfo.szArtistFileName);
                }
                context.iLevelID              = (int)info4.dwMapId;
                context.dwAttackOrder         = info4.dwAttackOrderID;
                context.dynamicPropertyConfig = info4.dwDynamicPropertyCfg;
                context.AIModeType            = (RES_LEVEL_HEROAITYPE)info4.stLevelCommonInfo.iHeroAIType;
                context.mapWidth              = info4.stLevelCommonInfo.iMapWidth;
                context.mapHeight             = info4.stLevelCommonInfo.iMapHeight;
                context.bigMapWidth           = info4.stLevelCommonInfo.iBigMapWidth;
                context.bigMapHeight          = info4.stLevelCommonInfo.iBigMapHeight;
                context.miniMapPath           = info4.stLevelCommonInfo.szThumbnailPath;
                context.bigMapPath            = info4.stLevelCommonInfo.szBigMapPath;
                context.battleTaskOfCamps[1]  = info4.dwBattleTaskOfCamp1;
                context.battleTaskOfCamps[2]  = info4.dwBattleTaskOfCamp2;
                context.musicStartEvent       = StringHelper.UTF8BytesToString(ref info4.szMusicStartEvent);
                context.musicEndEvent         = StringHelper.UTF8BytesToString(ref info4.szMusicEndEvent);
                context.ambientSoundEvent     = StringHelper.UTF8BytesToString(ref info4.szAmbientSoundEvent);
                context.bankResName           = StringHelper.UTF8BytesToString(ref info4.szBankResourceName);
                context.pvpLevelPlayerNum     = info4.stLevelCommonInfo.bMaxAcntNum;
            }
            else if (GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH)
            {
                ResRewardMatchLevelInfo info5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(LevelId);
                DebugHelper.Assert(info5 != null);
                context.LevelName           = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szName);
                context.LevelDesignFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szDesignFileName);
                if (info5.stLevelCommonInfo.szArtistFileName != null)
                {
                    context.LevelArtistFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szArtistFileName);
                }
                context.iLevelID              = (int)info5.dwMapId;
                context.dwAttackOrder         = info5.dwAttackOrderID;
                context.dynamicPropertyConfig = info5.dwDynamicPropertyCfg;
                context.AIModeType            = (RES_LEVEL_HEROAITYPE)info5.stLevelCommonInfo.iHeroAIType;
                context.mapWidth              = info5.stLevelCommonInfo.iMapWidth;
                context.mapHeight             = info5.stLevelCommonInfo.iMapHeight;
                context.bigMapWidth           = info5.stLevelCommonInfo.iBigMapWidth;
                context.bigMapHeight          = info5.stLevelCommonInfo.iBigMapHeight;
                context.miniMapPath           = info5.stLevelCommonInfo.szThumbnailPath;
                context.bigMapPath            = info5.stLevelCommonInfo.szBigMapPath;
                context.battleTaskOfCamps[1]  = info5.dwBattleTaskOfCamp1;
                context.battleTaskOfCamps[2]  = info5.dwBattleTaskOfCamp2;
                context.musicStartEvent       = StringHelper.UTF8BytesToString(ref info5.szMusicStartEvent);
                context.musicEndEvent         = StringHelper.UTF8BytesToString(ref info5.szMusicEndEvent);
                context.ambientSoundEvent     = StringHelper.UTF8BytesToString(ref info5.szAmbientSoundEvent);
                context.bankResName           = StringHelper.UTF8BytesToString(ref info5.szBankResourceName);
                context.pvpLevelPlayerNum     = info5.stLevelCommonInfo.bMaxAcntNum;
                context.m_SecondName          = info5.szMatchName;
            }
            ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(LevelId);

            if (dataByKey != null)
            {
                context.SubMapType = dataByKey.bEntertainmentSubType;
            }
            return(context);
        }
Ejemplo n.º 19
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, enOBTab curTab, int onlineNum, enStatus status = 0, long localTicks = 0, byte mapType = 0, uint mapId = 0)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(OB_FORM_PATH);

            if (form != null)
            {
                CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
                Image      image  = Utility.GetComponetInChild <Image>(element, "HeroImg");
                Image      image2 = Utility.GetComponetInChild <Image>(element, "RankImg");
                Image      image3 = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
                Text       text   = Utility.GetComponetInChild <Text>(element, "PlayerName");
                Text       text2  = Utility.GetComponetInChild <Text>(element, "HeroName");
                GameObject obj2   = Utility.FindChild(element, "WatchImg");
                Text       text3  = Utility.GetComponetInChild <Text>(element, "LocalTime");
                Text       text4  = Utility.GetComponetInChild <Text>(element, "LocalMap");
                Text       text5  = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
                GameObject obj3   = Utility.FindChild(element, "DeleteBtn");
                componetInChild.SetImageUrl(headUrl);
                if (bGrade > 0)
                {
                    image2.gameObject.CustomSetActive(true);
                    image2.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                    image3.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false);
                }
                else
                {
                    image2.gameObject.CustomSetActive(false);
                }
                text.text = name;
                ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);
                if (dataByKey != null)
                {
                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0));
                    image.SetSprite(prefabPath, form, false, true, true);
                    text2.text = dataByKey.szName;
                }
                else
                {
                    text2.text = string.Empty;
                    DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
                }
                if (curTab != enOBTab.Local)
                {
                    obj2.CustomSetActive(true);
                    string[] args = new string[] { onlineNum.ToString() };
                    text5.text = Singleton <CTextManager> .instance.GetText("OB_Desc_3", args);

                    text3.gameObject.SetActive(false);
                    obj3.CustomSetActive(false);
                    text4.gameObject.CustomSetActive(false);
                }
                else
                {
                    obj2.CustomSetActive(false);
                    text3.gameObject.SetActive(true);
                    DateTime time       = new DateTime(localTicks);
                    string[] textArray2 = new string[] { time.Month.ToString(), time.Day.ToString(), time.Hour.ToString("D2"), time.Minute.ToString("D2") };
                    text3.text = Singleton <CTextManager> .instance.GetText("OB_Desc_12", textArray2);

                    obj3.CustomSetActive(status == enStatus.Editor);
                    text4.gameObject.CustomSetActive(true);
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                    if (pvpMapCommonInfo != null)
                    {
                        text4.text = pvpMapCommonInfo.szName;
                    }
                    else
                    {
                        text4.text = string.Empty;
                    }
                }
            }
        }
Ejemplo n.º 20
0
        private static void ReqStartSingleWarmBattle()
        {
            bInFakeSelect = false;
            Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));

            RemoveAllFakeTimer();
            CSPkg    msg      = NetworkModule.CreateDefaultCSPKG(0x41a);
            RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            if (roomInfo == null)
            {
                DebugHelper.Assert(roomInfo != null, "RoomInfo Should not be NULL!!!");
            }
            else if (roomInfo != null)
            {
                msg.stPkgData.stStartSingleGameReq.stBattleParam.bGameType = 1;
                msg.stPkgData.stStartSingleGameReq.stBattleParam.stGameDetail.stGameOfCombat = Singleton <CHeroSelectBaseSystem> .instance.m_stGameOfCombat;
                msg.stPkgData.stStartSingleGameReq.stBattleList.stBattleList.wHeroCnt        = 1;
                if (msg.stPkgData.stStartSingleGameReq.stBattleParam.stGameDetail.stGameOfCombat != null)
                {
                    MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                    if (masterMemberInfo != null)
                    {
                        msg.stPkgData.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 camp     = COM_PLAYERCAMP.COM_PLAYERCAMP_1;
                            int            dwHeroID = 0;
                            for (COM_PLAYERCAMP com_playercamp2 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp2 < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp2 += 1)
                            {
                                ListView <MemberInfo> view = roomInfo[com_playercamp2];
                                for (int i = 0; i < view.Count; i++)
                                {
                                    if (view[i].ullUid == roomInfo.selfInfo.ullUid)
                                    {
                                        camp     = view[i].camp;
                                        dwHeroID = (int)view[i].ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                        break;
                                    }
                                }
                            }
                            CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer = msg.stPkgData.stStartSingleGameReq.stBattlePlayer;
                            int index = 0;
                            for (COM_PLAYERCAMP com_playercamp3 = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp3 < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp3 += 1)
                            {
                                ListView <MemberInfo> view2 = roomInfo[com_playercamp3];
                                for (int j = 0; j < view2.Count; j++)
                                {
                                    MemberInfo info4 = view2[j];
                                    if (info4 != null)
                                    {
                                        if (info4.RoomMemberType == 2)
                                        {
                                            stBattlePlayer.astFighter[index].bObjType   = 2;
                                            stBattlePlayer.astFighter[index].bPosOfCamp = (byte)j;
                                            stBattlePlayer.astFighter[index].bObjCamp   = (byte)com_playercamp3;
                                            stBattlePlayer.astFighter[index].dwLevel    = info4.dwMemberPvpLevel;
                                            FakeHeroSelect fakeHeroSelect = GetFakeHeroSelect(info4.ullUid);
                                            if (fakeHeroSelect != null)
                                            {
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID             = fakeHeroSelect.selectedHero;
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.stSkill.dwSelSkillID = fakeHeroSelect.selectedPlayerSkill;
                                                stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.wSkinID = (ushort)fakeHeroSelect.selectedSkin;
                                                stBattlePlayer.astFighter[index].szName = fakeHeroSelect.FakePlayer.szUserName;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = fakeHeroSelect.FakePlayer.ullUid;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = fakeHeroSelect.FakePlayer.dwAcntPvpLevel;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = fakeHeroSelect.FakePlayer.dwLogicWorldId;
                                            }
                                            else
                                            {
                                                SelectHeroForEnemyPlayer(ref stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo, stBattlePlayer.astFighter[index].dwLevel);
                                                stBattlePlayer.astFighter[index].szName = info4.WarmNpc.szUserName;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = info4.WarmNpc.ullUid;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = info4.WarmNpc.dwAcntPvpLevel;
                                                stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = info4.WarmNpc.dwLogicWorldId;
                                            }
                                        }
                                        else if (info4.RoomMemberType == 1)
                                        {
                                            stBattlePlayer.astFighter[index].bObjType   = 1;
                                            stBattlePlayer.astFighter[index].bPosOfCamp = (byte)j;
                                            stBattlePlayer.astFighter[index].bObjCamp   = (byte)camp;
                                            for (int k = 0; k < pvpMapCommonInfo.bHeroNum; k++)
                                            {
                                                stBattlePlayer.astFighter[index].astChoiceHero[k].stBaseInfo.stCommonInfo.dwHeroID = (uint)dwHeroID;
                                            }
                                        }
                                        index++;
                                    }
                                }
                            }
                            stBattlePlayer.bNum             = (byte)index;
                            roomInfo.roomAttrib.bWarmBattle = false;
                            roomInfo.roomAttrib.npcAILevel  = 2;
                            Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
                        }
                    }
                    else
                    {
                        DebugHelper.Assert(roomInfo != null, "selfInfo Should not be NULL!!!");
                    }
                }
            }
        }
Ejemplo n.º 21
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();
                }
            }
        }
Ejemplo n.º 22
0
        private void _InitMultiGame(COM_GAME_TYPE GameType, int mapType, uint mapID, bool isWarmBattle = false, int warmAiLv = 0)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = this.GetPvpMapCommonInfo(mapType, mapID);

            this._gameContextCommonData.GameType                   = GameType;
            this._gameContextCommonData.IsMultiPlayerGame          = true;
            this._gameContextCommonData.MapId                      = (int)mapID;
            this._gameContextCommonData.IsMobaGame                 = true;
            this._gameContextCommonData.SelectHeroType             = (enSelectType)pvpMapCommonInfo.stPickRuleInfo.bPickType;
            this._gameContextCommonData.LevelDifficulty            = 1;
            this._gameContextCommonData.HeroAiType                 = pvpMapCommonInfo.iHeroAIType;
            this._gameContextCommonData.SoulGrowActive             = true;
            this._gameContextCommonData.BaseReviveTime             = 15000;
            this._gameContextCommonData.DynamicPropertyConfigId    = pvpMapCommonInfo.dwDynamicPropertyCfg;
            this._gameContextCommonData.MiniMapPath                = pvpMapCommonInfo.szThumbnailPath;
            this._gameContextCommonData.BigMapPath                 = pvpMapCommonInfo.szBigMapPath;
            this._gameContextCommonData.MapWidth                   = pvpMapCommonInfo.iMapWidth;
            this._gameContextCommonData.MapHeight                  = pvpMapCommonInfo.iMapHeight;
            this._gameContextCommonData.BigMapWidth                = pvpMapCommonInfo.iBigMapWidth;
            this._gameContextCommonData.BigMapHeight               = pvpMapCommonInfo.iBigMapHeight;
            this._gameContextCommonData.MapFOWScale                = pvpMapCommonInfo.fBigMapFowScale;
            this._gameContextCommonData.BigMapFOWScale             = pvpMapCommonInfo.fBigMapFowScale;
            this._gameContextCommonData.MapName                    = pvpMapCommonInfo.szName;
            this._gameContextCommonData.MapDesignFileName          = pvpMapCommonInfo.szDesignFileName;
            this._gameContextCommonData.MapArtistFileName          = pvpMapCommonInfo.szArtistFileName;
            this._gameContextCommonData.MusicStartEvent            = pvpMapCommonInfo.szMusicStartEvent;
            this._gameContextCommonData.MusicEndEvent              = pvpMapCommonInfo.szMusicEndEvent;
            this._gameContextCommonData.AmbientSoundEvent          = pvpMapCommonInfo.szBankResourceName;
            this._gameContextCommonData.MusicBankResName           = pvpMapCommonInfo.szAmbientSoundEvent;
            this._gameContextCommonData.HorizonEnableMethod        = Horizon.EnableMethod.EnableAll;
            this._gameContextCommonData.SoulId                     = pvpMapCommonInfo.dwSoulID;
            this._gameContextCommonData.SoulAllocId                = pvpMapCommonInfo.dwSoulAllocId;
            this._gameContextCommonData.ExtraMapSkillId            = pvpMapCommonInfo.iExtraSkillId;
            this._gameContextCommonData.ExtraMapSkill2Id           = pvpMapCommonInfo.iExtraSkill2Id;
            this._gameContextCommonData.ExtraPassiveSkillId        = pvpMapCommonInfo.iExtraPassiveSkillId;
            this._gameContextCommonData.OrnamentSkillId            = pvpMapCommonInfo.iOrnamentSkillId;
            this._gameContextCommonData.OrnamentSwitchCd0          = pvpMapCommonInfo.iOrnamentSwitchCD;
            this._gameContextCommonData.EnableFOW                  = (pvpMapCommonInfo.bIsEnableFow > 0);
            this._gameContextCommonData.EnableShopHorizonTab       = (pvpMapCommonInfo.bIsEnableOrnamentSlot > 0);
            this._gameContextCommonData.EnableOrnamentSlot         = (pvpMapCommonInfo.bIsEnableShopHorizonTab > 0);
            this._gameContextCommonData.CanRightJoyStickCameraDrag = (pvpMapCommonInfo.bSupportCameraDrag > 0);
            this._gameContextCommonData.CameraFlip                 = (pvpMapCommonInfo.bCameraFlip > 0);
            this._gameContextMobaData.IsValid                      = true;
            this._gameContextMobaData.MapType                      = mapType;
            this._gameContextMobaData.OriginalGoldCoinInBattle     = pvpMapCommonInfo.wOriginalGoldCoinInBattle;
            this._gameContextMobaData.PlayerNum                    = (int)pvpMapCommonInfo.bMaxAcntNum;
            this._gameContextMobaData.BattleEquipLimit             = (pvpMapCommonInfo.bBattleEquipLimit > 0);
            this._gameContextMobaData.HeadPtsMaxLimit              = (int)pvpMapCommonInfo.bHeadPtsUpperLimit;
            this._gameContextMobaData.BirthLevelConfig             = (int)pvpMapCommonInfo.bBirthLevelConfig;
            this._gameContextMobaData.IsShowHonor                  = (pvpMapCommonInfo.bShowHonor > 0);
            this._gameContextMobaData.CooldownReduceMaxLimit       = pvpMapCommonInfo.dwCooldownReduceUpperLimit;
            this._gameContextMobaData.IsOpenExpCompensate          = (pvpMapCommonInfo.bIsOpenExpCompensate > 0);
            this._gameContextMobaData.ExpCompensateInfo            = pvpMapCommonInfo.astExpCompensateDetail;
            this._gameContextMobaData.SoldierActivateDelay         = pvpMapCommonInfo.iSoldierActivateDelay;
            this._gameContextMobaData.SoldierActivateCountDelay1   = pvpMapCommonInfo.iSoldierActivateCountDelay1;
            this._gameContextMobaData.SoldierActivateCountDelay2   = pvpMapCommonInfo.iSoldierActivateCountDelay2;
            this._gameContextMobaData.TimeDuration                 = pvpMapCommonInfo.dwTimeDuration;
            this._gameContextMobaData.AddWinCondStarId             = pvpMapCommonInfo.dwAddWinCondStarId;
            this._gameContextMobaData.AddLoseCondStarId            = pvpMapCommonInfo.dwAddLoseCondStarId;
            this._gameContextMobaData.SecondName                   = string.Empty;
            this._gameContextMobaData.GameMatchName                = pvpMapCommonInfo.szGameMatchName;
            this._gameContextMobaData.IsWarmBattle                 = false;
            this._gameContextMobaData.WarmHeroAiDiffInfo           = null;
            this._gameContextMobaData.IsWarmBattle                 = isWarmBattle;
            this._gameContextMobaData.WarmHeroAiDiffInfo           = ((!isWarmBattle) ? null : GameDataMgr.battleDynamicDifficultyDB.GetDataByKey((long)warmAiLv));
            if (mapType == 4)
            {
                ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID);
                this._gameContextMobaData.EntertainmentMapSubType = dataByKey.bEntertainmentSubType;
            }
            else if (mapType == 5)
            {
                ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID);
                this._gameContextMobaData.SecondName = dataByKey2.szMatchName;
            }
        }
Ejemplo n.º 23
0
    public void battleInvitation(SCPKG_INVITE_JOIN_GAME_REQ info)
    {
        if (!this.m_bInstall)
        {
            return;
        }
        if (!this.m_bStart)
        {
            return;
        }
        try
        {
            string    text           = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            ulong     ullUid         = info.stInviterInfo.ullUid;
            string    text2          = string.Empty;
            ulong     num            = 0uL;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                text2 = masterRoleInfo.Name;
                num   = masterRoleInfo.playerUllUID;
            }
            string text3 = string.Empty;
            if (info.bInviteType == 1)
            {
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stRoomDetail.bMapType, info.stInviteDetail.stRoomDetail.dwMapId);
                if (pvpMapCommonInfo != null)
                {
                    text3 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[]
                    {
                        ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                        ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                        Utility.UTF8Convert(pvpMapCommonInfo.szName)
                    });
                }
            }
            else if (info.bInviteType == 2)
            {
                ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.stTeamDetail.bMapType, info.stInviteDetail.stTeamDetail.dwMapId);
                if (pvpMapCommonInfo2 != null)
                {
                    text3 = Singleton <CTextManager> .instance.GetText("Invite_Map_Desc", new string[]
                    {
                        ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                        ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                        Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                    });
                }
            }
            string jsonString = string.Format("{{ \"user_id\" : \"{0}\",\"user_name\" : \" {1} \", \"friend_id\":\" {2} \",\"friend_name\":\" {3} \",\"battle_mode\":\" {4} \"}}", new object[]
            {
                num,
                text2,
                ullUid,
                text,
                text3
            });
            TGALive.battleInvitation(jsonString);
        }
        catch (Exception ex)
        {
            Debug.Log("TGA" + ex.ToString());
        }
    }
Ejemplo n.º 24
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, COBSystem.enOBTab curTab, int onlineNum, COBSystem.enStatus status = COBSystem.enStatus.Normal, long localTicks = 0L, byte mapType = 0, uint mapId = 0u, string localName = "")
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
            Image      componetInChild2        = Utility.GetComponetInChild <Image>(element, "HeroImg");
            Image      componetInChild3        = Utility.GetComponetInChild <Image>(element, "RankImg");
            Image      componetInChild4        = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
            Text       componetInChild5        = Utility.GetComponetInChild <Text>(element, "PlayerName");
            Text       componetInChild6        = Utility.GetComponetInChild <Text>(element, "HeroName");
            GameObject obj = Utility.FindChild(element, "WatchImg");
            Text       componetInChild7 = Utility.GetComponetInChild <Text>(element, "LocalTime");
            Text       componetInChild8 = Utility.GetComponetInChild <Text>(element, "LocalMap");
            Text       componetInChild9 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
            GameObject obj2             = Utility.FindChild(element, "DeleteBtn");

            componetInChild.SetImageUrl(headUrl);
            if (bGrade > 0)
            {
                componetInChild3.gameObject.CustomSetActive(true);
                componetInChild3.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
                componetInChild4.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
            }
            else
            {
                componetInChild3.gameObject.CustomSetActive(false);
            }
            componetInChild5.text = name;
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);

            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0u));
                componetInChild2.SetSprite(prefabPath, form, false, true, true, false);
                componetInChild6.text = dataByKey.szName;
            }
            else
            {
                componetInChild6.text = string.Empty;
                DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
            }
            if (curTab != COBSystem.enOBTab.Local)
            {
                obj.CustomSetActive(true);
                componetInChild9.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_3", new string[]
                {
                    onlineNum.ToString()
                });

                componetInChild7.gameObject.SetActive(false);
                obj2.CustomSetActive(false);
                componetInChild8.gameObject.CustomSetActive(false);
            }
            else
            {
                obj.CustomSetActive(false);
                componetInChild7.gameObject.SetActive(true);
                DateTime dateTime = new DateTime(localTicks);
                componetInChild7.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_12", new string[]
                {
                    dateTime.get_Month().ToString(),
                    dateTime.get_Day().ToString(),
                    dateTime.get_Hour().ToString("D2"),
                    dateTime.get_Minute().ToString("D2")
                });

                obj2.CustomSetActive(status == COBSystem.enStatus.Editor);
                componetInChild8.gameObject.CustomSetActive(true);
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                if (pvpMapCommonInfo != null)
                {
                    componetInChild8.text = pvpMapCommonInfo.szName;
                }
                else
                {
                    componetInChild8.text = string.Empty;
                }
                componetInChild6.text = string.Empty;
            }
        }
Ejemplo n.º 25
0
        public void Init(CUIFormScript formObj, ResDT_LevelCommonInfo pvp_level_cfg, SLevelContext levelContext)
        {
            if (((formObj != null) && (pvp_level_cfg != null)) && (levelContext != null))
            {
                this.regEvent();
                RectTransform transform = null;
                this.m_FormScript = formObj;
                this.miniMap_obj  = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap");
                this.bigMap_obj   = Utility.FindChild(formObj.gameObject, "panelTopLeft/BigMap");
                DebugHelper.Assert(this.miniMap_obj != null, "---MinimapSys miniMap_obj == null, check out...");
                DebugHelper.Assert(this.bigMap_obj != null, "---MinimapSys bigMap_obj == null, check out...");
                if ((this.miniMap_obj != null) && (this.bigMap_obj != null))
                {
                    this.miniMap_obj.CustomSetActive(true);
                    this.bigMap_obj.CustomSetActive(false);
                    this._init_view(this.miniMap_obj, this.bigMap_obj);
                    Image component = Utility.FindChild(formObj.gameObject, "panelTopLeft/MiniMap").GetComponent <Image>();
                    DebugHelper.Assert(component != null, "---MinimapSys miniMapImage == null, check out...");
                    if (component != null)
                    {
                        if (levelContext.isPVPMode)
                        {
                            float num;
                            transform = this.initMap(enBattleFormWidget.Bigmap, levelContext, false, out num);
                            transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f);
                            transform = this.initMap(enBattleFormWidget.Minimap, levelContext, true, out num);
                            if ((pvp_level_cfg != null) && (pvp_level_cfg.bMaxAcntNum == 6))
                            {
                                transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y);
                                GameObject obj2 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/DragonInfo");
                                GameObject obj3 = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/Button_Signal_1");
                                DebugHelper.Assert(obj2 != null, "---MinimapSys dragon_info == null, check out...");
                                DebugHelper.Assert(obj3 != null, "---MinimapSys button_signal_1 == null, check out...");
                                if (obj2 != null)
                                {
                                    RectTransform transform2 = obj2.gameObject.transform as RectTransform;
                                    transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y);
                                }
                                if (obj3 != null)
                                {
                                    RectTransform transform3 = obj3.gameObject.transform as RectTransform;
                                    transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y);
                                }
                            }
                        }
                        else
                        {
                            component.gameObject.CustomSetActive(false);
                        }
                        this.curMapType = EMapType.Mini;
                        bool flag  = false;
                        bool flag2 = false;
                        if (levelContext.LevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE)
                        {
                            switch (levelContext.iLevelID)
                            {
                            case 2:
                                flag  = true;
                                flag2 = false;
                                break;

                            case 3:
                            case 6:
                            case 7:
                                flag  = true;
                                flag2 = true;
                                break;
                            }
                        }
                        else if ((pvp_level_cfg != null) && ((pvp_level_cfg.bMaxAcntNum == 6) || (pvp_level_cfg.bMaxAcntNum == 10)))
                        {
                            flag  = true;
                            flag2 = pvp_level_cfg.bMaxAcntNum == 10;
                        }
                        if (flag)
                        {
                            GameObject node = Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/MiniMap/Container_MiniMapPointer_Dragon");
                            DebugHelper.Assert(node != null, "---MinimapSys dragonicons == null, check out...");
                            if (node != null)
                            {
                                this.m_dragonIcon = new DragonIcon();
                                this.m_dragonIcon.Init(node, Utility.FindChild(this.m_FormScript.gameObject, "panelTopLeft/BigMap/Container_BigMapPointer_Dragon"), flag2);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 26
0
        public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info)
        {
            string          text            = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            stUIEventParams stUIEventParams = default(stUIEventParams);

            stUIEventParams.tag = (int)info.bIndex;
            int num = 15;

            int.TryParse(Singleton <CTextManager> .get_instance().GetText("MessageBox_Close_Time"), ref num);
            this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, false);

            GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject;

            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject;

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            this.listNode     = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject;
            this.listScript   = this.listNode.transform.Find("List").GetComponent <CUIListScript>();
            this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>();
            this.m_sendBtn    = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject;
            this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Invite_Refuse_Title");

            if (this.form != null)
            {
                string text2 = null;
                string text3 = null;
                if (info.bInviteType == 1)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stRoomDetail().bMapType, info.stInviteDetail.get_stRoomDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stRoomDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stRoomDetail().dwMapId;
                    if (pvpMapCommonInfo != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo.szName)
                        });
                    }
                    text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4");
                }
                else if (info.bInviteType == 2)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stTeamDetail().bMapType, info.stInviteDetail.get_stTeamDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stTeamDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stTeamDetail().dwMapId;
                    if (pvpMapCommonInfo2 != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                        });
                    }
                    if (info.stInviteDetail.get_stTeamDetail().bMapType == 3)
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1");
                    }
                    else
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.get_stTeamDetail().bPkAI != 1) ? "Invite_Match_Type_3" : "Invite_Match_Type_2");
                    }
                }
                string text4 = Singleton <CTextManager> .get_instance().GetText("Be_Invited_Tips", new string[]
                {
                    text3,
                    text2
                });

                this.form.m_formWidgets[8].GetComponent <Text>().text = text4;
                uint   dwRelationMask = info.stInviterInfo.dwRelationMask;
                string text5;
                if ((dwRelationMask & 1u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 0;
                }
                else if ((dwRelationMask & 2u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_4");

                    stUIEventParams.tag2 = 1;
                }
                else if ((dwRelationMask & 4u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_5");

                    stUIEventParams.tag2 = 2;
                    CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both);

                    if (lBSUserInfo != null)
                    {
                        stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity;
                    }
                }
                else
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 3;
                }
                string text6 = string.Format(Singleton <CTextManager> .get_instance().GetText("Be_Invited_FromType"), text5);
                this.form.m_formWidgets[6].GetComponent <Text>().text = text6;
                stUIEventParams.tagStr             = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6);
                stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid;
                stUIEventParams.taskId             = info.stInviterInfo.dwLogicWorldID;
                stUIEventParams.tag3 = (int)info.bInviteType;
                if (num != 0)
                {
                    Transform transform = this.form.transform.Find("closeTimer");
                    if (transform != null)
                    {
                        this.timerScript = transform.GetComponent <CUITimerScript>();
                        if (this.timerScript != null)
                        {
                            this.timerScript.enabled = true;
                            this.timerScript.SetTotalTime((float)num);
                            this.timerScript.StartTimer();
                            this.timerScript.m_eventIDs[1]    = enUIEventID.Invite_TimeOut;
                            this.timerScript.m_eventParams[1] = stUIEventParams;
                        }
                    }
                }
                this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams);
                this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams);
                this.form.m_formWidgets[5].GetComponent <Text>().text = text;
                COM_SNSGENDER bGender   = info.stInviterInfo.bGender;
                Image         component = this.form.m_formWidgets[4].GetComponent <Image>();
                component.gameObject.CustomSetActive(bGender != 0);
                if (bGender == 1)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                else if (bGender == 2)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>();
                component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl)));
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f);

                this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0);
                if (info.stInviterInfo.bGradeOfRank > 0)
                {
                    CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bGradeOfRank, 0u, 1u, false, true, false, true, true);
                }
            }
        }
Ejemplo n.º 27
0
        private static void ReqStartSingleWarmBattle()
        {
            bInFakeSelect = false;
            Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnSelectHeroTimeout));

            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x41a);

            Assets.Scripts.GameSystem.RoomInfo roomInfo = Singleton <CRoomSystem> .GetInstance().roomInfo;

            DebugHelper.Assert(roomInfo != null, "RoomInfo Should not be NULL!!!");
            if (roomInfo != null)
            {
                msg.stPkgData.stStartSingleGameReq.stBattleParam.bGameType = 1;
                msg.stPkgData.stStartSingleGameReq.stBattleParam.stGameDetail.stGameOfCombat = Singleton <CHeroSelectSystem> .GetInstance().m_stGameOfCombat;

                msg.stPkgData.stStartSingleGameReq.stBattleList.stBattleList.wHeroCnt = 1;
                MemberInfo masterMemberInfo = roomInfo.GetMasterMemberInfo();
                DebugHelper.Assert(masterMemberInfo != null, "self Info Should not be NULL!!!");
                if (masterMemberInfo != null)
                {
                    msg.stPkgData.stStartSingleGameReq.stBattleList.stBattleList.BattleHeroList[0] = masterMemberInfo.ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                }
                ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(roomInfo.roomAttrib.dwMapId);
                DebugHelper.Assert(dataByKey != null);
                if (dataByKey != null)
                {
                    ResDT_LevelCommonInfo stLevelCommonInfo = dataByKey.stLevelCommonInfo;
                    COM_PLAYERCAMP        camp = COM_PLAYERCAMP.COM_PLAYERCAMP_1;
                    int dwHeroID = 0;
                    for (int i = 0; i < roomInfo.CampMemberList.Length; i++)
                    {
                        ListView <MemberInfo> view = roomInfo.CampMemberList[i];
                        for (int k = 0; k < view.Count; k++)
                        {
                            if (view[k].ullUid == roomInfo.selfInfo.ullUid)
                            {
                                camp     = view[k].camp;
                                dwHeroID = (int)view[k].ChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID;
                                break;
                            }
                        }
                    }
                    CSDT_BATTLE_PLAYER_BRIEF stBattlePlayer = msg.stPkgData.stStartSingleGameReq.stBattlePlayer;
                    int index = 0;
                    for (int j = 0; j < 2; j++)
                    {
                        for (int m = 0; m < roomInfo.CampMemberList[j].Count; m++)
                        {
                            MemberInfo info5 = roomInfo.CampMemberList[j][m];
                            if (info5 != null)
                            {
                                if (info5.RoomMemberType == 2)
                                {
                                    stBattlePlayer.astFighter[index].bObjType   = 2;
                                    stBattlePlayer.astFighter[index].bPosOfCamp = (byte)m;
                                    stBattlePlayer.astFighter[index].bObjCamp   = (byte)(j + 1);
                                    stBattlePlayer.astFighter[index].dwLevel    = info5.dwMemberPvpLevel;
                                    FakeHeroSelect fakeHeroSelect = GetFakeHeroSelect(info5.ullUid);
                                    if (fakeHeroSelect != null)
                                    {
                                        stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.dwHeroID             = fakeHeroSelect.selectedHero;
                                        stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.stSkill.dwSelSkillID = fakeHeroSelect.selectedPlayerSkill;
                                        stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo.stCommonInfo.wSkinID = (ushort)fakeHeroSelect.selectedSkin;
                                        stBattlePlayer.astFighter[index].szName = fakeHeroSelect.FakePlayer.szUserName;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = fakeHeroSelect.FakePlayer.ullUid;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = fakeHeroSelect.FakePlayer.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = fakeHeroSelect.FakePlayer.dwLogicWorldId;
                                    }
                                    else
                                    {
                                        SelectHeroForEnemyPlayer(ref stBattlePlayer.astFighter[index].astChoiceHero[0].stBaseInfo, stBattlePlayer.astFighter[index].dwLevel);
                                        stBattlePlayer.astFighter[index].szName = info5.WarmNpc.szUserName;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc                    = new COMDT_PLAYERINFO_OF_NPC();
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.ullFakeUid         = info5.WarmNpc.ullUid;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakePvpLevel     = info5.WarmNpc.dwAcntPvpLevel;
                                        stBattlePlayer.astFighter[index].stDetail.stPlayerOfNpc.dwFakeLogicWorldID = info5.WarmNpc.dwLogicWorldId;
                                    }
                                }
                                else if (info5.RoomMemberType == 1)
                                {
                                    stBattlePlayer.astFighter[index].bObjType   = 1;
                                    stBattlePlayer.astFighter[index].bPosOfCamp = (byte)m;
                                    stBattlePlayer.astFighter[index].bObjCamp   = (byte)camp;
                                    for (int n = 0; n < stLevelCommonInfo.bHeroNum; n++)
                                    {
                                        stBattlePlayer.astFighter[index].astChoiceHero[n].stBaseInfo.stCommonInfo.dwHeroID = (uint)dwHeroID;
                                    }
                                }
                                index++;
                            }
                        }
                    }
                    stBattlePlayer.bNum             = (byte)index;
                    roomInfo.roomAttrib.bWarmBattle = false;
                    roomInfo.roomAttrib.npcAILevel  = 2;
                    Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, true);
                }
            }
        }