Skip to content

DisableChat spawn.ini option for ladder#62

Open
CnCRAZER wants to merge 6 commits intomainfrom
disablechat
Open

DisableChat spawn.ini option for ladder#62
CnCRAZER wants to merge 6 commits intomainfrom
disablechat

Conversation

@CnCRAZER
Copy link
Contributor

@CnCRAZER CnCRAZER commented Feb 23, 2026

Potential solution to issue #60

Mirrors the DisableChat functionality of the older yr spawner.

Pull rquest to remain open and used for testing nightlybuild dll's.

Continuously enforces the disabled chat state to prevent
users from re-enabling it through the alliances menu.
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Provides visual feedback to the user when chat is disabled via the spawner configuration, preventing them from unknowingly attempting to send messages.

The feedback is throttled to prevent spamming the chat window.
Copy link

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

Adds a per-player DisableChat spawn.ini option to reintroduce the legacy “no send / no receive chat” behavior for ranked/ladder use cases (issue #60).

Changes:

  • Introduces DisableChat in SpawnerConfig with default false and INI loading support.
  • Implements hooks to suppress outgoing chat, suppress incoming chat display, and prevent re-enabling chat via the diplomacy UI.
  • Enforces Game::ChatMask while DisableChat is enabled.

Reviewed changes

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

File Description
src/Spawner/Spawner.Config.h Adds DisableChat config field with default value.
src/Spawner/Spawner.Config.cpp Loads DisableChat from the [Settings] section of spawn.ini.
src/Misc/InGameChat.cpp Adds hooks/UI enforcement to disable sending/receiving chat when configured.

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

Comment on lines +55 to +65
static int LastDisableChatFeedbackFrame = -1000;

if (IsDisableChatEnabled())
{
const int currentFrame = Unsorted::CurrentFrame;

if (currentFrame - LastDisableChatFeedbackFrame >= 90)
{
MessageListClass::Instance.PrintMessage(L"Chat is disabled. Message not sent.");
LastDisableChatFeedbackFrame = currentFrame;
}
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

LastDisableChatFeedbackFrame is a function-local static that persists across matches. If Unsorted::CurrentFrame resets to 0 on a new game, currentFrame - LastDisableChatFeedbackFrame will be negative and the feedback message may never display again until the frame counter surpasses the previous match’s value. Consider resetting the stored frame when the current frame goes backwards (or move this state into a global that gets reset in the game-start reset hook).

Copilot uses AI. Check for mistakes.
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.

3 participants