feat(bridge): protocol 10 — the tally, kit credits and chat (phase 13b) #10

Merged
whitlocktech merged 1 commits from feat/phase-13b-rewards into edge 2026-09-24 08:01:26 -05:00
Member

What & why

Phase 13b of module-rust (docs PLAN.md §29; protocol spec PROTOCOL.md §16, in docs PR). The bridge now records who took part in an event, spends the extra kit use a reward gives, and says lines in chat.

  • tally.open / .snapshot / .close: a run's participation tally, kept in tallies.json.
    • Presence is read every 5 s from ZoneManager's own zone membership, or the whole server.
    • A kill goes to the last hit, filtered by killsOf, and the killer must be inside the zone (D98).
    • The score is seconds, kills, or minutes + weight × kills (D99).
    • Only a zone this run opened counts (D100).
    • Opening a tally is refused while EventsEnabled is off (D107). A tally is forgotten 7 days after it opened (D108).
  • kits.list: the kit dropdown's data, from Kits' GetKitNames / GetKitInfo.
  • perm.sync gains credits: one extra use of a kit per reward (D103). The plugin keeps them in credits.json and spends them last, from OnKitRedeemed: Kits cannot be told about a use in advance, because SetPlayerKitUses does nothing for a player who has no usage record.
    • A credit the site withdraws and the player has not redeemed is put back into Kits' counter.
    • When Kits wipes its use counts at a new save, the credits the plugin had moved into them are reset.
    • The report gains creditsApplied, creditsWithdrawn, creditsUnresolved and creditsWaiting.
  • chat.say: one line to everyone on the server. The same key within 10 minutes is answered and not said twice.
  • Three new config bounds: EventsMaxRecipients, EventsMaxTallies, EventsMaxChat.
  • New hook and command: OnKitRedeemed (void, and listed with the others), and the rg.rewards console command.
  • overlay.toml protocol → 10.

How it was tested

  • node scripts/checkPlugin.js passes: 30 hooks, every one void and listed.
  • Compiled and loaded on both rigs, Oxide and Carbon, from the same file with no conditional compilation. Kits 4.4.9 was installed on both.
  • Walked against real core; results in PLAN.md §29.7:
    • recipient modes against a seeded tally;
    • credits applied, and withdrawn after a revert, through real Kits;
    • a zone tally across a server restart;
    • a credit across a wipe with Kits' WipeData on;
    • chat, including the same-key dedupe.
  • Not walked: anything that needs a person in game — standing in a zone, landing a kill, redeeming from the Kits menu. That is the rewards walk in PLAYER_WALK.md.

Checklist

  • I have read CONTRIBUTING.md.
  • The change builds and existing tests/checks pass locally.
  • I have added or updated tests/docs where it makes sense.
  • My commits are reasonably scoped with clear messages.

AI-assisted contributions (required)

  • AI tools were used. Tool(s): Claude Code (Claude Opus 5.5). I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a Co-Authored-By trailer.

License

  • I agree that my contribution is licensed under GPL-3.0-or-later.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

## What & why Phase 13b of module-rust (docs `PLAN.md` §29; protocol spec `PROTOCOL.md` §16, in docs PR). The bridge now records who took part in an event, spends the extra kit use a reward gives, and says lines in chat. - **`tally.open` / `.snapshot` / `.close`**: a run's participation tally, kept in `tallies.json`. - Presence is read every 5 s from ZoneManager's own zone membership, or the whole server. - A kill goes to the last hit, filtered by `killsOf`, and the killer must be inside the zone (D98). - The score is seconds, kills, or minutes + weight × kills (D99). - Only a zone this run opened counts (D100). - Opening a tally is refused while `EventsEnabled` is off (D107). A tally is forgotten 7 days after it opened (D108). - **`kits.list`**: the kit dropdown's data, from Kits' `GetKitNames` / `GetKitInfo`. - **`perm.sync` gains `credits`**: one extra use of a kit per reward (D103). The plugin keeps them in `credits.json` and spends them last, from `OnKitRedeemed`: Kits cannot be told about a use in advance, because `SetPlayerKitUses` does nothing for a player who has no usage record. - A credit the site withdraws and the player has not redeemed is put back into Kits' counter. - When Kits wipes its use counts at a new save, the credits the plugin had moved into them are reset. - The report gains `creditsApplied`, `creditsWithdrawn`, `creditsUnresolved` and `creditsWaiting`. - **`chat.say`**: one line to everyone on the server. The same key within 10 minutes is answered and not said twice. - **Three new config bounds**: `EventsMaxRecipients`, `EventsMaxTallies`, `EventsMaxChat`. - **New hook and command**: `OnKitRedeemed` (void, and listed with the others), and the `rg.rewards` console command. - `overlay.toml` protocol → 10. ## How it was tested - `node scripts/checkPlugin.js` passes: 30 hooks, every one void and listed. - **Compiled and loaded on both rigs, Oxide and Carbon**, from the same file with no conditional compilation. Kits 4.4.9 was installed on both. - Walked against real core; results in `PLAN.md` §29.7: - recipient modes against a seeded tally; - credits applied, and withdrawn after a revert, through real Kits; - a zone tally across a server restart; - a credit across a wipe with Kits' `WipeData` on; - chat, including the same-key dedupe. - **Not walked**: anything that needs a person in game — standing in a zone, landing a kill, redeeming from the Kits menu. That is the rewards walk in `PLAYER_WALK.md`. ## Checklist - [x] I have read CONTRIBUTING.md. - [x] The change builds and existing tests/checks pass locally. - [x] I have added or updated tests/docs where it makes sense. - [x] My commits are reasonably scoped with clear messages. ## AI-assisted contributions (required) - [x] AI tools were used. Tool(s): `Claude Code (Claude Opus 5.5)`. I have reviewed and understand every change, and take responsibility for it. AI-authored commits are marked with a `Co-Authored-By` trailer. ## License - [x] I agree that my contribution is licensed under GPL-3.0-or-later. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-09-24 07:50:17 -05:00
feat(bridge): protocol 10 — the tally, kit credits and chat (phase 13b)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in 10s
3d9998ce64
- tally.open / .snapshot / .close: a run's participation tally, persisted
  in tallies.json. Presence accrues every 5 s from ZoneManager's own
  membership (or the whole server); kills are the last hit, gated by
  killsOf and the killer being inside the area (D98); the score is
  seconds, kills, or minutes + killWeight x kills (D99). Only a zone this
  run opened counts (D100). Gated by EventsEnabled (D107); forgotten
  seven days after opening (D108).
- kits.list: the kit source, from Kits' GetKitNames/GetKitInfo.
- perm.sync `credits`: one extra use of a kit per reward (D103), held in
  credits.json and spent LAST from OnKitRedeemed, because Kits'
  SetPlayerKitUses does nothing for a player with no usage record.
  Withdrawn when unredeemed; reset when Kits wipes its use counts.
- chat.say: one line to the server, remembered by key for 10 minutes.
- EventsMaxRecipients / EventsMaxTallies / EventsMaxChat bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit d495150944 into edge 2026-09-24 08:01:26 -05:00
whitlocktech deleted branch feat/phase-13b-rewards 2026-09-24 08:01:27 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Rust-Plugins#10
No description provided.