Skip to content

Commit

Permalink
dependency updates, cleaned up some code; turned of spinner when upda…
Browse files Browse the repository at this point in the history
…te checks were done
  • Loading branch information
Icehunter committed Aug 6, 2017
1 parent ff1f48d commit dfb2107
Show file tree
Hide file tree
Showing 28 changed files with 216 additions and 99 deletions.
35 changes: 23 additions & 12 deletions FFXIVAPP.Client/FFXIVAPP.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\ffxivapp-props\FFXIVAPP.Common.props" />
<Import Project="..\..\ffxivapp-props\FFXIVAPP.IPluginInterface.props" />
<Import Project="..\..\ffxivapp-props\FFXIVAPP.ResourceFiles.props" />
<Import Project="..\..\ffxivapp-props\Machina.props" />
<Import Project="..\..\ffxivapp-props\Sharlayan.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down Expand Up @@ -67,21 +72,25 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="FFXIVAPP.Common, Version=4.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.Common.4.0.2\lib\net461\FFXIVAPP.Common.dll</HintPath>
<Reference Include="FFXIVAPP.Common, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.Common.4.0.3\lib\NET461\FFXIVAPP.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FFXIVAPP.IPluginInterface, Version=4.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.IPluginInterface.4.0.2\lib\net461\FFXIVAPP.IPluginInterface.dll</HintPath>
<Reference Include="FFXIVAPP.IPluginInterface, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.IPluginInterface.4.0.3\lib\NET461\FFXIVAPP.IPluginInterface.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FFXIVAPP.ResourceFiles, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.ResourceFiles.1.0.1\lib\net461\FFXIVAPP.ResourceFiles.dll</HintPath>
<Reference Include="FFXIVAPP.ResourceFiles, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FFXIVAPP.ResourceFiles.1.0.2\lib\NET461\FFXIVAPP.ResourceFiles.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Machina, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machina.1.0.3\lib\NET461\Machina.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="Machina, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Machina.1.0.2\lib\net461\Machina.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
Expand All @@ -97,13 +106,14 @@
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.11\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="Sharlayan, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sharlayan.3.0.1\lib\net461\Sharlayan.dll</HintPath>
<Reference Include="Sharlayan, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sharlayan.4.0.0\lib\net461\Sharlayan.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -260,7 +270,7 @@
</Resource>
<Resource Include="Defaults\ChatHistory.xml" />
<Resource Include="Defaults\Settings.xml" />
<None Include="FodyWeavers.xml" />
<Resource Include="FodyWeavers.xml" />
<Content Include="Licenses\License.NAudio.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand All @@ -283,6 +293,7 @@
<None Include="app.manifest">
<SubType>Designer</SubType>
</None>
<None Include="NLog.config" />
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
Expand Down
1 change: 1 addition & 0 deletions FFXIVAPP.Client/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura/>
</Weavers>
68 changes: 41 additions & 27 deletions FFXIVAPP.Client/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ public static void LoadAvailablePlugins()
UpdateView.View.AvailableLoadingInformation.Visibility = Visibility.Visible;
UpdateViewModel.Instance.AvailablePlugins.Clear();

Func<bool> updateCheck = delegate
UpdateView.View.PluginUpdateSpinner.Spin = true;
ShellView.View.PluginUpdateSpinner.Spin = true;

Func<bool> update = delegate
{
var pluginSourceList = new List<PluginSourceItem>();
try
Expand All @@ -279,20 +282,24 @@ public static void LoadAvailablePlugins()
if (httpResponse.StatusCode == HttpStatusCode.OK || !String.IsNullOrWhiteSpace(responseText))
{
var jsonResult = JArray.Parse(responseText);
pluginSourceList.AddRange(from item in jsonResult
let name = item["Name"]
.ToString()
let enabled = Boolean.Parse(item["Enabled"]
.ToString())
let sourceURI = item["SourceURI"]
.ToString()
where enabled
select new PluginSourceItem
{
Enabled = enabled,
Key = Guid.NewGuid(),
SourceURI = sourceURI
});
foreach (var jToken in jsonResult)
{
bool enabled;
bool.TryParse(jToken["Enabled"]
.ToString(), out enabled);
var sourceURI = jToken["SourceURI"]
.ToString();

if (enabled)
{
pluginSourceList.Add(new PluginSourceItem
{
Enabled = true,
Key = Guid.NewGuid(),
SourceURI = sourceURI
});
}
}
}
}
}
Expand Down Expand Up @@ -394,20 +401,26 @@ where enabled
{
Logging.Log(Logger, new LogItem(ex, true));
}
DispatcherHelper.Invoke(delegate
{
if (UpdateView.View.AvailableDG.Items.Count == UpdateViewModel.Instance.AvailablePlugins.Count)
{
UpdateView.View.AvailableLoadingInformation.Visibility = Visibility.Collapsed;
}
UpdateView.View.AvailableDG.Items.Refresh();
UpdateViewModel.Instance.SetupGrouping();
});
}
}

