mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 22:37:43 +01:00
Compare commits
7 commits
497ae32d3e
...
5e0b186f91
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e0b186f91 | ||
|
|
7510c032cc | ||
|
|
d12a9ec7da | ||
|
|
6367a66aad | ||
|
|
edc6962296 | ||
|
|
78ecb721cd | ||
|
|
d7915c7020 |
9 changed files with 52 additions and 43 deletions
|
|
@ -108,11 +108,6 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// </summary>
|
||||
public bool DoPluginTest { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a key to opt into Dalamud staging builds.
|
||||
/// </summary>
|
||||
public string? DalamudBetaKey { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of custom repos.
|
||||
/// </summary>
|
||||
|
|
@ -278,11 +273,6 @@ internal sealed class DalamudConfiguration : IInternalDisposableService
|
|||
/// </summary>
|
||||
public bool IsResumeGameAfterPluginLoad { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the kind of beta to download when <see cref="DalamudBetaKey"/> matches the server value.
|
||||
/// </summary>
|
||||
public string? DalamudBetaKind { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether any plugin should be loaded when the game is started.
|
||||
/// It is reset immediately when read.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
try
|
||||
{
|
||||
Log.Verbose("Starting data load...");
|
||||
|
||||
|
||||
using (Timings.Start("Lumina Init"))
|
||||
{
|
||||
var luminaOptions = new LuminaOptions
|
||||
|
|
@ -53,12 +53,25 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
DefaultExcelLanguage = this.Language.ToLumina(),
|
||||
};
|
||||
|
||||
this.GameData = new(
|
||||
Path.Combine(Path.GetDirectoryName(Environment.ProcessPath)!, "sqpack"),
|
||||
luminaOptions)
|
||||
try
|
||||
{
|
||||
StreamPool = new(),
|
||||
};
|
||||
this.GameData = new(
|
||||
Path.Combine(Path.GetDirectoryName(Environment.ProcessPath)!, "sqpack"),
|
||||
luminaOptions)
|
||||
{
|
||||
StreamPool = new(),
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Lumina GameData init failed");
|
||||
Util.Fatal(
|
||||
"Dalamud could not read required game data files. This likely means your game installation is corrupted or incomplete.\n\n" +
|
||||
"Please repair your installation by right-clicking the login button in XIVLauncher and choosing \"Repair game files\".",
|
||||
"Dalamud");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Information("Lumina is ready: {0}", this.GameData.DataPath);
|
||||
|
||||
|
|
@ -71,7 +84,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
dalamud.StartInfo.TroubleshootingPackData);
|
||||
this.HasModifiedGameDataFiles =
|
||||
tsInfo?.IndexIntegrity is LauncherTroubleshootingInfo.IndexIntegrityResult.Failed or LauncherTroubleshootingInfo.IndexIntegrityResult.Exception;
|
||||
|
||||
|
||||
if (this.HasModifiedGameDataFiles)
|
||||
Log.Verbose("Game data integrity check failed!\n{TsData}", dalamud.StartInfo.TroubleshootingPackData);
|
||||
}
|
||||
|
|
@ -130,7 +143,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
#region Lumina Wrappers
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelRow<T>
|
||||
public ExcelSheet<T> GetExcelSheet<T>(ClientLanguage? language = null, string? name = null) where T : struct, IExcelRow<T>
|
||||
=> this.Excel.GetSheet<T>(language?.ToLumina(), name);
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -138,7 +151,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
=> this.Excel.GetSubrowSheet<T>(language?.ToLumina(), name);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public FileResource? GetFile(string path)
|
||||
public FileResource? GetFile(string path)
|
||||
=> this.GetFile<FileResource>(path);
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -161,7 +174,7 @@ internal sealed class DataManager : IInternalDisposableService, IDataManager
|
|||
: Task.FromException<T>(new FileNotFoundException("The file could not be found."));
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool FileExists(string path)
|
||||
public bool FileExists(string path)
|
||||
=> this.GameData.FileExists(path);
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ internal class DalamudInterface : IInternalDisposableService
|
|||
() => Service<DalamudInterface>.GetNullable()?.ToggleDevMenu(),
|
||||
VirtualKey.SHIFT);
|
||||
|
||||
if (!configuration.DalamudBetaKind.IsNullOrEmpty())
|
||||
if (Util.GetActiveTrack() != "release")
|
||||
{
|
||||
titleScreenMenu.AddEntryCore(
|
||||
Loc.Localize("TSMDalamudDevMenu", "Developer Menu"),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using System.Net.Http.Json;
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
|
|
@ -15,6 +14,8 @@ using Dalamud.Utility;
|
|||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -47,7 +48,7 @@ public class BranchSwitcherWindow : Window
|
|||
Debug.Assert(this.branches != null, "this.branches != null");
|
||||
|
||||
var trackName = Util.GetActiveTrack();
|
||||
this.selectedBranchIndex = this.branches.IndexOf(x => x.Value.Track != trackName);
|
||||
this.selectedBranchIndex = this.branches.IndexOf(x => x.Value.Track == trackName);
|
||||
if (this.selectedBranchIndex == -1)
|
||||
{
|
||||
this.selectedBranchIndex = 0;
|
||||
|
|
@ -86,12 +87,9 @@ public class BranchSwitcherWindow : Window
|
|||
|
||||
if (ImGui.Button("Pick & Restart"u8))
|
||||
{
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
config.DalamudBetaKind = pickedBranch.Key;
|
||||
config.DalamudBetaKey = pickedBranch.Value.Key;
|
||||
|
||||
// If we exit immediately, we need to write out the new config now
|
||||
config.ForceSave();
|
||||
var newTrackName = pickedBranch.Key;
|
||||
var newTrackKey = pickedBranch.Value.Key;
|
||||
Log.Verbose("Switching to branch {Branch} with key {Key}", newTrackName, newTrackKey);
|
||||
|
||||
var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
var xlPath = Path.Combine(appData, "XIVLauncher", "current", "XIVLauncher.exe");
|
||||
|
|
@ -104,8 +102,8 @@ public class BranchSwitcherWindow : Window
|
|||
UseShellExecute = false,
|
||||
};
|
||||
|
||||
ps.ArgumentList.Add($"--dalamud-beta-kind={config.DalamudBetaKind}");
|
||||
ps.ArgumentList.Add($"--dalamud-beta-key={(config.DalamudBetaKey.IsNullOrEmpty() ? "invalid" : config.DalamudBetaKey)}");
|
||||
ps.ArgumentList.Add($"--dalamud-beta-kind={newTrackName}");
|
||||
ps.ArgumentList.Add($"--dalamud-beta-key={(newTrackKey.IsNullOrEmpty() ? "invalid" : newTrackKey)}");
|
||||
|
||||
Process.Start(ps);
|
||||
Environment.Exit(0);
|
||||
|
|
|
|||
|
|
@ -302,8 +302,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
|
||||
this.profileManagerWidget.Reset();
|
||||
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
if (this.staleDalamudNewVersion == null && !config.DalamudBetaKind.IsNullOrEmpty())
|
||||
if (this.staleDalamudNewVersion == null && !Util.GetActiveTrack().IsNullOrEmpty())
|
||||
{
|
||||
Service<DalamudReleases>.Get().GetVersionForCurrentTrack().ContinueWith(t =>
|
||||
{
|
||||
|
|
@ -311,10 +310,10 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
return;
|
||||
|
||||
var versionInfo = t.Result;
|
||||
if (versionInfo.AssemblyVersion != Util.GetScmVersion() &&
|
||||
versionInfo.Track != "release" &&
|
||||
string.Equals(versionInfo.Key, config.DalamudBetaKey, StringComparison.OrdinalIgnoreCase))
|
||||
if (versionInfo.AssemblyVersion != Util.GetScmVersion())
|
||||
{
|
||||
this.staleDalamudNewVersion = versionInfo.AssemblyVersion;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
|||
|
||||
using Dalamud.Configuration.Internal;
|
||||
using Dalamud.Networking.Http;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
|
@ -15,7 +16,7 @@ namespace Dalamud.Support;
|
|||
internal class DalamudReleases : IServiceType
|
||||
{
|
||||
private const string VersionInfoUrl = "https://kamori.goats.dev/Dalamud/Release/VersionInfo?track={0}";
|
||||
|
||||
|
||||
private readonly HappyHttpClient httpClient;
|
||||
private readonly DalamudConfiguration config;
|
||||
|
||||
|
|
@ -30,20 +31,24 @@ internal class DalamudReleases : IServiceType
|
|||
this.httpClient = httpClient;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get the latest version info for the current track.
|
||||
/// </summary>
|
||||
/// <returns>The version info for the current track.</returns>
|
||||
public async Task<DalamudVersionInfo> GetVersionForCurrentTrack()
|
||||
public async Task<DalamudVersionInfo?> GetVersionForCurrentTrack()
|
||||
{
|
||||
var url = string.Format(VersionInfoUrl, [this.config.DalamudBetaKind]);
|
||||
var currentTrack = Util.GetActiveTrack();
|
||||
if (currentTrack.IsNullOrEmpty())
|
||||
return null;
|
||||
|
||||
var url = string.Format(VersionInfoUrl, [currentTrack]);
|
||||
var response = await this.httpClient.SharedHttpClient.GetAsync(url);
|
||||
response.EnsureSuccessStatusCode();
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
return JsonConvert.DeserializeObject<DalamudVersionInfo>(content);
|
||||
}
|
||||
|
||||
|
||||
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "laziness")]
|
||||
public class DalamudVersionInfo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public static class Troubleshooting
|
|||
DalamudGitHash = Util.GetGitHash() ?? "Unknown",
|
||||
GameVersion = startInfo.GameVersion?.ToString() ?? "Unknown",
|
||||
Language = startInfo.Language.ToString(),
|
||||
BetaKey = configuration.DalamudBetaKey,
|
||||
BetaKey = Util.GetActiveTrack(),
|
||||
DoPluginTest = configuration.DoPluginTest,
|
||||
LoadAllApiLevels = pluginManager?.LoadAllApiLevels == true,
|
||||
InterfaceLoaded = interfaceManager?.IsReady ?? false,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Platforms>x64</Platforms>
|
||||
<LangVersion>13.0</LangVersion>
|
||||
|
||||
<!-- Disable Intel CET. Causes crashes on unpatched Windows 10 systems. -->
|
||||
<!-- https://github.com/dotnet/runtime/issues/108589 -->
|
||||
<CETCompat>false</CETCompat>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Code analysis settings for all Dalamud projects. -->
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0769d1f180f859688f47a7a99610e9ce10da946c
|
||||
Subproject commit 99789cc836760498bef644cfb449523a1fd174d6
|
||||
Loading…
Add table
Add a link
Reference in a new issue