32 Commits

Author SHA1 Message Date
7483e131ef Merge pull request 'fix(perms): never write a never-seen player into Carbon's shared blank record' (#47) from fix/carbon-blank-user into main
All checks were successful
Release plugin / release (push) Successful in 43s
Reviewed-on: #47
2026-10-30 09:31:54 +00:00
59db88d006 fix(perms): never write a never-seen player into Carbon's shared blank record
Some checks failed
PR Checks / plugin-checks (pull_request) Failing after -14s
Carbon 2.0.262 answers GetUserData for a Steam id it has no record for with
one shared, static blank record, and GrantUserPermission and AddUserGroup
write into it. A grant or membership for one never-seen player was then held
by every Steam id Carbon had no record for, until the server restarted, and
UserHasGroup read the membership back as a success, so the sync reported it
applied and later syncs saw nothing to fix.

On Carbon the sync now checks permission.UserExists before either write. A
never-seen player's grant is reported notLanded and their membership pending,
without touching the store; both land at the first audit sync after they
join, as PLAN.md section 29.8 and section 12.2 rule 4 already describe. Oxide
creates a real record and is unchanged.

Proven on the Carbon rig (Rust 26139947, Carbon 2.0.262): before, three
random never-seen ids each held autodoors.use after one admin grant; after,
a known id got its grant and membership, the never-seen id was reported
notLanded + pending, and random ids held nothing. Found in the account
deletion walk (docs/website/ACCOUNT_DELETION.md step 6, W3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-30 04:23:31 -05:00
19ad9279fa Merge pull request 'docs(bridge): bring EventsEnabled's comment to main' (#46) from edge into main
All checks were successful
Release plugin / release (push) Successful in 15s
Reviewed-on: #46
2026-10-23 07:07:09 +00:00
22da0026ca Merge pull request 'docs(bridge): EventsEnabled's comment says what it gates today' (#45) from fix/eventsenabled-comment into edge
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 22s
Reviewed-on: #45
2026-10-22 20:32:36 +00:00
ef9596ce67 docs(bridge): EventsEnabled's comment says what it gates today
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s
The doc comment on PluginConfig.EventsEnabled still said it "gates
taking a lease only", which stopped being true at protocol 9 when it
began gating every world write (D94). It now lists what the switch
gates as of protocol 14 - a lease, every world write (zones, crates,
NPCs, world calls, Dangerous Treasures, Guarded Crate, raid bases,
console commands), a tally and a run's chat line, and paying coins -
what always works with it off, and that the website can set it without
a reload. Comment only; no behaviour change.

Found while writing the runicgateway.com Rust docs (its PLAN.md §16,
phase 15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-22 15:29:34 -05:00
25a698e86e Merge pull request 'chore(release): cut edge over to main — protocol 14' (#44) from edge into main
All checks were successful
Release plugin / release (push) Successful in 30s
Reviewed-on: #44
2026-10-22 10:22:46 +00:00
3c0fcb0003 Merge pull request 'fix(bridge): the last fixes' bridge half (W3, W9, W12)' (#43) from fix/last-fixes-bridge into edge
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 13s
Reviewed-on: #43
2026-10-22 00:35:42 +00:00
38f854d580 fix(bridge): the last fixes' bridge half (W3, W9, W12)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 14s
Stage 3 of docs/modules/rust/PLAN_LAST_FIXES.md.

- W3: a Travelling Vendor call while one is on the map answers world.error
  reason `already-out` instead of "called 1" with nothing spawned. Not
  counted against the run's budget and not kept under its key, so a retry
  looks again. Module-Rust#55 reads it as called 0.
- W9: a rolled-back RaidableBases profile write carries RaidableBases' own
  log entry for the file (its path and the exception's message, without the
  stack), read from the log since the write began, instead of the last 8 KB
  of the server log. Its other entries since the write stand in when none
  names the profile, and nothing when it said nothing.
- W12: raid.ended carries the base's id, and its runId and key, when a run
  made it, as PROTOCOL §20.12 says. A teardown takes the base off the record
  before its despawn raises Ended, so the live base keeps its run and key too.

No protocol change: W3's reason is a new value of an existing field, and W12
sends the fields PROTOCOL already lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-21 13:59:10 -05:00
48aa62a07a Merge pull request 'feat(bridge): RaidableBases — raid.* events, raid.spawn, the raids helper (PLAN_REDESIGNS §11.4)' (#42) from feat/raidable-bases into edge
Reviewed-on: #42
2026-10-17 06:32:33 +00:00
e0d6c46850 feat(bridge): RaidableBases — raid.* events, raid.spawn, the raids helper (PLAN_REDESIGNS §11.4)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 11s
PLAN_REDESIGNS §11.4 (D202-D208, D386-D390), protocol 14. Spec: docs
rust-link/PROTOCOL.md §20.12.

- RunicGatewayRaids.cs, the raids helper (D168, D204-D207, D387), shipped
  beside the bridge and released with it. Harmony patches on RaidableBases'
  spawn queue Add, OpenEvent and each base's BypassUseOwners(): a run's base
  is tagged at birth, its PvP/NPCs/despawn/lock set on a member-by-member copy
  of its profile (Setup, NPC and DespawnOptions copied again, so the shared
  profile is never touched), PvP also set on the base after OpenEvent; a spot
  checked (own look, then the plugin's area check with its reason, rocks and
  cliffs a warning; then the ocean level, D388, D389) and pasted; one base
  despawned; profiles reloaded under watch. Both editions, every member found
  by name. rgr.status.
- Hello's integrations.raidableBases: edition, the paid spawn call (looked
  for by name, D348), CopyPaste, the plugin's own difficulties (D386), the
  helper, and with it the grid and the profiles.
- raid.started / raid.completed / raid.ended / raid.purchased / raid.locked
  from the lifecycle hooks; the unload trap's completions (no owner, no
  raiders) are neither sent nor counted. The tally's raidsCompleted (Warlord).
- map.live's raids layer, kept by the hooks and seeded from GetAllEvents().
- raid.spawn: with the helper the base is a world registry entry, so
  world.revert / world.owned / world.expired serve it (never-started after
  15 min, raidablebases-unloaded); without it the paid call or rbevent, not
  the run's. raid.check for the editor's advice (D208, D391).
- RaidableBases' profiles in the configuration editor (D205): a virtual
  @data/RaidableBases/Profiles/ path, all-profiles-or-none writes, reloaded by
  the helper and rolled back when a profile does not load.

Compiled on both rigs (Rust 25902425, Oxide 2.0.7830, Carbon 2.0.262) and
driven on both rigs with the paid 3.2.2 and the tier-3 pack through a
throwaway plugin: the pick and spot routes with every setting, a repeat key,
revert, expiry, and a good and a broken profile edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-16 19:29:02 -05:00
594acb5351 Merge pull request 'feat(bridge): console commands as event steps — command.run (PLAN_REDESIGNS §16, D382-D385)' (#41) from feat/command-steps into edge
Reviewed-on: #41
2026-10-16 07:47:40 +00:00
5104e0dbcd feat(bridge): keep a step's teardown with its key — teardownOf (D385)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s
Core records nothing for a step that failed or whose answer was lost, and
then reverts it with only the key: no server, no teardown. So a run request
now carries its `teardown`, stored in the key's record and never run with
it, and `{ key, teardownOf }` runs the teardown stored under `teardownOf`,
under its own key, at most once:

- only when something there may have run (some commands ran, or a reload
  cut the run off); otherwise answered with nothing run and nothing kept;
- `busy` while the run it is for is still going;
- a reward carries no teardown (refused `malformed`), and a teardown takes
  no placeholders.

Re-compiled and driven on both rigs (a failed run's teardown ran once, a
repeat ran nothing, nothing-ran and unknown keys ran nothing); rigs
restored to the protocol-13 bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-16 02:36:49 -05:00
b52b8a8f80 feat(bridge): console commands as event steps — command.run (PLAN_REDESIGNS §16)
A `command.run` frame (protocol 14, PROTOCOL.md §20.11) runs the console
commands a step's author typed: once, or once per online recipient with
{steamid} and {name} filled in (the name quoted the way the game's own
BuildCommand quotes an argument). D382-D384: no allowlist; offline
recipients are skipped and named.

- At most once per key: the key is written to commands-run.json before
  anything runs; a repeat answers from the record, a repeat while running
  joins the running job, a record a reload interrupted answers
  `interrupted`. Kept 7 days, at most 500 records.
- Spread over frames: whole recipients per frame, up to 30 commands or 8 ms.
- unknown-command: ConsoleSystem.Run returns null both for an unknown command
  and for one that replies nothing, so the run listens to Unity's log for the
  game's own "Command '...' not found" line while each command runs (spiked
  on Oxide 2.0.7830 and Carbon 2.0.262, Rust 25902425). The same capture is
  the reply when Run returns nothing.
- rg.world shows commandKeys and commandsRunning.

Compiled on both rigs and driven through a throwaway plugin (repeat key,
unknown command, offline recipients, malformed requests); rigs restored to
the protocol-13 bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-16 02:30:59 -05:00
9c99aceb65 Merge pull request 'feat(bridge): ZLevels Remastered in hello (PLAN_REDESIGNS §14.3.6)' (#40) from feat/zlevels into edge
Reviewed-on: #40
2026-10-16 06:10:45 +00:00
454ce53937 feat(bridge): ZLevels Remastered in hello (PLAN_REDESIGNS §14.3.6)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -2m7s
Stage 7 of the §14.3 integration plan (D374): hello's integrations gains
zLevels { loaded, version }, sent again when ZLevels loads or unloads,
and rg.world prints zLevels=. No level is read or sent; its XP boosts
are permissions a run already lends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 18:27:54 -05:00
92915f7de6 Merge pull request 'feat(bridge): Guarded Crate on protocol 14 (PLAN_REDESIGNS §14.3.5)' (#39) from feat/guarded-crate into edge
Reviewed-on: #39
2026-10-15 23:18:43 +00:00
4e83def0dd feat(bridge): Guarded Crate on protocol 14 (PLAN_REDESIGNS §14.3.5)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s
Stage 6 of the §14.3 integration plan. Spec: docs rust-link/PROTOCOL.md §20.9.

- gc.started, gc.ended (the clearer, or nobody) and gc.failed from Guarded
  Crate's three hooks; the start's key joins exactly, inside the call.
- gc.place { key, event, location as a world call } runs `<command> position
  <event> x,y,z`; refuses npcspawn-missing itself, since Guarded Crate's
  `position` does not check and the crate would land unguarded (D364).
- The running set is checked against Guarded Crate's private list (by
  reflection): the hotload seed, `stop all` (no hook), and which event ended.
- Hello's integrations.guardedCrate with npcSpawn and the events from its data
  file; the tally's guardedWon (Warden); map.live's guarded rows; rg.world.
- Guarded Crate's cargo plane no longer says airdrop.called.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 12:26:36 -05:00
7b1eabcd8b Merge pull request 'feat(bridge): Dangerous Treasures on protocol 14 (PLAN_REDESIGNS §14.3.4)' (#38) from feat/dangerous-treasures into edge
Reviewed-on: #38
2026-10-15 12:05:02 +00:00
72f51c3d9e feat(bridge): Dangerous Treasures on protocol 14 (PLAN_REDESIGNS §14.3.4)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 14s
Stage 5 of the §14.3 integration plan (docs rust-link/PROTOCOL.md §20.8).

- Three events from DT's own hooks: dt.started { x, z, key? },
  dt.won { steamId, name, invaders (max 32), invaderCount, x, z } and
  dt.ended { x, z }. None while the world is not live; a win still counts.
- The start hook fires inside the call that opens the chest, so the key a
  dt.start is running joins its start exactly, not by a ten-second window.
- dt.start { key, level 0-2 } runs `dtevent <level>` through
  ConsoleSystem.Run and answers dt.opened { key, level, repeat, x, z }. A key
  already answered is answered again and opens nothing (kept seven days in
  dt-starts.json). Refusals: malformed, bad-level, dt-missing,
  console-unavailable (D363), dt-not-ready (nothing opened, DT's own "Manual
  Event Failed" reply, under fifteen minutes since DT loaded, D365),
  dt-no-spot (after), refused (anything else DT said).
- The tally gains treasuresWon (Treasure Hunter, D375); map.live's world gains
  kind "treasure" for each running chest, seeded at load from DT's chests in
  the world (DT has no API that lists them).
- Hello's integrations gain dangerousTreasures, sent again on DT's load and
  unload. rg.world prints dangerousTreasures, treasures, dtStarts and
  dtWarmingUp. README lists Dangerous Treasures.

checkPlugin: 81 hooks, every one void and listed; 18 tests. Compiled and
loaded on both rigs (Rust 25902425, Oxide 2.0.7830, Carbon 2.0.262);
rg.world read dangerousTreasures=False treasures=0, then both went back on
the protocol-13 bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 06:45:25 -05:00
8e8553c589 Merge pull request 'feat(bridge): Dynamic PVP's zones on protocol 14 (PLAN_REDESIGNS §14.3.3)' (#37) from feat/dynamic-pvp into edge
Reviewed-on: #37
2026-10-15 11:17:45 +00:00
7c9c8bdacb feat(bridge): Dynamic PVP's zones on protocol 14 (PLAN_REDESIGNS §14.3.3)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -2m8s
Stage 4 of the §14.3 integration plan, specified in docs
rust-link/PROTOCOL.md §20.7 and §17.3.

- pvp.zone.created { zoneId, event, x, z, radius, shape, durationSec } from
  OnCreatedDynamicPVP, and pvp.zone.deleted { zoneId, event } from
  OnDeletedDynamicPVP. Neither is sent while the world is not live.
- Size and place come from ZoneManager: a sphere's Radius, or half a cube's
  longer side (cargo's zone is a cube); the position is the zone's transform,
  so cargo's moves with the ship.
- map.live gains a `pvp` layer of the live zones, kept by the two hooks and
  seeded from Dynamic PVP's own AllDynamicPVPZones / GetEventName at world
  ready and when it loads; a zone ZoneManager no longer holds is dropped.
- hello's integrations.dynamicPvp, sent again when it loads or unloads;
  rg.world prints dynamicPvp= and pvpZones=; both hooks join rg.hooks.
- The bridge never makes, maps or erases one of Dynamic PVP's zones.

Compiled and loaded on both rigs (Rust 25902425, Oxide 2.0.7830, Carbon
2.0.262).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 06:12:05 -05:00
49a677e3fb Merge pull request 'feat(bridge): TruePVE in a zone on protocol 14 (PLAN_REDESIGNS §14.3.2)' (#36) from feat/truepve-zone into edge
Reviewed-on: #36
2026-10-15 11:06:25 +00:00
491760d817 feat(bridge): TruePVE in a zone on protocol 14 (PLAN_REDESIGNS §14.3.2)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 10s
Stage 3 of the §14.3 integration plan (D362, D368), specified in docs
rust-link/PROTOCOL.md §20.6.

- world.zone's optional truePve: {"exclude": true} or {"ruleset": "name"},
  exactly one, the name 1-64 characters. Malformed is `malformed`; TruePVE
  not loaded is `truepve-missing`.
- All or nothing: the zone (and its dome) is made, then AddOrUpdateMapping.
  A false erases both and answers `truepve-ruleset` with the name (or
  `refused` for exclude).
- The registry entry remembers its mapping, and every path that erases one
  of our zones calls RemoveMapping first: the deadline, world.revert, a zone
  world.owned finds gone, a new wipe. While TruePVE is away the id waits in
  data/RunicGateway/truepve.json, flushed at OnPluginLoaded(TruePVE) and at
  the bridge's own load.
- hello's integrations.truePve { loaded, version }, sent again when TruePVE
  loads or unloads. rg.world prints truePve= and truePveLeftover=.

Compiled and loaded on both rigs (Rust 25902425, Oxide 2.0.7830, Carbon
2.0.262, TruePVE 2.4.6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 05:47:58 -05:00
8fdc374ab3 feat: TruePVE in the zone step (PLAN_REDESIGNS §14.3.2, WIP)
Stage 3 of the §14.3 integration plan (D362, D368): world.zone's optional
truePve ({exclude: true} or {ruleset}), all or nothing, unmapped on every
path that erases one of our zones, with truepve.json for erases while
TruePVE is away. Docs and PRs still to come.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 03:03:30 -05:00
51de1b492f Merge pull request 'feat(bridge): Rust's own world events on protocol 14 (PLAN_REDESIGNS §14.3.1)' (#35) from feat/world-events into edge
Reviewed-on: #35
2026-10-15 07:20:06 +00:00
adb9df6a2e feat(bridge): Rust's own world events on protocol 14 (PLAN_REDESIGNS §14.3.1)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -1m55s
Stage 1 of the §14.3 integration plan: the patrol helicopter, Bradley, the
cargo ship, the Chinook, airdrops, locked crates, the Travelling Vendor, the
satellite and the Deep Sea, with no plugin (D349).

- `world.event`, one frame kind whose `event` names which of 24 types
  (PROTOCOL.md §20.5). The type is in `event`, never `type`: `type` is the
  envelope's, and the rig's sidecar dropped every world event as untyped when
  the plan's example put it there. Nothing is said before the world loads or
  while the server quits. Positions are x/z; the site works out the grid.
- Credit (D372, D379): a damage table for the patrol helicopter, the Chinook
  and Bradley; `heli.downed`, `chinook.downed` and `bradley.destroyed` carry
  every candidate (blow, last, most, damagers) and the plugin credits nobody.
  D174's `CreditVehicle` and the tally's apcKills/heliKills are gone.
- Locked crates told positively (oil rigs, cargo, ghost ship, a Chinook drop
  joined at the crate's landing); anything else says nothing. A Bradley's
  `where` comes from the game's spawners, not `RoadSpawned` (which defaults to
  true). `airdrop.called` comes from the cargo plane's spawn: `supply.call`
  raised neither OnAirdrop nor OnCargoPlaneSignaled.
- The tally gains cratesHacked and dropsLooted (Safecracker, Scavenger, D356).
- `world.call` (D354, D367, D378): one of a schedule's TriggeredEvents at
  random, without Trigger (which would reset its clock); satellite.random for
  the satellite. A position for the airdrop (InitDropPosition) and the patrol
  helicopter (SetInitialDestination) only, both set before the spawn, as the
  stage-1 spike measured (0-1 m and 10-54 m). Kept; the key is remembered seven
  days in world-calls.json; EventsMaxWorldCalls (default and ceiling 10) per run.
- Hello/status `console.plugins` (D363): the bridge runs its own rg.probe
  through ConsoleSystem.Run from a timer. Carbon 2.0.262 refuses plugin
  commands only inside a console command (or a NextTick one queued), which is
  how §14.2's spike tested; from a timer, and from the link reader's NextTick,
  it finds them. Reads true on both rigs.
- checkPlugin.js: the probe must name a [ConsoleCommand] the plugin declares.

Compiled and loaded on both rigs (Rust 25902425, Oxide 2.0.7830, Carbon
2.0.262); heli.arrived, cargo.arrived and airdrop.called read back from each
rig's sidecar store. Rigs restored. 18 check tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-15 00:39:00 -05:00
6be14c7270 Merge pull request 'feat(bridge): Backpacks on protocol 14 — read a backpack (PLAN_REDESIGNS §11.3)' (#33) from feat/rust-backpacks into edge
Reviewed-on: #33
2026-10-12 19:41:33 +00:00
e3dc918400 feat(bridge): Backpacks on protocol 14 — read a backpack (PLAN_REDESIGNS §11.3)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 23s
WhiteThunder's Backpacks as an optional integration (D199), as §11.3.2 designs it.
Read, never write (R2):

- hello/status `integrations.backpacks` adds `sizes`: the N of every registered
  backpacks.size.N, ascending (dynamic-size profiles left out). Hello is resent
  when Backpacks loads or unloads.
- `backpacks.read {steamId}`: API_ReadBackpackContentsAsJson, and only when that
  answered a backpack, API_GetBackpackCapacityById — the backpack is loaded by
  then, so the capacity follows a later grant (§11.3.1's trap). Each stack is
  reduced to slot, shortname, display (the game's English name, D340), amount,
  skin and name when set; a blueprint carries its target as `blueprint` (D341);
  contents one level deep; `overflow` past the capacity. `pageSize` is
  Backpacks' "Max size per page" from its config, cached by mtime.
- Refusals: backpacks-missing, bad-id, unreadable.

The bigger backpack an event lends is a backpacks.size.N permission pushed by
perm.sync (D337), so it needs no code here. Still protocol 14 (D332).

Compiled on both rigs (Rust changeset 167584; Oxide 2.0.7826, Carbon 2.0.262),
then restored to the bridge they ran before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-12 14:35:54 -05:00
3db35cdd02 Merge pull request 'feat(bridge): Economics on protocol 14 — pay, balances, adjust (PLAN_REDESIGNS §11.2)' (#31) from feat/protocol-14-economics into edge
Reviewed-on: #31
2026-10-12 12:40:24 +00:00
66fbbd6b57 feat(bridge): Economics on protocol 14 — pay, balances, adjust (PLAN_REDESIGNS §11.2)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 10s
Wulf's Economics as an optional integration (D199), as §11.2.2 designs it:

- hello/status `integrations.economics` adds startingBalance and wipesWithMap,
  read from Economics.json (cached by mtime) because its API has neither.
- `economics.pay`: coins from an event step, kept once paid (D335). One main-
  thread call for the list; each deposit measured as after - before, since
  Deposit answers true while rounding and clamping (`at-limit` otherwise).
  The key and its reply are kept in data/RunicGateway/payments.json for seven
  days, so a retry answers `repeat: true` and pays nobody. The optional
  message ({amount} = what landed) is told now if awake, else on wake.
- `economics.balances` (bounded by PermMaxOps) and staff `economics.adjust`
  (deposit / withdraw / set; a withdrawal above the balance is refused
  `insufficient` with the balance).
- `player.tally` gains `balance`, a value: read at connect (D336) and from
  OnEconomicsBalanceUpdated, offline players included.
- `economics.wiped` from OnEconomicsDataWiped(IPlayer), with `newSave`.

Amounts are boxed as double and only Steam ids are sent, per the spike.
Compiled on both rigs (Oxide 2.0.7826, Carbon 2.0.262), then restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-12 06:56:46 -05:00
cc7b2b2a0e Merge pull request 'feat(bridge): protocol 14 — kits.uses and reward notices (PLAN_REDESIGNS §2)' (#30) from feat/protocol-14-step-editor into edge
Reviewed-on: #30
2026-10-12 09:52:10 +00:00
6952fbf123 feat(bridge): protocol 14 — kits.uses and reward notices (PLAN_REDESIGNS §2)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 9s
Opens protocol 14 (D332):
- kits.uses {kit, steamIds} -> {kit, max, cooldown, asked, exhausted,
  onCooldown}: counts only, bounded by the sync's own bound (§2.6).
- perm.sync notices [{key, steamId, message, delivery}] (D333): the site's
  whole untold set. Told at once to a player who is awake, else on
  OnPlayerSleepEnded; popup where PopupNotifications is loaded and chosen,
  chat otherwise. Told keys persist in notices.json until the site stops
  sending them; the report lists noticesTold.

ProtocolVersion and overlay.toml 13 -> 14; OnPlayerSleepEnded joins
ExpectedHooks (checkPlugin: 55 hooks, all void).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
2026-10-12 02:15:23 -05:00
7 changed files with 8942 additions and 90 deletions

View File

@@ -30,7 +30,7 @@
#
# 2. A FRAMEWORK-NEUTRAL LAYOUT. The tarball holds one directory,
# `runicgateway-rust-plugin/`, with `RunicGateway.cs`, its helpers
# (`RunicGatewayZones.cs`, `RunicGatewayDomes.cs`) and `manifest.json` at its top. Every `.cs` in it is listed in the
# (`RunicGatewayZones.cs`, `RunicGatewayDomes.cs`, `RunicGatewayRaids.cs`) and `manifest.json` at its top. Every `.cs` in it is listed in the
# manifest's `files`, and the installer and the egg place every one of them. It does NOT mirror `oxide/plugins/`: the same file goes to
# `oxide/plugins/` or `carbon/plugins/`, and the installer and the egg each
# decide which (§34.2.1). The fixed, unversioned prefix is so a reader never
@@ -41,7 +41,8 @@
# committed file keeps its placeholder; the manifest records the commit.
# Only the bridge is stamped. A helper (docs/modules/rust/PLAN_FIXES.md D168,
# D182 — today `RunicGatewayZones.cs` for ZoneManager and `RunicGatewayDomes.cs`
# for ZoneDomes, PLAN_REDESIGNS D194) keeps its own
# for ZoneDomes, PLAN_REDESIGNS D194, and `RunicGatewayRaids.cs` for RaidableBases,
# D204) keeps its own
# version: it does one job, changes rarely, and the bridge reads its version at
# hello to know which job it does.
#
@@ -81,7 +82,7 @@ env:
PLUGIN: overlay/oxide/plugins/RunicGateway.cs
# The helpers shipped beside the bridge (D168, D182). Optional at runtime —
# the bridge loads without them — and installed by default.
HELPERS: overlay/oxide/plugins/RunicGatewayZones.cs overlay/oxide/plugins/RunicGatewayDomes.cs
HELPERS: overlay/oxide/plugins/RunicGatewayZones.cs overlay/oxide/plugins/RunicGatewayDomes.cs overlay/oxide/plugins/RunicGatewayRaids.cs
SEED_VERSION: "0.1.0"
INSTALLER_REPO: RunicGateway/installer

View File

@@ -37,6 +37,7 @@ unauthenticated command channel on the network.
overlay/oxide/plugins/RunicGateway.cs → <server>/oxide/plugins/RunicGateway.cs
overlay/oxide/plugins/RunicGatewayZones.cs → <server>/oxide/plugins/RunicGatewayZones.cs
overlay/oxide/plugins/RunicGatewayDomes.cs → <server>/oxide/plugins/RunicGatewayDomes.cs
overlay/oxide/plugins/RunicGatewayRaids.cs → <server>/oxide/plugins/RunicGatewayRaids.cs
```
`RunicGatewayZones.cs` is the **ZoneManager helper** (docs/modules/rust/PLAN_FIXES.md D181, D182). ZoneManager
@@ -52,6 +53,17 @@ helper patches the first with Harmony and tells the bridge when ZoneDomes has st
domes back without drawing any twice. It is optional: without it the site offers no dome, and says which piece is
missing. `rgd.status` in the server console says whether it patched.
`RunicGatewayRaids.cs` is the **RaidableBases helper** (docs/modules/rust/PLAN_REDESIGNS.md §11.4, D204–D207,
D387). RaidableBases' API spawns nothing and despawns nothing, so an event's base cannot be the event's from the
outside. The helper reaches its internals by reflection and patches its spawn queue, `OpenEvent` and each base's
`BypassUseOwners()` with Harmony: it tags the base a run asked for at birth, applies that spawn's own PvP, NPCs,
despawn time and lock on a copy of its profile, places one at a spot after checking it, despawns that one base at
the run's end, and reloads RaidableBases' profiles when the site edits them. It serves both editions, free and
paid, and reads every difficulty, profile and base name from the installed plugin. It is optional: without it the
bridge still reports raid bases on the feed and the map, and a step can still ask RaidableBases for a base where it
picks, but that base despawns on its own timer, and the site says so. `rgr.status` in the server console says
whether it patched, which edition's spawn call it found, and whether the plugin's spawn grid is built.
Oxide compiles and loads it on the write, and writes `oxide/config/RunicGateway.json` on first load:
```json
@@ -101,6 +113,68 @@ Clans on the website come from Rust's **own** clan system, not from the uMod `Cl
is optional. The two share no data: a server running the plugin has two unrelated clan systems, and
only the game's own clans become Teams on the site.
Wulf's `Economics` is optional too, and not in `overlay.toml`. Where it is loaded the site can pay
coins from an event, show balances and a richest column, and let staff adjust a balance; where it is
not, each of those says "Economics is not installed on this server".
WhiteThunder's `Backpacks` is optional in the same way. Where it is loaded staff can open a player's
backpack from the site, a player can see their own, and an event can lend a bigger one for its run;
the bridge only ever reads a backpack, and the bigger size is one of Backpacks' own `backpacks.size.N`
permissions, pushed like any other grant.
nivex's `TruePVE` is optional in the same way. Where it is loaded an event's zone can turn off PvP
protection inside it, or use one of the operator's own TruePVE rulesets by name; where it is not, the
zone step says "TruePVE is not installed on this server". The bridge only ever adds and removes the
mappings of zones it opened, and removes each one with its zone, even when TruePVE was away at the time.
HunterZ's `Dynamic PVP` (which needs ZoneManager and TruePVE) is optional too. Where it is loaded, the
PvP zones it opens around a downed helicopter, a Bradley, cargo and the rest reach the site's feed and
its map. The bridge only reads them: it never makes, maps or erases one of Dynamic PVP's zones.
nivex's `Dangerous Treasures` is optional as well. Where it is loaded, its treasure events reach the
site's feed, its map and the *Treasure Hunter* title, and an event can open one (`dt.start`) through
DT's own `dtevent` console command; DT picks the spot and despawns its own chest. For about ten minutes
after DT loads it is still finding its spots, and a start then is answered "not ready yet". A framework
that cannot run another plugin's console command from code (`rg.world` says `consolePlugins=False`)
cannot open one.
Bazz3l's `Guarded Crate` is optional too, and needs `NpcSpawn` (a free Codefling download, not shipped
here) for its guards. Where both are loaded, a guarded crate landing, being cleared and timing out
reach the site's feed, its map and the *Warden* title, and an event can place one (`gc.place`) at a
monument or a point through Guarded Crate's own `gcrate position` console command. A placed crate is
kept when the event ends: Guarded Crate has no way to end one event alone. Without NpcSpawn a placement
is refused, because the crate would land unguarded; and, as for Dangerous Treasures, a framework with
`consolePlugins=False` cannot place one.
nivex's `RaidableBases` is optional, free or paid, and needs `CopyPaste` to paste its bases. Where it is
loaded, a base appearing, being raided, bought or locked to a player reach the site's feed, its map's own
*Raid bases* layer and the *Warlord* title, and an event can spawn one (`raid.spawn`). With
`RunicGatewayRaids.cs` (above) the base is the event's: at a spot or where RaidableBases picks, with its own
settings, despawned when the event ends; and the site can edit RaidableBases' profiles from its configuration
page, reloading them under watch. For up to ten minutes after RaidableBases loads it builds its spawn grid and
refuses every spawn, and a spawn then is answered "not ready". Every difficulty, profile and base name is read
from the installed plugin.
nivex's `ZLevels Remastered` is optional, and the bridge only says whether it is loaded. Its levels are
never read or sent. Its XP boosts are its own permissions (`zlevelsremastered.vip1` to `vip3`), so an
event lends one as it lends any other permission, and it takes effect at once.
An event can also run console commands an admin typed (`command.run`): once, as a step, or once for each
recipient of a reward who is online, with `{steamid}` and `{name}` filled in (the name as one quoted
argument). That is how a plugin with no support of its own here is used from an event, for example
RaidableBases' `rbe`. There is no allowlist: the site's switchboard is the switch, and `EventsEnabled`
here is the server's. Each request runs at most once: its key is written to
`data/RunicGateway/commands-run.json` before anything runs, and is kept for seven days. A step's
teardown commands are kept with its key too, so the site can have them run even for a step that failed
part-way or whose answer was lost (`teardownOf`). A command the
server does not know stops the request there as `unknown-command`. On a framework with
`consolePlugins=False`, that is every plugin's command.
Rust's own world events need no plugin at all. The patrol helicopter, Bradley, the cargo ship, the
Chinook, airdrops, locked crates, the Travelling Vendor, the satellite and the Deep Sea reach the
site's feed and its event triggers on every server, and an event can call one of them (`world.call`).
What a call starts is kept when the event ends; `EventsMaxWorldCalls` caps how many one run may call.
## Diagnosing it
```

View File

@@ -26,15 +26,23 @@
# the same change that alters the emitters, exactly as the sidecar bumps
# PROTOCOL_VERSION and the module bumps its own constant.
#
# Current: 13 — the transport, the read path, identity, the permission mirror,
# Current: 14 — the transport, the read path, identity, the permission mirror,
# configuration from the site, first-party clans, a raid frame that names who
# lives there, the event leases, the world verbs events place and give back, and
# the rewards: a run's participation tally, kit credits and chat (PROTOCOL.md §16),
# the map: its picture and everything that moves on it (PROTOCOL.md §17), and the
# optional mods: BetterChat titles and group styles, and popups (PROTOCOL.md §18),
# and the first player walk's fixes (PROTOCOL.md §19) — opened by a configuration
# save that answers at once and reports its reload as a `config.outcome` frame.
protocol = 13
# save that answers at once and reports its reload as a `config.outcome` frame,
# and the step editor (PROTOCOL.md §20): `kits.uses`, and the one-time reward
# messages a `perm.sync` carries as `notices`; and Economics (PROTOCOL.md §20.3):
# `economics.pay`, `economics.balances`, `economics.adjust`, the tally's
# `balance` and the `economics.wiped` event; and Backpacks (PROTOCOL.md §20.4):
# `backpacks.read` and hello's `integrations.backpacks.sizes`; and Rust's own world
# events (PROTOCOL.md §20.5): `world.event` with its `event`, `world.call`, hello's
# `console`, and the tally's `cratesHacked` and `dropsLooted` in place of `apcKills`
# and `heliKills`.
protocol = 14
# ── Oxide compatibility ──────────────────────────────────────────────────────
#

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -113,6 +113,16 @@ function readChatCommands(source) {
return found
}
/** Every `[ConsoleCommand("x")]` the plugin declares. */
function readConsoleCommands(source) {
return [...source.matchAll(/\[ConsoleCommand\("([^"]+)"\)\]/g)].map((m) => m[1])
}
/** The `rg.*` commands the plugin runs on itself through `ConsoleSystem.Run`. */
function readOwnConsoleRuns(source) {
return [...source.matchAll(/ConsoleSystem\.Run\([^,]+,\s*"(rg\.[\w.]+)"/g)].map((m) => m[1])
}
function readMethods(source) {
const found = []
let m
@@ -196,7 +206,20 @@ function check(source, toml) {
seen.add(cmd.command)
}
// 5. The two declaration sites this repository owns must agree.
// 5. Protocol 14 (D363): the console probe runs one of this plugin's own commands
// through `ConsoleSystem.Run` to learn whether the framework runs a plugin's
// command from code. A probe naming a command the plugin does not declare
// answers "no" on every framework, which reads exactly like Carbon's bug.
for (const name of readOwnConsoleRuns(source)) {
if (!readConsoleCommands(source).includes(name)) {
problems.push(
`ConsoleSystem.Run runs "${name}", but the plugin declares no [ConsoleCommand("${name}")]: ` +
'the console probe would report false on every framework (D363).'
)
}
}
// 6. The two declaration sites this repository owns must agree.
const inCode = /ProtocolVersion\s*=\s*(\d+)\s*;/.exec(source)
// runicnpc stage 4: the RunicNPC API the bridge needs, declared twice like the protocol.
const npcToml = /^\s*runicnpc_api\s*=\s*(\d+)\s*$/m.exec(toml)
@@ -242,6 +265,6 @@ function main() {
)
}
module.exports = { check, readExpectedHooks, readMethods, readChatCommands, HOOK_NAME }
module.exports = { check, readExpectedHooks, readMethods, readChatCommands, readConsoleCommands, readOwnConsoleRuns, HOOK_NAME }
if (require.main === module) main()

View File

@@ -16,7 +16,7 @@ const assert = require('node:assert')
const fs = require('node:fs')
const path = require('node:path')
const { check, readExpectedHooks, readMethods, readChatCommands, HOOK_NAME } = require('./checkPlugin')
const { check, readExpectedHooks, readMethods, readChatCommands, readConsoleCommands, readOwnConsoleRuns, HOOK_NAME } = require('./checkPlugin')
/** A minimal plugin that passes, as the baseline every case below deviates from. */
function source({ expected = ['OnPlayerDeath'], methods, version = 2 } = {}) {
@@ -210,3 +210,55 @@ test('the chat-command parser reads the real plugin, rather than quietly matchin
assert.ok(names.has('link'), '/link was not found by the chat-command parser')
assert.ok(names.has('unlink'), '/unlink was not found by the chat-command parser')
})
// ── The console probe (protocol 14, D363) ──────────────────────────────────
//
// The plugin runs its own `rg.probe` through `ConsoleSystem.Run` to learn whether
// the framework runs a plugin's command from code. A probe that names a command
// the plugin does not declare answers false everywhere, and false is exactly what
// Carbon's bug looks like, so nobody would ever notice.
/** A plugin that runs `ran` on itself and declares `declared`. */
function withProbe(ran, declared) {
return source({
expected: [],
methods: ` private void StartWorldEvents()
{
ConsoleSystem.Run(ConsoleSystem.Option.Server.Quiet(), "${ran}");
}
[ConsoleCommand("${declared}")]
private void CmdProbe(ConsoleSystem.Arg arg)
{
}`,
})
}
test('a probe that runs a command the plugin declares passes', () => {
assert.deepEqual(check(withProbe('rg.probe', 'rg.probe'), toml()), [])
})
test('a probe that runs a command the plugin does not declare is caught', () => {
const problems = check(withProbe('rg.probe', 'rg.prob'), toml())
assert.equal(problems.length, 1)
assert.match(problems[0], /ConsoleSystem\.Run runs "rg\.probe", but the plugin declares no \[ConsoleCommand\("rg\.probe"\)\]/)
})
test('a native command run through the console is not the probe, and is left alone', () => {
const methods = ` private void Call()
{
ConsoleSystem.Run(ConsoleSystem.Option.Server.Quiet(), "satellite.random");
}`
assert.deepEqual(check(source({ expected: [], methods }), toml()), [])
})
test('the probe parsers read the real plugin, rather than quietly matching nothing', () => {
const real = fs.readFileSync(
path.resolve(__dirname, '..', 'overlay', 'oxide', 'plugins', 'RunicGateway.cs'),
'utf8'
)
assert.ok(readOwnConsoleRuns(real).includes('rg.probe'), 'the console probe was not found by the parser')
assert.ok(readConsoleCommands(real).includes('rg.probe'), 'rg.probe was not found among the console commands')
assert.ok(readConsoleCommands(real).includes('rg.hooks'), 'rg.hooks was not found among the console commands')
})