Skip to content

Parse the fieldPortal section of table/FieldMetaData.xml - #81

Merged
AngeloTadeucci merged 2 commits into
masterfrom
feat/field-metadata-parser
Aug 28, 2026
Merged

Parse the fieldPortal section of table/FieldMetaData.xml#81
AngeloTadeucci merged 2 commits into
masterfrom
feat/field-metadata-parser

Conversation

@AngeloTadeucci

@AngeloTadeucci AngeloTadeucci commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

table/FieldMetaData.xml has no parser type, and its <fieldPortal> section is the client's own source for which exploration zone a sub-map belongs to. PrivateMaple2 currently reconstructs that mapping from map properties and runtime portal targets, which is a guess that has already needed one special case. This adds the type and the parse method so the real table can be ingested instead.

Package version goes to 2.4.23.

Files

Xml/Table/FieldMetaData.cs models <fieldPortal field="X" indoor="N"> and its <portal> children. Only that section is modelled. The file also carries npc, interactObject, fluid, liftable, pet and taxiStation sections, and nothing consumes those yet. indoor and portalIndoor are bool because the shipped data only ever holds 0 or 1 for both, checked across all 1008 entries.

TableParser.cs gains ParseFieldMetaData(), yielding (field id, entry) to match the other table parsers, plus the serializer field and its constructor line.

TableParserTest.cs pins the shipped shape: 1008 entries, 299 of them indoor="0", the portalIndoor edge from Turtcoli Cave 2000250 to Royal Road Plaza 2000114, the PvP arena 65010004 whose portals all target field 0, and the absence of Wedding Village 84000001. A parse that silently dropped indoor or portalIndoor would still deserialize, and it would quietly change what the consumer computes, so the test checks those two attributes specifically rather than just iterating.

Verification

dotnet build Maple2.File.Parser -c Release succeeds.

The test I added has never executed. Maple2.File.Tests cannot run on my machine at all: TestUtils's static constructor throws DebugAssertException from AssetIndex.ParseNtFile while reading asset-web-metadata.m2d, which fails every test in the project at class initialization. I confirmed this on a clean tree with my changes stashed, so it predates this branch. If the suite runs for you, TestFieldMetaData is the one to watch.

The parse itself is verified by other means. I packed 2.4.23 locally, pointed PrivateMaple2's ingest at it, and re-ingested. The resulting component walk produces 388 members, which matches an independent Python walk over the raw XML exactly, including the three multi-root members and every spot check. So the parser demonstrably reads the file correctly, just not through this test.

dotnet format not run; the diff follows the surrounding style by hand.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The client builds its sub-map to exploration-zone mapping from this section at
startup, and PrivateMaple2 needs the same table to stop reconstructing that
mapping from map properties and runtime portal targets.

Xml/Table/FieldMetaData.cs models the fieldPortal entries and their portal
children. Only that section is modelled; the file also carries npc,
interactObject, fluid, liftable, pet and taxiStation sections that nothing
consumes yet.

ParseFieldMetaData on TableParser yields (field id, entry), matching the shape
of the other table parsers.

TableParserTest pins the shipped counts and the portalIndoor edge out of
Turtcoli Cave, so a parse that silently drops indoor or portalIndoor fails
rather than changing consumer behaviour quietly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a8a2c47c-426b-40f6-927f-3bc2aeac05e6

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/field-metadata-parser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AngeloTadeucci
AngeloTadeucci merged commit d1a2815 into master Aug 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant