Merge pull request #953 from wabbajack-tools/several-patches

Hotfixes for 2.1.0.2
This commit is contained in:
Timothy Baldridge 2020-07-07 14:03:10 -07:00 committed by GitHub
commit 83f49bab59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 73 additions and 54 deletions

View File

@ -1,5 +1,10 @@
### Changelog
#### Version - 2.1.0.2 - 7/7/2020
* Don't scan the game folder during compilation. If you are compiling and want `Game Folder Files` create it in your MO2 folder and manually place files into it
* Don't throw a hard error on a post-patch hash failure.
* Don't save the VFS cache to disk or load it during compilation. We have other caches that make this mostly worthless
#### Version - 2.1.0.1 - 7/6/2020
* Don't include saves in .wabbajack files
* Don't delete saves from any MO2 profile during installation

View File

@ -6,8 +6,8 @@
<AssemblyName>wabbajack-cli</AssemblyName>
<Company>Wabbajack</Company>
<Platforms>x64</Platforms>
<AssemblyVersion>2.1.0.1</AssemblyVersion>
<FileVersion>2.1.0.1</FileVersion>
<AssemblyVersion>2.1.0.2</AssemblyVersion>
<FileVersion>2.1.0.2</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>An automated ModList installer</Description>
<PublishReadyToRun>true</PublishReadyToRun>

View File

@ -4,8 +4,8 @@
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyVersion>2.1.0.1</AssemblyVersion>
<FileVersion>2.1.0.1</FileVersion>
<AssemblyVersion>2.1.0.2</AssemblyVersion>
<FileVersion>2.1.0.2</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>Wabbajack Application Launcher</Description>
<PublishReadyToRun>true</PublishReadyToRun>

View File

@ -221,7 +221,9 @@ namespace Wabbajack.Lib
Status($"Verifying Patch {toPatch.To.FileName}");
hash = await toFile.FileHashAsync();
if (hash != toPatch.Hash)
throw new InvalidDataException($"Invalid Hash for {toPatch.To} after patching");
{
Utils.Log($"NOTE: Invalid Hash for {toPatch.To} after patching {hash} vs {toPatch.Hash}");
}
});
}

View File

@ -39,7 +39,7 @@ namespace Wabbajack.Lib
{
var v = new T();
v.To = Path;
v.Hash = Hash;
v.Hash = File.Hash;
v.Size = File.Size;
return v;
}

View File

@ -104,9 +104,6 @@ namespace Wabbajack.Lib
if (cancel.IsCancellationRequested) return false;
if (VFSCacheName.Exists)
await VFS.IntegrateFromFile(VFSCacheName);
List<AbsolutePath> roots;
if (UseGamePaths)
{
@ -138,7 +135,6 @@ namespace Wabbajack.Lib
if (cancel.IsCancellationRequested) return false;
await VFS.AddRoots(roots);
await VFS.WriteToFile(VFSCacheName);
if (lootPath.Exists)
{
@ -183,8 +179,7 @@ namespace Wabbajack.Lib
if (cancel.IsCancellationRequested) return false;
UpdateTracker.NextStep("Reindexing downloads after meta inferring");
await VFS.AddRoot(MO2DownloadsFolder);
await VFS.WriteToFile(VFSCacheName);
if (cancel.IsCancellationRequested) return false;
UpdateTracker.NextStep("Pre-validating Archives");
@ -246,27 +241,12 @@ namespace Wabbajack.Lib
});
// If Game Folder Files exists, ignore the game folder
IEnumerable<RawSourceFile> gameFiles;
if (!MO2Folder.Combine(Consts.GameFolderFilesDir).Exists)
{
gameFiles = GamePath.EnumerateFiles()
.Where(p => p.IsFile)
.Where(p => p.Extension!= Consts.HashFileExtension)
.Select(p => new RawSourceFile(VFS.Index.ByRootPath[p],
Consts.GameFolderFilesDir.Combine(p.RelativeTo(GamePath))));
}
else
{
gameFiles = new List<RawSourceFile>();
}
IndexedFiles = IndexedArchives.SelectMany(f => f.File.ThisAndAllChildren)
.OrderBy(f => f.NestingFactor)
.GroupBy(f => f.Hash)
.ToDictionary(f => f.Key, f => f.AsEnumerable());
AllFiles.SetTo(mo2Files.Concat(gameFiles)
AllFiles.SetTo(mo2Files
.Concat(lootFiles)
.DistinctBy(f => f.Path));

View File

@ -54,27 +54,30 @@ namespace Wabbajack.BuildServer.Controllers
}
[HttpGet]
[Route("badge/{name}/badge.json")]
public async Task<IActionResult> MetricsGitHubBadge(string name)
[Route("badge/{name}/total_installs_badge.json")]
public async Task<IActionResult> TotalInstallsBadge(string name)
{
var results = (await _sql.MetricsReport("finish_install"))
.GroupBy(m => m.Subject)
.Select(g => new MetricResult
{
SeriesName = g.Key,
Labels = g.Select(m => m.Date.ToString(CultureInfo.InvariantCulture)).ToList(),
Values = g.Select(m => m.Count).ToList()
}).ToList();
var results = await _sql.TotalInstalls(name);
Response.ContentType = "application/json";
return Ok(results == 0
? new Badge($"Modlist {name} not found!", "Error") {color = "red"}
: new Badge("Installations: ", $"{results}") {color = "green"});
}
[HttpGet]
[Route("badge/{name}/unique_installs_badge.json")]
public async Task<IActionResult> UniqueInstallsBadge(string name)
{
var results = await _sql.UniqueInstalls(name);
Response.ContentType = "application/json";
var modlist =
results.FirstOrDefault(x => x.SeriesName.Equals(name, StringComparison.InvariantCultureIgnoreCase));
return Ok(modlist == null
? new Badge($"Modlist {name} not found!", "Error") {color = "red"}.ToJson()
: new Badge("Installations: ", $"{modlist.Values.Aggregate((x, y) => x + y)}").ToJson());
}
return Ok(results == 0
? new Badge($"Modlist {name} not found!", "Error") {color = "red"}
: new Badge("Installations: ", $"{results}"){color = "green"}) ;
}
private static readonly Func<object, string> ReportTemplate = NettleEngine.GetCompiler().Compile(@"
<html><body>

View File

@ -72,5 +72,27 @@ namespace Wabbajack.Server.DataLayer
return (await conn.QueryAsync<string>("SELECT TOP(1) MetricsKey from Metrics Where MetricsKey = @MetricsKey",
new {MetricsKey = metricsKey})).FirstOrDefault() != null;
}
public async Task<long> UniqueInstalls(string machineUrl)
{
await using var conn = await Open();
return await conn.QueryFirstAsync<long>(
@"SELECT COUNT(*) FROM (
SELECT DISTINCT MetricsKey from dbo.Metrics where Action = 'finish_install' and GroupingSubject in (
SELECT JSON_VALUE(Metadata, '$.title') FROM dbo.ModLists
WHERE JSON_VALUE(Metadata, '$.links.machineURL') = @MachineURL)) s",
new {MachineURL = machineUrl});
}
public async Task<long> TotalInstalls(string machineUrl)
{
await using var conn = await Open();
return await conn.QueryFirstAsync<long>(
@"SELECT COUNT(*) from dbo.Metrics where Action = 'finish_install' and GroupingSubject in (
SELECT JSON_VALUE(Metadata, '$.title') FROM dbo.ModLists
WHERE JSON_VALUE(Metadata, '$.links.machineURL') = @MachineURL)",
new {MachineURL = machineUrl});
}
}
}

