Skip to content

Commit 4bc16d1

Browse files
committed
feat: add dalamud beta kind & key to launcher config file
1 parent 67ce2c2 commit 4bc16d1

File tree

5 files changed

+40
-43
lines changed

5 files changed

+40
-43
lines changed

lib/FFXIVQuickLauncher

Submodule FFXIVQuickLauncher updated 84 files

src/XIVLauncher.Core/Components/MainPage/MainPage.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ public async Task<bool> Login(string username, string password, bool isOtp, bool
167167
if (action == LoginAction.Fake)
168168
{
169169
IGameRunner gameRunner;
170+
// FIXME: Should we really be passing a null DalamudLauncher to both of these?
170171
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
171-
gameRunner = new WindowsGameRunner(null, false, Program.DalamudUpdater.Runtime);
172+
gameRunner = new WindowsGameRunner(null, false);
172173
else
173174
gameRunner = new UnixGameRunner(Program.CompatibilityTools, null, false);
174175

@@ -534,7 +535,7 @@ public async Task<Process> StartGameAndAddon(Launcher.LoginResult loginResult, b
534535
switch (Environment.OSVersion.Platform)
535536
{
536537
case PlatformID.Win32NT:
537-
dalamudRunner = new WindowsDalamudRunner();
538+
dalamudRunner = new WindowsDalamudRunner(Program.DalamudUpdater.Runtime);
538539
dalamudCompatCheck = new WindowsDalamudCompatibilityCheck();
539540
break;
540541

@@ -658,7 +659,7 @@ public async Task<Process> StartGameAndAddon(Launcher.LoginResult loginResult, b
658659

659660
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
660661
{
661-
runner = new WindowsGameRunner(dalamudLauncher, dalamudOk, Program.DalamudUpdater.Runtime);
662+
runner = new WindowsGameRunner(dalamudLauncher, dalamudOk);
662663
}
663664
else if (Environment.OSVersion.Platform == PlatformID.Unix)
664665
{
@@ -672,7 +673,7 @@ public async Task<Process> StartGameAndAddon(Launcher.LoginResult loginResult, b
672673
else if (!File.Exists(Path.Combine(App.Settings.WineBinaryPath, "wine64")))
673674
throw new InvalidOperationException("Custom wine binary path is invalid: no wine64 found at that location.\n" +
674675
"Check path carefully for typos: " + App.Settings.WineBinaryPath);
675-
676+
676677
Log.Information("Using Custom Wine: " + App.Settings.WineBinaryPath);
677678
}
678679
else
@@ -896,7 +897,7 @@ private async Task<bool> TryHandlePatchAsync(Repository repository, PatchListEnt
896897
return false;
897898
}
898899

899-
using var installer = new PatchInstaller(App.Settings.KeepPatches ?? false);
900+
using var installer = new PatchInstaller(App.Settings.GamePath, App.Settings.KeepPatches ?? false);
900901
Program.Patcher = new PatchManager(App.Settings.PatchAcquisitionMethod ?? AcquisitionMethod.Aria, App.Settings.PatchSpeedLimit, repository, pendingPatches, App.Settings.GamePath,
901902
App.Settings.PatchPath, installer, App.Launcher, sid);
902903
Program.Patcher.OnFail += PatcherOnFail;
@@ -932,8 +933,8 @@ void UpdatePatchStatus()
932933
Thread.Sleep(30);
933934

934935
App.LoadingPage.Line2 = string.Format(Strings.WorkingOnStatus, Program.Patcher.CurrentInstallIndex, Program.Patcher.Downloads.Count);
935-
App.LoadingPage.Line3 = string.Format(Strings.LeftToDownloadStatus, ApiHelpers.BytesToString(Program.Patcher.AllDownloadsLength < 0 ? 0 : Program.Patcher.AllDownloadsLength),
936-
ApiHelpers.BytesToString(Program.Patcher.Speeds.Sum()));
936+
App.LoadingPage.Line3 = string.Format(Strings.LeftToDownloadStatus, MathHelpers.BytesToString(Program.Patcher.AllDownloadsLength < 0 ? 0 : Program.Patcher.AllDownloadsLength),
937+
MathHelpers.BytesToString(Program.Patcher.Speeds.Sum()));
937938

938939
App.LoadingPage.Progress = Program.Patcher.CurrentInstallIndex / (float)Program.Patcher.Downloads.Count;
939940
}
@@ -963,19 +964,19 @@ void UpdatePatchStatus()
963964
case NotEnoughSpaceException.SpaceKind.Patches:
964965
App.ShowMessageBlocking(
965966
string.Format(Strings.NotEnoughSpacePatchesError,
966-
ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
967+
MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
967968
break;
968969

969970
case NotEnoughSpaceException.SpaceKind.AllPatches:
970971
App.ShowMessageBlocking(
971972
string.Format(Strings.NotEnoughSpaceAllPatchesError,
972-
ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
973+
MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
973974
break;
974975

975976
case NotEnoughSpaceException.SpaceKind.Game:
976977
App.ShowMessageBlocking(
977978
string.Format(Strings.NotEnoughSpaceGameError,
978-
ApiHelpers.BytesToString(sex.BytesRequired), ApiHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
979+
MathHelpers.BytesToString(sex.BytesRequired), MathHelpers.BytesToString(sex.BytesFree)), Strings.XIVLauncherError);
979980
break;
980981

981982
default:
@@ -1045,13 +1046,13 @@ private async Task<bool> RepairGame(Launcher.LoginResult loginResult)
10451046
// TODO: show more progress info here
10461047
case PatchVerifier.VerifyState.DownloadMeta:
10471048
this.App.LoadingPage.Line2 = $"{verify.CurrentFile}";
1048-
this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {ApiHelpers.BytesToString(verify.Progress)}/{ApiHelpers.BytesToString(verify.Total)}";
1049+
this.App.LoadingPage.Line3 = $"{Math.Min(verify.PatchSetIndex + 1, verify.PatchSetCount)}/{verify.PatchSetCount} - {MathHelpers.BytesToString(verify.Progress)}/{MathHelpers.BytesToString(verify.Total)}";
10491050
this.App.LoadingPage.Progress = (float)(verify.Total != 0 ? (float)verify.Progress / (float)verify.Total : 0.0);
10501051
break;
10511052

10521053
case PatchVerifier.VerifyState.VerifyAndRepair:
10531054
this.App.LoadingPage.Line2 = $"{verify.CurrentFile}";
1054-
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)}";
1055+
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)}";
10551056
this.App.LoadingPage.Progress = (float)(verify.Total != 0 ? (float)verify.Progress / (float)verify.Total : 0);
10561057
break;
10571058

src/XIVLauncher.Core/Configuration/ILauncherConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ public interface ILauncherConfig
1111
{
1212
public bool? CompletedFts { get; set; }
1313

14-
public bool? DoVersionCheck { get; set; }
15-
1614
public float? FontPxSize { get; set; }
1715

1816
public string? CurrentAccountId { get; set; }
@@ -98,6 +96,8 @@ public interface ILauncherConfig
9896
public DalamudLoadMethod? DalamudLoadMethod { get; set; }
9997
public bool? DalamudManualInjectionEnabled { get; set; }
10098
public DirectoryInfo? DalamudManualInjectPath { get; set; }
99+
public string? DalamudBetaKind { get; set; }
100+
public string? DalamudBetaKey { get; set; }
101101

102102
public int DalamudLoadDelay { get; set; }
103103

src/XIVLauncher.Core/Program.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ private static void LoadConfig(Storage storage)
109109
Config.DpiAwareness ??= DpiAwareness.Unaware;
110110
Config.IsAutologin ??= false;
111111
Config.CompletedFts ??= false;
112-
Config.DoVersionCheck ??= true;
113112
Config.FontPxSize ??= 22.0f;
114113

115114
Config.IsEncryptArgs ??= true;
@@ -169,7 +168,7 @@ private static DalamudUpdater CreateDalamudUpdater()
169168
{
170169
runnerOverride = new FileInfo(Path.Combine(Config.DalamudManualInjectPath.FullName, DALAMUD_INJECTOR_NAME));
171170
}
172-
return new DalamudUpdater(storage.GetFolder("dalamud"), storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), storage.Root, null, null)
171+
return new DalamudUpdater(storage.GetFolder("dalamud"), storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), null, null)
173172
{
174173
Overlay = DalamudLoadInfo,
175174
RunnerOverride = runnerOverride
@@ -251,7 +250,7 @@ private static void Main(string[] args)
251250
// Manual or auto injection setup.
252251
DalamudLoadInfo = new DalamudOverlayInfoProxy();
253252
DalamudUpdater = CreateDalamudUpdater();
254-
DalamudUpdater.Run();
253+
DalamudUpdater.Run(Config.DalamudBetaKind, Config.DalamudBetaKind);
255254

256255
CreateCompatToolsInstance();
257256

@@ -317,17 +316,10 @@ private static void Main(string[] args)
317316
guiBindings.Dispose();
318317
commandList.Dispose();
319318
graphicsDevice.Dispose();
320-
321319
HttpClient.Dispose();
322-
323320
if (Patcher is not null)
324321
{
325-
Patcher.CancelAllDownloads();
326-
Task.Run(async () =>
327-
{
328-
await PatchManager.UnInitializeAcquisition().ConfigureAwait(false);
329-
Environment.Exit(0);
330-
});
322+
Patcher.StartCancellation();
331323
}
332324
}
333325

@@ -418,7 +410,7 @@ public static void ClearPlugins(bool tsbutton = false)
418410
{
419411
DalamudLoadInfo = new DalamudOverlayInfoProxy();
420412
DalamudUpdater = CreateDalamudUpdater();
421-
DalamudUpdater.Run();
413+
DalamudUpdater.Run(Config.DalamudBetaKind, Config.DalamudBetaKey);
422414
}
423415
}
424416

src/XIVLauncher.Core/XIVLauncher.Core.csproj

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
<PackageReference Include="Config.Net" Version="4.19.0" />
6969
<PackageReference Include="ImGui.NET" Version="1.87.2" />
7070
<PackageReference Include="KeySharp" Version="1.0.5" />
71-
<PackageReference Include="Serilog" Version="2.12.0" />
72-
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
73-
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
74-
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
71+
<PackageReference Include="Serilog" Version="4.3.0" />
72+
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
73+
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
74+
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
7575
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
7676
<PackageReference Include="Veldrid" Version="4.9.0" />
7777
<PackageReference Include="Veldrid.ImageSharp" Version="4.9.0" />
@@ -93,22 +93,26 @@
9393
<EmbeddedResource Include="Shaders/Metal/imgui-frag.metallib"
9494
LogicalName="imgui-frag.metallib" />
9595
<EmbeddedResource Update="Resources\Localization\Strings.resx">
96-
<Generator>ResXFileCodeGenerator</Generator>
97-
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
96+
<Generator>ResXFileCodeGenerator</Generator>
97+
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
9898
</EmbeddedResource>
9999
</ItemGroup>
100100

101101
<ItemGroup>
102-
<EmbeddedResource Include="Resources/fonts/FontAwesome5FreeSolid.otf" LogicalName="FontAwesome5FreeSolid.otf" />
103-
<EmbeddedResource Include="Resources/fonts/NotoSansCJKjp-Regular.otf" LogicalName="NotoSansCJKjp-Regular.otf" />
102+
<EmbeddedResource Include="Resources/fonts/FontAwesome5FreeSolid.otf"
103+
LogicalName="FontAwesome5FreeSolid.otf" />
104+
<EmbeddedResource Include="Resources/fonts/NotoSansCJKjp-Regular.otf"
105+
LogicalName="NotoSansCJKjp-Regular.otf" />
104106

105107
<EmbeddedResource Include="Resources/logo.png" LogicalName="logo.png" />
106108

107109
<EmbeddedResource Include="Resources/bg_logo.png" LogicalName="bg_logo.png" />
108110

109111
<EmbeddedResource Include="Resources/steamdeck_fts.png" LogicalName="steamdeck_fts.png" />
110-
<EmbeddedResource Include="Resources/steamdeck_fterror.png" LogicalName="steamdeck_fterror.png" />
111-
<EmbeddedResource Include="Resources/steamdeck_switchprompt.png" LogicalName="steamdeck_switchprompt.png" />
112+
<EmbeddedResource Include="Resources/steamdeck_fterror.png"
113+
LogicalName="steamdeck_fterror.png" />
114+
<EmbeddedResource Include="Resources/steamdeck_switchprompt.png"
115+
LogicalName="steamdeck_switchprompt.png" />
112116
</ItemGroup>
113117

114118
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win10-x64'">
@@ -119,11 +123,11 @@
119123
</ItemGroup>
120124

121125
<ItemGroup>
122-
<Compile Update="Resources\Localization\Strings.Designer.cs">
123-
<DesignTime>True</DesignTime>
124-
<AutoGen>True</AutoGen>
125-
<DependentUpon>Strings.resx</DependentUpon>
126-
</Compile>
126+
<Compile Update="Resources\Localization\Strings.Designer.cs">
127+
<DesignTime>True</DesignTime>
128+
<AutoGen>True</AutoGen>
129+
<DependentUpon>Strings.resx</DependentUpon>
130+
</Compile>
127131
</ItemGroup>
128132

129133
<!-- Git -->
@@ -170,4 +174,4 @@
170174
AssemblyAttributes="@(AssemblyAttributes)" />
171175
</Target>
172176

173-
</Project>
177+
</Project>

0 commit comments

Comments
 (0)