Uh oh!
There was an error while loading. Please reload this page.
Parse the fieldPortal section of table/FieldMetaData.xml - #81
Merged
Conversation
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>
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
table/FieldMetaData.xmlhas 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.csmodels<fieldPortal field="X" indoor="N">and its<portal>children. Only that section is modelled. The file also carriesnpc,interactObject,fluid,liftable,petandtaxiStationsections, and nothing consumes those yet.indoorandportalIndoorareboolbecause the shipped data only ever holds 0 or 1 for both, checked across all 1008 entries.TableParser.csgainsParseFieldMetaData(), yielding(field id, entry)to match the other table parsers, plus the serializer field and its constructor line.TableParserTest.cspins the shipped shape: 1008 entries, 299 of themindoor="0", theportalIndooredge from Turtcoli Cave2000250to Royal Road Plaza2000114, the PvP arena65010004whose portals all target field 0, and the absence of Wedding Village84000001. A parse that silently droppedindoororportalIndoorwould 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 Releasesucceeds.The test I added has never executed.
Maple2.File.Testscannot run on my machine at all:TestUtils's static constructor throwsDebugAssertExceptionfromAssetIndex.ParseNtFilewhile readingasset-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,TestFieldMetaDatais 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 formatnot run; the diff follows the surrounding style by hand.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.