Skip to content

fix: run the admin commands from the server console and rcon - #116

Merged
Rushaway merged 2 commits into
masterfrom
fix/console-commands
Nov 2, 2026
Merged

Rushaway merged 2 commits into
masterfrom
fix/console-commands

Conversation

@Rushaway

@Rushaway Rushaway commented Nov 2, 2026

Copy link
Copy Markdown
Member

Part of #109, split from #110.

Changes

  • New PrintToChatOrReply() helper: chat for players, command reply for the server console. Used by the tag and color set functions, so sm_forcetag, sm_forcetagcolor, sm_forcenamecolor and sm_forcetextcolor work from the console and rcon.
  • sm_cccaddtag, sm_cccdeletetag, sm_cccaddtrigger, sm_cccdeletetrigger, sm_cccban and sm_cccunban store client ? GetClientUserId(client) : 0 like sm_cccimportreplacefile, and sm_cccban stores the issuer name with %N ("Console" for the server).
  • The requests and callbacks treat userid 0 as the server console: they only drop a request when a real player left. The console uses retry slot 0, which SQL_BeginRequest() now resets. The "replace list full" and "import failed" messages go to the server console.
  • Version 8.1.5.

Checks

  • Builds with spcomp 1.12 and the CI dependencies, no warnings.

🤖 Generated with Claude Code

- sm_forcetag, sm_forcetagcolor, sm_forcenamecolor and sm_forcetextcolor
  answered with CPrintToChat, which throws for the server console. New
  PrintToChatOrReply() helper: chat for players, command reply for the
  console.
- sm_cccaddtag, sm_cccdeletetag, sm_cccaddtrigger, sm_cccdeletetrigger,
  sm_cccban and sm_cccunban called GetClientUserId(0), which throws. They
  store userid 0 for the console like sm_cccimportreplacefile, and
  sm_cccban stores "Console" as the issuer name.
- The requests and callbacks treat userid 0 as the server console: they
  only drop a request when a real player left. The console uses retry
  slot 0, which SQL_BeginRequest() now resets. The "replace list full"
  and "import failed" messages go to the server console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rushaway
Rushaway merged commit eb6f21d into master Nov 2, 2026
9 checks passed
@Rushaway
Rushaway deleted the fix/console-commands branch November 2, 2026 09:11
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