feat(rust): Backpacks — staff and player views, the Bigger backpack step (PLAN_REDESIGNS §11.3)
All checks were successful
PR Checks / server-tests (pull_request) Successful in 37s
PR Checks / frozen-manifest (pull_request) Successful in 1m0s
PR Checks / client-build (pull_request) Successful in 7m23s

The site half of §11.3.2, on protocol 14:

- `rust.backpack.size` ("Bigger backpack"): a kit reward with a different
  permission (D337) — one rust_perm_run_grants row per website user with
  backpacks.size.N, no kit, no credit; the perm mirror pushes it and the run's
  revert deletes it. risk change, reversible ledger, a new `rust.backpacks`
  budget, rust.kit.entitle's recipient modes including `linked`. Refused with
  "Backpacks is not installed on this server" in the dry run too (D199), and a
  size the server does not offer is refused by name. Its message is never
  silent: empty is the take-back warning (D338).
- `rust.options.backpacksizes`: each server's sizes above its smallest, from
  the last hello, grouped by server.
- GET /player/rust/backpacks (own links only, 20 reads a minute) and
  GET /admin/users/:id/rust/backpacks (that user's links only). Live, never
  stored; a stranger's id is a 404 and never reaches the game.
- Client: a shared Backpack panel (pick server and account, open, read once)
  on the account page and the admin user page; the grid draws pages of
  pageSize, each slot named by the game (D340, no icons), blueprints by what
  they make (D341), overflow marked. Backpacks joins the server's mod line.

Server 548/548 (13 new in test/backpacks.test.js), client 79/79 (5 new),
routes.manifest regenerated against the pinned core (89 routes), swagger
fragment regenerated.

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-12 14:35:55 -05:00
parent 69ec0f6c46
commit e4591af906
22 changed files with 1786 additions and 7 deletions

View File

@@ -244,6 +244,15 @@ module.exports = {
type: 'object',
properties: { loaded: { type: 'boolean', example: false } },
},
backpacks: {
type: 'object',
description: 'Protocol 14 (PLAN_REDESIGNS §11.3.2): `sizes` is every registered backpacks.size.N, ascending; a Bigger backpack step may lease any above the first.',
properties: {
loaded: { type: 'boolean', example: true },
version: { type: 'string', example: '3.17.8' },
sizes: { type: 'array', items: { type: 'integer' }, example: [6, 12, 18, 24, 30, 36, 42, 48, 96, 144] },
},
},
},
},
},
@@ -1331,6 +1340,35 @@ module.exports = {
repeat: { type: 'boolean', example: false },
},
},
RustBackpackStack: {
type: 'object',
description: 'One stack in a backpack (PLAN_REDESIGNS §11.3.2). `display` is the game’s English name (D340); for a blueprint it is the name of what it makes, and `blueprint` that item’s shortname (D341). `shortname` is null, with `itemId`, for an item the game does not know.',
properties: {
slot: { type: 'integer', example: 2, description: 'Runs across pages: the first slot of page two is pageSize.' },
shortname: { type: 'string', nullable: true, example: 'rifle.ak' },
display: { type: 'string', nullable: true, example: 'Assault Rifle' },
amount: { type: 'integer', example: 1 },
itemId: { type: 'integer', example: 1545779598 },
blueprint: { type: 'string', example: 'rifle.ak' },
skin: { type: 'string', example: '10129', description: 'A workshop skin id, as text.' },
name: { type: 'string', example: 'spike-a', description: 'A renamed item’s name.' },
overflow: { type: 'boolean', example: true, description: 'Past the capacity: it moves to the owner’s inventory, or the ground, at their next open (D338).' },
contents: { type: 'array', description: 'A weapon’s attachments or a container’s items, one level deep, without `contents` or `overflow` of their own.', items: { type: 'object' } },
},
},
RustBackpack: {
type: 'object',
description: 'One Steam account’s backpack on one server, read live and never stored. `capacity`, `pageSize` and `items` are present only when `exists`.',
properties: {
serverId: { type: 'string', example: 'main' },
server: { type: 'string', example: 'Main' },
steamId: { type: 'string', example: '76561198000000001' },
exists: { type: 'boolean', example: true, description: 'False for an account that has never had a backpack.' },
capacity: { type: 'integer', example: 12 },
pageSize: { type: 'integer', example: 48 },
items: { type: 'array', items: { $ref: '#/components/schemas/RustBackpackStack' } },
},
},
RustVisibilityUpdate: {
type: 'object',
description: 'A change to who may see who is online. Either part may be omitted; a server set to null follows the fleet default again.',