Permalink
Browse files

- updated all 3rd party packages and depending code

- removed / solved a lot of warnings
- updated some async code
- minor cleanups
  • Loading branch information...
1 parent cbbc036 commit 99b22f637b7a48410a3b87563cc2eb7ce9e37339 @remcoros remcoros committed Jul 22, 2015
Showing with 1,427 additions and 934 deletions.
  1. BIN .build/MSBuild.Community.Tasks.dll
  2. +155 −155 .build/MSBuild.Community.Tasks.targets
  3. +1 −0 .gitignore
  4. +11 −10 Capture/Capture.csproj
  5. +1 −5 Capture/FodyWeavers.xml
  6. +0 −6 Capture/Hook/DXHookD3D9.cs
  7. +2 −4 Capture/Hook/DXHookD3D9SharedMem.cs
  8. +0 −2 Capture/Hook/DXHookD3D9Simple.cs
  9. +1 −3 Capture/Interface/CaptureInterface.cs
  10. +16 −0 Capture/app.config
  11. +4 −4 Capture/packages.config
  12. +2 −2 HearthCap.Core/GameCapture/AutoCaptureEngine.cs
  13. +11 −33 HearthCap.Core/GameCapture/HS/HSImageScanner.cs
  14. +47 −8 HearthCap.Core/GameCapture/HS/ScanArea.cs
  15. +1 −4 HearthCap.Core/GameCapture/LogCaptureEngine.cs
  16. +12 −11 HearthCap.Core/HearthCap.Core.csproj
  17. +16 −0 HearthCap.Core/app.config
  18. +3 −3 HearthCap.Core/packages.config
  19. +0 −2 HearthCap.Data/App.config
  20. +6 −5 HearthCap.Data/HearthCap.Data.csproj
  21. +2 −2 HearthCap.Data/packages.config
  22. +8 −7 HearthCap.Updater/HearthCap.Updater.csproj
  23. +3 −3 HearthCap.Updater/packages.config
  24. +359 −8 HearthCap.sln.DotSettings
  25. +54 −54 HearthCap/App.config
  26. +3 −9 HearthCap/Features/Analytics/HsAnalyticsSession.cs
  27. +1 −1 HearthCap/Features/Analytics/HsTrackerEnvironment.cs
  28. +31 −9 HearthCap/Features/Analytics/Tracker.cs
  29. +7 −16 HearthCap/Features/ArenaSessions/ArenaSessionsViewModel.cs
  30. +141 −147 HearthCap/Features/ArenaSessions/CurrentSessionFlyoutViewModel.cs
  31. +0 −4 HearthCap/Features/BalloonSettings/BalloonSettingsViewModel.cs
  32. +1 −1 HearthCap/Features/Charts/ChartsViewModel.cs
  33. +3 −2 HearthCap/Features/Charts/ImprovementChartsView.xaml
  34. +78 −75 HearthCap/Features/Charts/ImprovementChartsViewModel.cs
  35. +0 −2 HearthCap/Features/Diagnostics/AreaDesigner/AreaDesignerViewModel.cs
  36. +0 −18 HearthCap/Features/Diagnostics/AreaDesigner/ScanAreaModel.cs
  37. +4 −6 HearthCap/Features/Diagnostics/DiagnosisViewModel.cs
  38. +0 −7 HearthCap/Features/Diagnostics/LogExtensions.cs
  39. +2 −2 HearthCap/Features/Diagnostics/LogFlyout/LogFlyoutViewModel.cs
  40. +2 −2 HearthCap/Features/Diagnostics/Tests/TestsView.cs
  41. +1 −1 HearthCap/Features/EngineSettings/EngineSettingsViewModel.cs
  42. +1 −1 HearthCap/Features/GameManager/GameManager.cs
  43. +0 −7 HearthCap/Features/Games/CurrentGame/CurrentGameFlyoutViewModel.cs
  44. +0 −3 HearthCap/Features/Games/EditGame/EditGameFlyoutViewModel.cs
  45. +0 −17 HearthCap/Features/Games/LatestGames/LatestGamesViewModel.cs
  46. +0 −2 HearthCap/Features/Games/Models/GameResultModel.cs
  47. +1 −6 HearthCap/Features/Games/Statistics/FilteredStatsViewModel.cs
  48. +0 −10 HearthCap/Features/Settings/SettingsViewModel.cs
  49. +2 −2 HearthCap/Features/StartHearthstone/StartHearthstoneViewModel.cs
  50. +0 −2 HearthCap/Features/Statistics/HeroStatViewModel.cs
  51. +0 −7 HearthCap/Features/TextFiles/TextFilesViewModel.cs
  52. +0 −7 HearthCap/Features/ThemeSettings/ThemeSettingsViewModel.cs
  53. +1 −11 HearthCap/FodyWeavers.xml
  54. +82 −56 HearthCap/HearthCap.csproj
  55. +3 −8 HearthCap/Logging/AppLogManager.cs
  56. +235 −46 HearthCap/Resources/Icons.xaml
  57. +4 −3 HearthCap/Resources/IntegerUpDown.xaml
  58. +62 −62 HearthCap/Resources/WindowsIcons-license.txt
  59. +0 −1 HearthCap/Shell/ShellView.xaml
  60. +0 −8 HearthCap/Shell/ShellViewModel.cs
  61. +1 −1 HearthCap/Shell/UserPreferences/RegistrySettings.cs
  62. +8 −9 HearthCap/StartUp/AppBootstrapper.cs
  63. +13 −7 HearthCap/StartUp/CrashManager.cs
  64. +21 −21 HearthCap/packages.config
  65. +3 −3 PHash.AForge/PHash.AForge.csproj
  66. +1 −1 PHash.AForge/packages.config
