コード例 #1
0
        private static void Main(string[] args)
        {
            var stringReader = new StringReader(XElement.Load("./Bootstrapper.exe.nlog")
                                                .ToString());

            using (var xmlReader = XmlReader.Create(stringReader))
            {
                LogManager.Configuration = new XmlLoggingConfiguration(xmlReader, null);
            }

            ActionHelper.ActionInfo(2);
            StatusEffectHelper.StatusInfo(2);
            ZoneHelper.MapInfo(138);

            var process = Process.GetProcessesByName("ffxiv_dx11")
                          .FirstOrDefault();

            MemoryHandler.Instance.SetProcess(new ProcessModel
            {
                IsWin64 = true,
                Process = process
            });

            while (Scanner.Instance.IsScanning)
            {
                Thread.Sleep(1000);
                Console.WriteLine("Scanning...");
            }

            Scanner.Instance.SignaturesFoundEvent += delegate(object sender, SignaturesFoundEvent e)
            {
                foreach (var kvp in e.Signatures)
                {
                    Console.WriteLine($"{kvp.Key} => {kvp.Value.GetAddress():X}");
                }

                Console.WriteLine("To exit this application press \"Enter\".");
                Console.ReadLine();
            };
        }
コード例 #2
0
        private void InitializeHistory()
        {
            var hasDamage      = ParseControl.Timeline.Overall.Stats.GetStatValue("TotalOverallDamage") > 0;
            var hasHealing     = ParseControl.Timeline.Overall.Stats.GetStatValue("TotalOverallHealing") > 0;
            var hasDamageTaken = ParseControl.Timeline.Overall.Stats.GetStatValue("TotalOverallDamageTaken") > 0;

            if (hasDamage || hasHealing || hasDamageTaken)
            {
                var currentOverallStats = ParseControl.Timeline.Overall.Stats;
                var historyItem         = new ParseHistoryItem();
                var historyController   = historyItem.HistoryControl = new HistoryControl();
                foreach (var stat in currentOverallStats)
                {
                    historyController.Timeline.Overall.Stats.EnsureStatValue(stat.Name, stat.Value);
                }
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerDPS", currentOverallStats.GetStatValue("DPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerDOTPS", currentOverallStats.GetStatValue("DOTPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerHPS", currentOverallStats.GetStatValue("HPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerHOHPS", currentOverallStats.GetStatValue("HOHPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerHOTPS", currentOverallStats.GetStatValue("HOTPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerHMPS", currentOverallStats.GetStatValue("HMPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerDTPS", currentOverallStats.GetStatValue("DTPS"));
                historyController.Timeline.Overall.Stats.EnsureStatValue("StaticPlayerDTOTPS", currentOverallStats.GetStatValue("DTOTPS"));
                var playerList = ParseControl.Timeline.Party.ToArray();
                foreach (var player in playerList)
                {
                    var playerInstance = historyController.Timeline.GetSetPlayer(player.Name);
                    playerInstance.Last20DamageActions      = ((Player)player).Last20DamageActions.ToList();
                    playerInstance.Last20DamageTakenActions = ((Player)player).Last20DamageTakenActions.ToList();
                    playerInstance.Last20HealingActions     = ((Player)player).Last20HealingActions.ToList();
                    playerInstance.Last20Items = ((Player)player).Last20Items.ToList();
                    foreach (var stat in player.Stats)
                    {
                        playerInstance.Stats.EnsureStatValue(stat.Name, stat.Value);
                    }
                    RabbitHoleCopy(ref playerInstance, player);
                }
                var monsterList = ParseControl.Timeline.Monster.ToArray();
                foreach (var monster in monsterList)
                {
                    var monsterInstance = historyController.Timeline.GetSetMonster(monster.Name);
                    monsterInstance.Last20DamageActions      = ((Monster)monster).Last20DamageActions.ToList();
                    monsterInstance.Last20DamageTakenActions = ((Monster)monster).Last20DamageTakenActions.ToList();
                    monsterInstance.Last20HealingActions     = ((Monster)monster).Last20HealingActions.ToList();
                    monsterInstance.Last20Items = ((Monster)monster).Last20Items.ToList();
                    foreach (var stat in monster.Stats)
                    {
                        monsterInstance.Stats.EnsureStatValue(stat.Name, stat.Value);
                    }
                    RabbitHoleCopy(ref monsterInstance, monster);
                }
                historyItem.Start       = ParseControl.StartTime;
                historyItem.End         = DateTime.Now;
                historyItem.ParseLength = historyItem.End - historyItem.Start;
                var parseTimeDetails = String.Format("{0} -> {1} [{2}]", historyItem.Start, historyItem.End, historyItem.ParseLength);
                var zone             = "Unknown";
                if (XIVInfoViewModel.Instance.CurrentUser != null)
                {
                    var mapIndex = XIVInfoViewModel.Instance.CurrentUser.MapIndex;
                    zone = ZoneHelper.MapInfo(mapIndex).Name.English;
                    switch (Constants.GameLanguage)
                    {
                    case "French":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.French;
                        break;

                    case "Japanese":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.Japanese;
                        break;

                    case "German":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.German;
                        break;

                    case "Chinese":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.Chinese;
                        break;
                    }
                }
                var monsterName = "NULL";
                try
                {
                    StatGroup biggestMonster = null;
                    foreach (var monster in ParseControl.Timeline.Monster)
                    {
                        if (biggestMonster == null)
                        {
                            biggestMonster = monster;
                        }
                        else
                        {
                            if (monster.Stats.GetStatValue("TotalOverallDamage") > biggestMonster.Stats.GetStatValue("TotalOverallDamage"))
                            {
                                biggestMonster = monster;
                            }
                        }
                    }
                    if (biggestMonster != null)
                    {
                        monsterName = biggestMonster.Name;
                    }
                }
                catch (Exception ex)
                {
                }
                foreach (var oStat in currentOverallStats)
                {
                    historyController.Timeline.Overall.Stats.EnsureStatValue(oStat.Name, oStat.Value);
                }
                historyItem.Name = String.Format("{0} [{1}] {2}", zone, monsterName, parseTimeDetails);
                DispatcherHelper.Invoke(() => MainViewModel.Instance.ParseHistory.Insert(1, historyItem));
            }
        }
