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:
@@ -900,3 +900,30 @@ CREATE TABLE IF NOT EXISTS rust_map_overrides (
|
||||
CONSTRAINT fk_rust_map_overrides_user
|
||||
FOREIGN KEY (updated_by) REFERENCES users (id) ON DELETE SET NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- ── The next wipe (phase 16, D128 · D130) ─────────────────────────────────
|
||||
--
|
||||
-- What an operator says about a server's wipe calendar: a rule, and an optional
|
||||
-- one-off date. The next wipe itself is NOT stored — it is computed from these on
|
||||
-- every read (`model/servers/nextWipe.js`), so nothing rolls it forward after a
|
||||
-- wipe and nothing can go stale.
|
||||
--
|
||||
-- wipe_rule `none` · `forced` · `weekly` · `biweekly`. `none` forecasts
|
||||
-- nothing; every other rule includes Facepunch's forced wipe.
|
||||
-- wipe_day 0 (Sunday) … 6, for weekly and biweekly
|
||||
-- wipe_time `HH:MM`, 24-hour, on the wall clock of…
|
||||
-- wipe_tz an IANA zone. The server's own, because a wipe announced as
|
||||
-- "Thursday 14:00" means 14:00 where the operator is, summer or
|
||||
-- winter; a UTC time would drift by an hour twice a year.
|
||||
-- wipe_anchor one wipe on a biweekly rule, which says WHICH weeks
|
||||
-- wipe_once_at a one-off wipe, UTC. While it is in the future it IS the next
|
||||
-- wipe; once passed it is ignored rather than cleared.
|
||||
--
|
||||
-- A word this build does not recognise reads as `none`: a forecast nobody made
|
||||
-- must not appear.
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_rule VARCHAR(16) NOT NULL DEFAULT 'none';
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_day TINYINT NULL;
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_time CHAR(5) NULL;
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_tz VARCHAR(64) NULL;
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_anchor DATE NULL;
|
||||
ALTER TABLE rust_servers ADD COLUMN IF NOT EXISTS wipe_once_at DATETIME NULL;
|
||||
|
||||
Reference in New Issue
Block a user