Skip to content

Parse table/reactor.xml and table/reactorstate.xml - #82

Merged
Zintixx merged 1 commit into
MS2Community:masterfrom
Zintixx:parse-reactor-xml
Aug 31, 2026
Merged

Parse table/reactor.xml and table/reactorstate.xml#82
Zintixx merged 1 commit into
MS2Community:masterfrom
Zintixx:parse-reactor-xml

Conversation

@Zintixx

@Zintixx Zintixx commented Aug 30, 2026

Copy link
Copy Markdown

table/reactor.xml and table/reactorstate.xml had no type here, so any consumer that needs to look up which GameEvent a reactor id belongs to (Maple2's <gameEvent eventType="reactor"> gate flows through reactor.gameEventId) would have to hand-roll an XmlDocument walk.

  • Xml/Table/Reactor.cs: ReactorRoot locale-filtered by id (same row appears once per locale), then attributes id, reactDistance, reactorStateList, connectedEffect, gameEventId, rewardItemListXml, reactTimeMSec (defaults 15000), reactAnimation, createAnimation. reactorStateList and rewardItemListXml stay strings on purpose: the former is "[100, 101, 102, 103]" (M2dArray chokes on the []), the latter is an escaped <items><v .../></items> fragment.
  • Xml/Table/ReactorState.cs: id, type (connect/sleep/reward), nextTimeSec, expireTimeSec, kfmName, startAni, idleAni, actionStringKey, plus a nested CondItem { code, consume } element. Only connect states carry a populated <condItem>; others self-close.
  • TableParser gets ParseReactor() and ParseReactorState() matching the other Parse* methods.
  • PackageVersion 2.4.23 → 2.4.24.

Verification

dotnet build clean. Both new tests (TestReactor, TestReactorState) pass. The one pre-existing failure in TableParserTest (TestFieldMetaData) is from #81 and unrelated to this PR — it looks for table/na/fieldmetadata.xml which isn't in my MS2_DATA_FOLDER; all 148 other tests pass alongside the two new ones.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

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: cac622a7-5692-4ac0-92ef-5397904d9bc1


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.

`table/reactor.xml` and `table/reactorstate.xml` had no type here, so any
consumer that needs to look up which GameEvent a reactor id belongs to
(Maple2's `<gameEvent eventType="reactor">` gate flows through
`reactor.gameEventId`) would have to hand-roll an `XmlDocument` walk.

- `Xml/Table/Reactor.cs`: `ReactorRoot` locale-filtered by `id` (same row
  appears once per locale), then attributes `id`, `reactDistance`,
  `reactorStateList`, `connectedEffect`, `gameEventId`, `rewardItemListXml`,
  `reactTimeMSec` (defaults 15000), `reactAnimation`, `createAnimation`.
  `reactorStateList` and `rewardItemListXml` stay strings on purpose:
  the former is `"[100, 101, 102, 103]"` (M2dArray chokes on the `[]`),
  the latter is an escaped `<items><v .../></items>` fragment.
- `Xml/Table/ReactorState.cs`: `id`, `type` (connect/sleep/reward),
  `nextTimeSec`, `expireTimeSec`, `kfmName`, `startAni`, `idleAni`,
  `actionStringKey`, plus a nested `CondItem { code, consume }` element.
  Only `connect` states carry a populated `<condItem>`; others self-close.
- `TableParser` gets `ParseReactor()` and `ParseReactorState()` matching
  the other `Parse*` methods.
- `PackageVersion` 2.4.21 -> 2.4.22.

`dotnet build` clean. All 150 TableParserTest cases pass, including the
two new ones (`TestReactor`, `TestReactorState`).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Zintixx
Zintixx force-pushed the parse-reactor-xml branch from aa9057b to 7d0a703 Compare August 31, 2026 00:03
@Zintixx
Zintixx merged commit c34beb2 into MS2Community:master Aug 31, 2026
4 checks passed
@Zintixx
Zintixx deleted the parse-reactor-xml branch August 31, 2026 00:06
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