DispatcherHelper.Invoke(delegate
{
if (UpdateView.View.AvailableDG.Items.Count == UpdateViewModel.Instance.AvailablePlugins.Count)
{
UpdateView.View.AvailableLoadingInformation.Visibility = Visibility.Collapsed;
}
UpdateView.View.AvailableDG.Items.Refresh();

UpdateViewModel.Instance.SetupGrouping();

UpdateView.View.PluginUpdateSpinner.Spin = false;
ShellView.View.PluginUpdateSpinner.Spin = false;
});

return true;
};
updateCheck.BeginInvoke(null, null);
update.BeginInvoke(delegate { }, update);
}

/// <summary>
Expand Down Expand Up @@ -480,7 +493,8 @@ public static void CheckUpdates()
{
Logging.Log(Logger, new LogItem(ex, true));
}
Func<bool> updateCheck = delegate

Func<bool> update = delegate
{
var current = Assembly.GetExecutingAssembly()
.GetName()
Expand Down Expand Up @@ -561,7 +575,7 @@ public static void CheckUpdates()
}
return true;
};
updateCheck.BeginInvoke(null, null);
update.BeginInvoke(delegate { }, update);
}

/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/ActorWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 100;
if (Double.TryParse(Settings.Default.ActorWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetActors();

Expand Down Expand Up @@ -164,7 +166,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
35 changes: 19 additions & 16 deletions FFXIVAPP.Client/Memory/ChatLogWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,34 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 250;
if (Double.TryParse(Settings.Default.ChatLogWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate
{
var readResult = Reader.GetChatLog(_previousArrayIndex, _previousOffset);

_previousArrayIndex = readResult.PreviousArrayIndex;
_previousOffset = readResult.PreviousOffset;

#region Notifications

foreach (var chatLogEntry in readResult.ChatLogEntries)
Func<bool> scanner = delegate
{
AppContextHelper.Instance.RaiseNewChatLogEntry(chatLogEntry);
}
var readResult = Reader.GetChatLog(_previousArrayIndex, _previousOffset);

#endregion
_previousArrayIndex = readResult.PreviousArrayIndex;
_previousOffset = readResult.PreviousOffset;

_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
#region Notifications

foreach (var chatLogEntry in readResult.ChatLogEntries)
{
AppContextHelper.Instance.RaiseNewChatLogEntry(chatLogEntry);
}

#endregion

_isScanning = false;
return true;
};
scanner.BeginInvoke(delegate { }, scanner);
}
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/HotBarRecastWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 100;
if (Double.TryParse(Settings.Default.HotBarRecastWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetActions();

Expand All @@ -113,7 +115,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/InventoryWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 100;
if (Double.TryParse(Settings.Default.InventoryWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetInventoryItems();

Expand All @@ -113,7 +115,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/PartyInfoWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 1000;
if (Double.TryParse(Settings.Default.PartyInfoWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetPartyMembers();

Expand All @@ -102,7 +104,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/PlayerInfoWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 1000;
if (Double.TryParse(Settings.Default.PlayerInfoWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetPlayerInfo();

Expand All @@ -81,7 +83,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
6 changes: 4 additions & 2 deletions FFXIVAPP.Client/Memory/TargetWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
return;
}
_isScanning = true;

double refresh = 100;
if (Double.TryParse(Settings.Default.TargetWorkerRefresh.ToString(CultureInfo.InvariantCulture), out refresh))
{
_scanTimer.Interval = refresh;
}
Func<bool> scannerWorker = delegate

Func<bool> scanner = delegate
{
var readResult = Reader.GetTargetInfo();

Expand All @@ -81,7 +83,7 @@ private void ScanTimerElapsed(object sender, ElapsedEventArgs e)
_isScanning = false;
return true;
};
scannerWorker.BeginInvoke(delegate { }, scannerWorker);
scanner.BeginInvoke(delegate { }, scanner);
}

#endregion
Expand Down
Loading

0 comments on commit dfb2107

Please sign in to comment.