T6: expand telemetry to T5-parity reports and add .join module

- Telemetry: async queued game_start/heartbeat/round_change/game_end with
  sequenced FIFO, watchdog, log-level dvar, and per-player stats snapshot
- Join: new tws_t6_join.gsc chat command lets late spectators enter mid-match
- Update NOTES/README/check.ps1 to reflect the six-module layout
This commit is contained in:
2026-09-24 08:12:25 -04:00
parent f77cc7bdee
commit 26bb9e158d
5 changed files with 507 additions and 99 deletions
+33 -12
View File
@@ -9,11 +9,12 @@ just like T5. There is no separate TWS config file or database setup.
| `tws_t6_hud.gsc` | Match/round timers, name, zombie count and health bar | Common |
| `tws_t6_afk.gsc` | `.afk` / `.back`, protection, movement and weapon blocking | Common |
| `tws_t6_lock.gsc` | Lock at round 20; clear password on game over | Common, HUD |
| `tws_t6_telemetry.gsc` | HTTP JSON round updates, enabled by default | t6-gsc-utils |
| `tws_t6_telemetry.gsc` | Async queued game reports (game_start/heartbeat/round_change/game_end) | t6-gsc-utils |
| `tws_t6_join.gsc` | `.join` chat command lets a spectator newcomer enter mid-match once | Common |
## Install
1. Copy these five `tws_t6_*.gsc` files into `Plutonium/storage/t6/scripts/zm/`.
1. Copy these six `tws_t6_*.gsc` files into `Plutonium/storage/t6/scripts/zm/`.
2. For telemetry, install [t6-gsc-utils v3.1.1](https://github.com/alicealys/t6-gsc-utils/releases/tag/v3.1.1)
in `Plutonium/plugins/` and restart the server process. The other four scripts
do not require that plugin.
@@ -60,21 +61,41 @@ set tws_server_id "t6_zombie_town_1"
set tws_telemetry_url "http://192.168.1.199:3000/api/telemetry"
```
It sends the first occupied positive round and subsequent round changes:
It sends four event types over the life of a match, mirroring the T5 script:
```json
{"event":"round_change","server":"t6_zombie_town_1","round":17,"players":4}
```
| Event | When | Round in payload |
| --- | --- | --- |
| `game_start` | First playable spawn | omitted |
| `heartbeat` | Every 30s while the match is in progress | current round |
| `round_change` | Every new positive round | new round |
| `game_end` | `end_game` / `game_ended` / `intermission` | final round |
Delivery is asynchronous, with one in-flight request and one replaceable pending
observation. Transport failures retry at most three times (1/2/5 seconds), retiring
snapshots older than 15 seconds or superseded by a newer round. Transport success
does not establish API acceptance. These reports update Fleet; they do not send
beta boot, session, feature or match-completion evidence.
Each event payload includes `event`, `server`, `map`, `round` (except `game_start`)
and a `players` array with `name`, `guid`, `kills`, `headshots`, `downs`, `revives`
and `score` per player. `guid` reads Plutonium's `player.guid` engine property
(T5 uses the `player getGuid()` method — T6 has no such method, but the field is
equivalent for identity purposes). `kills`/`headshots`/`downs`/`revives` read
from `player.stats[]` if a mod populates it, otherwise `0`.
Delivery is asynchronous with a sequenced FIFO queue and one in-flight request.
The queue survives the game-end signal so the final snapshot drains. There is no
automatic retry: the receiver may already have accepted the event. Transport
success reports the HTTP call finished, not that the API accepted it. Increase
`tws_telemetry_log_level` to `2` for per-event capture/queue/response logging;
set to `0` to silence non-error output.
## `.join` for newcomers
Late connectors who never got a spawn can type `.join` in chat to leave spectator
mode before the round ends, once per connection. `.join` is rejected if the player
has already played, if the game is not running, if no active player is alive, or
during intermission. The script hooks the stock `spectator_respawn` path via
`level.custom_spawnplayer`; it does not skip the map-authored spawn callback if
another mod installed one first.
## Validation
All five scripts compile for T6 PC with gsc-tool 1.4.10. To repeat:
All six scripts compile for T6 PC with gsc-tool 1.4.10. To repeat:
```powershell
.\tools\check.ps1 -CompilerPath C:\path\to\gsc-tool.exe