コード例 #1
0
        private static Log CreateLog(int start, int end, List <Player> PlayerList, EncounterData encounter, string append)
        {
            try
            {
                Log Log = new Log();
                Log.successLevel = SuccessLevelEnum.GetByCode(encounter.GetEncounterSuccessLevel()).Name;
                Log.startTime    = encounter.StartTime.TimeOfDay.ToString() + " " + append;
                Log.duration     = encounter.Duration.ToString();
                Log.maxHit       = ValidateAndFill("MaxHitParty", encounter.GetMaxHit(false));
                Log.totalHealing = ValidateAndFill("TotalHealing", encounter.Healed.ToString());
                Log.targetName   = encounter.GetStrongestEnemy(null);
                Log.mapName      = ValidateAndFill("MapName", encounter.ZoneName);
                Log.sortBy       = PluginSettings.GetSetting <string>("SortBy");
                PlayerList.Where(Player => Player.number >= start && Player.number <= end).ToList().ForEach(Player =>
                {
                    Log.players.Add(Player);
                });

                if (Log.players.Count > 0)
                {
                    return(Log);
                }

                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
コード例 #2
0
ファイル: PluginUtil.cs プロジェクト: zixsen/MognetPlugin
        public static Log ACTEncounterToModel(EncounterData encounter)
        {
            Log Log = new Log();

            Log.successLevel = SuccessLevelEnum.GetByCode(encounter.GetEncounterSuccessLevel()).Name;
            Log.startTime    = encounter.StartTime.TimeOfDay.ToString();
            Log.duration     = encounter.Duration.ToString();
            Log.maxHit       = ValidateAndFill("MaxHitParty", encounter.GetMaxHit(false));
            Log.totalHealing = ValidateAndFill("TotalHealing", encounter.Healed.ToString());
            Log.targetName   = encounter.GetStrongestEnemy(null);
            Log.mapName      = ValidateAndFill("MapName", encounter.ZoneName);
            Log.sortBy       = PluginSettings.GetSetting <string>("SortBy");
            encounter.GetAllies().ForEach(combatant =>
            {
                Player Player = new Player();

                if (IsLimitBreak(combatant.Name))
                {
                    Player.playerName = combatant.Name;
                    Player.maxHit     = combatant.GetMaxHit(true);

                    Log.players.Add(Player);
                }
                else if (!IsLimitBreak(combatant.Name) && GetCustomColumnData(combatant, "Job") != "")
                {
                    Player.playerJob        = GetCustomColumnData(combatant, "Job").ToUpper();
                    Player.playerName       = FormatName(combatant.Name);
                    Player.damagePercentage = ValidateAndFill("DamagePerc", combatant.DamagePercent);
                    Player.dps                = Math.Round(combatant.EncDPS).ToString();
                    Player.maxHit             = FormatSkill(ValidateAndFill("MaxHitIndividual", combatant.GetMaxHit(true)));
                    Player.healingPercentage  = ValidateAndFill("HealingPerc", combatant.HealedPercent);
                    Player.hps                = ValidateAndFill("HPS", Math.Round(combatant.EncHPS).ToString());
                    Player.maxHeal            = FormatSkill(ValidateAndFill("MaxHeal", combatant.GetMaxHeal(true, false)));
                    Player.overhealPercentage = ValidateAndFill("OverHealPerc", GetCustomColumnData(combatant, "OverHealPct"));
                    Player.deaths             = ValidateAndFill("Deaths", combatant.Deaths.ToString());
                    Player.crit               = ValidateAndFill("Crit", Math.Round(combatant.CritDamPerc).ToString());
                    Player.dh                 = ValidateAndFill("DirectHit", GetCustomColumnData(combatant, "DirectHitPct"));
                    Player.dhCrit             = ValidateAndFill("DirectHitCrit", GetCustomColumnData(combatant, "CritDirectHitPct"));
                    Player.critHealPercentage = ValidateAndFill("CritHealPerc", Math.Round(combatant.CritHealPerc).ToString());

                    Log.players.Add(Player);
                }
            });

            if (Log.players.Count == 0 || Log.duration == "00:00:00")
            {
                return(null);
            }

            return(Log);
        }