Commit Graph

14 Commits

Author SHA1 Message Date
f6df7e1e3b Merge pull request #1557 from IlyassRS3/fix/gamedata-reader-filter-and-out-io
gamedata_reader: fix --root filter, sanitize --out filenames, and write JSON atomically (GAMEDATA-READER-FILTER-AND-OUT-IO)
2026-11-28 11:50:27 +01:00
6e85823da4 gamedata_reader: preserve empty polymorphic objects 2026-11-25 16:05:38 +03:00
b6721dc0ba gamedata_reader: fix --root filter, sanitize --out filenames, and write JSON atomically 2026-11-25 05:30:15 +01:00
62c9e8bf92 Merge pull request #3158 from bobcatchris
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:52 -05:00
303a15ad13 gamedata_reader: a run that read nothing because every document was broken exits 1
The tool counts documents it could not parse and prints the count, then returned
0 whatever happened. A corpus with some truncated tails is normal (a tail-cut
carve) and must stay 0, but a run where *no* document parsed looks exactly like
an empty corpus: "0 documents read, 0 roots, 1 not well-formed" with a success
status, which a caller cannot act on.

Report that one case on stderr and return 1, mirroring content_definitions.py,
which returns 1 when an input fails. A partial corpus is unchanged.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 17:33:23 -06:00
8fd758b63c Merge pull request #3536 from Kosmabb8 2026-11-22 17:02:35 -05:00
9dda9ed695 gamedata_reader: continue batches after conversion and encoding errors 2026-11-22 21:44:39 +01:00
ee5f0ee5f5 Merge pull request #3264 from kapitche 2026-11-22 15:16:18 -05:00
90ac7927e7 Merge pull request #3054 from Marco Luzzaro 2026-11-22 15:14:23 -05:00
e7c48f3394 gamedata_reader: bad index.json or a file as --out is one error line, exit 2 2026-11-22 14:56:35 -05:00
6d4bc8a4c9 gamedata_reader: preserve exports with duplicate names 2026-11-22 20:14:15 +01:00
2019b905d5 gamedata_reader: preserve stats on direct convert(use_type_handler=False) calls
Track active type-handler elements by identity instead of suppressing type and extra-attribute counts whenever use_type_handler=False is passed directly, and cover multi-chunk streaming child cleanup in tests.
2026-11-22 15:49:43 -03:00
8f53961c19 gamedata_reader: keep streaming root parity, extra vector attributes and single type counts
- Keep Reader.read() aligned with Reader.convert() on root type handlers, type="NULL", attribute conventions, and stats["object"], and detach cleared top-level elements from root via del root[:].
- Match vector elements by float x/y/z/w attributes so vectors with extra attributes retain their tuple value via "$value", while non-vector x/y/z/w attributes are preserved as @x/@y/@z/@w instead of failing _float() or being dropped.
- Avoid double-counting types[t] and stats["extra attributes"] when a registered type handler falls back to reader.convert(el, use_type_handler=False).
2026-11-22 15:38:59 -03:00
a217b88d8f tools: gamedata_reader, a streaming reader for the game-data XML that dispatches on root and type (ASSET-139)
Converts RAGE parser XML into plain values by its conventions (value,
x/y/z/w, content arrays, polymorphic type and NULL, ref, Item lists and
keyed maps, extra attributes), with register_root / register_type for
typed handlers. Each top-level field is converted and dropped as it ends.
On the 1.0.2.1 carve of common.rpf: 259 of 267 documents, 111 roots, 317
type classes, 0 conversion errors (counts only). Synthetic tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:26:13 +01:00