Implemented fallback decoder

Added a new fallback decoder on the chance things do not decode correctly with the primary decoder.
This commit is contained in:
Golumpa 2026-07-15 19:32:40 +01:00
parent 042d47e3d4
commit a5312520e7
9 changed files with 691 additions and 5 deletions

View file

@ -10,6 +10,9 @@ Known limitations:
- A partially captured oldest timestamp group is still exported; its captured prefix has stable UIDs, and a later deeper scan adds the rest with the same UIDs.
- Pages are anchored to the continuous run starting at page 1. Live capture reports gaps immediately and accepts replacement pages from another pass while the exporter remains open. Scrolling backward does not request cached pages again, so close and reopen the history board before rescanning. Any gap left when capture ends causes later pages to be ignored and reported as warnings.
- Pipelined page requests and multi-page responses are supported, including observed 10-record responses containing two consecutive Monopoly pages. Non-byte-aligned response payloads are realigned before decoding.
- Structured Monopoly and Arc blocks are parsed in enrichment/fallback mode.
The existing decoder remains authoritative when structured rows do not agree
on record count, reward ID, and timestamp.
- Live capture prefers Npcap on Windows and automatically falls back to the built-in raw-socket backend if Npcap is unavailable. Linux and macOS require the system libpcap runtime.
- The file adapter reads mitmproxy `.flows` captures for research and testing.
- Npcap is Windows-only and is not redistributed with this project; Linux and macOS use their system libpcap.

View file

@ -3,7 +3,7 @@
`tools/update_mappings.py` rebuilds `arcs.json`, `characters.json`, and
`items.json` directly from the current
[`Waifus-Grace/NTE_Assets`](https://github.com/Waifus-Grace/NTE_Assets)
tables. No other exporter or intermediate mapping format is used.
tables.
English display names come from `Localization/en/game.json`. The data tables
provide localization namespace/key references and quality metadata; their

View file

@ -2,6 +2,30 @@
This prototype supports separate Monopoly and Arc/Gashapon history decoders.
## Decoder strategy
Both history paths now recognize the structured `FMonopolyLotteryRecordData`
and `FForkLotteryRecordData` blocks, including blocks packed at a non-byte
alignment. Structured fields include the item/count pair, pool ID, secondary
reward data, roll result, and standard .NET timestamp.
The structured parser is deliberately compatibility-gated:
- The established decoder remains the primary path.
- Structured rows enrich primary rows only when row count, reward ID, and raw
timestamp agree. Enrichment supplies exact quantities, missing roll details,
pool diagnostics, and secondary reward diagnostics.
- If the primary decoder returns no records but a complete structured block is
valid, the structured records are converted into the same internal row shape
as a fallback.
- Malformed, incomplete, mismatched, or ambiguous structured data is ignored;
it cannot overwrite a successfully decoded primary row.
`decoder_mode`, `structured_protocol_view`, `structured_pool_id`,
`secondary_reward_id`, and `secondary_quantity` are research/debug CSV fields.
They are intentionally omitted from the public JSON export, whose format stays
at version 1.
## Monopoly
- History is fetched over the UDP game connection.