fix(rust): nothing names who is online by default
The org lead's rule, settled 2026-09-22: who is online is always the
narrowest audience - staff - unless an operator deliberately widens it,
and a count is fine where a list of names is not.
The public site broke that in three places since phase 4. The Online
tab named every player, the feed carried joins, respawns, deaths, chat
and tallies, and the leaderboard's lastSeen - refreshed every minute by
a gather tally - said who was on as plainly as either. All three now
sit behind one setting:
* PRESENCE_KINDS, a subset of the public allowlist, gated per request.
Below the audience the feed keeps the server's own story (wipe, start,
shutdown) and says presenceHidden rather than looking quiet.
* the Online route answers { players: [], hidden, count, audience } -
same shape, so an older client renders empty rather than breaking.
* rungs staff / signed_in / public, fleet-wide default in a new
rust_settings table with an optional per-server override on
rust_servers; an unknown stored word narrows to staff.
* the viewer's standing is RE-READ from the users row (ctx.users.getById),
not taken from the token, so a demotion or a ban applies on the next
request. Walked: a moderator demoted mid-session lost the roll call on
the same cookie.
* per-viewer answers are Cache-Control: private, no-store.
* GET/PUT /admin/rust/visibility (requireRole admin) and an admin page,
Rust visibility; every save is one activity-log row.
The browser walk also found every empty state in this module rendering
as a blank box. Core's EmptyState renders children only; this module
passed title/message (the shape the Integration Kit template teaches)
and React dropped both without a word. Fixed module-side with a small
Empty wrapper - nothing core or module-uo renders changes - and a client
test that refuses a titled EmptyState or a PageHeader subtitle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -478,6 +478,77 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
},
|
||||
RustOnline: {
|
||||
type: 'object',
|
||||
description: 'Who is on one server (GET /public/rust/servers/{id}/online). Below the operator’s presence audience the names are withheld and only the count is answered — nothing names who is online by default.',
|
||||
properties: {
|
||||
players: {
|
||||
type: 'array',
|
||||
description: 'Empty whenever `hidden` is true.',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
steamId: { type: 'string', example: '76561198000000000' },
|
||||
name: { type: 'string', nullable: true, example: 'Wanderer' },
|
||||
sleeping: { type: 'boolean', example: false },
|
||||
connectedAt: { type: 'string', nullable: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
hidden: { type: 'boolean', description: 'Were the names withheld from this viewer?', example: true },
|
||||
count: { type: 'integer', description: 'How many are online. Public at every audience.', example: 12 },
|
||||
audience: { $ref: '#/components/schemas/RustAudience' },
|
||||
},
|
||||
},
|
||||
RustAudience: {
|
||||
type: 'string',
|
||||
enum: ['staff', 'signed_in', 'public'],
|
||||
description: 'Who may see something: admins and moderators, any signed-in account, or anybody. Ordered — each includes the ones before it.',
|
||||
example: 'staff',
|
||||
},
|
||||
RustVisibility: {
|
||||
type: 'object',
|
||||
description: 'Who may see who is online: the fleet default and each server’s optional override (GET /admin/rust/visibility).',
|
||||
properties: {
|
||||
audiences: { type: 'array', items: { $ref: '#/components/schemas/RustAudience' } },
|
||||
presence: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fleet: { $ref: '#/components/schemas/RustAudience' },
|
||||
servers: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', example: 'main' },
|
||||
name: { type: 'string', example: 'Main · Vanilla' },
|
||||
enabled: { type: 'boolean', example: true },
|
||||
override: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
enum: ['staff', 'signed_in', 'public', null],
|
||||
description: 'This server’s own choice, or null to follow the fleet default.',
|
||||
},
|
||||
effective: { $ref: '#/components/schemas/RustAudience' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
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.',
|
||||
properties: {
|
||||
fleet: { $ref: '#/components/schemas/RustAudience' },
|
||||
servers: {
|
||||
type: 'object',
|
||||
additionalProperties: { type: 'string', nullable: true, enum: ['staff', 'signed_in', 'public', null] },
|
||||
example: { main: 'public', pvp: null },
|
||||
},
|
||||
},
|
||||
},
|
||||
RustSidecarProbe: {
|
||||
type: 'object',
|
||||
description: 'What a sidecar said when probed (POST /admin/rust/servers/{id}/test).',
|
||||
|
||||
Reference in New Issue
Block a user