fix(feed): print weapons by name, not "ak47u entity"
All checks were successful
PR Checks / client-build (pull_request) Successful in 33s
PR Checks / server-tests (pull_request) Successful in 43s
PR Checks / frozen-manifest (pull_request) Successful in 1m5s

The bridge names a kill's weapon by the held entity's short prefab name
(ak47u.entity), and the feed printed it with the dots turned to spaces:
"with ak47u entity". Every event read now gives the frame a weaponName
(server/model/titles/weaponNames.js): the game's own English name for the
53 ranged weapons (guns, bows, crossbows, launchers, flamethrowers), read
off the Oxide rig's item list on Rust 26139947, and for anything else the
prefab name as words with its .entity/.weapon ending dropped.

The site prints weaponName and falls back to the same stripping for an
older server. The prefab name stays in the frame: the title lists count by
it. Added at read, so stored rows are renamed too. No protocol change; the
events route's Swagger description names the new field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
2026-10-23 01:22:37 -05:00
parent 2e80a21597
commit 55a9ea4649
9 changed files with 191 additions and 6 deletions

View File

@@ -338,3 +338,18 @@ test('a purchase and an admin lock name the player only when the server sent the
assert.equal(describe(raid('raid.locked', { difficulty: 'Wobbly' })).verb, 'A Wobbly raid base was locked to a player')
assert.equal(describe(raid('raid.ended', { difficulty: 'Wobbly' })).verb, 'A Wobbly raid base despawned')
})
test('a kill line says the weapon by name', () => {
const named = describe(row('player.death', {
name: 'Bob', attackerType: 'player', attackerName: 'Alice',
weapon: 'ak47u.entity', weaponName: 'Assault Rifle', distance: 22,
}))
assert.match(named.detail, /with Assault Rifle/)
assert.doesNotMatch(named.detail, /entity/)
const older = describe(row('player.death', {
name: 'Bob', attackerType: 'player', attackerName: 'Alice', weapon: 'bolt_rifle.entity',
}))
assert.match(older.detail, /with bolt rifle/)
assert.doesNotMatch(older.detail, /entity/)
})