diff options
| author | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-22 20:58:01 +0300 |
|---|---|---|
| committer | AAyberkU <97833630+AAyberkU@users.noreply.github.com> | 2026-11-22 23:02:25 +0300 |
| commit | 78f92bcf2e8f61ca9dca4fbea38e194782cb688a (patch) | |
| tree | a939d104a1630cea159d5908a1074ef36673e361 /tests/Rpf9DumpDiagnostics/Program.cs | |
| parent | f847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff) | |
rpf9dump: rescan instead of exporting from a partial index cache
rpf9dump shares %LOCALAPPDATA%\RpfPreview\Indexes with the rpf9-explorer GUI, which saves its model index
while it is still indexing and when a scan is cancelled, with IsComplete=false. rpf9dump trusted any cache that
loaded, so after a stopped GUI scan it exported only what had been indexed so far, published the manifest and
exited 0, and make_game.py never redid the step. A cached index now stands in for a full scan only when it is
marked complete or carries rpf9dump's own coverage text; otherwise rpf9dump scans again. Its own full scans are
saved with the complete mark, which the cache file already had a field for.
Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
Diffstat (limited to 'tests/Rpf9DumpDiagnostics/Program.cs')
| -rw-r--r-- | tests/Rpf9DumpDiagnostics/Program.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/Rpf9DumpDiagnostics/Program.cs b/tests/Rpf9DumpDiagnostics/Program.cs index 0ee25d023..704231347 100644 --- a/tests/Rpf9DumpDiagnostics/Program.cs +++ b/tests/Rpf9DumpDiagnostics/Program.cs | |||
| @@ -114,11 +114,24 @@ Console.WriteLine("Mesh key tests passed."); | |||
| 114 | } | 114 | } |
| 115 | Console.WriteLine("Recovered segment tests passed."); | 115 | Console.WriteLine("Recovered segment tests passed."); |
| 116 | 116 | ||
| 117 | // Only a full scan replaces rpf9dump's own: rpf9-explorer saves partial model indexes while indexing and on cancel. | ||
| 118 | Check(!ScanCounts.IsFullScan(Index("Dictionary-aware model scan in progress \u00B7 1,001/183,801 containers validated.", false)), "GUI index saved while indexing"); | ||
| 119 | Check(!ScanCounts.IsFullScan(Index("Dictionary-aware model scan canceled. Validated models are retained; discovery will resume on reopen.", false)), "GUI index saved on cancel"); | ||
| 120 | Check(ScanCounts.IsFullScan(Index("Full 1,234,567-byte model-container scan \u00B7 149,811 supported models including drawable dictionary children.", true)), "GUI index marked complete"); | ||
| 121 | Check(ScanCounts.IsFullScan(Index(ScanCounts.Coverage(183801, 149811), true)), "rpf9dump index"); | ||
| 122 | Check(ScanCounts.IsFullScan(Index(ScanCounts.Coverage(183801, 149811), false)), "rpf9dump index saved without the complete mark"); | ||
| 123 | Check(ScanCounts.IsFullScan(Index(string.Format(System.Globalization.CultureInfo.GetCultureInfo("de-CH"), "rpf9dump full scan, {0:N0} candidates, {1:N0} recovered", 183801, 149811), false)), "culture-formatted rpf9dump index"); | ||
| 124 | Check(!ScanCounts.IsFullScan(null), "no cached index"); | ||
| 125 | Console.WriteLine("Cached index tests passed."); | ||
| 126 | |||
| 117 | static void Check(bool ok, string what) | 127 | static void Check(bool ok, string what) |
| 118 | { | 128 | { |
| 119 | if (!ok) throw new Exception($"Failed: {what}"); | 129 | if (!ok) throw new Exception($"Failed: {what}"); |
| 120 | } | 130 | } |
| 121 | 131 | ||
| 132 | static RecoveryIndexCache.CachedIndex Index(string coverage, bool complete) => | ||
| 133 | new("rpfpreview-payload-index/models/4", "models", "levels.rpf", 0, 0, "", coverage, []) { IsComplete = complete }; | ||
| 134 | |||
| 122 | static void Expect(ReadOnlySpan<byte> system, int graphicsBytes, string expected) | 135 | static void Expect(ReadOnlySpan<byte> system, int graphicsBytes, string expected) |
| 123 | { | 136 | { |
| 124 | string actual = ModelDecodeFailure.Explain(system, graphicsBytes).Code; | 137 | string actual = ModelDecodeFailure.Explain(system, graphicsBytes).Code; |