Skip to content

Add a server setting that turns off typed console commands - #22

Open
absol89 wants to merge 3 commits into
devfrom
feat/allow-console-commands
Open

absol89 wants to merge 3 commits into
devfrom
feat/allow-console-commands

Conversation

@absol89

@absol89 absol89 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Gameplay:bAllowConsoleCommands (default true, so existing servers are unchanged; ToggleConsoleCommands switches it at runtime) is sent to clients with the other server settings. When it is false, the client refuses lines a player types into the console and sends with Enter, and prints a note in the console instead. The console still opens, so clicking a reference to read its id keeps working, and commands run by code (ConsoleUtil, Papyrus ExecuteCommand, the F2 chat /wave) are untouched. Stops trolls spawning enemies in town or killing NPCs from the console.

The hook is the Console menu's ExecuteCommand callback (51084), which only builds and queues a script from the typed line. Checked in the 1.6.1170 and 1.7.104 databases: 51083 registers it, 51084 reads the line from args->pArgs[0] and queues it without running it, 51109 is ConsoleLog::Print and 401203 the ConsoleLog singleton. Tested in game 2 Nov.

image

Claude-Session: https://claude.ai/code/session_018fvQxNiMZ7kPLL1PGMuxYo

Gameplay:bAllowConsoleCommands (default true, so existing servers are
unchanged; ToggleConsoleCommands switches it at runtime) is sent to clients
with the other server settings. When it is false, the client refuses lines a
player types into the console and sends with Enter, and prints a note in the
console instead. The console still opens, so clicking a reference to read its
id keeps working, and commands run by code (ConsoleUtil, Papyrus
ExecuteCommand, the F2 chat /wave) are untouched. Stops trolls spawning
enemies in town or killing NPCs from the console.

The hook is the Console menu's ExecuteCommand callback (51084), which only
builds and queues a script from the typed line. Checked in the 1.6.1170
and 1.7.104 databases: 51083 registers it, 51084 reads the line from
args->pArgs[0] and queues it without running it, 51109 is ConsoleLog::Print
and 401203 the ConsoleLog singleton. Not tested in game yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxNiMZ7kPLL1PGMuxYo
- Shorten the comments and drop the mention of an unmerged feature.
- Type the ExecuteCommand callback as void(const FxDelegateArgs*).
- Replace the ported CommonLibSSE-NG structs with GFxValue and
  FxDelegateArgs in IMenu.h, laid out after powerof3's CommonLibSSE, and
  use them for FxDelegateHandler::CallbackFn.
- Keep tcl, tfc, tgm, tm and coc (and their full names) allowed while
  typed commands are turned off. A reference prefix is still refused.

World has no const getter, so World::Get() stays as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxR8LzniCZWnKRhyEtP
tgm makes a player invulnerable, which breaks PvP, and tcl lets a player
walk through walls and breaks enemy pathing. Players who are stuck can
use fast travel, teleport to a party member, or the Become Ethereal
shout instead. tfc, tm and coc stay allowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fvQxR8LzniCZWnKRhyEtP
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.

2 participants