Skip to content

feat(ns2): add player warnings using sv_say - #5246

Open
dgibbs64 wants to merge 1 commit into
developfrom
feat/ns2-player-warnings
Open

dgibbs64 wants to merge 1 commit into
developfrom
feat/ns2-player-warnings

Conversation

@dgibbs64

Copy link
Copy Markdown
Member

Description

Adds in-game player warnings (warnplayerstimer) for Natural Selection 2.

ns2server had consoleinteract="no", so warnings were skipped as "not supported" and the send command was blocked. The NS2 server console does take input, and sv_say is a stock NS2 admin command (no Shine needed) that prints to every player's chat as Admin: <message>.

Changes:

  • ns2server/_default.cfg: consoleinteract="yes". This also enables ./ns2server send.
  • command_stop.sh: sv_say %s as the warning command for ns2.

Shine users who want a centred message can still use send with sh_csay, but warnings use sv_say so they work on a stock server.

NS2: Combat (ns2cserver) is not changed: its console could not be tested here, so it keeps consoleinteract="no".

Fixes #5240

Affected servers: ns2

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Chore (CI, workflows, tooling or other maintenance).
  • Comment update (typo, spelling, explanation, examples, etc).

Testing

  • Commands/tests run: on a running build 345 ns2server, typed into its tmux console the same way fn_stop_warn_players_send does (send-keys -l "<text>" then ENTER): sv_say LinuxGSM console test, an unknown command as a negative test, and sv_status.
  • Result: sv_say was run as an admin command and printed Chat All - Admin: LinuxGSM console test, with spaces intact. sv_status was run as an admin command too. The unknown command was echoed but did nothing, as expected. No Shine on that server.
  • Environment used (distro/version): Ubuntu 26.04 container on a test server.

Risk and rollback

  • Risk level: low (only affects ns2, and warnings stay off unless warnplayerstimer is set)
  • Rollback plan: revert the commit.

Breaking changes

  • No breaking changes.
  • Breaking changes included (describe below).

Documentation

  • No documentation update required.
  • User documentation update required (LinuxGSM-Docs). Docs PR adds NS2 to the supported games table on the player warnings page.
  • Developer documentation update required (LinuxGSM-Dev-Docs).

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue ("Fixes", or "Related to" for a partial fix).
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Thank you for your Pull Request!

The NS2 server console accepts input: sv_say is a stock admin command (no Shine needed) and shows in chat as "Admin: <message>". Set consoleinteract to yes, which also enables the send command, and add sv_say as the ns2 warning command so warnplayerstimer works.

Fixes #5240
@dgibbs64 dgibbs64 added this to the v26.7.0 milestone Nov 20, 2026
@github-actions github-actions Bot added the type: feature New feature or request label Nov 20, 2026
@github-actions github-actions Bot added engine: spark Issues related to spark engine game: Natural Selection 2 Issues related to Natural Selection 2 game: NS2: Combat Issues related to NS2: Combat labels Nov 20, 2026
@dgibbs64 dgibbs64 removed the game: NS2: Combat Issues related to NS2: Combat label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine: spark Issues related to spark engine game: Natural Selection 2 Issues related to Natural Selection 2 type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant