Fix T6 telemetry to read stock match counters

This commit is contained in:
2026-10-09 09:54:11 -04:00
parent 58399d2191
commit b172086301
3 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ telemetry and leaderboard modules; neither includes bank or database modules.
| Enemy count | Stock `_zm_utility::get_current_zombie_count()` plus queued zombies | Uses the map's zombie team and enemy filters | | Enemy count | Stock `_zm_utility::get_current_zombie_count()` plus queued zombies | Uses the map's zombie team and enemy filters |
| Timers | Seed elapsed time for late joiners; stop round watcher/reset on game over | T6 timer behavior; keep frozen timers frozen | | Timers | Seed elapsed time for late joiners; stop round watcher/reset on game over | T6 timer behavior; keep frozen timers frozen |
| AFK | Maintain control freeze, disable guns/grenades, guard player state and stale grace threads | Requested movement/shooting fix; retain `.afk` / `.back` and two-second grace | | AFK | Maintain control freeze, disable guns/grenades, guard player state and stale grace threads | Requested movement/shooting fix; retain `.afk` / `.back` and two-second grace |
| Telemetry | Global `httpPost(url, options)`; T5-parity queue + heartbeat + game_start/end + watchdog + log-level dvar; per-player `guid` sources from Plutonium's `player.guid` engine property (T5 uses `player getGuid()` method); per-match `kills`/`headshots`/`downs`/`revives` fall back to `0` when `player.stats[]` is unpopulated | T6 has no `getGuid` method but exposes the persistent identity as `.guid` on the player entity; `_zm_stats` writes only into persistent stat storage, so `player.stats[]` is not a stock T6 field. Payload keys match T5 for downstream shape parity | | Telemetry | Global `httpPost(url, options)`; T5-parity queue + heartbeat + game_start/end + watchdog + log-level dvar; per-player `guid` sources from Plutonium's `player.guid` engine property (T5 uses `player getGuid()` method); per-match `kills`/`headshots`/`downs`/`revives` read from `player.pers[]`, with missing or negative values reported as `0` | T6 has no `getGuid` method but exposes the persistent identity as `.guid` on the player entity; stock `initpersstat` / `incpersstat` maintain match counters in `player.pers[]`, whereas T5 uses `player.stats[]`. Payload keys match T5 for downstream shape parity |
| Join | Port of T5 `tws_t5_join.gsc`; uses `level.spawnplayer` / `level.custom_spawnplayer` (lowercase) and `maps\mp\zombies\_zm::spectator_respawn`; readiness gated on `self.sessionstate == "spectator"` instead of T5's `self.initialized` | T6 stock spectator respawn hook lives in `_zm.gsc`; `self.initialized` is a T5 SP zombiemode marker that T6 stock does not populate the same way | | Join | Port of T5 `tws_t5_join.gsc`; uses `level.spawnplayer` / `level.custom_spawnplayer` (lowercase) and `maps\mp\zombies\_zm::spectator_respawn`; readiness gated on `self.sessionstate == "spectator"` instead of T5's `self.initialized` | T6 stock spectator respawn hook lives in `_zm.gsc`; `self.initialized` is a T5 SP zombiemode marker that T6 stock does not populate the same way |
Common retains the T5 HUD constants, helpers and first-spawn dispatcher. Common retains the T5 HUD constants, helpers and first-spawn dispatcher.
+2 -1
View File
@@ -134,7 +134,8 @@ and a `players` array with `name`, `guid`, `kills`, `headshots`, `downs`, `reviv
and `score` per player. `guid` reads Plutonium's `player.guid` engine property 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 (T5 uses the `player getGuid()` method — T6 has no such method, but the field is
equivalent for identity purposes). `kills`/`headshots`/`downs`/`revives` read equivalent for identity purposes). `kills`/`headshots`/`downs`/`revives` read
from `player.stats[]` if a mod populates it, otherwise `0`. from T6's stock match counters in `player.pers[]`; missing or negative values
are reported as `0`. `score` is the player's current spendable `player.score`.
Delivery is asynchronous with a sequenced FIFO queue and one in-flight request. 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 The queue survives the game-end signal so the final snapshot drains. There is no
+4 -7
View File
@@ -165,17 +165,14 @@ telemetry_nonnegative_int(value)
return int(value); return int(value);
} }
// T6 stock does not expose per-match kill/headshot/down/revive counters as a // T6 stock initializes and updates match counters in player.pers[] through
// plain player.stats[] dictionary the way T5 does; _zm_stats writes through // _globallogic_score::initpersstat / incpersstat; getpersstat reads this array.
// increment_client_stat / increment_player_stat into persistent stat storage.
// Read player.stats[name] when present so any mod that mirrors T5 into it
// still populates the report; otherwise emit 0 to preserve payload shape.
telemetry_stat(player, name) telemetry_stat(player, name)
{ {
if (!isDefined(player.stats) || !isDefined(player.stats[name])) if (!isDefined(player.pers) || !isDefined(player.pers[name]))
return 0; return 0;
return telemetry_nonnegative_int(player.stats[name]); return telemetry_nonnegative_int(player.pers[name]);
} }
telemetry_players_json(include_stats) telemetry_players_json(include_stats)