From 1b5b703fe3e4a7fe062b8c5fabd07ebbe0617615 Mon Sep 17 00:00:00 2001 From: Andrew Savinykh <658865+AndrewSav@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:47:38 +1300 Subject: [PATCH] update dependencies, add save game files build number logging --- CHANGELOG.md | 5 + .../Remnant2SaveAnalyzer-dev.csproj | 202 +++++++++--------- .../Remnant2SaveAnalyzer.csproj | 12 +- Remnant2SaveAnalyzer/RemnantSave.cs | 16 +- 4 files changed, 126 insertions(+), 109 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c50a4a1..1594a0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +## v0.0.29 (3 December 2024) +- Update dependencies +- Add warning if the save files game build is less than expected +- Suppress bogus naked armor warning + ## v0.0.28 (15 Nov 2024) - Suppress warning about unknow relic charge item - Fix engram names displayed instead of archetype names diff --git a/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer-dev.csproj b/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer-dev.csproj index 4a018e8..2c2337d 100644 --- a/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer-dev.csproj +++ b/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer-dev.csproj @@ -1,103 +1,103 @@ - - - - WinExe - net8.0-windows7.0 - enable - true - true - en;ru;de;es;fr;it;ja;ko;pt-BR;zh-Hans;zh-Hant - app.manifest - Assets\256.ico - 999.0.0.0 - Remnant2SaveAnalyzer - Remnant2SaveAnalyzer - - - - - - - - - - - - - - - - - - - - - - - - + + + + WinExe + net8.0-windows7.0 + enable + true + true + en;ru;de;es;fr;it;ja;ko;pt-BR;zh-Hans;zh-Hant + app.manifest + Assets\256.ico + 999.0.0.0 + Remnant2SaveAnalyzer + Remnant2SaveAnalyzer + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - GameStrings.resx - True - True - - - Strings.resx - True - True - - - True - True - Resources.resx - - - True - True - Settings.settings - - - - - - GameStrings.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - - - Strings.Designer.cs - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - - - PublicResXFileCodeGenerator - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - + + + + + + + + + + + GameStrings.resx + True + True + + + Strings.resx + True + True + + + True + True + Resources.resx + + + True + True + Settings.settings + + + + + + GameStrings.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + Strings.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + diff --git a/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer.csproj b/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer.csproj index 321a17f..d0e7772 100644 --- a/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer.csproj +++ b/Remnant2SaveAnalyzer/Remnant2SaveAnalyzer.csproj @@ -16,15 +16,15 @@ - - - + + + - + - - + + diff --git a/Remnant2SaveAnalyzer/RemnantSave.cs b/Remnant2SaveAnalyzer/RemnantSave.cs index 5031168..4dffdb4 100644 --- a/Remnant2SaveAnalyzer/RemnantSave.cs +++ b/Remnant2SaveAnalyzer/RemnantSave.cs @@ -7,6 +7,7 @@ using lib.remnant2.analyzer.Model; using lib.remnant2.analyzer; using lib.remnant2.analyzer.Enums; +using lib.remnant2.saves.Model.Memory; using Newtonsoft.Json; using Remnant2SaveAnalyzer.Properties; using Remnant2SaveAnalyzer.Logging; @@ -30,12 +31,14 @@ public class RemnantSave private static readonly object LoadLock = new(); public static readonly Guid FolderIdSavedGames = new(0x4C5C32FF, 0xBB9D, 0x43B0, 0xB5, 0xB4, 0x2D, 0x72, 0xE5, 0x4E, 0xAA, 0xA4); - [DllImport("shell32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, PreserveSig = false)] +#pragma warning disable IDE0079 // Remove unnecessary suppression #pragma warning disable SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + [DllImport("shell32.dll", CharSet = CharSet.Unicode, ExactSpelling = true, PreserveSig = false)] static extern string SHGetKnownFolderPath([MarshalAs(UnmanagedType.LPStruct)] Guid rfid, uint dwFlags, IntPtr hToken = default); #pragma warning restore SYSLIB1054 // Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time public RemnantSave(string path, bool skipUpdate = false) +#pragma warning restore IDE0079 // Remove unnecessary suppression { if (!Directory.Exists(path)) { @@ -103,6 +106,7 @@ public void UpdateCharacters() try { + Analyzer.CheckBuildNumber(_savePath); _remnantDataset = Analyzer.Analyze(_savePath, _remnantDataset); } catch (Exception ex) @@ -161,6 +165,9 @@ private void ReportPlayerInfo() logger.Information($"Active character save: save_{_remnantDataset.ActiveCharacterIndex}.sav"); + FileHeader fhp = _remnantDataset.ProfileSaveFile!.FileHeader; + logger.Information($"Profile save file version: {fhp.Version}, game build: {fhp.BuildNumber}"); + // Account Awards ------------------------------------------------------------ logger.Information("BEGIN Account Awards"); foreach (string award in _remnantDataset.AccountAwards) @@ -184,11 +191,16 @@ private void ReportPlayerInfo() for (int index = 0; index < _remnantDataset.Characters.Count; index++) { // Character ------------------------------------------------------------ - var character = _remnantDataset.Characters[index]; + Character character = _remnantDataset.Characters[index]; int acquired = character.Profile.AcquiredItems; int missing = character.Profile.MissingItems.Count; int total = acquired + missing; + + + logger.Information($"Character {index+1} (save_{character.Index}), Acquired Items: {acquired}, Missing Items: {missing}, Total: {total}"); + FileHeader fh = character.WorldSaveFile!.FileHeader; + logger.Information($"World save file version: {fh.Version}, game build: {fh.BuildNumber}"); logger.Information($"Is Hardcore: {character.Profile.IsHardcore}"); logger.Information($"Trait Rank: {character.Profile.TraitRank}"); logger.Information($"Last Saved Trait Points: {character.Profile.LastSavedTraitPoints}");