Compare commits

..

No commits in common. "fc6b574f47c004f2494101698ef7ee7e4d4b9705" and "291ff54101857894499e9b7b6064393a37d507cb" have entirely different histories.

4 changed files with 14 additions and 23 deletions

View File

@ -4,8 +4,8 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyVersion>2.15.4</AssemblyVersion> <AssemblyVersion>2.15.3</AssemblyVersion>
<FileVersion>2.15.4</FileVersion> <FileVersion>2.15.3</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AvaloniaResource Include="Assets\**" /> <AvaloniaResource Include="Assets\**" />

View File

@ -4,8 +4,8 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyVersion>2.15.4</AssemblyVersion> <AssemblyVersion>2.15.3</AssemblyVersion>
<FileVersion>2.15.4</FileVersion> <FileVersion>2.15.3</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -42,6 +42,8 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Resources\PatchClient.exe" /> <EmbeddedResource Include="..\..\..\..\..\Downloads\PatchClient.exe">
<Link>Resources\PatchClient.exe</Link>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -483,10 +483,10 @@ namespace PatcherUtils
if (sourceFile == null) if (sourceFile == null)
{ {
patchingTokenSource.Cancel();
errorsQueue.Enqueue(new PatchMessage( errorsQueue.Enqueue(new PatchMessage(
$"Failed to find matching source file for '{deltaFile.FullName}'", $"Failed to find matching source file for '{deltaFile.FullName}'",
PatcherExitCode.MissingFile)); PatcherExitCode.MissingFile));
patchingTokenSource.Cancel();
return; return;
} }
@ -495,8 +495,8 @@ namespace PatcherUtils
if (!result.Item1) if (!result.Item1)
{ {
errorsQueue.Enqueue(new PatchMessage(result.Item2, PatcherExitCode.PatchFailed));
patchingTokenSource.Cancel(); patchingTokenSource.Cancel();
errorsQueue.Enqueue(new PatchMessage(result.Item2, PatcherExitCode.PatchFailed));
return; return;
} }
@ -520,9 +520,9 @@ namespace PatcherUtils
} }
catch (Exception ex) catch (Exception ex)
{ {
patchingTokenSource.Cancel();
PatchLogger.LogException(ex); PatchLogger.LogException(ex);
errorsQueue.Enqueue(new PatchMessage(ex.Message, PatcherExitCode.PatchFailed)); errorsQueue.Enqueue(new PatchMessage(ex.Message, PatcherExitCode.PatchFailed));
patchingTokenSource.Cancel();
return; return;
} }
@ -545,9 +545,9 @@ namespace PatcherUtils
} }
catch (Exception ex) catch (Exception ex)
{ {
patchingTokenSource.Cancel();
PatchLogger.LogException(ex); PatchLogger.LogException(ex);
errorsQueue.Enqueue(new PatchMessage(ex.Message, PatcherExitCode.PatchFailed)); errorsQueue.Enqueue(new PatchMessage(ex.Message, PatcherExitCode.PatchFailed));
patchingTokenSource.Cancel();
return; return;
} }
@ -573,23 +573,12 @@ namespace PatcherUtils
if (errorsQueue.Count > 0) if (errorsQueue.Count > 0)
{ {
PatchLogger.LogError($"Error queue entry count: {errorsQueue.Count}"); PatchLogger.LogError($"Error queue entry count: {errorsQueue.Count}");
PatchLogger.LogError("Dequeuing errors"); if (!errorsQueue.TryDequeue(out PatchMessage error))
PatchMessage error = null;
for (int i = 0; i < errorsQueue.Count; i++)
{ {
if (!errorsQueue.TryDequeue(out error)) return new PatchMessage("Errors occurred during patching, but we couldn't dequeue them :(\n\nThere may be more information in the log", PatcherExitCode.PatchFailed);
{
return new PatchMessage(
"Errors occurred during patching, but we couldn't dequeue them :(\n\nThere may be more information in the log",
PatcherExitCode.PatchFailed);
}
PatchLogger.LogError(error.Message);
} }
return error ?? new PatchMessage("Something went wrong :(", PatcherExitCode.PatchFailed); return error;
} }
PatchLogger.LogInfo("::: Patching Complete :::"); PatchLogger.LogInfo("::: Patching Complete :::");