feat: add GameData.HasModifiedGameDataFiles

This commit is contained in:
goat 2022-10-29 15:28:19 +02:00
parent 987ff8dc8f
commit 02f90899a3
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -84,6 +84,19 @@ public sealed class DataManager : IDisposable, IServiceType
}
Log.Information("Lumina is ready: {0}", this.GameData.DataPath);
try
{
var tsInfo =
JsonConvert.DeserializeObject<LauncherTroubleshootingInfo>(
dalamudStartInfo.TroubleshootingPackData);
this.HasModifiedGameDataFiles =
tsInfo?.IndexIntegrity is LauncherTroubleshootingInfo.IndexIntegrityResult.Failed or LauncherTroubleshootingInfo.IndexIntegrityResult.Exception;
}
catch
{
// ignored
}
}
this.IsDataReady = true;
@ -144,6 +157,11 @@ public sealed class DataManager : IDisposable, IServiceType
/// </summary>
public bool IsDataReady { get; private set; }
/// <summary>
/// Gets a value indicating whether the game data files have been modified by another third-party tool.
/// </summary>
public bool HasModifiedGameDataFiles { get; private set; }
#region Lumina Wrappers
/// <summary>
@ -345,4 +363,19 @@ public sealed class DataManager : IDisposable, IServiceType
{
this.luminaCancellationTokenSource.Cancel();
}
private class LauncherTroubleshootingInfo
{
public enum IndexIntegrityResult
{
Failed,
Exception,
NoGame,
ReferenceNotFound,
ReferenceFetchFailure,
Success,
}
public IndexIntegrityResult IndexIntegrity { get; set; }
}
}