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); }