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 /tools/rpf9dump/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 'tools/rpf9dump/Program.cs')
| -rw-r--r-- | tools/rpf9dump/Program.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/rpf9dump/Program.cs b/tools/rpf9dump/Program.cs index ba67d4d5e..aba410a73 100644 --- a/tools/rpf9dump/Program.cs +++ b/tools/rpf9dump/Program.cs | |||
| @@ -144,12 +144,14 @@ else if (mode is "models" or "textures") | |||
| 144 | { | 144 | { |
| 145 | byte[] header; using (var f = File.OpenRead(src)) { header = new byte[64]; f.ReadExactly(header); } | 145 | byte[] header; using (var f = File.OpenRead(src)) { header = new byte[64]; f.ReadExactly(header); } |
| 146 | var cached = RecoveryIndexCache.Load(mode, src, length, header); | 146 | var cached = RecoveryIndexCache.Load(mode, src, length, header); |
| 147 | // A partial index (rpf9-explorer stopped or still indexing) would export only part of the archive: scan again. | ||
| 148 | if (cached != null && !ScanCounts.IsFullScan(cached)) { Console.WriteLine($" cached {mode} index is not marked as a full scan ({cached.Entries.Count:N0} entries), rescanning"); cached = null; } | ||
| 147 | candidates = ScanCounts.Candidates(cached?.Coverage); | 149 | candidates = ScanCounts.Candidates(cached?.Coverage); |
| 148 | if (cached == null) | 150 | if (cached == null) |
| 149 | { | 151 | { |
| 150 | var cands = Scan(src, 0, null); | 152 | var cands = Scan(src, 0, null); |
| 151 | list = Recover(src, length, cands); | 153 | list = Recover(src, length, cands); |
| 152 | RecoveryIndexCache.Save(mode, src, list, ScanCounts.Coverage(cands.Count, list.Select(e => e.Offset).Distinct().Count())); | 154 | RecoveryIndexCache.Save(mode, src, list, ScanCounts.Coverage(cands.Count, list.Select(e => e.Offset).Distinct().Count()), complete: true); |
| 153 | candidates = cands.Count; | 155 | candidates = cands.Count; |
| 154 | } | 156 | } |
| 155 | else | 157 | else |