feat(rust): Teams from first-party clans (phase 9, protocol 6)
A first-party Rust clan is a Team (R5). This module becomes the site's Team provider and answers core from the plugin's `clans` board. Design of record: docs/modules/rust/PLAN.md §24, D47-D58. - The store: rust_clans, rust_clan_members and rust_clan_boards. A clan's identity is <serverId>:<clanId>:<createdMs> (D52), because the game restarts clan ids whenever its clan database version changes. - The provider (D53): getTeams is complete only when every server's board is fresh, supported and untruncated. It is partial when some are, and refuses when none are. Freshness is judged by the website's clock, from when the board's `t` last advanced. - Only a complete board may mark a clan gone. A board at the game's 100-clan ceiling (D55), or one with an unreadable row, proves nothing about what it leaves out. - Leadership is diffed board to board and published (D54). The five clan events are published as team.* kinds, and written to the Team feed as members-only lines (D49). - Core only writes feed items for a Team it already holds. So the last 10 minutes of clan events are re-offered on each board refresh, deduped by a sha1 key: core clamps a dedupeKey to 40 characters, and a readable key would be truncated into collisions. - projectRoster and the clan page share one audience rule (D48): the clan's linked members and staff by default, re-read from the users row. The setting lives on Admin > Rust visibility, which also warns about uMod Clans (D47) and the ceiling. - Public: GET servers/:id/clans (the list is public, D58) and GET clans/:externalId. The client adds a Clans tab and /rust/clans/:externalId, with three module slots for core's notify, activity and forum contributions (D56). - Linking and unlinking an account ask core to reconcile Teams (D57). - The clan kinds are staff-class in the public feed allowlist. - PROTOCOL_VERSION is now 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -20,6 +20,7 @@ import { registry, coreApiVersion } from './core.js'
|
||||
|
||||
import Servers from './routes/public/Servers.jsx'
|
||||
import ServerDetail from './routes/public/ServerDetail.jsx'
|
||||
import Clan from './routes/public/Clan.jsx'
|
||||
import Account from './routes/player/Account.jsx'
|
||||
import Permissions from './routes/admin/Permissions.jsx'
|
||||
import ModConfig from './routes/admin/ModConfig.jsx'
|
||||
@@ -82,6 +83,10 @@ registry.registerRoutes(ID, {
|
||||
public: [
|
||||
{ path: '', element: <Servers /> },
|
||||
{ path: 'servers/:id', element: <ServerDetail /> },
|
||||
// Phase 9 (D56). Not nested under its server: core links here from Team
|
||||
// notification email through `pageUrlTemplate`, which substitutes
|
||||
// `{externalId}` and nothing else — and the server is inside that id.
|
||||
{ path: 'clans/:externalId', element: <Clan /> },
|
||||
],
|
||||
player: [{ path: '', element: <Account /> }],
|
||||
admin: [
|
||||
@@ -175,6 +180,22 @@ registry.registerExtension(ID, 'site.footer.status', FooterStatus)
|
||||
// no linked Steam account, which is most of them.
|
||||
registry.registerExtension(ID, 'admin.users.detail', UserRustSections)
|
||||
|
||||
// ── Inverted slots: core's Team contributions on OUR clan page ─────────────
|
||||
//
|
||||
// §3.7a. A clan is a Team (R5), and core renders no Team page because it does
|
||||
// not own the word "clan". So the page is `routes/public/Clan.jsx` and core
|
||||
// contributes the three things only it can render — into places this module
|
||||
// names, in this module's vocabulary. Core offers a CONTRIBUTION; it never names
|
||||
// a slot, which is what lets a second game use the same contract as module-uo.
|
||||
//
|
||||
// One slot per PLACE (D56): a slot holds one component, and a collapsed slot
|
||||
// would hand core the decision about where each part sits on a page it does not
|
||||
// own. Asking for a contribution core does not offer throws here, at
|
||||
// registration — a typo fails loudly rather than rendering nothing for ever.
|
||||
registry.declareModuleSlot(ID, 'rust.clan.header', { core: 'team.notify' })
|
||||
registry.declareModuleSlot(ID, 'rust.clan.detail', { core: 'team.activity' })
|
||||
registry.declareModuleSlot(ID, 'rust.clan.forum', { core: 'team.forum' })
|
||||
|
||||
// `module.json`'s `coreApi` range was checked by the loader before this file was
|
||||
// ever served, so there is nothing to re-check here. Log it anyway: a mismatch
|
||||
// between the core that validated the manifest and the core that published this
|
||||
|
||||
Reference in New Issue
Block a user