Skip to content

fix(einfo): the monster name is the last field, so it has to opt into escaping - #507

Merged
erwan-joly merged 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/escape-spaces-trailing-names
Aug 31, 2026
Merged

fix(einfo): the monster name is the last field, so it has to opt into escaping#507
erwan-joly merged 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/escape-spaces-trailing-names

Conversation

@denislauri1999

@denislauri1999 denislauri1999 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

A trailing string field keeps its spaces unless it opts in, and Name is the
last field of e_info. Without the flag the line ends

... 0 0 -1 Mother Cuby

and everything after the first word is read as extra fields.

It is not a rare shape: 929 of the 1109 monster info lines in a capture carry a
name with a space in it, across 630 distinct names.

What was tested

Added to AFieldThatOptsInIsEscapedEvenThoughItIsLast, next to the two fields
that already opt in. Written red first: without the flag it fails with
actual: "... -1 Mother Cuby", with it the tail reads Mother^Cuby.

dotnet build: 0 warnings. dotnet test: 127/127.

What was NOT tested

Not played. This is the packet model only; the server side that fills the field
is a separate change.

Summary by CodeRabbit

  • Bug Fixes

    • Improved serialization of NPC monster names containing spaces, ensuring they are transmitted correctly without field-separation issues.
  • Tests

    • Added coverage verifying that spaced monster names are properly escaped during serialization.

… escaping

A trailing string field keeps its spaces unless it asks not to, and a monster
name is the last field of e_info. 929 of the 1109 monster info lines in a real
capture carry a space, across 630 distinct names, so without the flag the field
splits and everything after the first word is read as extra fields.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a588ca38-f4f1-4b8f-b1c9-500995de9702

📥 Commits

Reviewing files that changed from the base of the PR and between 5caf2c1 and fac930a.

📒 Files selected for processing (2)
  • src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs
  • test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The EInfoNpcMonsterPacket.Name field now escapes spaces during serialization. Tests register the packet and verify that Mother Cuby serializes as Mother^Cuby.

Changes

NPC monster name serialization

Layer / File(s) Summary
NPC monster name escaping
src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs, test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs
The Name field enables space escaping. The serializer test verifies the escaped output Mother^Cuby.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to fac93

The change correctly escapes spaces in trailing monster names so packet fields are parsed reliably; focused tests and the full build/test suite pass, and no actionable merge-blocking risk remains.

Suggested reviewers: erwan-joly

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enabling space escaping for the trailing monster name field in the e_info packet.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@erwan-joly
erwan-joly merged commit 5218ba1 into NosCoreIO:master Aug 31, 2026
4 checks passed
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.

2 participants