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); }
public static SLevelContext CreatePveLevelContext(SCPKG_STARTSINGLEGAMERSP InMessage) { SLevelContext context = new SLevelContext(); context.SetGameType((COM_GAME_TYPE)InMessage.bGameType); ResLevelCfgInfo pveMapInfo = GetPveMapInfo(InMessage.bGameType, InMessage.iLevelId); if (InMessage.bGameType == 2) { context.InitPveData(pveMapInfo, 1); if (pveMapInfo.bGuideLevelSubType == 0) { context.m_isMobaType = true; return(context); } if (pveMapInfo.bGuideLevelSubType == 1) { context.m_isMobaType = false; } return(context); } if (InMessage.bGameType == 0) { context.InitPveData(pveMapInfo, Singleton <CAdventureSys> .instance.currentDifficulty); return(context); } if (InMessage.bGameType == 7) { context.InitPveData(pveMapInfo, 1); return(context); } if (InMessage.bGameType == 8) { context.InitPveData(pveMapInfo, 1); return(context); } if ((InMessage.bGameType != 3) && (InMessage.bGameType == 1)) { byte bMapType = InMessage.stGameParam.stSingleGameRspOfCombat.bMapType; uint dwMapId = InMessage.stGameParam.stSingleGameRspOfCombat.dwMapId; context = CreatePvpLevelContext(bMapType, dwMapId, (COM_GAME_TYPE)InMessage.bGameType, 1); context.m_isWarmBattle = Convert.ToBoolean(InMessage.stGameParam.stSingleGameRspOfCombat.bIsWarmBattle); context.SetWarmHeroAiDiff(InMessage.stGameParam.stSingleGameRspOfCombat.bAILevel); } return(context); }
public static SLevelContext CreatePveLevelContext(SCPKG_STARTSINGLEGAMERSP InMessage) { SLevelContext sLevelContext = new SLevelContext(); sLevelContext.SetGameType(InMessage.bGameType); ResLevelCfgInfo pveMapInfo = CLevelCfgLogicManager.GetPveMapInfo(InMessage.bGameType, InMessage.iLevelId); if (InMessage.bGameType == 2) { sLevelContext.InitPveData(pveMapInfo, 1); if (pveMapInfo.bGuideLevelSubType == 0) { sLevelContext.m_isMobaType = true; } else if (pveMapInfo.bGuideLevelSubType == 1) { sLevelContext.m_isMobaType = false; } } else if (InMessage.bGameType == 0) { sLevelContext.InitPveData(pveMapInfo, Singleton <CAdventureSys> .get_instance().currentDifficulty); } else if (InMessage.bGameType == 7) { sLevelContext.InitPveData(pveMapInfo, 1); } else if (InMessage.bGameType == 8) { sLevelContext.InitPveData(pveMapInfo, 1); } else if (InMessage.bGameType != 3) { if (InMessage.bGameType == 1) { byte bMapType = InMessage.stGameParam.get_stSingleGameRspOfCombat().bMapType; uint dwMapId = InMessage.stGameParam.get_stSingleGameRspOfCombat().dwMapId; sLevelContext = CLevelCfgLogicManager.CreatePvpLevelContext(bMapType, dwMapId, InMessage.bGameType, 1); sLevelContext.m_isWarmBattle = Convert.ToBoolean(InMessage.stGameParam.get_stSingleGameRspOfCombat().bIsWarmBattle); sLevelContext.SetWarmHeroAiDiff(InMessage.stGameParam.get_stSingleGameRspOfCombat().bAILevel); } } return(sLevelContext); }