/// <summary>
 /// プレイヤ情報をリフレッシュする
 /// </summary>
 public static void RefreshPlayer()
 {
     var list = FF14PluginHelper.GetCombatantList();
     if (list.Count > 0)
     {
         player = list[0];
         lastPlayerDateTime = DateTime.Now;
     }
 }
Exemplo n.º 2
0
        public static List<Combatant> GetCombatantList()
        {
            Initialize();

            var result = new List<Combatant>();

            if (plugin == null)
            {
                return result;
            }

            if (GetFFXIVProcess == null)
            {
                return result;
            }

            if (pluginScancombat == null)
            {
                return result;
            }

            dynamic list = pluginScancombat.GetCombatantList();
            foreach (dynamic item in list.ToArray())
            {
                if (item == null)
                {
                    continue;
                }

                var combatant = new Combatant();

                combatant.Name = (string)item.Name;
                combatant.ID = (uint)item.ID;
                combatant.Job = (int)item.Job;
                combatant.CurrentMP = (int)item.CurrentMP;
                combatant.MaxMP = (int)item.MaxMP;
/*
                combatant.OwnerID = (uint)item.OwnerID;
                combatant.Name = (string)item.Name;
                combatant.type = (byte)item.type;
                combatant.Level = (int)item.Level;
                combatant.CurrentHP = (int)item.CurrentHP;
                combatant.MaxHP = (int)item.MaxHP;
                combatant.CurrentTP = (int)item.CurrentTP;
*/

                result.Add(combatant);
            }

            return result;
        }
Exemplo n.º 3
0
        public static Combatant GetCombatantPlayer()
        {
            var result = default(Combatant);

            Initialize();
/*
#if DEBUG
            result = new Combatant();
            result.Job = 25;
            result.CurrentMP = 1000;
            result.MaxMP = 5400;
            return result;
#else
*/
            if (plugin == null)
            {
                return result;
            }

            if (GetFFXIVProcess == null)
            {
                return result;
            }

            if (pluginScancombat == null)
            {
                return result;
            }

            object[] list = pluginScancombat.GetCombatantList().ToArray();
            if (list.Length > 0)
            {
                var item = (dynamic)list[0];
                var combatant = new Combatant();

                combatant.Name = (string)item.Name;
                combatant.ID = (uint)item.ID;
                combatant.Job = (int)item.Job;
                combatant.CurrentMP = (int)item.CurrentMP;
                combatant.MaxMP = (int)item.MaxMP;

                result = combatant;
            }

            return result;
/*
#endif
*/
        }