Skip to content

Re-Enable Console Pipe Functionality#24963

Merged
Nyeriah merged 7 commits intoazerothcore:masterfrom
yani9o:pipe-fix
Mar 13, 2026
Merged

Re-Enable Console Pipe Functionality#24963
Nyeriah merged 7 commits intoazerothcore:masterfrom
yani9o:pipe-fix

Conversation

@yani9o
Copy link
Copy Markdown
Contributor

@yani9o yani9o commented Mar 2, 2026

Fix Pipe-Functionality

Changes Proposed:

This PR fixes an issue introduced in #24725 where console input was broken for environments using redirected pipes on windows (in my case: CubeCoders AMP).

Added a check using GetConsoleMode to detect if the server is running in a real interactive Windows console.

  • If a real console is detected, it uses ReadConsoleW to support Unicode/Non-Latin characters as intended by the original commit.
  • If no real console is detected (input is redirected via pipe), it falls back to std::getline.

This ensures that pipes can still send commands to the server while preserving the new Unicode support for real terminals.

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

AI-assisted Pull Requests

Important

While the use of AI tools when preparing pull requests is not prohibited, contributors must clearly disclose when such tools have been used and specify the model involved.

Contributors are also expected to fully understand the changes they are submitting and must be able to explain and justify those changes when requested by maintainers.

  • AI tools (e.g. ChatGPT, Claude, or similar) were used entirely or partially in preparing this pull request:
    ChatGPT helped me with this fix.

Issues Addressed:

Tests Performed:

Piped Console works again (tested with AMP - CubeCoders).

Also tested with normal console:

.lookup spell höh

image

non-latin chars:
image

How to Test the Changes:

use any non-latin character in console.

Known Issues and TODO List:

  • none known

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

@github-actions github-actions Bot added CORE Related to the core file-cpp Used to trigger the matrix build labels Mar 2, 2026
@heyitsbench heyitsbench requested a review from Kitzunu March 2, 2026 01:33
@sudlud sudlud requested review from Copilot and removed request for Kitzunu March 2, 2026 04:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Re-enables Windows worldserver CLI command input when stdin is redirected (pipes), while preserving the Unicode-capable ReadConsoleW path for interactive consoles (regression from #24725 / issue #13203 context).

Changes:

  • Detects whether stdin is a real Windows console via GetConsoleMode.
  • Uses ReadConsoleW + UTF-16→UTF-8 conversion for real consoles; falls back to std::getline(std::cin, ...) for redirected input.
  • Stops the server on redirected-input EOF to mirror the existing EOF shutdown behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server/apps/worldserver/CommandLine/CliRunnable.cpp
yani9o added 3 commits March 2, 2026 13:15
Added iostream include for input/output operations.
fix(Core/Spells): Port SPELL_ATTR3_INSTANT_TARGET_PROCS cascade proc …
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server/apps/worldserver/CommandLine/CliRunnable.cpp
@Nyeriah Nyeriah merged commit e2c966a into azerothcore:master Mar 13, 2026
17 checks passed
trolloks pushed a commit to trolloks/azerothcore-cata that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core file-cpp Used to trigger the matrix build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows Console only takes allows char input

3 participants