コード例 #3
0
            public static JsonParse ConvertParse()
            {
                var hasDamage      = ParseControl.Instance.Timeline.Overall.Stats.GetStatValue("TotalOverallDamage") > 0;
                var hasHealing     = ParseControl.Instance.Timeline.Overall.Stats.GetStatValue("TotalOverallHealing") > 0;
                var hasDamageTaken = ParseControl.Instance.Timeline.Overall.Stats.GetStatValue("TotalOverallDamageTaken") > 0;

                if (!hasDamage && !hasHealing && !hasDamageTaken)
                {
                    return(new JsonParse());
                }
                var currentOverallStats = ParseControl.Instance.Timeline.Overall.Stats;
                var historyItem         = new Dictionary <string, object>();
                var timeline            = new Dictionary <string, object>();
                var overall             = new Dictionary <string, object>
                {
                    {
                        "Stats", new Dictionary <string, object>()
                    }
                };

                foreach (var stat in currentOverallStats)
                {
                    ((Dictionary <string, object>)overall["Stats"]).Add(stat.Name, stat.Value);
                }
                timeline.Add("Overall", overall);
                var playerList = ParseControl.Instance.Timeline.Party.ToArray();
                var players    = new Dictionary <string, object>();

                foreach (var player in playerList)
                {
                    var playerItem = new Dictionary <string, object>
                    {
                        {
                            "Stats", new Dictionary <string, object>()
                        },
                        {
                            "Last20DamageActions", ((Player)player).Last20DamageActions.ToList()
                        },
                        {
                            "Last20DamageTakenActions", ((Player)player).Last20DamageTakenActions.ToList()
                        },
                        {
                            "Last20HealingActions", ((Player)player).Last20HealingActions.ToList()
                        },
                        {
                            "Last20Items", ((Player)player).Last20Items.ToList()
                        }
                    };
                    foreach (var stat in player.Stats)
                    {
                        ((Dictionary <string, object>)playerItem["Stats"]).Add(stat.Name, stat.Value);
                    }
                    players.Add(player.Name, playerItem);
                    RabbitHoleCopy(ref playerItem, player);
                }
                timeline.Add("Party", players);
                var monsterList = ParseControl.Instance.Timeline.Monster.ToArray();
                var monsters    = new Dictionary <string, object>();

                foreach (var monster in monsterList)
                {
                    var monsterItem = new Dictionary <string, object>
                    {
                        {
                            "Stats", new Dictionary <string, object>()
                        },
                        {
                            "Last20DamageActions", ((Monster)monster).Last20DamageActions.ToList()
                        },
                        {
                            "Last20DamageTakenActions", ((Monster)monster).Last20DamageTakenActions.ToList()
                        },
                        {
                            "Last20HealingActions", ((Monster)monster).Last20HealingActions.ToList()
                        },
                        {
                            "Last20Items", ((Monster)monster).Last20Items.ToList()
                        }
                    };
                    foreach (var stat in monster.Stats)
                    {
                        ((Dictionary <string, object>)monsterItem["Stats"]).Add(stat.Name, stat.Value);
                    }
                    monsters.Add(monster.Name, monsterItem);
                    RabbitHoleCopy(ref monsterItem, monster);
                }
                timeline.Add("Monster", monsters);
                historyItem.Add("Timeline", timeline);

                #region Resolve FileName Details

                var start            = ParseControl.Instance.StartTime;
                var end              = DateTime.Now;
                var parseLength      = end - start;
                var parseTimeDetails = String.Format("{0} -> {1} [{2}]", start, end, parseLength);
                var zone             = "UNKNOWN";
                if (XIVInfoViewModel.Instance.CurrentUser != null)
                {
                    var mapIndex = XIVInfoViewModel.Instance.CurrentUser.MapIndex;
                    zone = ZoneHelper.MapInfo(mapIndex).Name.English;
                    switch (Constants.GameLanguage)
                    {
                    case "French":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.French;
                        break;

                    case "Japanese":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.Japanese;
                        break;

                    case "German":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.German;
                        break;

                    case "Chinese":
                        zone = ZoneHelper.MapInfo(mapIndex).Name.Chinese;
                        break;
                    }
                }
                var monsterName = "NULL";
                try
                {
                    StatGroup biggestMonster = null;
                    foreach (var monster in ParseControl.Instance.Timeline.Monster)
                    {
                        if (biggestMonster == null)
                        {
                            biggestMonster = monster;
                        }
                        else
                        {
                            if (monster.Stats.GetStatValue("TotalOverallDamage") > biggestMonster.Stats.GetStatValue("TotalOverallDamage"))
                            {
                                biggestMonster = monster;
                            }
                        }
                    }
                    if (biggestMonster != null)
                    {
                        monsterName = biggestMonster.Name;
                    }
                }
                catch (Exception ex)
                {
                }

                #endregion

                return(new JsonParse
                {
                    Name = String.Format("{0} [{1}] {2}", zone, monsterName, parseTimeDetails),
                    Parse = JsonConvert.SerializeObject(historyItem, new JsonSerializerSettings
                    {
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                    })
                });
            }