public void Init(SLevelContext _levelContext) { uint levelIncomeRuleID = CLevelCfgLogicManager.GetLevelIncomeRuleID(_levelContext, this); this.InitIncomeRule(levelIncomeRuleID); this.bSoulGrow = Singleton <BattleLogic> .GetInstance().m_GameInfo.gameContext.IsSoulGrow(); this.bPvpMode = _levelContext.isPVPMode; Singleton <GameEventSys> .instance.RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDead, new RefAction <DefaultGameEventParam>(this.OnActorDead)); Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorDead, new RefAction <DefaultGameEventParam>(this.OnActorDead)); this.m_actorIncomes.Clear(); if (this.m_originalGoldCoinInBattle > 0) { List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .GetInstance().HeroActors; for (int i = 0; i < heroActors.Count; i++) { if (heroActors[i] != 0) { PoolObjHandle <ActorRoot> handle = heroActors[i]; Vector3 position = new Vector3(); handle.handle.ValueComponent.ChangeGoldCoinInBattle(this.m_originalGoldCoinInBattle, true, false, position); } } } }
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); } }
public MultiGameContext(SCPKG_MULTGAME_BEGINLOAD InMessage) { this.MessageRef = InMessage; uint dwMapId = this.MessageRef.stDeskInfo.dwMapId; base.LevelContext = CLevelCfgLogicManager.MakeMobaContext(dwMapId, (COM_GAME_TYPE)InMessage.bGameType, 1); base.LevelContext.isWarmBattle = Convert.ToBoolean(InMessage.stDeskInfo.bIsWarmBattle); base.LevelContext.DynamicDifficulty = InMessage.stDeskInfo.bAILevel; DebugHelper.Assert(base.LevelContext != null); CLevelCfgLogicManager.SetMultiGameContextLevelName(this, dwMapId, (COM_GAME_TYPE)InMessage.bGameType); }
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(); } }
public MultiGameContext(SCPKG_MULTGAME_BEGINLOAD InMessage) { this.MessageRef = InMessage; if (CheatCommandReplayEntry.heroPerformanceTest) { this.InitPerformanceTest(); } uint dwMapId = this.MessageRef.stDeskInfo.dwMapId; byte bMapType = this.MessageRef.stDeskInfo.bMapType; base.LevelContext = CLevelCfgLogicManager.CreatePvpLevelContext(bMapType, dwMapId, (COM_GAME_TYPE)InMessage.bGameType, 1); base.LevelContext.m_isWarmBattle = Convert.ToBoolean(InMessage.stDeskInfo.bIsWarmBattle); base.LevelContext.SetWarmHeroAiDiff(InMessage.stDeskInfo.bAILevel); Singleton <GameLogic> .GetInstance().HashCheckFreq = InMessage.dwHaskChkFreq; FrameTracer.Initial(InMessage.dwCltLogMask, InMessage.dwCltLogSize); }
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); }
public SingleGameContext(SCPKG_STARTSINGLEGAMERSP InMessage) { DebugHelper.Assert(InMessage != null, "输入不应该为null"); this.RewardCount = (int)((InMessage == null) ? 0u : InMessage.dwRewardNum); Singleton <ActorDataCenter> .get_instance().ClearHeroServerData(); if (Singleton <GamePlayerCenter> .get_instance().GetAllPlayers().get_Count() > 0) { } Singleton <GamePlayerCenter> .get_instance().ClearAllPlayers(); if (InMessage == null || InMessage.stDetail.get_stSingleGameSucc() == null || InMessage.stDetail.get_stSingleGameSucc().bNum < 1) { return; } this.DoNew9SlotCalc(InMessage); int num = Mathf.Min((int)InMessage.stDetail.get_stSingleGameSucc().bNum, InMessage.stDetail.get_stSingleGameSucc().astFighter.Length); for (int i = 0; i < num; i++) { COMDT_PLAYERINFO cOMDT_PLAYERINFO = InMessage.stDetail.get_stSingleGameSucc().astFighter[i]; if (CheatCommandReplayEntry.heroPerformanceTest) { cOMDT_PLAYERINFO.astChoiceHero = InMessage.stDetail.get_stSingleGameSucc().astFighter[0].astChoiceHero; } if (cOMDT_PLAYERINFO.bObjType != 0) { string empty = string.Empty; int honorId = 0; int honorLevel = 0; uint gradeOfRank = 0u; ulong uid; uint logicWrold; uint level; if (cOMDT_PLAYERINFO.bObjType == 2) { if (InMessage.bGameType == 1 && Convert.ToBoolean(InMessage.stGameParam.get_stSingleGameRspOfCombat().bIsWarmBattle)) { uid = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfNpc().ullFakeUid; logicWrold = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfNpc().dwFakeLogicWorldID; level = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfNpc().dwFakePvpLevel; } else { uid = 0uL; logicWrold = 0u; level = cOMDT_PLAYERINFO.dwLevel; } } else { uid = ((cOMDT_PLAYERINFO.bObjType != 1) ? 0uL : cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt().ullUid); logicWrold = (uint)((cOMDT_PLAYERINFO.bObjType != 1) ? 0 : cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt().iLogicWorldID); level = cOMDT_PLAYERINFO.dwLevel; honorId = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt().iHonorID; honorLevel = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt().iHonorLevel; gradeOfRank = (uint)((InMessage.stGameParam.get_stSingleGameRspOfCombat() != null) ? InMessage.stGameParam.get_stSingleGameRspOfCombat().bGradeOfRank : 0); } uint vipLv = 0u; if (cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt() != null) { vipLv = cOMDT_PLAYERINFO.stDetail.get_stPlayerOfAcnt().stGameVip.dwCurLevel; } Player player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(cOMDT_PLAYERINFO.dwObjId, cOMDT_PLAYERINFO.bObjCamp, (int)cOMDT_PLAYERINFO.bPosOfCamp, level, cOMDT_PLAYERINFO.bObjType != 1, StringHelper.UTF8BytesToString(ref cOMDT_PLAYERINFO.szName), 0, (int)logicWrold, uid, vipLv, null, gradeOfRank, 0u, honorId, honorLevel, null); if (player != null) { for (int j = 0; j < cOMDT_PLAYERINFO.astChoiceHero.Length; j++) { uint dwHeroID = cOMDT_PLAYERINFO.astChoiceHero[j].stBaseInfo.stCommonInfo.dwHeroID; player.AddHero(dwHeroID); } player.isGM = LobbyMsgHandler.isHostGMAcnt; } Singleton <ActorDataCenter> .get_instance().AddHeroesServerData(cOMDT_PLAYERINFO.dwObjId, cOMDT_PLAYERINFO.astChoiceHero); } if (cOMDT_PLAYERINFO.bObjType == 1) { Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(cOMDT_PLAYERINFO.dwObjId); } } this.LevelContext = CLevelCfgLogicManager.CreatePveLevelContext(InMessage); }
public SingleGameContext(SCPKG_STARTSINGLEGAMERSP InMessage) { DebugHelper.Assert(InMessage != null, "输入不应该为null"); base.RewardCount = (InMessage == null) ? 0 : ((int)InMessage.dwRewardNum); Singleton <ActorDataCenter> .instance.ClearHeroServerData(); if (Singleton <GamePlayerCenter> .instance.GetAllPlayers().Count > 0) { } Singleton <GamePlayerCenter> .instance.ClearAllPlayers(); if (((InMessage != null) && (InMessage.stDetail.stSingleGameSucc != null)) && (InMessage.stDetail.stSingleGameSucc.bNum >= 1)) { this.DoNew9SlotCalc(InMessage); int num = Mathf.Min(InMessage.stDetail.stSingleGameSucc.bNum, InMessage.stDetail.stSingleGameSucc.astFighter.Length); for (int i = 0; i < num; i++) { COMDT_PLAYERINFO comdt_playerinfo = InMessage.stDetail.stSingleGameSucc.astFighter[i]; if (comdt_playerinfo.bObjType != 0) { ulong uid = 0L; uint dwFakeLogicWorldID = 0; uint level = 1; if (comdt_playerinfo.bObjType == 2) { if ((InMessage.bGameType == 1) && Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle)) { uid = comdt_playerinfo.stDetail.stPlayerOfNpc.ullFakeUid; dwFakeLogicWorldID = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakeLogicWorldID; level = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakePvpLevel; } else { uid = 0L; dwFakeLogicWorldID = 0; level = comdt_playerinfo.dwLevel; } } else { uid = (comdt_playerinfo.bObjType != 1) ? ((ulong)0L) : comdt_playerinfo.stDetail.stPlayerOfAcnt.ullUid; dwFakeLogicWorldID = (comdt_playerinfo.bObjType != 1) ? 0 : ((uint)comdt_playerinfo.stDetail.stPlayerOfAcnt.iLogicWorldID); level = comdt_playerinfo.dwLevel; } uint vipLv = 0; if (comdt_playerinfo.stDetail.stPlayerOfAcnt != null) { vipLv = comdt_playerinfo.stDetail.stPlayerOfAcnt.stGameVip.dwCurLevel; } Player player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(comdt_playerinfo.dwObjId, (COM_PLAYERCAMP)comdt_playerinfo.bObjCamp, comdt_playerinfo.bPosOfCamp, level, comdt_playerinfo.bObjType != 1, StringHelper.UTF8BytesToString(ref comdt_playerinfo.szName), 0, (int)dwFakeLogicWorldID, uid, vipLv, null, 0); if (player != null) { for (int j = 0; j < comdt_playerinfo.astChoiceHero.Length; j++) { uint dwHeroID = comdt_playerinfo.astChoiceHero[j].stBaseInfo.stCommonInfo.dwHeroID; player.AddHero(dwHeroID); } player.isGM = LobbyMsgHandler.isHostGMAcnt; } Singleton <ActorDataCenter> .instance.AddHeroesServerData(comdt_playerinfo.dwObjId, comdt_playerinfo.astChoiceHero); } if (comdt_playerinfo.bObjType == 1) { Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(comdt_playerinfo.dwObjId); } } if (InMessage.bGameType == 2) { ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey(InMessage.iLevelId); DebugHelper.Assert(dataByKey != null); base.LevelContext = new SLevelContext(); base.LevelContext.Init(dataByKey, 1); if (dataByKey.bGuideLevelSubType == 0) { base.LevelContext.isPVPLevel = true; base.LevelContext.isPVPMode = true; } else if (dataByKey.bGuideLevelSubType == 1) { base.LevelContext.isPVPLevel = false; base.LevelContext.isPVPMode = false; } base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType; this.levelContext.bShowTrainingHelper = dataByKey.bShowTrainingHelper > 0; this.m_LevelDesignFileName = base.LevelContext.LevelDesignFileName; this.m_LevelArtistFileName = base.LevelContext.LevelArtistFileName; } else if (InMessage.bGameType == 0) { ResLevelCfgInfo levelCfg = GameDataMgr.levelDatabin.GetDataByKey(InMessage.iLevelId); DebugHelper.Assert(levelCfg != null); base.LevelContext = new SLevelContext(); base.LevelContext.Init(levelCfg, Singleton <CAdventureSys> .instance.currentDifficulty); base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType; this.levelContext.bShowTrainingHelper = levelCfg.bShowTrainingHelper > 0; this.m_LevelDesignFileName = base.LevelContext.LevelDesignFileName; this.m_LevelArtistFileName = base.LevelContext.LevelArtistFileName; } else if (InMessage.bGameType == 7) { ResLevelCfgInfo info3 = GameDataMgr.burnMap.GetDataByKey(Singleton <BurnExpeditionController> .GetInstance().model.Get_LevelID(Singleton <BurnExpeditionController> .GetInstance().model.curSelect_LevelIndex)); DebugHelper.Assert(info3 != null); base.LevelContext = new SLevelContext(); base.LevelContext.Init(info3, 1); base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType; this.levelContext.bShowTrainingHelper = info3.bShowTrainingHelper > 0; this.m_LevelDesignFileName = base.LevelContext.LevelDesignFileName; this.m_LevelArtistFileName = base.LevelContext.LevelArtistFileName; } else if (InMessage.bGameType == 8) { ResLevelCfgInfo info4 = GameDataMgr.arenaLevelDatabin.GetDataByKey(InMessage.iLevelId); DebugHelper.Assert(info4 != null); base.LevelContext = new SLevelContext(); base.LevelContext.Init(info4, 1); base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType; this.levelContext.bShowTrainingHelper = info4.bShowTrainingHelper > 0; this.m_LevelDesignFileName = base.LevelContext.LevelDesignFileName; this.m_LevelArtistFileName = base.LevelContext.LevelArtistFileName; } else if (InMessage.bGameType == 1) { base.LevelContext = CLevelCfgLogicManager.MakeMobaContext((uint)InMessage.iLevelId, COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT, 1); base.LevelContext.GameType = (COM_GAME_TYPE)InMessage.bGameType; ResAcntBattleLevelInfo info5 = GameDataMgr.pvpLevelDatabin.GetDataByKey((uint)InMessage.iLevelId); if (info5 != null) { this.m_LevelDesignFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szDesignFileName); if (info5.stLevelCommonInfo.szArtistFileName != null) { this.m_LevelArtistFileName = StringHelper.UTF8BytesToString(ref info5.stLevelCommonInfo.szArtistFileName); } } else { ResCounterPartLevelInfo info6 = GameDataMgr.cpLevelDatabin.GetDataByKey((uint)InMessage.iLevelId); this.m_LevelDesignFileName = StringHelper.UTF8BytesToString(ref info6.stLevelCommonInfo.szDesignFileName); if (info6.stLevelCommonInfo.szArtistFileName != null) { this.m_LevelArtistFileName = StringHelper.UTF8BytesToString(ref info6.stLevelCommonInfo.szArtistFileName); } } base.LevelContext.isWarmBattle = Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle); base.LevelContext.DynamicDifficulty = InMessage.stGameParam.stSingleGameRspOfCombat.bAILevel; base.LevelContext.MapType = InMessage.stGameParam.stSingleGameRspOfCombat.bMapType; } } }
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(); } } }
public static void SetMasterPvpDetailWhenGameSettle(COMDT_GAME_INFO gameInfo) { byte bMaxAcntNum; byte bGameType = gameInfo.bGameType; byte bMapType = gameInfo.bMapType; uint iLevelID = (uint)gameInfo.iLevelID; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null"); if (masterRoleInfo == null) { return; } switch (((COM_GAME_TYPE)bGameType)) { case COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT: Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stVsMachineInfo, gameInfo.bGameResult); return; case COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE: case COM_GAME_TYPE.COM_SINGLE_GAME_OF_ACTIVITY: case COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM: case COM_GAME_TYPE.COM_SINGLE_GAME_OF_BURNING: case COM_GAME_TYPE.COM_SINGLE_GAME_OF_ARENA: return; case COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER: Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stLadderInfo, gameInfo.bGameResult); Singleton <CRoleInfoManager> .instance.CalculateKDA(gameInfo); return; case COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH: case COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH: if (gameInfo.bIsPKAI != 2) { bMaxAcntNum = CLevelCfgLogicManager.GetPvpMapCommonInfo(bMapType, iLevelID).bMaxAcntNum; switch (bMaxAcntNum) { case 2: Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stOneVsOneInfo, gameInfo.bGameResult); goto Label_0183; case 4: Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stTwoVsTwoInfo, gameInfo.bGameResult); goto Label_0183; case 6: Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stThreeVsThreeInfo, gameInfo.bGameResult); goto Label_0183; } break; } Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stVsMachineInfo, gameInfo.bGameResult); return; case COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT: if (gameInfo.bIsPKAI == 1) { Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stEntertainmentInfo, gameInfo.bGameResult); Singleton <CRoleInfoManager> .instance.CalculateKDA(gameInfo); } return; default: return; } if (bMaxAcntNum == 10) { Singleton <CRoleInfoManager> .instance.CalculateWins(masterRoleInfo.pvpDetail.stFiveVsFiveInfo, gameInfo.bGameResult); } Label_0183: Singleton <CRoleInfoManager> .instance.CalculateKDA(gameInfo); }
public static void SetMasterPvpDetailWhenGameSettle(COMDT_GAME_INFO gameInfo) { byte bGameType = gameInfo.bGameType; byte bMapType = gameInfo.bMapType; uint iLevelID = (uint)gameInfo.iLevelID; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo(); DebugHelper.Assert(masterRoleInfo != null, "masterRoleInfo is null"); if (masterRoleInfo == null) { return; } switch (bGameType) { case 1: Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stVsMachineInfo, (int)gameInfo.bGameResult); break; case 4: Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stLadderInfo, (int)gameInfo.bGameResult); Singleton <CRoleInfoManager> .get_instance().CalculateKDA(gameInfo); break; case 5: case 10: if (gameInfo.bIsPKAI == 2) { Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stVsMachineInfo, (int)gameInfo.bGameResult); } else { byte bMaxAcntNum = CLevelCfgLogicManager.GetPvpMapCommonInfo(bMapType, iLevelID).bMaxAcntNum; byte b = bMaxAcntNum; switch (b) { case 2: Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stOneVsOneInfo, (int)gameInfo.bGameResult); goto IL_183; case 3: case 5: IL_F1: if (b != 10) { goto IL_183; } Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stFiveVsFiveInfo, (int)gameInfo.bGameResult); goto IL_183; case 4: Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stTwoVsTwoInfo, (int)gameInfo.bGameResult); goto IL_183; case 6: Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stThreeVsThreeInfo, (int)gameInfo.bGameResult); goto IL_183; } goto IL_F1; IL_183: Singleton <CRoleInfoManager> .get_instance().CalculateKDA(gameInfo); } break; case 9: if (gameInfo.bIsPKAI == 1) { Singleton <CRoleInfoManager> .get_instance().CalculateWins(masterRoleInfo.pvpDetail.stEntertainmentInfo, (int)gameInfo.bGameResult); Singleton <CRoleInfoManager> .get_instance().CalculateKDA(gameInfo); } break; } }
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()); } }
private void onReconnectGame(CSPkg msg) { CSDT_RECONN_PICKINFO stPickInfo; stUIEventParams @params; switch (msg.stPkgData.stReconnGameNtf.bState) { case 1: OnRelayStatePick(ref msg); stPickInfo = msg.stPkgData.stReconnGameNtf.stStateData.stPickInfo; @params = new stUIEventParams(); if (stPickInfo.stDeskInfo.bMapType != 3) { if (stPickInfo.stDeskInfo.bMapType == 4) { @params.heroSelectGameType = enSelectHeroType.enLuanDou; } else if (stPickInfo.stDeskInfo.bMapType == 5) { @params.heroSelectGameType = enSelectHeroType.enUnion; } else { @params.heroSelectGameType = enSelectHeroType.enPVP; } break; } @params.heroSelectGameType = enSelectHeroType.enLadder; break; case 2: if (!Singleton <LobbyLogic> .instance.inMultiGame) { Singleton <LobbyLogic> .instance.inMultiGame = true; Singleton <LobbyLogic> .instance.inMultiRoom = true; SCPKG_MULTGAME_BEGINLOAD stBeginLoad = msg.stPkgData.stReconnGameNtf.stStateData.stLoadingInfo.stBeginLoad; Singleton <GameBuilder> .instance.StartGame(new MultiGameContext(stBeginLoad)); return; } return; case 3: this.g_fBeginReconnectTime = Time.time; Singleton <LobbyLogic> .GetInstance().inMultiRoom = true; MonoSingleton <Reconnection> .GetInstance().RequestRelaySyncCacheFrames(false); return; case 4: MonoSingleton <Reconnection> .GetInstance().ExitMultiGame(); return; default: DebugHelper.Assert(false); return; } Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroSelect_OpenForm, @params); Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); if ((@params.heroSelectGameType == enSelectHeroType.enLuanDou) || ((@params.heroSelectGameType == enSelectHeroType.enUnion) && CLevelCfgLogicManager.IsLuanDouRuleWithUnion(stPickInfo.stDeskInfo.dwMapId))) { CHeroSelectSystem.RefreshHeroSel(Singleton <CRoomSystem> .instance.roomInfo.GetMasterMemberInfo()); Singleton <CHeroSelectSystem> .instance.RefreshSkinPanel(null); } }
public SingleGameContext(SCPKG_STARTSINGLEGAMERSP InMessage) { DebugHelper.Assert(InMessage != null, "输入不应该为null"); base.RewardCount = (InMessage == null) ? 0 : ((int)InMessage.dwRewardNum); Singleton <ActorDataCenter> .instance.ClearHeroServerData(); if (Singleton <GamePlayerCenter> .instance.GetAllPlayers().Count > 0) { } Singleton <GamePlayerCenter> .instance.ClearAllPlayers(); if (((InMessage != null) && (InMessage.stDetail.stSingleGameSucc != null)) && (InMessage.stDetail.stSingleGameSucc.bNum >= 1)) { this.DoNew9SlotCalc(InMessage); int num = Mathf.Min(InMessage.stDetail.stSingleGameSucc.bNum, InMessage.stDetail.stSingleGameSucc.astFighter.Length); for (int i = 0; i < num; i++) { COMDT_PLAYERINFO comdt_playerinfo = InMessage.stDetail.stSingleGameSucc.astFighter[i]; if (CheatCommandReplayEntry.heroPerformanceTest) { comdt_playerinfo.astChoiceHero = InMessage.stDetail.stSingleGameSucc.astFighter[0].astChoiceHero; } if (comdt_playerinfo.bObjType != 0) { ulong uid = 0L; uint dwFakeLogicWorldID = 0; uint level = 1; int honorId = 0; int honorLevel = 0; uint gradeOfRank = 0; if (comdt_playerinfo.bObjType == 2) { if ((InMessage.bGameType == 1) && Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle)) { uid = comdt_playerinfo.stDetail.stPlayerOfNpc.ullFakeUid; dwFakeLogicWorldID = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakeLogicWorldID; level = comdt_playerinfo.stDetail.stPlayerOfNpc.dwFakePvpLevel; } else { uid = 0L; dwFakeLogicWorldID = 0; level = comdt_playerinfo.dwLevel; } } else { uid = (comdt_playerinfo.bObjType != 1) ? ((ulong)0L) : comdt_playerinfo.stDetail.stPlayerOfAcnt.ullUid; dwFakeLogicWorldID = (comdt_playerinfo.bObjType != 1) ? 0 : ((uint)comdt_playerinfo.stDetail.stPlayerOfAcnt.iLogicWorldID); level = comdt_playerinfo.dwLevel; honorId = comdt_playerinfo.stDetail.stPlayerOfAcnt.iHonorID; honorLevel = comdt_playerinfo.stDetail.stPlayerOfAcnt.iHonorLevel; gradeOfRank = (InMessage.stGameParam.stSingleGameRspOfCombat != null) ? InMessage.stGameParam.stSingleGameRspOfCombat.bGradeOfRank : 0; } uint vipLv = 0; if (comdt_playerinfo.stDetail.stPlayerOfAcnt != null) { vipLv = comdt_playerinfo.stDetail.stPlayerOfAcnt.stGameVip.dwCurLevel; } Player player = Singleton <GamePlayerCenter> .GetInstance().AddPlayer(comdt_playerinfo.dwObjId, (COM_PLAYERCAMP)comdt_playerinfo.bObjCamp, comdt_playerinfo.bPosOfCamp, level, comdt_playerinfo.bObjType != 1, StringHelper.UTF8BytesToString(ref comdt_playerinfo.szName), 0, (int)dwFakeLogicWorldID, uid, vipLv, null, gradeOfRank, 0, honorId, honorLevel); if (player != null) { for (int j = 0; j < comdt_playerinfo.astChoiceHero.Length; j++) { uint dwHeroID = comdt_playerinfo.astChoiceHero[j].stBaseInfo.stCommonInfo.dwHeroID; player.AddHero(dwHeroID); } player.isGM = LobbyMsgHandler.isHostGMAcnt; } Singleton <ActorDataCenter> .instance.AddHeroesServerData(comdt_playerinfo.dwObjId, comdt_playerinfo.astChoiceHero); } if (comdt_playerinfo.bObjType == 1) { Singleton <GamePlayerCenter> .GetInstance().SetHostPlayer(comdt_playerinfo.dwObjId); } } base.LevelContext = CLevelCfgLogicManager.CreatePveLevelContext(InMessage); } }