Skip to content

Commit

Permalink
3.0.5666.36582
Browse files Browse the repository at this point in the history
  • Loading branch information
Icehunter committed Jul 8, 2015
1 parent ca885a3 commit 7b98634
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 342 deletions.
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/FFXIVAPP.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
<Compile Include="Localization\Japanese.cs" />
<Compile Include="Localization\Russian.cs" />
<Compile Include="Memory\ChatEntry.cs" />
<Compile Include="Memory\ActorWorker.cs" />
<Compile Include="Memory\InventoryWorker.cs" />
<Compile Include="Memory\PartyInfoWorker.cs" />
<Compile Include="Memory\TargetWorker.cs" />
Expand All @@ -171,7 +170,7 @@
<Compile Include="Initializer.cs" />
<Compile Include="Memory\ChatCleaner.cs" />
<Compile Include="Memory\Structures.cs" />
<Compile Include="Memory\MonsterWorker.cs" />
<Compile Include="Memory\ActorWorker.cs" />
<Compile Include="Memory\MemoryHandler.cs" />
<Compile Include="Memory\SigScanner.cs" />
<Compile Include="Memory\Signature.cs" />
Expand Down
8 changes: 0 additions & 8 deletions FFXIVAPP.Client/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ internal static class Initializer

private static ActorWorker _actorWorker;
private static ChatLogWorker _chatLogWorker;
private static MonsterWorker _monsterWorker;
private static PlayerInfoWorker _playerInfoWorker;
private static TargetWorker _targetWorker;
private static PartyInfoWorker _partyInfoWorker;
Expand Down Expand Up @@ -839,8 +838,6 @@ public static void StartMemoryWorkers()
_chatLogWorker.StartScanning();
_actorWorker = new ActorWorker();
_actorWorker.StartScanning();
_monsterWorker = new MonsterWorker();
_monsterWorker.StartScanning();
_playerInfoWorker = new PlayerInfoWorker();
_playerInfoWorker.StartScanning();
_targetWorker = new TargetWorker();
Expand Down Expand Up @@ -870,11 +867,6 @@ public static void StopMemoryWorkers()
_actorWorker.StopScanning();
_actorWorker.Dispose();
}
if (_monsterWorker != null)
{
_monsterWorker.StopScanning();
_monsterWorker.Dispose();
}
if (_playerInfoWorker != null)
{
_playerInfoWorker.StopScanning();
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Localization/Chinese.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public static ResourceDictionary Context()
Dictionary.Add("app_BTNResNetWorker", "Reset Network Worker");
Dictionary.Add("app_DefAudioDeviceLabel", "Default Audio Device");
Dictionary.Add("app_MemScanSpeedLabel", "Memory Scanning Speed (Milliseconds)");
Dictionary.Add("app_ActorMSSLabel", "Actor (NPCs &amp; Other)");
Dictionary.Add("app_ActorMSSLabel", "Actors (Anything Targetable)");
Dictionary.Add("app_ChatLogMSSLabel", "ChatLog");
Dictionary.Add("app_MonstersPCMSSLabel", "Monsters &amp; PCs");
Dictionary.Add("app_PlayerInfMSSLabel", "Player Info (YOU)");
Dictionary.Add("app_TargEnmMSSLabel", "Targets &amp; Enmity");
Dictionary.Add("app_InvMSSLabel", "Inventory");
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Localization/English.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public static ResourceDictionary Context()
Dictionary.Add("app_BTNResNetWorker", "Reset Network Worker");
Dictionary.Add("app_DefAudioDeviceLabel", "Default Audio Device");
Dictionary.Add("app_MemScanSpeedLabel", "Memory Scanning Speed (Milliseconds)");
Dictionary.Add("app_ActorMSSLabel", "Actor (NPCs &amp; Other)");
Dictionary.Add("app_ActorMSSLabel", "Actors (Anything Targetable)");
Dictionary.Add("app_ChatLogMSSLabel", "ChatLog");
Dictionary.Add("app_MonstersPCMSSLabel", "Monsters &amp; PCs");
Dictionary.Add("app_PartyInfMSSLabel", "Party Info");
Dictionary.Add("app_PlayerInfMSSLabel", "Player Info (YOU)");
Dictionary.Add("app_TargEnmMSSLabel", "Targets &amp; Enmity");
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Localization/French.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public static ResourceDictionary Context()
Dictionary.Add("app_BTNResNetWorker", "Reset Network Worker");
Dictionary.Add("app_DefAudioDeviceLabel", "Default Audio Device");
Dictionary.Add("app_MemScanSpeedLabel", "Memory Scanning Speed (Milliseconds)");
Dictionary.Add("app_ActorMSSLabel", "Actor (NPCs &amp; Other)");
Dictionary.Add("app_ActorMSSLabel", "Actors (Anything Targetable)");
Dictionary.Add("app_ChatLogMSSLabel", "ChatLog");
Dictionary.Add("app_MonstersPCMSSLabel", "Monsters &amp; PCs");
Dictionary.Add("app_PlayerInfMSSLabel", "Player Info (YOU)");
Dictionary.Add("app_TargEnmMSSLabel", "Targets &amp; Enmity");
Dictionary.Add("app_InvMSSLabel", "Inventory");
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Localization/German.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public static ResourceDictionary Context()
Dictionary.Add("app_BTNResNetWorker", "Reset Network Worker");
Dictionary.Add("app_DefAudioDeviceLabel", "Default Audio Device");
Dictionary.Add("app_MemScanSpeedLabel", "Memory Scanning Speed (Milliseconds)");
Dictionary.Add("app_ActorMSSLabel", "Actor (NPCs &amp; Other)");
Dictionary.Add("app_ActorMSSLabel", "Actors (Anything Targetable)");
Dictionary.Add("app_ChatLogMSSLabel", "ChatLog");
Dictionary.Add("app_MonstersPCMSSLabel", "Monsters &amp; PCs");
Dictionary.Add("app_PlayerInfMSSLabel", "Player Info (YOU)");
Dictionary.Add("app_TargEnmMSSLabel", "Targets &amp; Enmity");
Dictionary.Add("app_InvMSSLabel", "Inventory");
Expand Down
3 changes: 1 addition & 2 deletions FFXIVAPP.Client/Localization/Japanese.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ public static ResourceDictionary Context()
Dictionary.Add("app_BTNResNetWorker", "Reset Network Worker");
Dictionary.Add("app_DefAudioDeviceLabel", "Default Audio Device");
Dictionary.Add("app_MemScanSpeedLabel", "Memory Scanning Speed (Milliseconds)");
Dictionary.Add("app_ActorMSSLabel", "Actor (NPCs &amp; Other)");
Dictionary.Add("app_ActorMSSLabel", "Actors (Anything Targetable)");
Dictionary.Add("app_ChatLogMSSLabel", "ChatLog");
Dictionary.Add("app_MonstersPCMSSLabel", "Monsters &amp; PCs");
Dictionary.Add("app_PlayerInfMSSLabel", "Player Info (YOU)");
Dictionary.Add("app_TargEnmMSSLabel", "Targets &amp; Enmity");
Dictionary.Add("app_InvMSSLabel", "Inventory");
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Localization/Russian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static ResourceDictionary Context()
Dictionary.Add("app_MemScanSpeedLabel", "Скорочть Чтения Памяти Игры (Миллисекунды)");
Dictionary.Add("app_ActorMSSLabel", "Субъект (NPCs и Остальные)");
Dictionary.Add("app_ChatLogMSSLabel", "Запись Чата");
Dictionary.Add("app_MonstersPCMSSLabel", "Монстры и Игроки");
Dictionary.Add("app_ActorsPCMSSLabel", "Монстры и Игроки");
Dictionary.Add("app_PartyInfMSSLabel", "Информация о Группе");
Dictionary.Add("app_PlayerInfMSSLabel", "Информация о персонаже (Вы)");
Dictionary.Add("app_TargEnmMSSLabel", "Цели и Враждебность");
Expand Down
65 changes: 59 additions & 6 deletions FFXIVAPP.Client/Memory/ActorWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -87,6 +88,8 @@ public void StopScanning()

#region Threads

public Stopwatch Stopwatch = new Stopwatch();

/// <summary>
/// </summary>
/// <param name="sender"> </param>
Expand All @@ -107,7 +110,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
{
if (MemoryHandler.Instance.SigScanner.Locations.ContainsKey("GAMEMAIN"))
{
if (MemoryHandler.Instance.SigScanner.Locations.ContainsKey("ACTORMAP"))
if (MemoryHandler.Instance.SigScanner.Locations.ContainsKey("CHARMAP"))
{
try
{
Expand Down Expand Up @@ -138,41 +141,83 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)

#endregion

var characterAddressMap = MemoryHandler.Instance.GetByteArray(MemoryHandler.Instance.SigScanner.Locations["ACTORMAP"], 4000);
var sourceData = new List<byte[]>();
for (var i = 0; i <= 1000; i += 4)
var endianSize = 4;
var limit = 1372;
var chunkSize = endianSize * limit;

var characterAddressMap = MemoryHandler.Instance.GetByteArray(MemoryHandler.Instance.SigScanner.Locations["CHARMAP"], chunkSize);

var uniqueAddresses = new Dictionary<UInt32, UInt32>();

for (var i = 0; i <= (chunkSize / endianSize); i += endianSize)
{
var characterAddress = BitConverter.ToUInt32(characterAddressMap, i);
if (characterAddress == 0)
{
continue;
}
sourceData.Add(MemoryHandler.Instance.GetByteArray(characterAddress, 0x3F40));
uniqueAddresses[characterAddress] = characterAddress;
}

var sourceData = uniqueAddresses.Select(kvp => MemoryHandler.Instance.GetByteArray(kvp.Value, 0x3F40))
.ToList();

#region ActorEntity Handlers

var firstTime = true;

var monsterEntries = new List<ActorEntity>();
var pcEntries = new List<ActorEntity>();
var npcEntries = new List<ActorEntity>();
for (var i = 0; i < sourceData.Count; i++)
{
try
{
var source = sourceData[i];
//var source = MemoryHandler.Instance.GetByteArray(characterAddress, 0x3F40);
var entry = ActorEntityHelper.ResolveActorFromBytes(source);
var entry = ActorEntityHelper.ResolveActorFromBytes(source, firstTime);

firstTime = false;

//var actor = MemoryHandler.Instance.GetStructureFromBytes<Structures.NPCEntry>(source);
//var actor = MemoryHandler.Instance.GetStructure<Structures.NPCEntry>(characterAddress);
//var name = MemoryHandler.Instance.GetString(characterAddress, 48);
//var entry = ActorEntityHelper.ResolveActorFromMemory(actor, name);
entry.MapIndex = mapIndex;
if (i == 0)
{
var name = Settings.Default.CharacterName;
if (name != entry.Name || String.IsNullOrWhiteSpace(name))
{
Settings.Default.CharacterName = entry.Name;
}
if (targetAddress > 0)
{
uint currentTargetID;
var targetInfoSource = MemoryHandler.Instance.GetByteArray(targetAddress, 128);
switch (Settings.Default.GameLanguage)
{
case "Chinese":
currentTargetID = BitConverter.ToUInt32(targetInfoSource, 0x68);
break;
default:
currentTargetID = BitConverter.ToUInt32(targetInfoSource, 0x68);
break;
}
entry.TargetID = (int) currentTargetID;
}
}
if (!entry.IsValid)
{
continue;
}
switch (entry.Type)
{
case Actor.Type.Monster:
monsterEntries.Add(entry);
break;
case Actor.Type.PC:
pcEntries.Add(entry);
break;
default:
npcEntries.Add(entry);
Expand All @@ -183,6 +228,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
{
}
}
if (pcEntries.Any())
{
AppContextHelper.Instance.RaiseNewPCEntries(pcEntries);
}
if (monsterEntries.Any())
{
AppContextHelper.Instance.RaiseNewMonsterEntries(monsterEntries);
}
if (npcEntries.Any())
{
AppContextHelper.Instance.RaiseNewNPCEntries(npcEntries);
Expand Down
Loading

0 comments on commit 7b98634

Please sign in to comment.