WebPanelBridge/README.md

47 lines
2.1 KiB
Markdown

# WebPanelBridge
Reports live match state to [simpleadmin-web](../../go/simpleadmin-web) over RCON: the hostname,
map, team scores, warmup state, and each connected player's userid, name, SteamID64, team,
kills, deaths and ping. Admins hidden with CS2-SimpleAdmin's `css_hide` are left out entirely, as if
they weren't connected, so the panel never lists or counts them. It changes nothing in the game.
Built for CounterStrikeSharp **1.0.376** (`net10.0`) on Metamod:Source 2.0.0.1469. It uses
CS2-SimpleAdmin's shared API (`CS2-SimpleAdminApi`) to spot hidden admins. `lib/CS2-SimpleAdminApi.dll`
is a compile-time copy of the server's `shared/` one and isn't shipped. Without SimpleAdmin loaded,
everyone is listed.
## The command
`css_webpanel_status` is server-only: it runs from the server console or RCON, never from a
player. It prints one JSON object per line, each prefixed with `wpb `, then `wpb end`:
```
wpb {"v":1,"hostname":"zio.sh | Random Skills","map":"de_mirage","maxPlayers":24,"scoreT":7,"scoreCt":9,"warmup":false}
wpb {"userid":2,"name":"astra","steamid":"76561198012345601","team":3,"kills":21,"deaths":9,"ping":12,"bot":false}
wpb end
```
`team` is 1 for spectators, 2 for T and 3 for CT. Bots have `steamid` "0". `maxPlayers` is
`sv_visiblemaxplayers` when that's set, otherwise the slot count.
The prefix lets the panel pick these lines out of anything else the server prints into the same
RCON response. `v` is the format version; the panel rejects output it doesn't recognise.
## Install
Build with `cd plugins/WebPanelBridge && ../../build.sh`. Then copy the contents of
`compiled/WebPanelBridge/` to `game/csgo/addons/counterstrikesharp/plugins/WebPanelBridge/` on the
server.
Or install a release, which unpacks into `game/csgo/`:
```
tar -xzf WebPanelBridge-<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 `WebPanelBridge-<tag>.tar.gz` to the git.zio.sh
release. The plugin has no config.
Check it from RCON with `css_webpanel_status`.