AdminStealth 0.2.0: keep admins hidden across reconnects and map changes, block joining teams while hidden

This commit is contained in:
Astra 2026-09-27 19:08:59 +01:00
parent 791c198fa0
commit b60f508a7b
2 changed files with 282 additions and 17 deletions

View file

@ -7,24 +7,38 @@ admin off the scoreboard. This plugin makes it look like they left the server:
client only. The server and other plugins never see it, so the admin stays connected.
- While an admin is hidden, their team changes, their death and their real disconnect are not
broadcast to clients.
- Hiding lasts until the admin unhides. Hidden admins are saved by SteamID in
`configs/plugins/AdminStealth/hidden.json`. When one reconnects, or on a map change (SimpleAdmin
forgets hidden admins on both), their join isn't announced, the plugin runs `css_hide` for them
again once SimpleAdmin has loaded their permissions, and tells them they're still hidden. After
five tries (about 12 seconds) it gives up, forgets them and tells them they're visible.
- A hidden admin can't join a team or go to spectators (`jointeam` and `spectate` are blocked
with a chat message). If the game or another plugin puts them on a team anyway, which makes
SimpleAdmin unhide them, they're hidden again straight away.
- `status` from a player's console is blocked and prints nothing. It still works from the server
console and RCON.
The plugin listens for `css_hide` under whatever aliases SimpleAdmin's
`configs/plugins/CS2-SimpleAdmin/Commands.json` gives it (by default `css_hide` and `css_stealth`),
so adding aliases there (e.g. `css_invis`) works here too after a restart.
WebPanelBridge leaves hidden admins out of `css_webpanel_status`, so simpleadmin-web doesn't show
them either.
Built for CounterStrikeSharp **1.0.375** (`net10.0`) on Metamod:Source 2.0.0.1469, and needs
Built for CounterStrikeSharp **1.0.376** (`net10.0`) on Metamod:Source 2.0.0.1469, and needs
CS2-SimpleAdmin 1.8.2b's shared API (`CS2-SimpleAdminApi`). `lib/CS2-SimpleAdminApi.dll` is a
compile-time copy of the server's `shared/` one and isn't shipped. Without SimpleAdmin loaded, only
the `status` block works.
## Limits
- Hiding still lasts only as long as SimpleAdmin remembers it: a map change or reconnect makes the
admin visible again, and joining a team unhides them.
- After a reconnect or map change, the admin is visible to SimpleAdmin (and so on the web panel) for
the few seconds it takes to hide them again.
- Unhiding doesn't announce the admin as joining again.
- The server browser and trackers get the player list from a separate server query, which this
doesn't touch, so they still list a hidden admin.
- Reloading CS2-SimpleAdmin on its own leaves this plugin listening to the old instance. Reload
AdminStealth after it.
## Install
@ -41,4 +55,4 @@ tar -xzf AdminStealth-<tag>.tar.gz -C /srv/cs2/game/csgo
To publish one, commit, bump `ModuleVersion`, then run
`FORGEJO_TOKEN=... ./release.sh v<ModuleVersion>`. It rebuilds the plugin from the committed
source in the SDK container, tags HEAD, and uploads `AdminStealth-<tag>.tar.gz` to the git.zio.sh
release. The plugin has no config.
release. The plugin has no config. The release never includes `hidden.json`.