Ejemplo n.º 1
0
 public EvtcParser(EvtcParserSettings parserSettings)
 {
     _parserSettings = parserSettings;
     _allAgentsList  = new List <AgentItem>();
     _skillData      = new SkillData();
     _combatItems    = new List <CombatItem>();
     _playerList     = new List <Player>();
     _logStartTime   = 0;
     _logEndTime     = 0;
 }
 public EvtcParser(EvtcParserSettings parserSettings, GW2APIController apiController)
 {
     _apiController     = apiController;
     _parserSettings    = parserSettings;
     _allAgentsList     = new List <AgentItem>();
     _combatItems       = new List <CombatItem>();
     _playerList        = new List <Player>();
     _logStartTime      = 0;
     _logEndTime        = 0;
     _enabledExtensions = new Dictionary <uint, AbstractExtensionHandler>();
 }
 public EvtcParser(EvtcParserSettings parserSettings, GW2EIGW2API.GW2APIController apiController)
 {
     _apiController  = apiController;
     _parserSettings = parserSettings;
     _allAgentsList  = new List <AgentItem>();
     _skillData      = new SkillData(apiController);
     _combatItems    = new List <CombatItem>();
     _playerList     = new List <Player>();
     _logStartTime   = 0;
     _logEndTime     = 0;
 }
Ejemplo n.º 4
0
        internal ParsedEvtcLog(int evtcVersion, FightData fightData, AgentData agentData, SkillData skillData,
                               List <CombatItem> combatItems, List <Player> playerList, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions, long evtcLogDuration, EvtcParserSettings parserSettings, ParserController operation)
        {
            FightData      = fightData;
            AgentData      = agentData;
            SkillData      = skillData;
            PlayerList     = playerList;
            ParserSettings = parserSettings;
            _operation     = operation;
            var friendlies = new List <AbstractSingleActor>();

            friendlies.AddRange(playerList);
            friendlies.AddRange(fightData.Logic.NonPlayerFriendlies);
            Friendlies = friendlies;
            //
            FriendliesListBySpec = friendlies.GroupBy(x => x.Spec).ToDictionary(x => x.Key, x => x.ToList());
            PlayerAgents         = new HashSet <AgentItem>(playerList.Select(x => x.AgentItem));
            FriendlyAgents       = new HashSet <AgentItem>(friendlies.Select(x => x.AgentItem));
            _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Combat Events");
            CombatData = new CombatData(combatItems, FightData, AgentData, SkillData, playerList, operation, extensions, evtcVersion);
            operation.UpdateProgressWithCancellationCheck("Checking CM");
            FightData.SetCM(CombatData, AgentData);
            operation.UpdateProgressWithCancellationCheck("Setting Fight Name");
            FightData.SetFightName(CombatData, AgentData);
            //
            _operation.UpdateProgressWithCancellationCheck("Checking Success");
            FightData.Logic.CheckSuccess(CombatData, AgentData, FightData, PlayerAgents);
            if (FightData.FightDuration <= ParserSettings.TooShortLimit)
            {
                throw new TooShortException(FightData.FightDuration, ParserSettings.TooShortLimit);
            }
            if (ParserSettings.SkipFailedTries && !FightData.Success)
            {
                throw new SkipException();
            }
            _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Log Meta Data");
            LogData = new LogData(evtcVersion, CombatData, evtcLogDuration, playerList, extensions, operation);
            //
            _operation.UpdateProgressWithCancellationCheck("Creating Buff Container");
            Buffs = new BuffsContainer(LogData.GW2Build, CombatData, operation);
            _operation.UpdateProgressWithCancellationCheck("Creating Damage Modifier Container");
            DamageModifiers = new DamageModifiersContainer(LogData.GW2Build, fightData.Logic.Mode, parserSettings);
            _operation.UpdateProgressWithCancellationCheck("Creating Mechanic Data");
            MechanicData = FightData.Logic.GetMechanicData();
            _operation.UpdateProgressWithCancellationCheck("Creating General Statistics Container");
            StatisticsHelper = new StatisticsHelper(CombatData, PlayerList, Buffs);
        }