Binary file not shown.
Oops, something went wrong.
View
@@ -40,3 +40,4 @@ installer/Version.nsh
HearthCap.sdf
*.opensdf
ipch/*
+NDependOut/*
@@ -14,7 +14,8 @@
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
- <NuGetPackageImportStamp>d364781d</NuGetPackageImportStamp>
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -47,13 +48,13 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\EasyHook\EasyHook.dll</HintPath>
</Reference>
- <Reference Include="SharpDX, Version=2.6.2.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
+ <Reference Include="SharpDX, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\SharpDX.2.6.2\Bin\DirectX11-Signed-net40\SharpDX.dll</HintPath>
+ <HintPath>$(SharpDXPackageBinDir)\SharpDX.dll</HintPath>
</Reference>
- <Reference Include="SharpDX.Direct3D9, Version=2.6.2.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
+ <Reference Include="SharpDX.Direct3D9, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\SharpDX.2.6.2\Bin\DirectX11-Signed-net40\SharpDX.Direct3D9.dll</HintPath>
+ <HintPath>$(SharpDXPackageBinDir)\SharpDX.Direct3D9.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -111,15 +112,15 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
+ <Import Project="..\packages\Fody.1.29.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.29.0\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
- <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
- <Error Condition="!Exists('..\packages\Fody.1.25.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.25.0\build\Fody.targets'))" />
- <Error Condition="!Exists('..\packages\SharpDX.2.6.2\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SharpDX.2.6.2\build\SharpDX.targets'))" />
+ <Error Condition="!Exists('..\packages\Fody.1.29.0\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.0\build\Fody.targets'))" />
+ <Error Condition="!Exists('..\packages\SharpDX.2.6.3\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SharpDX.2.6.3\build\SharpDX.targets'))" />
</Target>
- <Import Project="..\packages\Fody.1.25.0\build\Fody.targets" Condition="Exists('..\packages\Fody.1.25.0\build\Fody.targets')" />
- <Import Project="..\packages\SharpDX.2.6.2\build\SharpDX.targets" Condition="Exists('..\packages\SharpDX.2.6.2\build\SharpDX.targets')" />
+ <Import Project="..\packages\SharpDX.2.6.3\build\SharpDX.targets" Condition="Exists('..\packages\SharpDX.2.6.3\build\SharpDX.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
@@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
- <Costura>
- <ExcludeAssemblies>
- EasyHook
- </ExcludeAssemblies>
- </Costura>
+ <Costura/>
</Weavers>
@@ -60,8 +60,6 @@ internal class DXHookD3D9 : BaseDXHook
private Surface[] copySurfaces = new Surface[BUFFERS];
- private RetrieveImageDataParams? retrieveParams;
-
private Thread retrieveThread;
private bool supportsDirect3DEx = false;
@@ -88,10 +86,6 @@ internal class DXHookD3D9 : BaseDXHook
private const int BUFFERS = 2;
- private long desiredFrameTime = TimeSpan.FromMilliseconds(1000 / 30).Ticks;
-
- private long lastTime;
-
private Guid? previousRequestId;
#endregion
@@ -63,8 +63,6 @@ internal unsafe class DXHookD3D9SharedMem : BaseDXHook
private Surface[] copySurfaces = new Surface[BUFFERS];
- private RetrieveImageDataParams? retrieveParams;
-
private Thread retrieveThread;
private bool supportsDirect3DEx = false;
@@ -599,7 +597,7 @@ private unsafe void RetrieveImageDataThread()
}
}
}
- catch (AbandonedMutexException ex)
+ catch (AbandonedMutexException)
{
sharedMemMutexes[lastKnown].ReleaseMutex();
continue;
@@ -828,7 +826,7 @@ private void SetupSurfaces(Device device)
{
locked = this.sharedMemMutexes[i].WaitOne(0);
}
- catch (AbandonedMutexException ex)
+ catch (AbandonedMutexException)
{
locked = true;
}
@@ -54,8 +54,6 @@ internal class DXHookD3D9Simple : BaseDXHook
private List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>();
- private bool isUsingPresent;
-
private bool killThread;
private int pitch;
@@ -20,9 +20,7 @@ public class CaptureInterface : MarshalByRefObject
private Action<Screenshot> _completeScreenshot = null;
- private bool _disposed;
-
- private object _lock = new object();
+ private readonly object _lock = new object();
private Guid? _requestId = null;
View
@@ -0,0 +1,16 @@
+<?xml version="1.0"
+ encoding="utf-8"?>
+
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="SharpDX"
+ publicKeyToken="b4dcf0f35e5521f1"
+ culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-2.6.3.0"
+ newVersion="2.6.3.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Costura.Fody" version="1.3.2.0" targetFramework="net40" developmentDependency="true" />
- <package id="Fody" version="1.25.0" targetFramework="net40" developmentDependency="true" />
- <package id="SharpDX" version="2.6.2" targetFramework="net40" />
- <package id="SharpDX.Direct3D9" version="2.6.2" targetFramework="net40" />
+ <package id="Costura.Fody" version="1.3.3.0" targetFramework="net4" developmentDependency="true" />
+ <package id="Fody" version="1.29.0" targetFramework="net4" developmentDependency="true" />
+ <package id="SharpDX" version="2.6.3" targetFramework="net4" />
+ <package id="SharpDX.Direct3D9" version="2.6.3" targetFramework="net4" />
</packages>
@@ -727,7 +727,7 @@ private ScreenshotResource CaptureDirectX(IntPtr wnd)
}
catch (Exception ex)
{
- Log.Debug("Error decoding DirectX pixels: {0}", ex);
+ Log.Debug(ex, "Error decoding DirectX pixels: {0}");
return null;
}
}
@@ -863,7 +863,7 @@ private void DettachHookFromProcess()
{
locked = sharedMemMutexes[i].WaitOne(1000);
}
- catch (AbandonedMutexException ex)
+ catch (AbandonedMutexException)
{
locked = true;
}
@@ -7,9 +7,6 @@ namespace HearthCap.Core.GameCapture.HS
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Runtime.InteropServices;
- using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -25,6 +22,9 @@ namespace HearthCap.Core.GameCapture.HS
using PHash;
+ using Action = System.Action;
+ using LogManager = NLog.LogManager;
+
[Export(typeof(IImageScanner))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class HSImageScanner : IImageScanner,
@@ -100,15 +100,13 @@ public DetectionResult(bool found, int distance)
private int inGameCounter = 0;
- private bool inMenu;
-
private string lastDeck;
private GameMode lastGameMode;
private int lastResolution = 900;
- private static readonly Logger Log = NLog.LogManager.GetCurrentClassLogger();
+ private static readonly Logger Log = LogManager.GetCurrentClassLogger();
private static readonly TraceLogger TraceLog = new TraceLogger(Log);
private bool myturn;
@@ -137,7 +135,7 @@ public DetectionResult(bool found, int distance)
private ScanAreaImageDictionary arenaWinsLookup2;
- private Queue<System.Action> gameModeChangeActionQueue = new Queue<System.Action>();
+ private Queue<Action> gameModeChangeActionQueue = new Queue<Action>();
private bool requestReset;
@@ -151,10 +149,6 @@ public DetectionResult(bool found, int distance)
private bool arenaWinsScanning;
- private string lastVicDetect;
-
- private string lastLossDetect;
-
private CurrentScanState currentScan;
private bool deckScreenshotRequested;
@@ -308,13 +302,13 @@ private string DetectBest(ScanAreaDictionary lookup, string debugkey, int? thres
if (template.ContainsKey(this.lastResolution))
{
matchhash = template[this.lastResolution].Hash;
- rect = template[this.lastResolution].Rect;
+ rect = template[this.lastResolution].Rectangle;
theResolution = this.lastResolution;
}
else if (template.ContainsKey(this.BaseResolution))
{
matchhash = template[this.BaseResolution].Hash;
- rect = template[this.BaseResolution].Rect;
+ rect = template[this.BaseResolution].Rectangle;
theResolution = this.BaseResolution;
}
else
@@ -403,7 +397,7 @@ private DetectionResult Detect(ScanAreaDictionary lookup, string key, IDictionar
var source = this.image;
int distance = -1;
DetectionResult result = new DetectionResult();
- using (var roi = source.Lock(ResolutionHelper.CorrectRectangle(source.Size, area.Rect, theResolution), source.PixelFormat))
+ using (var roi = source.Lock(ResolutionHelper.CorrectRectangle(source.Size, area.Rectangle, theResolution), source.PixelFormat))
{
// var roi = source.Clone(ResolutionHelper.CorrectRectangle(source.Size, area.Rect, theResolution), source.PixelFormat);
//Tuple<byte[], DetectionResult> cached = null;
@@ -691,7 +685,6 @@ private void Reset()
this.gameTurns = 0;
this.roundTurned = false;
this.conceded = false;
- this.inMenu = false;
this.myturn = false;
this.endTime = DateTime.MinValue;
// this.lastDeck = null;
@@ -787,7 +780,7 @@ private void ScanArenaDeckScreenshot()
if (arenadeckScreenshotRequested && gameMode == GameMode.Arena)
{
arenadeckScreenshotRequested = false;
- var deckRect = this.areas["deckarea_arena"][BaseResolution].Rect;
+ var deckRect = this.areas["deckarea_arena"][BaseResolution].Rectangle;
deckRect = ResolutionHelper.CorrectRectangle(this.image.Size, deckRect, BaseResolution);
var deck = this.image.Clone(deckRect, this.image.PixelFormat);
Log.Debug("Arena deck Screenshot Requested. Sending screenshot...");
@@ -840,7 +833,7 @@ private void ScanDeckScreenshot()
if (takeDeckScreenshot)
{
takeDeckScreenshot = false;
- var deckRect = this.areas["deckarea_cards"][BaseResolution].Rect;
+ var deckRect = this.areas["deckarea_cards"][BaseResolution].Rectangle;
deckRect = ResolutionHelper.CorrectRectangle(this.image.Size, deckRect, BaseResolution);
var deck = this.image.Clone(deckRect, this.image.PixelFormat);
Log.Debug("Deck Screenshot Requested. Sending screenshot...");
@@ -1048,7 +1041,6 @@ private void ScanGameModes()
if (!found && this.Detect(this.areas, "quest"))
{
foundGameMode = GameMode.Unknown;
- this.inMenu = true;
found = true;
}
@@ -1219,9 +1211,7 @@ private void ResetFoundVictory()
Log.Debug("ResetFoundVictory called. Was: {0}", this.foundUsing);
this.foundLoss = 0;
this.foundVic = 0;
- this.foundUsing.Clear();
- this.lastLossDetect = null;
- this.lastVicDetect = null;
+ this.foundUsing.Clear();
}
private void ScanVictory()
@@ -1234,84 +1224,72 @@ private void ScanVictory()
if (this.Detect(this.areas, "victory"))
{
this.foundVic++;
- this.lastVicDetect = "victory";
foundUsing.Append("victory|");
}
if (this.Detect(this.areas, "loss"))
{
this.foundLoss++;
- this.lastLossDetect = "loss";
foundUsing.Append("loss|");
}
if (this.Detect(this.areas, "victory_explode"))
{
this.foundVic++;
- this.lastVicDetect = "victory_explode";
foundUsing.Append("victory_explode|");
}
if (this.Detect(this.areas, "victory_explode2"))
{
this.foundVic++;
- this.lastVicDetect = "victory_explode2";
foundUsing.Append("victory_explode2|");
}
if (this.Detect(this.areas, "victory_explode3"))
{
this.foundVic++;
- this.lastVicDetect = "victory_explode3";
foundUsing.Append("victory_explode3|");
}
if (this.Detect(this.areas, "victory_explode4"))
{
this.foundVic++;
- this.lastVicDetect = "victory_explode4";
foundUsing.Append("victory_explode4|");
}
if (this.Detect(this.areas, "victory_explode5"))
{
this.foundVic++;
- this.lastVicDetect = "victory_explode5";
foundUsing.Append("victory_explode5|");
}
if (this.Detect(this.areas, "loss_explode"))
{
this.foundLoss++;
- this.lastLossDetect = "loss_explode";
foundUsing.Append("loss_explode|");
}
if (this.Detect(this.areas, "loss_explode2"))
{
this.foundLoss++;
- this.lastLossDetect = "loss_explode2";
foundUsing.Append("loss_explode2|");
}
if (this.Detect(this.areas, "victory2"))
{
this.foundVic++;
- this.lastVicDetect = "victory2";
foundUsing.Append("victory2|");
}
if (this.Detect(this.areas, "victory3"))
{
this.foundVic++;
- this.lastVicDetect = "victory3";
foundUsing.Append("victory3|");
}
if (this.Detect(this.areas, "loss2"))
{
this.foundLoss++;
- this.lastLossDetect = "loss2";
foundUsing.Append("loss2|");
}
Oops, something went wrong.

0 comments on commit 99b22f6

Please sign in to comment.