一些修复和优化

This commit is contained in:
FloatGaming
2026-07-20 02:22:51 +08:00
parent 818fc9a02f
commit 0a0872c4f4
49 changed files with 2008 additions and 262 deletions
@@ -167,6 +167,9 @@ public static class SecureSaveVault
DeleteIfExists(GetFilePath(category, key, ".bak"));
DeleteIfExists(GetFilePath(category, key, ".tmp"));
DeleteLegacyPlainFile(legacyPlainPath);
// 同时删除恢复镜像(.save_recovery/*),否则下次 TryLoadRawJson 会从镜像
// 复活刚删掉的数据并回写主存档——删除必须彻底,覆盖所有根目录变体与 .bak。
DeleteRecoveryCopies(category, key);
return true;
}
catch (Exception ex)
@@ -176,6 +179,15 @@ public static class SecureSaveVault
}
}
private static void DeleteRecoveryCopies(string category, string key)
{
IReadOnlyList<string> candidates = GetRecoveryFilePathVariants(category, key);
for (int i = 0; i < candidates.Count; i++)
{
DeleteIfExists(candidates[i]);
}
}
public static List<string> LoadAllRawJson(string category, string legacyDirectory = null, string legacySearchPattern = "*.json")
{
var result = new List<string>();