feat(rust): slash commands and the next wipe, server half (phase 16)
Five read-only commands registered with api.registerSlashCommands: /status, /wipe, /top, /online and /clan (D126). Every refusal is private, and any answer narrower than public (online names, a clan roster) goes to the caller alone (D127). No command asks a sidecar. The next wipe (D128, D130): six nullable columns on rust_servers, a pure nextWipe(row, now) with the zone arithmetic through Intl, computed on every read. The public server shape gains nextWipe; the admin shape gains the stored schedule; PUT /admin/rust/servers/:id takes the six fields and writes them only when wipeRule is present. server/commands joins ci/bundle.json, which checkBundle caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -65,6 +65,46 @@ module.exports = {
|
||||
description: 'Has nothing reported in longer than the freshness window? A stale row is reported offline.',
|
||||
example: false,
|
||||
},
|
||||
nextWipe: { $ref: '#/components/schemas/RustNextWipe' },
|
||||
},
|
||||
},
|
||||
RustNextWipe: {
|
||||
type: 'object',
|
||||
nullable: true,
|
||||
description: 'When the server wipes next, computed from the operator’s schedule on every read, or null when no schedule is set. `source` is `forced` (Facepunch’s monthly forced wipe, first Thursday 19:00 UK time), `rule` (the server’s own weekly or biweekly day) or `once` (a one-off date the operator set, which replaces any computed wipe before it). Absent from a module older than phase 16.',
|
||||
properties: {
|
||||
at: { type: 'string', format: 'date-time', example: '2026-10-01T18:00:00.000Z' },
|
||||
source: { type: 'string', enum: ['forced', 'rule', 'once'], example: 'forced' },
|
||||
},
|
||||
},
|
||||
RustWipeSchedule: {
|
||||
type: 'object',
|
||||
description: 'A server’s wipe schedule as the operator stored it — what they typed, not what it computes to. A past `onceAt` is still returned so the form can show it as past.',
|
||||
properties: {
|
||||
rule: { type: 'string', enum: ['none', 'forced', 'weekly', 'biweekly'], example: 'weekly' },
|
||||
day: { type: 'integer', nullable: true, description: '0 = Sunday … 6 = Saturday', example: 4 },
|
||||
time: { type: 'string', nullable: true, example: '14:00' },
|
||||
tz: { type: 'string', nullable: true, example: 'America/Chicago' },
|
||||
anchor: { type: 'string', format: 'date', nullable: true, example: null },
|
||||
onceAt: { type: 'string', format: 'date-time', nullable: true, example: null },
|
||||
},
|
||||
},
|
||||
RustServerSave: {
|
||||
type: 'object',
|
||||
description: 'The body of PUT /admin/rust/servers/{id}. The wipe fields are written only when `wipeRule` is present.',
|
||||
properties: {
|
||||
name: { type: 'string', example: 'Main · Vanilla' },
|
||||
sidecarBaseUrl: { type: 'string', example: 'http://10.0.0.5:8090' },
|
||||
sidecarToken: { type: 'string', description: 'Write-only. Omit or send empty to keep the stored one.', example: '' },
|
||||
protocol: { type: 'integer', example: 11 },
|
||||
enabled: { type: 'boolean', example: true },
|
||||
sortOrder: { type: 'integer', example: 0 },
|
||||
wipeRule: { type: 'string', enum: ['none', 'forced', 'weekly', 'biweekly'], example: 'weekly' },
|
||||
wipeDay: { type: 'integer', nullable: true, example: 4 },
|
||||
wipeTime: { type: 'string', nullable: true, example: '14:00' },
|
||||
wipeTz: { type: 'string', nullable: true, example: 'America/Chicago' },
|
||||
wipeAnchor: { type: 'string', format: 'date', nullable: true, example: null },
|
||||
wipeOnceAt: { type: 'string', format: 'date-time', nullable: true, example: null },
|
||||
},
|
||||
},
|
||||
RustAdminServerList: {
|
||||
@@ -98,6 +138,8 @@ module.exports = {
|
||||
online: { type: 'boolean', example: true },
|
||||
players: { type: 'integer', example: 42 },
|
||||
stale: { type: 'boolean', example: false },
|
||||
nextWipe: { $ref: '#/components/schemas/RustNextWipe' },
|
||||
schedule: { $ref: '#/components/schemas/RustWipeSchedule' },
|
||||
},
|
||||
},
|
||||
RustLink: {
|
||||
|
||||
Reference in New Issue
Block a user