Skip to content

Read a game's INFO name only from inside a closed block - #194

Merged
HarryCordewener merged 1 commit into
mainfrom
fix/info-name-needs-a-closed-block
Sep 28, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
fix/info-name-needs-a-closed-block

Conversation

@HarryCordewener

@HarryCordewener HarryCordewener commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

What happened

mud.paroxysmrpg.com:3000 (submitted 2026-09-20) treats INFO as a character name. It replies:

Illegal name, try another.
Name: ESC[40;0;37m

The second line is its own login prompt, ending in a colour reset. LoginCommandReading.MeaningfulName read any Name: line anywhere in the reply, so the listing was named \x1B[40;0;37m and got the slug /g/40-0-37m. I renamed it to Paroxysm by hand on 2026-09-28 (slug is now paroxysm, and the old one 301s).

Change

  • MeaningfulName now reads only the lines strictly inside an INFO block that both opened and closed. That's the rule ConnectedPlayers already followed.
  • Both readers get their lines from one InfoBlock helper, which strips CSI colour codes first. A coloured name reads cleanly, and a value that is only colour codes reads as nothing.
  • CatalogueBinder also uses a non-null MeaningfulName as a sign the address is a game, so a login prompt shaped like Name: no longer counts toward that either.

Tests

  • New tests refuse the measured Paroxysm bytes, an echoed Name: INFO, and an unterminated block.
  • A coloured name inside a block reads without its codes.
  • MUI.Crawl.Tests 606/606, MUI.Crawler.Tests 351/351.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Login details now recognize player names and connected-player information only within a complete server information block, ignoring labelled text outside it.
    • Colour and other supported terminal formatting codes are removed before login information is read, so they no longer interfere with names or player details.
    • Names containing only formatting codes are no longer accepted.

mud.paroxysmrpg.com:3000 takes INFO as a character name. It replies
"Illegal name, try another." and then its own prompt, `Name: ESC[40;0;37m`,
with a trailing colour reset after the colon. `LoginCommandReading.MeaningfulName`
read every `Name:` line anywhere in the reply, so that escape sequence became
the listing's name and minted /g/40-0-37m (submitted 2026-09-20, renamed to
Paroxysm by hand 2026-09-28). The same reading also admits the address in
`CatalogueBinder`, which should only happen when the server actually named itself.

`ConnectedPlayers` already refused anything outside a block that both opened
and closed, for this reason. Both readers now take their lines from one
`InfoBlock` helper that strips CSI colour codes first, so a coloured value
still reads cleanly and a value made only of colour codes reads as empty.

Tests: the measured Paroxysm bytes, an echoed `Name: INFO`, and an unterminated
block are all refused. A coloured name inside a block reads without its codes.
MUI.Crawl.Tests 606/606, MUI.Crawler.Tests 351/351.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Essentials

Run ID: dcd3a92b-f08f-4b21-a948-1f77b19cf116

📥 Commits

Reviewing files that changed from the base of the PR and between 0df4178 and 396e71a.

📒 Files selected for processing (2)
  • src/MUI.Crawl/LoginFlow/LoginCommandReading.cs
  • tests/MUI.Crawl.Tests/LoginFlow/LoginCommandReadingTests.cs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


Walkthrough

The login reader now parses names and connected-player counts from lines inside the first closed INFO block. It removes ANSI CSI escape sequences before parsing. Tests cover incomplete blocks and names with ANSI color codes.

Changes

INFO Block Parsing

Layer / File(s) Summary
INFO block extraction and ANSI handling
src/MUI.Crawl/LoginFlow/LoginCommandReading.cs
InfoBlock returns lines from the first closed INFO block after removing ANSI escape sequences. An unclosed block returns no lines.
Name and player parsing
src/MUI.Crawl/LoginFlow/LoginCommandReading.cs, tests/MUI.Crawl.Tests/LoginFlow/LoginCommandReadingTests.cs
MeaningfulName and ConnectedPlayers use lines from InfoBlock. Tests cover text outside a closed block, ANSI-wrapped names, and values containing only ANSI color codes.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 396e7

No actionable issue remains; the change is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reading a game's INFO name only from a closed INFO block.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@HarryCordewener
HarryCordewener merged commit 630f655 into main Sep 28, 2026
3 checks passed
@HarryCordewener
HarryCordewener deleted the fix/info-name-needs-a-closed-block branch September 28, 2026 23:19
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