Escape the spaces in the monster name - #509
Conversation
Name ends the e_info line, and a last field keeps its spaces so free text
like a chat message survives. A monster name is a value, not free text, and
EscapeSpaces already exists for exactly that - GInfoPacket, MlInfoBrPacket
and MlintroPacket declare it. This one did not, so consumers were left to
call Replace(' ', '^') themselves before handing the value over.
929 of the 1109 monster-info lines in a capture carry a name with a space.
Test asserts the serialised tail, and fails on the raw name without the
attribute.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe packet metadata now escapes spaces in NPC monster names during serialization. Tests cover the ChangesMonster name serialization
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change corrects how spaces are encoded in one existing monster-name packet field and is covered by a focused serialization test; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 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 |
What
EInfoNpcMonsterPacket.Nameis[PacketIndex(25)]— the last field — and a last field keeps its spaces, so free text like a chat message survives the trip. A monster name is a value, not free text, and 929 of the 1109 monster-info lines in a capture carry a name with a space in it.EscapeSpacesalready exists for exactly this, andGInfoPacket,MlInfoBrPacketandMlintroPacketdeclare it. This one did not, so consumers were left callingReplace(' ', '^')themselves before handing the value over — which is what NosCoreIO/NosCore#2365 was about to ship.One attribute argument, and
<Version>21.1.1 → 21.1.2.Testing
SerializeEInfoNpcMonsterPacketEscapesTheNameasserts the serialised tail reads-1 Fire^Cannoneer. Written red first: without the attribute it fails on the rawFire Cannoneer.dotnet test: 128 tests, all green.Summary by CodeRabbit
Bug Fixes
Maintenance
Tests