feat: show client structs hash in Game submenu

This commit is contained in:
goaaats 2021-12-05 02:08:43 +01:00
parent 9588e12619
commit 6a977fb59e
No known key found for this signature in database
GPG key ID: F18F057873895461
4 changed files with 33 additions and 3 deletions

View file

@ -22,7 +22,8 @@ namespace Dalamud.Utility
/// </summary>
public static class Util
{
private static string gitHashInternal;
private static string? gitHashInternal;
private static string? gitHashClientStructsInternal;
/// <summary>
/// Gets an httpclient for usage.
@ -48,11 +49,29 @@ namespace Dalamud.Utility
var asm = typeof(Util).Assembly;
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
gitHashInternal = attrs.FirstOrDefault(a => a.Key == "GitHash")?.Value;
gitHashInternal = attrs.First(a => a.Key == "GitHash").Value;
return gitHashInternal;
}
/// <summary>
/// Gets the git hash value from the assembly
/// or null if it cannot be found.
/// </summary>
/// <returns>The git hash of the assembly.</returns>
public static string GetGitHashClientStructs()
{
if (gitHashClientStructsInternal != null)
return gitHashClientStructsInternal;
var asm = typeof(Util).Assembly;
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
gitHashClientStructsInternal = attrs.First(a => a.Key == "GitHashClientStructs").Value;
return gitHashClientStructsInternal;
}
/// <summary>
/// Read memory from an offset and hexdump them via Serilog.
/// </summary>