diff --git a/lib/FFXIVQuickLauncher b/lib/FFXIVQuickLauncher index 5ea1ee9c..cf7c2b28 160000 --- a/lib/FFXIVQuickLauncher +++ b/lib/FFXIVQuickLauncher @@ -1 +1 @@ -Subproject commit 5ea1ee9c87b9542aaf8b1739ddf869960a5c007f +Subproject commit cf7c2b281d44ae26f8896d534d3c8ad8e88eb7e6 diff --git a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs index 88871f1c..8ae18d48 100644 --- a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs +++ b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs @@ -167,8 +167,9 @@ public async Task Login(string username, string password, bool isOtp, bool if (action == LoginAction.Fake) { IGameRunner gameRunner; + // FIXME: Should we really be passing a null DalamudLauncher to both of these? if (Environment.OSVersion.Platform == PlatformID.Win32NT) - gameRunner = new WindowsGameRunner(null, false, Program.DalamudUpdater.Runtime); + gameRunner = new WindowsGameRunner(null, false); else gameRunner = new UnixGameRunner(Program.CompatibilityTools, null, false); @@ -534,7 +535,7 @@ public async Task StartGameAndAddon(Launcher.LoginResult loginResult, b switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: - dalamudRunner = new WindowsDalamudRunner(); + dalamudRunner = new WindowsDalamudRunner(Program.DalamudUpdater.Runtime); dalamudCompatCheck = new WindowsDalamudCompatibilityCheck(); break; @@ -658,7 +659,7 @@ public async Task StartGameAndAddon(Launcher.LoginResult loginResult, b if (Environment.OSVersion.Platform == PlatformID.Win32NT) { - runner = new WindowsGameRunner(dalamudLauncher, dalamudOk, Program.DalamudUpdater.Runtime); + runner = new WindowsGameRunner(dalamudLauncher, dalamudOk); } else if (Environment.OSVersion.Platform == PlatformID.Unix) { @@ -672,7 +673,7 @@ public async Task StartGameAndAddon(Launcher.LoginResult loginResult, b else if (!File.Exists(Path.Combine(App.Settings.WineBinaryPath, "wine64"))) throw new InvalidOperationException("Custom wine binary path is invalid: no wine64 found at that location.\n" + "Check path carefully for typos: " + App.Settings.WineBinaryPath); - + Log.Information("Using Custom Wine: " + App.Settings.WineBinaryPath); } else @@ -896,7 +897,7 @@ private async Task TryHandlePatchAsync(Repository repository, PatchListEnt return false; } - using var installer = new PatchInstaller(App.Settings.KeepPatches ?? false); + using var installer = new PatchInstaller(App.Settings.GamePath, App.Settings.KeepPatches ?? false); Program.Patcher = new PatchManager(App.Settings.PatchAcquisitionMethod ?? AcquisitionMethod.Aria, App.Settings.PatchSpeedLimit, repository, pendingPatches, App.Settings.GamePath, App.Settings.PatchPath, installer, App.Launcher, sid); Program.Patcher.OnFail += PatcherOnFail; @@ -932,8 +933,8 @@ void UpdatePatchStatus() Thread.Sleep(30); App.LoadingPage.Line2 = string.Format(Strings.WorkingOnStatus, Program.Patcher.CurrentInstallIndex, Program.Patcher.Downloads.Count); - App.LoadingPage.Line3 = string.Format(Strings.LeftToDownloadStatus, ApiHelpers.BytesToString(Program.Patcher.AllDownloadsLength < 0 ? 0 : Program.Patcher.AllDownloadsLength), - ApiHelpers.BytesToString(Program.Patcher.Speeds.Sum())); + App.LoadingPage.Line3 = string.Format(Strings.LeftToDownloadStatus, MathHelpers.BytesToString(Program.Patcher.AllDownloadsLength < 0 ? 0 : Program.Patcher.AllDownloadsLength), + MathHelpers.BytesToString(Program.Patcher.Speeds.Sum())); App.LoadingPage.Progress = Program.Patcher.CurrentInstallIndex / (float)Program.Patcher.Downloads.Count; } @@ -963,19 +964,19 @@ void UpdatePatchStatus() case NotEnoughSpaceException.SpaceKind.Patches: App.ShowMessageBlocking( string.Format(Strings.NotEnoughSpacePatchesError, - ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); + MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); break; case NotEnoughSpaceException.SpaceKind.AllPatches: App.ShowMessageBlocking( string.Format(Strings.NotEnoughSpaceAllPatchesError, - ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); + MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); break; case NotEnoughSpaceException.SpaceKind.Game: App.ShowMessageBlocking( string.Format(Strings.NotEnoughSpaceGameError, - ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); + MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError); break; default: @@ -1045,13 +1046,13 @@ private async Task RepairGame(Launcher.LoginResult loginResult) // TODO: show more progress info here case PatchVerifier.VerifyState.DownloadMeta: this.App.LoadingPage.Line2 = $"{verify.CurrentFile}"; - this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {ApiHelpers.BytesToString(verify.Progress)}/{ApiHelpers.BytesToString(verify.Total)}"; + this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {MathHelpers.BytesToString(verify.Progress)}/{MathHelpers.BytesToString(verify.Total)}"; this.App.LoadingPage.Progress = (float)(verify.Total != 0 ? (float)verify.Progress / (float)verify.Total : 0.0); break; case PatchVerifier.VerifyState.VerifyAndRepair: this.App.LoadingPage.Line2 = $"{verify.CurrentFile}"; - this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {Math.Min(verify.TaskIndex + 1, verify.TaskCount)}/{verify.TaskCount} - {ApiHelpers.BytesToString(verify.Progress)}/{ApiHelpers.BytesToString(verify.Total)}"; + this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {Math.Min(verify.TaskIndex + 1, verify.TaskCount)}/{verify.TaskCount} - {MathHelpers.BytesToString(verify.Progress)}/{MathHelpers.BytesToString(verify.Total)}"; this.App.LoadingPage.Progress = (float)(verify.Total != 0 ? (float)verify.Progress / (float)verify.Total : 0); break; diff --git a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs index 92a19e08..9514d5b3 100644 --- a/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs +++ b/src/XIVLauncher.Core/Configuration/ILauncherConfig.cs @@ -11,8 +11,6 @@ public interface ILauncherConfig { public bool? CompletedFts { get; set; } - public bool? DoVersionCheck { get; set; } - public float? FontPxSize { get; set; } public string? CurrentAccountId { get; set; } @@ -98,6 +96,8 @@ public interface ILauncherConfig public DalamudLoadMethod? DalamudLoadMethod { get; set; } public bool? DalamudManualInjectionEnabled { get; set; } public DirectoryInfo? DalamudManualInjectPath { get; set; } + public string? DalamudBetaKind { get; set; } + public string? DalamudBetaKey { get; set; } public int DalamudLoadDelay { get; set; } diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index b3dbcd26..dfcb29bd 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -109,7 +109,6 @@ private static void LoadConfig(Storage storage) Config.DpiAwareness ??= DpiAwareness.Unaware; Config.IsAutologin ??= false; Config.CompletedFts ??= false; - Config.DoVersionCheck ??= true; Config.FontPxSize ??= 22.0f; Config.IsEncryptArgs ??= true; @@ -169,7 +168,7 @@ private static DalamudUpdater CreateDalamudUpdater() { runnerOverride = new FileInfo(Path.Combine(Config.DalamudManualInjectPath.FullName, DALAMUD_INJECTOR_NAME)); } - return new DalamudUpdater(storage.GetFolder("dalamud"), storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), storage.Root, null, null) + return new DalamudUpdater(storage.GetFolder("dalamud"), storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), null, null) { Overlay = DalamudLoadInfo, RunnerOverride = runnerOverride @@ -251,7 +250,7 @@ private static void Main(string[] args) // Manual or auto injection setup. DalamudLoadInfo = new DalamudOverlayInfoProxy(); DalamudUpdater = CreateDalamudUpdater(); - DalamudUpdater.Run(); + DalamudUpdater.Run(Config.DalamudBetaKind, Config.DalamudBetaKind); CreateCompatToolsInstance(); @@ -317,17 +316,10 @@ private static void Main(string[] args) guiBindings.Dispose(); commandList.Dispose(); graphicsDevice.Dispose(); - HttpClient.Dispose(); - if (Patcher is not null) { - Patcher.CancelAllDownloads(); - Task.Run(async () => - { - await PatchManager.UnInitializeAcquisition().ConfigureAwait(false); - Environment.Exit(0); - }); + Patcher.StartCancellation(); } } @@ -418,7 +410,7 @@ public static void ClearPlugins(bool tsbutton = false) { DalamudLoadInfo = new DalamudOverlayInfoProxy(); DalamudUpdater = CreateDalamudUpdater(); - DalamudUpdater.Run(); + DalamudUpdater.Run(Config.DalamudBetaKind, Config.DalamudBetaKey); } } diff --git a/src/XIVLauncher.Core/XIVLauncher.Core.csproj b/src/XIVLauncher.Core/XIVLauncher.Core.csproj index f2f87c70..f8aec5d0 100644 --- a/src/XIVLauncher.Core/XIVLauncher.Core.csproj +++ b/src/XIVLauncher.Core/XIVLauncher.Core.csproj @@ -68,10 +68,10 @@ - - - - + + + + @@ -93,22 +93,26 @@ - ResXFileCodeGenerator - Strings.Designer.cs + ResXFileCodeGenerator + Strings.Designer.cs - - + + - - + + @@ -119,11 +123,11 @@ - - True - True - Strings.resx - + + True + True + Strings.resx + @@ -170,4 +174,4 @@ AssemblyAttributes="@(AssemblyAttributes)" /> - + \ No newline at end of file