fix(feed): print weapons by name, not "ak47u entity" #60

Merged
whitlocktech merged 1 commits from fix/weapon-names into edge 2026-10-23 01:26:41 -05:00
Member

What & why

Found while taking runicgateway.com's phase 18 screenshots (runicgateway.com#39). 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". The org lead chose a game-name table with a stripped fallback, kept in one place on the server (2026-10-23).

  • server/model/titles/weaponNames.js (new) holds the game's own English name for the 53 ranged weapons: guns, bows, crossbows, launchers and flamethrowers.
    • It is not written from memory. I read it off the Oxide rig's item list (Rust 26139947) with a throwaway, read-only probe: every item whose held entity is an AttackEntity, with its short prefab name and English display name. It's the same walk lists.js came from. The probe is deleted.
    • Anything not in the table (melee, throwables, a weapon a later Rust update adds) falls back to the prefab name as words, with its .entity / .weapon ending dropped: salvaged_sword.entity → "salvaged sword".
  • Every event read adds frame.weaponName in events.model.js shape().
    • It's added at read, so rows stored before this read the same as new ones.
    • frame.weapon (the prefab name) stays, because the title lists count by it.
  • The site prints weaponName (format.js weapon(), used by feed.js). For a server too old to send it, it falls back to the same stripping.
  • No protocol or bridge change. The public events route's Swagger description names the new field, and swagger-fragment.json is regenerated.

The app gets the same weaponName-with-fallback in the Android vocabulary sweep (separate PR into Android-app edge).

Before After
with ak47u entity with Assault Rifle
with bolt rifle entity with Bolt Action Rifle
with lr300 entity with LR-300 Assault Rifle
with mp5 entity with MP5A4
with machete weapon with machete

How it was tested

  • Server: 709 tests pass. The new weaponNames.test.js covers the table, the fallback, that no table name carries a prefab ending, and that shape() adds the name and leaves a frame without a weapon alone.
  • Client: 101 tests pass, with new ones for weapon() and the kill line.
  • Checks: check:imports, check:swagger, vite build and check:externals all pass.
  • Walked on the Rust demo site (Oxide rig), with this branch's server files and client build in the module directory. GET /public/rust/servers/rust-oxide/events returns "weapon":"thompson.entity" … "weaponName":"Thompson", and the feed's Kills filter reads "with Thompson", "with Bolt Action Rifle", "with Assault Rifle", "with MP5A4", "with Semi-Automatic Rifle" and "with LR-300 Assault Rifle".

Checklist

  • Tests added/updated and passing.
  • OpenAPI fragment regenerated.
  • No protocol change (no bump).

AI-assisted contributions (required)

  • No AI tools were used to produce this contribution.
  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a Co-Authored-By trailer.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What & why Found while taking runicgateway.com's phase 18 screenshots (runicgateway.com#39). 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"**. The org lead chose a **game-name table with a stripped fallback, kept in one place on the server** (2026-10-23). - **`server/model/titles/weaponNames.js`** (new) holds the game's own English name for the **53 ranged weapons**: guns, bows, crossbows, launchers and flamethrowers. - It is not written from memory. I read it off the Oxide rig's item list (Rust 26139947) with a throwaway, read-only probe: every item whose held entity is an `AttackEntity`, with its short prefab name and English display name. It's the same walk `lists.js` came from. The probe is deleted. - Anything not in the table (melee, throwables, a weapon a later Rust update adds) falls back to the prefab name as words, with its `.entity` / `.weapon` ending dropped: `salvaged_sword.entity` → "salvaged sword". - **Every event read adds `frame.weaponName`** in `events.model.js` `shape()`. - It's added at read, so rows stored before this read the same as new ones. - `frame.weapon` (the prefab name) stays, because the title lists count by it. - **The site prints `weaponName`** (`format.js` `weapon()`, used by `feed.js`). For a server too old to send it, it falls back to the same stripping. - **No protocol or bridge change.** The public events route's Swagger description names the new field, and `swagger-fragment.json` is regenerated. The app gets the same `weaponName`-with-fallback in the Android vocabulary sweep (separate PR into `Android-app` `edge`). | Before | After | |---|---| | with ak47u entity | with Assault Rifle | | with bolt rifle entity | with Bolt Action Rifle | | with lr300 entity | with LR-300 Assault Rifle | | with mp5 entity | with MP5A4 | | with machete weapon | with machete | ## How it was tested - **Server:** 709 tests pass. The new `weaponNames.test.js` covers the table, the fallback, that no table name carries a prefab ending, and that `shape()` adds the name and leaves a frame without a weapon alone. - **Client:** 101 tests pass, with new ones for `weapon()` and the kill line. - **Checks:** `check:imports`, `check:swagger`, `vite build` and `check:externals` all pass. - **Walked** on the Rust demo site (Oxide rig), with this branch's server files and client build in the module directory. `GET /public/rust/servers/rust-oxide/events` returns `"weapon":"thompson.entity" … "weaponName":"Thompson"`, and the feed's Kills filter reads "with Thompson", "with Bolt Action Rifle", "with Assault Rifle", "with MP5A4", "with Semi-Automatic Rifle" and "with LR-300 Assault Rifle". ## Checklist - [x] Tests added/updated and passing. - [x] OpenAPI fragment regenerated. - [x] No protocol change (no bump). ## AI-assisted contributions (required) - [ ] No AI tools were used to produce this contribution. - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` trailer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-10-23 01:24:09 -05:00
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
55a9ea4649
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
whitlocktech merged commit c4729315cd into edge 2026-10-23 01:26:41 -05:00
whitlocktech deleted branch fix/weapon-names 2026-10-23 01:26:42 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Module-Rust#60
No description provided.