View File

@ -128,14 +128,14 @@ namespace Wabbajack.Server.Services
foreach (var patch in patches)
{
_logger.LogInformation($"Cleaning patch {patch.Src.Archive.Hash} -> {patch.Dest.Archive.Hash}");
/*
await _discordWebHook.Send(Channel.Ham,
new DiscordMessage
{
Content =
$"Removing patch from {patch.Src.Archive.State.PrimaryKeyString} to {patch.Dest.Archive.State.PrimaryKeyString} due it no longer being required by curated lists"
});
*/
if (!await DeleteFromCDN(client, PatchName(patch)))
{
_logger.LogWarning($"Patch file didn't exist {PatchName(patch)}");

View File

@ -3,8 +3,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>2.1.0.1</AssemblyVersion>
<FileVersion>2.1.0.1</FileVersion>
<AssemblyVersion>2.1.0.2</AssemblyVersion>
<FileVersion>2.1.0.2</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>Wabbajack Server</Description>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>

View File

@ -9,6 +9,7 @@ using Wabbajack.Lib;
using Wabbajack.Lib.CompilationSteps.CompilationErrors;
using Xunit;
using Xunit.Abstractions;
using Xunit.Sdk;
using File = Alphaleonis.Win32.Filesystem.File;
using Path = Alphaleonis.Win32.Filesystem.Path;
@ -63,7 +64,7 @@ namespace Wabbajack.Test
[Fact]
public async Task TestDirectMatchFromGameFolder()
{
// This code is disabled, but we'll still test for it in case it somehow gets re-enabled in the future
var profile = utils.AddProfile();
var mod = await utils.AddMod();
var testPex = await utils.AddGameFile(@"enbstuff\test.pex", 10);
@ -75,7 +76,8 @@ namespace Wabbajack.Test
await CompileAndInstall(profile, useGameFiles: true);
await utils.VerifyInstalledGameFile(@"enbstuff\test.pex");
// This should fail
await Assert.ThrowsAsync<TrueException>(async () => await utils.VerifyInstalledGameFile(@"enbstuff\test.pex"));
}
[Fact]
@ -533,6 +535,8 @@ namespace Wabbajack.Test
await utils.VerifyInstalledFile(mod, @"Data\SkyrimSE\Update.esm.old");
await utils.VerifyInstalledFile(mod, @"Data\SkyrimSE\Update.esm");
Assert.False(utils.InstallFolder.Combine(Consts.GameFolderFilesDir).IsDirectory);
}

View File

@ -356,7 +356,10 @@ namespace Wabbajack.VirtualFileSystem
public async Task<IndexRoot> Integrate(ICollection<VirtualFile> files)
{
Utils.Log($"Integrating {files.Count} files");
var allFiles = AllFiles.Concat(files).GroupBy(f => f.FullPath).Select(g => g.Last()).ToImmutableList();
var allFiles = AllFiles.Concat(files)
.OrderByDescending(f => f.LastModified)
.GroupBy(f => f.FullPath).Select(g => g.Last())
.ToImmutableList();
var byFullPath = Task.Run(() => allFiles.SelectMany(f => f.ThisAndAllChildren)
.ToDictionary(f => f.FullPath));

View File

@ -6,8 +6,8 @@
<UseWPF>true</UseWPF>
<Platforms>x64</Platforms>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<AssemblyVersion>2.1.0.1</AssemblyVersion>
<FileVersion>2.1.0.1</FileVersion>
<AssemblyVersion>2.1.0.2</AssemblyVersion>
<FileVersion>2.1.0.2</FileVersion>
<Copyright>Copyright © 2019-2020</Copyright>
<Description>An automated ModList installer</Description>
<PublishReadyToRun>true</PublishReadyToRun>