Add majority lock and unlock voting for T5 and T6

This commit is contained in:
2026-10-18 16:01:57 -04:00
parent caaaa102a4
commit 9ef5932d36
10 changed files with 816 additions and 78 deletions
+19 -12
View File
@@ -10,7 +10,7 @@ private server token.
| `tws_t6_common.gsc` | Shared HUD values, helpers, paginated `.help`, service window, connection and first-spawn dispatchers | Stock T6 |
| `tws_t6_hud.gsc` | Unboxed timers, branding, zombies/health and per-player `.hud` visibility toggle | Common 1.4.0+, Plutonium r5334+ |
| `tws_t6_afk.gsc` | Persistent AFK reserve, rewards and central countdown | Common 1.4.0+, telemetry 1.0.0+, plugin 1.4.0+, EC #151 |
| `tws_t6_lock.gsc` | Lock at round 20; clear password on game over | Common, HUD |
| `tws_t6_lock.gsc` | Auto-lock at round 20 plus majority `.lock` / `.unlock` votes; clear on game over | Common, HUD |
| `tws_t6_telemetry.gsc` | Async queued game reports (game_start/heartbeat/round_change/game_end) | tws-t6-gsc-utils |
| `tws_t6_join.gsc` | `.join` chat command lets a spectator newcomer enter mid-match once | Common |
| `tws_t6_leaderboard.gsc` | Private map record on connection, `.leaders` replay and adaptive round-start reminders | Common 1.5.0+, tws-t6-gsc-utils |
@@ -154,9 +154,9 @@ apply to both versions. All T6 script filenames use the `tws_t6_` prefix.
Type `.help` or `.commands` in chat to see the commands supplied by the loaded TWS modules and
a short description of each. The list is shown only to the requesting player,
including spectators who have not spawned. Commands are case-insensitive.
Help uses the unboxed upper-right service area. All nine installed commands
fit in one list with command and description columns. Additional registered
commands use pages of nine rows, with a counter only for multi-page lists.
Help uses the unboxed upper-right service area with command and description
columns. Registered commands use pages of nine rows, with a counter only for
multi-page lists.
Pages advance every 12 seconds and close after the last page. Typing either
command again returns to page one with a fresh timer. Both engines use
explicit row positions so T5 does not concatenate newline-separated text.
@@ -172,15 +172,17 @@ explicit row positions so T5 does not concatenate newline-separated text.
| `.b` | Check bank balance (bank module required) |
| `.d <amount\|all>` | Deposit points (bank module required) |
| `.w <amount\|all>` | Withdraw points (bank module required) |
| `.lock` | Vote to lock the lobby from round 6 (lock module required) |
| `.unlock` | Vote to unlock the lobby (lock module required) |
Command modules register their commands during `init()` through
`tws_t6_common::register_help_command(command, description)`. If a module is
omitted, its commands are omitted from `.help`. Commands follow the order above,
independent of initialization order. Register new commands alongside their
module's initialization so the list stays current.
With all command modules installed, help shows one page of nine commands,
including the full `.d <amount|all>` / `.w <amount|all>` syntax. Removing HUD
removes `.hud` from the list.
omitted, its commands are omitted from `.help`. The first nine commands follow
the order above; additional entries follow registration order. Register new
commands alongside their module's initialization so the list stays current.
Lock and extended AFK commands appear on additional pages. Bank entries retain
the full `.d <amount|all>` / `.w <amount|all>` syntax. Removing HUD removes `.hud`
from the list.
The enabled leaderboard module registers `.leaders`, which replays the latest
cached map record privately. Repeating it restarts the record from the first page;
help pauses the record's remaining page time and resumes it after the final
@@ -195,8 +197,13 @@ help page. `.leaders` during help replaces the pending record replay from page o
- AFK uses T5's native `level waittill("say", message, player)` listener.
`.back` restores movement and weapons immediately, then ends protection after
two seconds. The T6 control/weapon fix remains in place.
- Lock uses T5's HUD round/game-over notifications. Default threshold is 20.
As in T5, it clears `g_password` at startup and game over.
- Lock uses T5's HUD round notifications with a default automatic threshold of
20. `.lock` is available from round 6; `.unlock` whenever locked. Both use a
60-second strict-majority vote (1/1, 2/2, 2/3, 3/4). A successful unlock
overrides auto-lock for the rest of the match. There is no round-6 prompt.
As in T5, it clears `g_password` and votes at startup and HUD/stock game over.
Lock `1.1.0` adds no dependency; copy the script and restart the map, without
a full server-process restart. See [voting behavior and validation](../../README.md#lobby-lock-voting-t5-and-t6).
- Telemetry is enabled by default and posts to
`https://ec.thewrightserver.net/api/telemetry`. Set `tws_server_id` to the exact,
case-sensitive Electric Cherry registry name; missing or overlong names