feat(rust): Economics — pay coins, balances, staff adjust, the richest (PLAN_REDESIGNS §11.2)
The site half of §11.2.2, on protocol 14:
- `rust.coins.pay` ("Pay coins"): irreversible, reversible none (D335). The
recipient modes of rust.kit.entitle including `linked`, one payment per
website user (D103's rule), an optional message with {amount}, a new
`rust.coins` budget. Refused with "Economics is not installed on this
server" in the dry run too (D199). Core's key goes to the plugin, so a
retried step answers `repeat` and pays nobody twice.
- `rust_player_wipe_stats.balance`: the tally's balance, written as a value.
A nameless balance frame (an offline player) moves nobody's last-seen.
`economics.wiped` clears the wipe's balances, except at a new save.
- The richest: a Coins leaderboard column on one wipe of a server that
reports Economics, `sort=balance`, and a `richest` title category
(Magnate); both rank only above the starting balance (D336).
- GET /player/rust/economics (live, falling back to the last known), and
GET/POST /admin/users/:id/rust/economics for staff — scoped to the user's
own links, keyed per submission, an activity row with before and after.
- Client: the account page's Coins, the admin user page's Coins panel with
its form, the leaderboard column, and Economics in the server's mod line
(saying when its config could not be read).
Server 535/535 (14 new in test/economics.test.js), client 74/74,
routes.manifest regenerated against the pinned core (87 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:
@@ -1286,6 +1286,51 @@ module.exports = {
|
||||
kills: { type: 'array', items: { type: 'object' }, example: [{ serverId: 'main', profile: 'warden', label: 'Warden', kills: 3 }] },
|
||||
},
|
||||
},
|
||||
RustEconomicsBalances: {
|
||||
type: 'object',
|
||||
description: 'Coin balances per server and linked Steam account (PLAN_REDESIGNS §11.2.2). `source` is `live`, `last-known` or null.',
|
||||
properties: {
|
||||
servers: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
serverId: { type: 'string', example: 'main' },
|
||||
server: { type: 'string', example: 'Main' },
|
||||
economics: { type: 'boolean', example: true },
|
||||
reason: { type: 'string', example: 'Economics is not installed on this server' },
|
||||
startingBalance: { type: 'number', example: 1000 },
|
||||
startingKnown: { type: 'boolean', example: true },
|
||||
live: { type: 'boolean', example: true },
|
||||
accounts: {
|
||||
type: 'array',
|
||||
items: { type: 'object' },
|
||||
example: [{ steamId: '76561198000000001', name: 'Wanderer', balance: 1500, source: 'live' }],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
RustEconomicsAdjust: {
|
||||
type: 'object',
|
||||
required: ['serverId', 'steamId', 'op', 'amount'],
|
||||
properties: {
|
||||
serverId: { type: 'string', example: 'main' },
|
||||
steamId: { type: 'string', example: '76561198000000001' },
|
||||
op: { type: 'string', enum: ['deposit', 'withdraw', 'set'], example: 'deposit' },
|
||||
amount: { type: 'number', example: 500, description: '0.01 to 1,000,000; 0 is allowed for set.' },
|
||||
key: { type: 'string', example: '3f2a9c1e-7b4d-4e8a-9f10-2c6d5e8b7a41', description: 'One per submission, so a resend moves nothing.' },
|
||||
},
|
||||
},
|
||||
RustEconomicsAdjusted: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
before: { type: 'number', example: 1000 },
|
||||
after: { type: 'number', example: 1500 },
|
||||
repeat: { type: 'boolean', example: false },
|
||||
},
|
||||
},
|
||||
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.',
|
||||
|
||||
Reference in New Issue
Block a user