Repository navigation
Kill feed: change who got a kill, who died or the weapon, or hide one kill, from the console (part of #1021) - #1026
Merged
Merged
Conversation
…rt of #1021) Matches a DeathMsg by killer, victim, demo-bar time and demo name, and rewrites its killer, victim or weapon byte, or drops it. Rules are read lock-free on the message path. Long console prints now go over in pieces, since the engine cut the command's usage at about 1 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
Owner
Author
ReviewI read the whole diff: What I checked, and found fine:
Merged origin/dev (studio-only commits, no conflict): Merge order with #1030: whichever of #1026 and #1030 merges second conflicts in two places:
Nothing else conflicts; I tried each merge. #1034 and #1038 merge cleanly on top of this one. No bugs found and no code changed, so I didn't run another game test. The PR's own PRE and POST runs on dyelife h1 cover the main path. Verdict: ready to merge. |
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note: New: ds_hud_deathmsg replace changes one kill-feed line (killer, victim or weapon) or hides it, matched by players, time and demo.
Part of #1021 (the
ds_player_change_namehalf is a separate PR).The command shape is the one agreed on #1021. The hook already catches
DeathMsg(killer, victim, weapon index). A matched message goes toclient.dllas a copy with those bytes rewritten, or doesn't go at all. The game colours each name by its slot's team, so the colours follow the new killer and victim without extra code. New code is ingoldsrc-hooks/src/deathmsg/replace.rs.deathmsg.rsonly gains the handler step, thereplacearm, usage and the status line.Decisions
atis the demo player's world clock, the oneds_demo_seek_touses. In play it reads the kill's own time: on PRE greetz1 the matches logged 442.5, 464.4 and 537.9, the analyzer's times to the tenth. During a stepped forward seek, kills are read up to one 5 s step behind the clock, so a match then accepts that whole step.cl.timedoesn't help here: under viewdemo it doesn't jump with a seek (47.3 at world 614). Underplaydemo(no demo bar)atfalls back tocl.time. That fallback is not measured.AtomicPtrload. Commands publish a new copy and leak the old one (a few hundred bytes per command), so a reader can never see a list that has been freed. Matching keeps no state, so a kill replayed after a seek (or the backward-seek duplicate) matches again.blockthen filters the feed asreplaceleft it.fakelines are not changed byreplace.console_printnow sends long text in pieces of 900 bytes or less (commands.rs). The engine cutds_hud_deathmsg's usage mid-word at about 1 KB (it stopped at "list each pla"), so the newreplacelines never showed. This also fixes the cut for every long reply.docs/dodstudio_commands.mdgains the general rule that a command with more than three values, or optional ones, names its parameters. It's worded so theds_player_change_namePR can carry the same rule. The deathmsg table and areplacesection are also added.Commands.txt's hint now mentionsreplace. The first sentence of the docs entry is unchanged, soconsole_commands_data.jsneeds no regeneration.cfg_scan) forselfor a slot withoutin. For now the console warns.Test done
Final build (
ce5161c1). Demoktps8w3-dyelife_ih_anzio_h1: a POV recorded by ddL , who is slot 8 andself. Kills come from the analyzer cache. Played under viewdemo on the Brain account, test DLLlocal\test-1021-replace\. Grabs are inlocal\review-images\1021\replace\(pre-anzio-*,post-anzio-*, plus_feedcrops). Both installs gave identical hook-log lines and both probes passed; the game was still running at the end, with no crash.PRE and POST (same results on each):
self: the 851.5 kill loggedrule 1 made 8 -> 12 d_garand into 13 -> 12 d_garand (clock 851.5).dicE[: :]deeebeee killed icyHOT ~ monday with garand.d_kar, and the feed showed a K98 for ddL → seanality.ktps8w3-dyelife*pattern, was hidden. kanguhhh → warchyldd at 961.8 still showed.inthat doesn't match:in nothing_herehid nothing.expect_not rule 4 hidpassed, and the 966.2 kill stayed as recorded.clock 1004.4..1009.4. The feed showed ddL → hildebrand with a K98.ds_hud_deathmsgnow prints the whole usage, throughscale default, including bothreplacelines. Before theconsole_printchange it stopped at about 1 KB.vicitm, nothing afterwith, no killer or victim).selfwithoutinwarned. The same line sent twice was kept once.list,remove 5,remove 9(refused, 1..4) andclearall worked.Earlier run, greetz1 (laggy demo), PRE only, previous build: the same kinds of checks passed on
solifotw-greetz1. That demo warps and jitters, so take those results with care. The run did find two bugs, both fixed in this PR: the usage cut at about 1 KB, and a clock idea based oncl.timethat doesn't follow a seek.Unit tests cover the parser (any order,
m:ss/h:mm:ss/seconds,inlists,*,.dem, refusals, warnings) and the matcher (2 s window, seek span, demo filter, first match, SteamID in any slot, missing player).cargo test -p goldsrc-hookspasses (790). Clippy and fmt pass with the pinned 1.98.1 toolchain on the host and on i686.Test steps
ktps8w3-dyelife_ih_anzio_h1withviewdemoand this DLL.ds_hud_deathmsg replace killer self victim 76561197983650610 at 14:11.5 in ktps8w3-dyelife_ih_anzio_h1 with killer 76561197960525375, thends_demo_seek_to 846.ds_hud_deathmsg replace in ktps8w3-dyelife_ih_anzio_h1 victim 76561197961763339 killer 76561198113870514 at 855.7 with weapon kar.ds_hud_deathmsg replace killer 76561198113870514 victim 76561197983650610 at 16:01.5 in ktps8w3-dyelife* with hide, then seek to 958.inthat doesn't match:ds_hud_deathmsg replace killer 76561198113870514 at 966.2 in nothing_here with hide.ds_hud_deathmsg replace killer self at 1009.1 with weapon kar(this warns aboutself), thends_demo_seek_to 1013.ds_hud_deathmsg replace list,remove 1andclear.ds_hud_deathmsgshould print the whole usage.Other open PRs on the same files
deathmsg.rs, docs andCommands.txt: Kill feed: an even layout where every weapon icon has the same height and nothing is cut off (#1022) #1023 and Kill feed: outline the names and put boxes behind lines or names (part of #562) #1000 (kill-feed layout/backdrop). Those PRs change different parts of these files: usage lines nearfont/scale, and the status line.commands.rs,docs/dodstudio_commands.md,Commands.txt: R&D: show the overview map in POV demos (part of #897) #906, R&D: a restyled health readout drawn by the hook (part of #849) #882, Review highlights: console commands can't move the demo or the camera while a review runs (#855) #880, While a demo loads, the demo player bar shows how far along it is (#465) #758, Hide server HUD text and engine centre text (part of #677) #717.docs/dodstudio_commands.mdandCommands.txt: Render while capturing: each clip renders as soon as it's recorded, and a long batch waits for space instead of filling the drive (#861) #885.🤖 Generated with Claude Code