Skip to content

Take the console title helper from NosCore.Shared - #2363

Merged
erwan-joly merged 1 commit into
masterfrom
chore/use-shared-console-helper
Aug 30, 2026
Merged

Take the console title helper from NosCore.Shared#2363
erwan-joly merged 1 commit into
masterfrom
chore/use-shared-console-helper

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

What

NosCore.Core.ConsoleTitle was written here (#2323) because the package had nothing to offer. NosCore.Shared 6.0.2 does: ConsoleHelper carries the same two calls, next to the window-size predicate Logger.PrintHeader uses. So the local copy goes and the seven call sites take the shared one.

ConsoleTitle.SetConsoleHelper.SetTitle, ConsoleTitle.AppendConsoleHelper.AppendTitle. Behaviour is identical — same Windows check, same !IsOutputRedirected, same GetConsoleWindow() probe.

Why it belongs in the package

Three repositories had grown the same try { Console.Title = …; } catch { }: this one, NosCore.Injector and NosCore.ParserInputGenerator. All three already depend on NosCore.Shared, so one helper serves them. The other two are separate repositories and get the same treatment separately.

6.0.2 also fixes a hole in PrintHeader itself: its width probe counted stdin, and a console input handle has no screen buffer, so Server.exe > log.txt 2>&1 from a shell still threw. Nothing here changes for that — the package handles it — but it is the reason the version moves.

Testing

  • Builds with 0 warnings; suite green — 1126 tests.
  • Verified against the packed NosCore.Shared.6.0.2.nupkg before it indexed on nuget.org; CI restores the published one.
  • Not played in game — startup path only, no in-game behaviour.

Summary by CodeRabbit

  • Improvements

    • Server console titles continue to display service names, ports, and configuration details across login, master, parser, and world servers.
    • Console title handling has been standardized for more consistent behavior.
  • Maintenance

    • Updated the shared package version to 6.0.2.

NosCore.Core.ConsoleTitle was written here because the package had nothing
to offer. 6.0.2 does - ConsoleHelper carries the same two calls next to the
window-size predicate that Logger.PrintHeader uses - so the local copy goes
and the seven call sites take the shared one.

NosCore.Injector and NosCore.ParserInputGenerator keep their own
try/catch around Console.Title and can drop it the same way; they are
separate repositories.

Tested: builds with 0 warnings, suite green - 1126 tests.
@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: 55d58ccc-e28e-4cb2-a18c-bda9f840c785

📥 Commits

Reviewing files that changed from the base of the PR and between c1f8fb5 and b6b1a19.

📒 Files selected for processing (9)
  • Directory.Packages.props
  • src/NosCore.Core/ConsoleTitle.cs
  • src/NosCore.LoginServer/LoginServer.cs
  • src/NosCore.LoginServer/LoginServerBootstrap.cs
  • src/NosCore.MasterServer/MasterServer.cs
  • src/NosCore.MasterServer/MasterServerBootstrap.cs
  • src/NosCore.Parser/ParserBootstrap.cs
  • src/NosCore.WorldServer/WorldServer.cs
  • src/NosCore.WorldServer/WorldServerBootstrap.cs
💤 Files with no reviewable changes (1)
  • src/NosCore.Core/ConsoleTitle.cs

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


Walkthrough

The change updates NosCore.Shared, removes the local ConsoleTitle class, and migrates login, master, parser, and world server code to ConsoleHelper for console title operations.

Changes

Console title helper migration

Layer / File(s) Summary
Shared console title contract
Directory.Packages.props, src/NosCore.Core/ConsoleTitle.cs
NosCore.Shared is updated from 6.0.1 to 6.0.2. The local ConsoleTitle implementation and its Windows console APIs are removed.
Server console title wiring
src/NosCore.LoginServer/*, src/NosCore.MasterServer/*, src/NosCore.Parser/*, src/NosCore.WorldServer/*
Server startup and execution paths use ConsoleHelper.SetTitle and ConsoleHelper.AppendTitle. Required namespace imports are added.

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

Merge Risk: ⚪ Minimal · up to b6b1a

The change centralizes existing console-title behavior in the shared package without altering startup reachability or user-visible functionality; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: denislauri1999

🚥 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 7 functions across 7 files. (1 skipped: 1 … 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: moving the console title helper to NosCore.Shared. It is concise and relevant to the pull request.
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.
Full details: Docstring Coverage

Explanation

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 7 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/use-shared-console-helper

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 61c1fec into master Aug 30, 2026
2 checks passed
@erwan-joly
erwan-joly deleted the chore/use-shared-console-helper branch August 30, 2026 14:30
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