Parse table/Server/defaultCharacterInfo.xml - #78
Merged
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 |
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 free
to 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/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