コード例 #1
0
ファイル: WoWNameCache.cs プロジェクト: SpoinkyNL/Artemis
        public WoWDetails GetNameByGuid(Guid searchGuid)
        {
            var current = Process.Memory.Read<IntPtr>(CurrentCacheAddress);
            var index = 0;
            while (current != IntPtr.Zero)
            {
                var guid = Process.Memory.Read<Guid>(current + 0x20);
                if (guid.Equals(searchGuid))
                {
                    var pRace = Process.Memory.Read<int>(current + 0x88);
                    var pClass = Process.Memory.Read<int>(current + 0x90);
                    var pName = Process.Memory.Read(current + 0x31, Encoding.ASCII, 48);

                    var name = new WoWDetails(guid, pRace, pClass, WoWEnums.WoWType.Player, pName);
                    return name;
                }

                if (index > 20000)
                    return null;

                index++;
                current = Process.Memory.Read<IntPtr>(current);
            }
            return null;
        }
コード例 #2
0
ファイル: WoWNameCache.cs プロジェクト: roxaskeyheart/Artemis
        public WoWDetails GetNameByGuid(Guid searchGuid)
        {
            var current = Process.Memory.Read <IntPtr>(CurrentCacheAddress);
            var index   = 0;

            while (current != IntPtr.Zero)
            {
                var guid = Process.Memory.Read <Guid>(current + 0x20);
                if (guid.Equals(searchGuid))
                {
                    var pRace  = Process.Memory.Read <int>(current + 0x88);
                    var pClass = Process.Memory.Read <int>(current + 0x90);
                    var pName  = Process.Memory.Read(current + 0x31, Encoding.ASCII, 48);

                    var name = new WoWDetails(guid, pRace, pClass, WoWEnums.WoWType.Player, pName);
                    return(name);
                }

                if (index > 20000)
                {
                    return(null);
                }

                index++;
                current = Process.Memory.Read <IntPtr>(current);
            }
            return(null);
        }
コード例 #3
0
 public void UpdateDetails(WoWNameCache nameCache)
 {
     Details = GetNpcDetails() ?? nameCache.GetNameByGuid(Guid);
 }
コード例 #4
0
ファイル: WoWUnit.cs プロジェクト: SpoinkyNL/Artemis
 public void UpdateDetails(WoWNameCache nameCache)
 {
     Details = GetNpcDetails() ?? nameCache.GetNameByGuid(Guid);
 }