Organize scripts and add TWS plugins with HTTP timeouts

Vendor pinned T5 and T6 plugin sources under the new plugins layout. Add native HTTP deadlines, status and timing diagnostics, telemetry integration, and build/test tooling.
This commit is contained in:
2026-10-09 11:02:20 -04:00
parent b172086301
commit 1121b44857
253 changed files with 28028 additions and 59 deletions
+60 -15
View File
@@ -1,11 +1,54 @@
# tws-zombies-scripts
Combined working repo for the TWS Plutonium Zombies GSC scripts across two games.
Combined working repo for the TWS Plutonium Zombies scripts and native plugins across two games.
## Layout
- [t5/](t5/) — Plutonium **T5** (Call of Duty: Black Ops 1) Zombies scripts. Most-developed baseline. See [t5/README.md](t5/README.md) and [t5/NOTES.md](t5/NOTES.md).
- [t6/](t6/) — Plutonium **T6** (Call of Duty: Black Ops 2) Zombies scripts. Ported from T5; at parity on common, HUD, AFK, lock, telemetry, join and leaderboard. See [t6/README.md](t6/README.md), [t6/NOTES.md](t6/NOTES.md), and [t6/tools/check.ps1](t6/tools/check.ps1).
- [t5/scripts/](t5/scripts/) — T5 GSC modules, [README](t5/scripts/README.md), and [notes](t5/scripts/NOTES.md).
- [t5/plugins/](t5/plugins/) — `tws-t5-gsc-utils`, based on [alicealys/t5-gsc-utils](https://github.com/alicealys/t5-gsc-utils), with TWS HTTP changes.
- [t6/scripts/](t6/scripts/) — T6 GSC modules, [README](t6/scripts/README.md), [notes](t6/scripts/NOTES.md), and compiler checks.
- [t6/plugins/](t6/plugins/) — `tws-t6-gsc-utils`, based on [alicealys/t6-gsc-utils](https://github.com/alicealys/t6-gsc-utils), with the same HTTP changes.
The scripts still deploy to the game's existing `storage/t5/scripts/sp/` or
`storage/t6/scripts/zm/` directories; the new source layout does not change GSC namespaces.
## Building plugins
Plugin source is vendored as regular tracked files so local modifications travel
with this repository. Each plugin's `upstream.json` records its upstream revision
and exact Git dependency revisions. Dependencies and build outputs are ignored.
The dependency loader replaces upstream's submodule setup; nested upstream
`.github` files are retained for reference and do not run as this repo's CI.
Use Windows with Visual Studio 2022 C++ build tools, a Windows SDK, Git, and
Python 3.9+. From a Developer PowerShell with `msbuild` on PATH, at the repository root:
```powershell
.\tools\build_plugins.ps1 -Game all -Configuration Release
```
This restores pinned dependencies, generates both projects, and builds x86 DLLs.
Upstream's Premake setup also downloads its MySQL client dependency on first use.
Outputs are `t5/plugins/tws-t5-gsc-utils/build/bin/Release/tws-t5-gsc-utils.dll` and
`t6/plugins/tws-t6-gsc-utils/build/bin/Release/tws-t6-gsc-utils.dll`.
Remove the old `t5-gsc-utils.dll` or `t6-gsc-utils.dll` before installing the
corresponding `tws-` DLL in `Plutonium/plugins/`; load only one version per game.
**Restart the server process**;
restarting only the map cannot load an updated plugin.
Use `python tools/fetch_plugin_deps.py all --check` to verify dependency revisions
without fetching. Use `python3 tools/test_plugin_http.py` on macOS/Linux with a
C++20 compiler and libcurl development files to compile the real HTTP utilities
and test local stalled connections, response deadlines, status reporting and recovery.
These portable tests do not build the Windows DLLs or exercise Plutonium's VM.
Run `python3 tools/test_plugin_component.py` to compile the completion/option
handling against host engine shims with address and undefined-behavior sanitizers.
Both plugins now default to a 5-second connection timeout and 15-second total
transfer timeout. Request options can override these with positive millisecond
values. Telemetry explicitly sets those limits and logs native HTTP status and
timings. See the [T5](t5/plugins/README.md) and [T6](t6/plugins/README.md) plugin notes.
Requests are still sent once, in order, with no retries or event timestamp changes.
## Parity
@@ -15,13 +58,13 @@ Modules currently in each tree:
| Module | T5 | T6 |
|------------|-------------------------------|---------------------------------|
| common | `t5/tws_t5_common.gsc` | `t6/tws_t6_common.gsc` |
| hud | `t5/tws_t5_hud.gsc` | `t6/tws_t6_hud.gsc` |
| afk | `t5/tws_t5_afk.gsc` | `t6/tws_t6_afk.gsc` |
| lock | `t5/tws_t5_lock.gsc` | `t6/tws_t6_lock.gsc` |
| telemetry | `t5/tws_t5_telemetry.gsc` | `t6/tws_t6_telemetry.gsc` — queued `game_start` / `heartbeat` / `round_change` / `game_end` matching T5 |
| join | `t5/tws_t5_join.gsc` | `t6/tws_t6_join.gsc` |
| leaderboard | `t5/tws_t5_leaderboard.gsc` | `t6/tws_t6_leaderboard.gsc` |
| common | `t5/scripts/tws_t5_common.gsc` | `t6/scripts/tws_t6_common.gsc` |
| hud | `t5/scripts/tws_t5_hud.gsc` | `t6/scripts/tws_t6_hud.gsc` |
| afk | `t5/scripts/tws_t5_afk.gsc` | `t6/scripts/tws_t6_afk.gsc` |
| lock | `t5/scripts/tws_t5_lock.gsc` | `t6/scripts/tws_t6_lock.gsc` |
| telemetry | `t5/scripts/tws_t5_telemetry.gsc` | `t6/scripts/tws_t6_telemetry.gsc` — queued `game_start` / `heartbeat` / `round_change` / `game_end` matching T5 |
| join | `t5/scripts/tws_t5_join.gsc` | `t6/scripts/tws_t6_join.gsc` |
| leaderboard | `t5/scripts/tws_t5_leaderboard.gsc` | `t6/scripts/tws_t6_leaderboard.gsc` |
## Map record announcements
@@ -71,12 +114,14 @@ Partial page results never replace the cache. The API has no pagination snapshot
token: changed totals/record rounds reject the refresh, but concurrent renames can
still move entries between pages. Refreshes deduplicate GUIDs.
Requests have a 15-second GSC wait limit. The plugins cannot cancel a native
request, so a stalled request prevents new leaderboard requests until it finishes;
Requests have a 15-second GSC wait limit. The TWS plugins also enforce native
5-second connection and 15-second transfer limits. The leaderboard waits for native
completion before starting another request;
player threads never wait directly on HTTP. Responses at the plugins' 20 KiB
truncation boundary are rejected. The complete JSON grammar, UTF-8, string escapes
and response shape are checked before consuming data. These guards also reject
HTML/error bodies; the plugins do not expose HTTP status or response headers.
HTML/error bodies. Leaderboard still uses body validation; the new native HTTP
status diagnostics are consumed by telemetry.
Run the portable data/structure checks with `node tools/check_leaderboard.mjs`.
They execute the scripts' data helpers with engine-value shims, not a game VM.
@@ -126,7 +171,7 @@ not prove API acceptance; inspect the API response or ingestion records.
## Validating T6
```powershell
powershell -File t6/tools/check.ps1
powershell -File t6/scripts/tools/check.ps1 -CompilerPath C:\path\to\gsc-tool.exe
```
Requires `gsc-tool` 1.4.10 (T6 PC) on PATH.
Requires PowerShell and `gsc-tool` (T6 PC).