Uh oh!
There was an error while loading. Please reload this page.
Parse table/Server/defaultCharacterInfo.xml - #78
Conversation
Adds DefaultCharacterInfoRoot plus ServerTableParser.ParseDefaultCharacterInfo, so consumers can read the per-gender default appearance (skin palette and the HR/FA/FD/ER items with their hair controls) instead of hand-rolling an XmlDocument walk over the entry. colorSN defaults to -1 rather than 0: the attribute is absent on slots that keep the palette's own swatch, and 0 is a real swatch index. Verified against Server.m2d: both gender blocks, all four slots each, the two hair controls with their Vector3 position/rotation, and the -1 sentinel on ER/FD all round-trip to the raw XML. Maple2.File.Tests cannot run on this machine - TestUtils' static constructor trips a Debug.Fail inside AssetIndex for this data folder, which fails every test in the project including untouched ones. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds XML models and ChangesDefault character info parsing
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ServerTableParser
participant defaultCharacterInfo.xml
participant XmlSerializer
ServerTableParser->>defaultCharacterInfo.xml: Load table data
ServerTableParser->>XmlSerializer: Deserialize DefaultCharacterInfoRoot
XmlSerializer-->>ServerTableParser: Return gender entries
Possibly related PRs
Suggested reviewers: ✨ 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.
table/Server/defaultCharacterInfo.xmlhad no type here, so a consumer that needs the per-gender default appearance (Maple2's gender-change voucher) had to hand-roll anXmlDocumentwalk over the entry. This adds the type and the parser method.Xml/Table/Server/DefaultCharacterInfo.cs:DefaultCharacterInfoRoot→genderblocks, each withskinanditems/item, each item optionally carryingcontrols/control(hair transform).valueis[M2dEnum] Gender;position/rotationare[M2dVector3].ServerTableParser.ParseDefaultCharacterInfo()returns(Gender, DefaultCharacterInfo), matching the otherParse*methods.colorSNdefaults to-1, not0. The attribute is absent on slots that keep the palette's own swatch, and0is a real swatch index.PackageVersion2.4.20 → 2.4.21.Verification
Ran a throwaway harness against the real
Server.m2dand diffed the parsed tree against the raw XML entry. Every field round-trips:dotnet buildclean (0 errors),dotnet format whitespace --verify-no-changesclean.Not run:
dotnet test Maple2.File.Tests. It cannot start on my machine -TestUtils' static constructor trips aDebug.FailinsideAssetIndexfor this data folder, which fails every test in the project, including untouched ones likeTestMaidRecipe. The newTestDefaultCharacterInfois therefore unexecuted; it asserts the same structure the harness above confirmed.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Tests