Ejemplo n.º 5
0
 internal ParsedEvtcLog(string buildVersion, FightData fightData, AgentData agentData, SkillData skillData,
                        List <CombatItem> combatItems, List <Player> playerList, long evtcLogDuration, EvtcParserSettings parserSettings, ParserController operation)
 {
     FightData      = fightData;
     AgentData      = agentData;
     SkillData      = skillData;
     PlayerList     = playerList;
     ParserSettings = parserSettings;
     _operation     = operation;
     //
     PlayerListBySpec = playerList.GroupBy(x => x.Prof).ToDictionary(x => x.Key, x => x.ToList());
     PlayerAgents     = new HashSet <AgentItem>(playerList.Select(x => x.AgentItem));
     _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Combat Events");
     CombatData = new CombatData(combatItems, FightData, AgentData, SkillData, playerList, operation);
     _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Log Meta Data");
     LogData = new LogData(buildVersion, CombatData, evtcLogDuration, playerList, operation);
     //
     _operation.UpdateProgressWithCancellationCheck("Checking Success");
     FightData.Logic.CheckSuccess(CombatData, AgentData, FightData, PlayerAgents);
     if (FightData.FightEnd <= ParserSettings.TooShortLimit)
     {
         throw new TooShortException(FightData.FightEnd, ParserSettings.TooShortLimit);
     }
     if (ParserSettings.SkipFailedTries && !FightData.Success)
     {
         throw new SkipException();
     }
     _operation.UpdateProgressWithCancellationCheck("Checking CM");
     FightData.SetCM(CombatData, AgentData, FightData);
     //
     _operation.UpdateProgressWithCancellationCheck("Creating Buff Container");
     Buffs = new BuffsContainer(LogData.GW2Build, CombatData, operation);
     _operation.UpdateProgressWithCancellationCheck("Creating Damage Modifier Container");
     DamageModifiers = new DamageModifiersContainer(LogData.GW2Build, fightData.Logic.Mode, parserSettings);
     _operation.UpdateProgressWithCancellationCheck("Creating Mechanic Data");
     MechanicData = FightData.Logic.GetMechanicData();
     _operation.UpdateProgressWithCancellationCheck("Creating General Statistics Container");
     StatisticsHelper = new StatisticsHelper(CombatData, PlayerList, Buffs);
 }
        internal ParsedEvtcLog(int evtcVersion, FightData fightData, AgentData agentData, SkillData skillData,
                               List <CombatItem> combatItems, List <Player> playerList, IReadOnlyDictionary <uint, AbstractExtensionHandler> extensions, long evtcLogDuration, EvtcParserSettings parserSettings, ParserController operation)
        {
            FightData      = fightData;
            AgentData      = agentData;
            SkillData      = skillData;
            PlayerList     = playerList;
            PlayerAgents   = new HashSet <AgentItem>(PlayerList.Select(x => x.AgentItem));
            ParserSettings = parserSettings;
            _operation     = operation;
            if (parserSettings.AnonymousPlayer)
            {
                operation.UpdateProgressWithCancellationCheck("Anonymous players");
                for (int i = 0; i < PlayerList.Count; i++)
                {
                    PlayerList[i].Anonymize(i + 1);
                }
                IReadOnlyList <AgentItem> allPlayerAgents = agentData.GetAgentByType(AgentItem.AgentType.Player);
                int playerOffset = PlayerList.Count;
                foreach (AgentItem playerAgent in allPlayerAgents)
                {
                    if (!PlayerAgents.Contains(playerAgent))
                    {
                        string character = "Player " + playerOffset;
                        string account   = "Account " + (playerOffset++);
                        playerAgent.OverrideName(character + "\0:" + account + "\01");
                    }
                }
            }
            //
            _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Combat Events");
            CombatData = new CombatData(combatItems, FightData, AgentData, SkillData, PlayerList, operation, extensions, evtcVersion);
            if (parserSettings.AnonymousPlayer)
            {
                operation.UpdateProgressWithCancellationCheck("Anonymous guilds");
                IReadOnlyList <AgentItem> allPlayerAgents = agentData.GetAgentByType(AgentItem.AgentType.Player);
                foreach (AgentItem playerAgent in allPlayerAgents)
                {
                    foreach (GuildEvent guildEvent in CombatData.GetGuildEvents(playerAgent))
                    {
                        guildEvent.Anonymize();
                    }
                }
            }
            //
            operation.UpdateProgressWithCancellationCheck("Checking CM");
            FightData.SetEncounterMode(CombatData, AgentData);
            operation.UpdateProgressWithCancellationCheck("Setting Fight Name");
            FightData.SetFightName(CombatData, AgentData);
            //
            var friendlies = new List <AbstractSingleActor>();

            friendlies.AddRange(PlayerList);
            friendlies.AddRange(fightData.Logic.NonPlayerFriendlies);
            Friendlies           = friendlies;
            FriendliesListBySpec = friendlies.GroupBy(x => x.Spec).ToDictionary(x => x.Key, x => x.ToList());
            FriendlyAgents       = new HashSet <AgentItem>(Friendlies.Select(x => x.AgentItem));
            //
            _operation.UpdateProgressWithCancellationCheck("Checking Success");
            FightData.Logic.CheckSuccess(CombatData, AgentData, FightData, PlayerAgents);
            if (FightData.FightDuration <= ParserSettings.TooShortLimit)
            {
                throw new TooShortException(FightData.FightDuration, ParserSettings.TooShortLimit);
            }
            if (ParserSettings.SkipFailedTries && !FightData.Success)
            {
                throw new SkipException();
            }
            _operation.UpdateProgressWithCancellationCheck("Creating GW2EI Log Meta Data");
            LogData = new LogData(evtcVersion, CombatData, evtcLogDuration, playerList, extensions, operation);
            //
            _operation.UpdateProgressWithCancellationCheck("Creating Buff Container");
            Buffs = new BuffsContainer(LogData.GW2Build, CombatData, operation);
            _operation.UpdateProgressWithCancellationCheck("Creating Damage Modifier Container");
            DamageModifiers = new DamageModifiersContainer(LogData.GW2Build, fightData.Logic.Mode, parserSettings);
            _operation.UpdateProgressWithCancellationCheck("Creating Mechanic Data");
            MechanicData = FightData.Logic.GetMechanicData();
            _operation.UpdateProgressWithCancellationCheck("Creating General Statistics Container");
            StatisticsHelper = new StatisticsHelper(CombatData, PlayerList, Buffs);
        }