From 2ae65688f08d7e766b53f5a66abea322036924fe Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Mon, 30 Mar 2020 14:53:59 -0600 Subject: [PATCH] Fixes and changes to get into 1.1.4.0 --- CHANGELOG.md | 5 ++++- .../Controllers/Heartbeat.cs | 20 +++++++++++++++++++ .../Wabbajack.BuildServer.csproj | 4 ++-- Wabbajack.CLI/Wabbajack.CLI.csproj | 4 ++-- Wabbajack.Launcher/Wabbajack.Launcher.csproj | 4 ++-- Wabbajack.Lib/FileUploader/AuthorAPI.cs | 8 ++++---- 6 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c31d9301..ebefcb3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ ### Changelog -#### Version - Next +#### Version - 3/30/2020 * Added support for Morrowind on GOG +* Fix a bug in the Author file uploader (Sync Error) +* Include symbols in the launcher + #### Version - 1.1.3.0 - 3/23/2020 * Fix for a lack of VC++ Redist dlls on newly installed Windows machines. diff --git a/Wabbajack.BuildServer/Controllers/Heartbeat.cs b/Wabbajack.BuildServer/Controllers/Heartbeat.cs index 823a4ff7..ad7dac79 100644 --- a/Wabbajack.BuildServer/Controllers/Heartbeat.cs +++ b/Wabbajack.BuildServer/Controllers/Heartbeat.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Alphaleonis.Win32.Filesystem; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using MongoDB.Bson; +using MongoDB.Driver; using Wabbajack.BuildServer.Model.Models; using Wabbajack.BuildServer.Models; using Wabbajack.Common; @@ -65,5 +67,23 @@ namespace Wabbajack.BuildServer.Controllers } return Ok(string.Join("\n", lst)); } + + [HttpPost("export_inis")] + [Authorize] + public async Task ExportInis() + { + if (!Directory.Exists("exported_inis")) + Directory.CreateDirectory("exported_inis"); + + var loaded = 0; + foreach (var ini in await Db.DownloadStates.AsQueryable().ToListAsync()) + { + var file = Path.Combine("exported_inis", ini.Hash.FromBase64().ToHex() + ".ini"); + Alphaleonis.Win32.Filesystem.File.WriteAllLines(file, ini.State.GetMetaIni()); + loaded += 1; + } + + return Ok(loaded); + } } } diff --git a/Wabbajack.BuildServer/Wabbajack.BuildServer.csproj b/Wabbajack.BuildServer/Wabbajack.BuildServer.csproj index e5746788..7ce9b762 100644 --- a/Wabbajack.BuildServer/Wabbajack.BuildServer.csproj +++ b/Wabbajack.BuildServer/Wabbajack.BuildServer.csproj @@ -7,8 +7,8 @@ true true win10-x64 - 1.1.2.0 - 1.1.2.0 + 1.1.4.0 + 1.1.4.0 Copyright © 2019-2020 Server component for Wabbajack BuildServer diff --git a/Wabbajack.CLI/Wabbajack.CLI.csproj b/Wabbajack.CLI/Wabbajack.CLI.csproj index d455cdab..177a680f 100644 --- a/Wabbajack.CLI/Wabbajack.CLI.csproj +++ b/Wabbajack.CLI/Wabbajack.CLI.csproj @@ -6,8 +6,8 @@ wabbajack-cli Wabbajack x64 - 1.1.2.0 - 1.1.2.0 + 1.1.4.0 + 1.1.4.0 Copyright © 2019-2020 An automated ModList installer true diff --git a/Wabbajack.Launcher/Wabbajack.Launcher.csproj b/Wabbajack.Launcher/Wabbajack.Launcher.csproj index 80f15bf4..b5050447 100644 --- a/Wabbajack.Launcher/Wabbajack.Launcher.csproj +++ b/Wabbajack.Launcher/Wabbajack.Launcher.csproj @@ -4,8 +4,8 @@ WinExe netcoreapp3.1 true - 1.1.2.0 - 1.1.2.0 + 1.1.4.0 + 1.1.4.0 Copyright © 2019-2020 Wabbajack Application Launcher true diff --git a/Wabbajack.Lib/FileUploader/AuthorAPI.cs b/Wabbajack.Lib/FileUploader/AuthorAPI.cs index 552e5ade..98b6c4e3 100644 --- a/Wabbajack.Lib/FileUploader/AuthorAPI.cs +++ b/Wabbajack.Lib/FileUploader/AuthorAPI.cs @@ -83,16 +83,16 @@ namespace Wabbajack.Lib.FileUploader await fs.ReadAsync(data, 0, data.Length); - response = await client.PutAsync(UploadURL + $"/{key}/data/{block_offset}", + var putResponse = await client.PutAsync(UploadURL + $"/{key}/data/{block_offset}", new ByteArrayContent(data)); - if (!response.IsSuccessStatusCode) + if (!putResponse.IsSuccessStatusCode) { - tcs.SetException(new Exception($"Put Error: {response.StatusCode} {response.ReasonPhrase}")); + tcs.SetException(new Exception($"Put Error: {putResponse.StatusCode} {putResponse.ReasonPhrase}")); return; } - var val = long.Parse(await response.Content.ReadAsStringAsync()); + var val = long.Parse(await putResponse.Content.ReadAsStringAsync()); if (val != block_offset + data.Length) { tcs.SetResult($"Sync Error {val} vs {block_offset + data.Length}");