Skip to content

Commit

Permalink
dependency update
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wilson <syndicated.life@gmail.com>
  • Loading branch information
Icehunter committed Jul 11, 2017
1 parent 3280872 commit 1a4878b
Show file tree
Hide file tree
Showing 52 changed files with 8,067 additions and 3,946 deletions.
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private static void SettingsPropertyChanged(object sender, PropertyChangedEventA
Common.Constants.EnableNetworkReading = Constants.EnableNetworkReading = Settings.Default.EnableNetworkReading;
if (Settings.Default.EnableNetworkReading)
{
if (!Initializer.NetworkWorking)
if (!Initializer.NetworkWorking && Constants.IsOpen)
{
Initializer.StartNetworkWorker();
}
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/AppBootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
using FFXIVAPP.Client.Views;
using FFXIVAPP.Common.Models;
using FFXIVAPP.Common.Utilities;
using FFXIVAPP.Memory.Models;
using NLog;
using Sharlayan.Models;

namespace FFXIVAPP.Client
{
Expand Down
4 changes: 2 additions & 2 deletions FFXIVAPP.Client/AppViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
using FFXIVAPP.Client.Models;
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Common.Helpers;
using FFXIVAPP.Memory.Core;
using FFXIVAPP.Memory.Models;
using Sharlayan.Core;
using Sharlayan.Models;
using ContextMenu = System.Windows.Forms.ContextMenu;

namespace FFXIVAPP.Client
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using FFXIVAPP.Client.Helpers;
using FFXIVAPP.Common.Core.Constant;
using FFXIVAPP.Common.Helpers;
using FFXIVAPP.Memory.Models;
using Sharlayan.Models;

namespace FFXIVAPP.Client
{
Expand Down
26 changes: 7 additions & 19 deletions FFXIVAPP.Client/FFXIVAPP.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\..\ffxivapp-aio\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Machina, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\ffxivapp-aio\packages\Machina.1.0.1\lib\NET461\Machina.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.2.0.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\..\ffxivapp-aio\packages\MahApps.Metro.1.2.0.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
Expand All @@ -100,6 +103,9 @@
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\..\ffxivapp-aio\packages\NLog.4.4.11\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="Sharlayan, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\ffxivapp-aio\packages\Sharlayan.3.0.0\lib\NET461\Sharlayan.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
Expand Down Expand Up @@ -143,6 +149,7 @@
<Compile Include="Localization\Japanese.cs" />
<Compile Include="Localization\Korean.cs" />
<Compile Include="Localization\Russian.cs" />
<Compile Include="Memory\HotBarRecastWorker.cs" />
<Compile Include="Memory\InventoryWorker.cs" />
<Compile Include="Memory\PartyInfoWorker.cs" />
<Compile Include="Memory\TargetWorker.cs" />
Expand All @@ -164,21 +171,6 @@
<Compile Include="Models\PluginSourceItem.cs" />
<Compile Include="Models\PluginStatus.cs" />
<Compile Include="Models\UILanguage.cs" />
<Compile Include="Network\IPHelper.cs" />
<Compile Include="Network\NetworkWorker.cs" />
<Compile Include="Network\DNSHeader.cs" />
<Compile Include="Network\TCPRow.cs" />
<Compile Include="Network\TCPTable.cs" />
<Compile Include="Network\ServerConnection.cs" />
<Compile Include="Network\SocketObject.cs" />
<Compile Include="Network\IPHeader.cs" />
<Compile Include="Network\NetworkConnection.cs" />
<Compile Include="Network\NetworkPacket.cs" />
<Compile Include="Network\Protocol.cs" />
<Compile Include="Network\TCPHeader.cs" />
<Compile Include="Network\UDPHeader.cs" />
<Compile Include="Network\UnsafeNativeMethods.cs" />
<Compile Include="Network\WinPcapWrapper.cs" />
<Compile Include="PluginHost.cs" />
<Compile Include="Models\PluginInstance.cs" />
<Compile Include="PluginInitializer.cs" />
Expand Down Expand Up @@ -420,10 +412,6 @@
<Project>{56e3fd21-17c4-4306-ba2c-adaf6aaea330}</Project>
<Name>FFXIVAPP.IPluginInterface</Name>
</ProjectReference>
<ProjectReference Include="..\..\ffxivapp-memory\FFXIVAPP.Memory\FFXIVAPP.Memory.csproj">
<Project>{9510d5ef-208a-4897-a582-8eae5c6e9406}</Project>
<Name>FFXIVAPP.Memory</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
Expand Down
8 changes: 7 additions & 1 deletion FFXIVAPP.Client/Helpers/AppContextHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
using System.Linq;
using FFXIVAPP.Common.Core.Constant;
using FFXIVAPP.Common.Core.Network;
using FFXIVAPP.Memory.Core;
using NLog;
using Sharlayan.Core;

namespace FFXIVAPP.Client.Helpers
{
Expand Down Expand Up @@ -79,6 +79,12 @@ public void RaiseNewInventoryEntries(List<InventoryEntity> inventoryEntities)
PluginHost.Instance.RaiseNewInventoryEntries(inventoryEntities);
}

public void RaiseNewActionEntities(List<ActionEntity> actionEntities)
{
// THIRD PARTY
PluginHost.Instance.RaiseNewActionEntities(actionEntities);
}

#region Property Backings

private static AppContextHelper _instance;
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Helpers/SavedlLogsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static bool SaveCurrentLog(bool isTemporary = true)
{
if (savedSayBuilder.Length > 0)
{
var path = Path.Combine(AppViewModel.Instance.LogsPath, "Say", savedTextLogName);
var path = Path.Combine(AppViewModel.Instance.LogsPath, "Say", savedTextLogName);
File.WriteAllText(path, savedSayBuilder.ToString());
}
if (savedShoutBuilder.Length > 0)
Expand Down
94 changes: 70 additions & 24 deletions FFXIVAPP.Client/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,30 @@
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows;
using System.Xml.Linq;
using FFXIVAPP.Client.Helpers;
using FFXIVAPP.Client.Memory;
using FFXIVAPP.Client.Models;
using FFXIVAPP.Client.Network;
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Client.Utilities;
using FFXIVAPP.Client.ViewModels;
using FFXIVAPP.Client.Views;
using FFXIVAPP.Common.Core.Constant;
using FFXIVAPP.Common.Core.Network;
using FFXIVAPP.Common.Helpers;
using FFXIVAPP.Common.Models;
using FFXIVAPP.Common.RegularExpressions;
using FFXIVAPP.Common.Utilities;
using FFXIVAPP.Memory;
using FFXIVAPP.Memory.Models;
using Machina;
using Machina.Models;
using Newtonsoft.Json.Linq;
using NLog;
using Sharlayan;
using Sharlayan.Events;
using Sharlayan.Models;
using Application = System.Windows.Forms.Application;
using NetworkPacket = FFXIVAPP.Common.Core.Network.NetworkPacket;

namespace FFXIVAPP.Client
{
Expand All @@ -59,7 +63,7 @@ internal static class Initializer

public static bool NetworkWorking
{
get { return _networkWorker != null; }
get { return NetworkHandler.Instance.IsRunning; }
}

/// <summary>
Expand Down Expand Up @@ -675,7 +679,7 @@ public static void ResetProcessID()

/// <summary>
/// </summary>
/// <param name="pid"> </param>
/// <param name="processModel"> </param>
private static void UpdateProcessID(ProcessModel processModel)
{
Constants.ProcessModel = processModel;
Expand All @@ -699,8 +703,10 @@ public static void StartMemoryWorkers()
return;
}

MemoryHandler.Instance.SetProcess(Constants.ProcessModel, Settings.Default.GameLanguage, "latest", !Settings.Default.CacheMemoryJSONData);
MemoryHandler.Instance.ExceptionEvent += MemoryHandler_ExceptionEvent;
MemoryHandler.Instance.SignaturesFoundEvent += MemoryHandler_SignaturesFoundEvent;

MemoryHandler.Instance.SetProcess(Constants.ProcessModel, Settings.Default.GameLanguage, "latest", !Settings.Default.CacheMemoryJSONData);

_chatLogWorker = new ChatLogWorker();
_chatLogWorker.StartScanning();
Expand All @@ -714,13 +720,16 @@ public static void StartMemoryWorkers()
_partyInfoWorker.StartScanning();
_inventoryWorker = new InventoryWorker();
_inventoryWorker.StartScanning();
_hotBarRecastWorker = new HotBarRecastWorker();
_hotBarRecastWorker.StartScanning();
}

/// <summary>
/// </summary>
public static void StopMemoryWorkers()
{
MemoryHandler.Instance.ExceptionEvent -= MemoryHandler_ExceptionEvent;
MemoryHandler.Instance.SignaturesFoundEvent -= MemoryHandler_SignaturesFoundEvent;

if (_chatLogWorker != null)
{
Expand Down Expand Up @@ -752,13 +761,26 @@ public static void StopMemoryWorkers()
_inventoryWorker.StopScanning();
_inventoryWorker.Dispose();
}
if (_hotBarRecastWorker != null)
{
_hotBarRecastWorker.StopScanning();
_hotBarRecastWorker.Dispose();
}
}
private static void MemoryHandler_ExceptionEvent(object sender, FFXIVAPP.Memory.Events.ExceptionEvent e)

private static void MemoryHandler_ExceptionEvent(object sender, ExceptionEvent e)
{
Logging.Log(e.Logger, new LogItem(e.Exception, e.LevelIsError));
}

private static void MemoryHandler_SignaturesFoundEvent(object sender, SignaturesFoundEvent e)
{
foreach (var kvp in e.Signatures)
{
Logging.Log(e.Logger, new LogItem($"Signature [{kvp.Key}] Found At Address: [{((IntPtr) kvp.Value).ToString("X")}]"));
}
}

public static void RefreshMemoryWorkers()
{
StopMemoryWorkers();
Expand All @@ -767,32 +789,56 @@ public static void RefreshMemoryWorkers()

public static void StartNetworkWorker()
{
RefreshNetworkWorker();
StopNetworkWorker();

NetworkHandler.Instance.ExceptionEvent += NetworkHandler_ExceptionEvent;
NetworkHandler.Instance.NewNetworkPacketEvent += NetworkHandler_NewPacketEvent;

var config = new NetworkConfig();
config.ApplicationName = AssemblyHelper.Name;
config.CurrentProcessID = Constants.ProcessModel.ProcessID;
config.ExecutablePath = Application.ExecutablePath;
config.UserSelectedInterface = Settings.Default.DefaultNetworkInterface;
config.UseWinPCap = Settings.Default.NetworkUseWinPCap;

NetworkHandler.Instance.SetProcess(config);

NetworkHandler.Instance.StartDecrypting();
}

public static void StopNetworkWorker()
{
if (NetworkWorking)
{
_networkWorker.StopScanning();
_networkWorker.Dispose();
_networkWorker = null;
}
NetworkHandler.Instance.ExceptionEvent -= NetworkHandler_ExceptionEvent;
NetworkHandler.Instance.NewNetworkPacketEvent -= NetworkHandler_NewPacketEvent;

NetworkHandler.Instance.StopDecrypting();
}

public static void RefreshNetworkWorker()
private static void NetworkHandler_ExceptionEvent(object sender, Machina.Events.ExceptionEvent e)
{
var thread = new Thread(StartNetworkingThread);
thread.Start();
Logging.Log(e.Logger, new LogItem(e.Exception, e.LevelIsError));
}

private static void StartNetworkingThread()
private static void NetworkHandler_NewPacketEvent(object sender, Machina.Events.NewNetworkPacketEvent e)
{
StopNetworkWorker();
_networkWorker = new NetworkWorker();
_networkWorker.StartScanning();
var packet = e.NetworkPacket;

AppContextHelper.Instance.RaiseNewPacket(new NetworkPacket
{
Buffer = packet.Buffer,
CurrentPosition = packet.CurrentPosition,
Key = packet.Key,
MessageSize = packet.MessageSize,
PacketDate = packet.PacketDate
});
}

public static void RefreshNetworkWorker()
{
StopNetworkWorker();
StartNetworkWorker();
}

#region Declarations

private static ActorWorker _actorWorker;
Expand All @@ -801,7 +847,7 @@ private static void StartNetworkingThread()
private static TargetWorker _targetWorker;
private static PartyInfoWorker _partyInfoWorker;
private static InventoryWorker _inventoryWorker;
private static NetworkWorker _networkWorker;
private static HotBarRecastWorker _hotBarRecastWorker;

#endregion
}
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Memory/ActorWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
using System.Timers;
using FFXIVAPP.Client.Helpers;
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Memory;
using NLog;
using Sharlayan;

namespace FFXIVAPP.Client.Memory
{
Expand Down
2 changes: 1 addition & 1 deletion FFXIVAPP.Client/Memory/ChatLogWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
using System.Timers;
using FFXIVAPP.Client.Helpers;
using FFXIVAPP.Client.Properties;
using FFXIVAPP.Memory;
using NLog;
using Sharlayan;

namespace FFXIVAPP.Client.Memory
{
Expand Down

0 comments on commit 1a4878b

Please sign in to comment.