Commit Graph
49 Commits
Author SHA1 Message Date
legop3 70f71b2d1e green mode slop 1 2026-08-08 23:59:47 -04:00
legop3 6c69c583c5 moving audio gain perms around 2026-08-07 22:34:04 -04:00
legop3 9702cf0f82 gruh i hate fun!! 2026-08-07 15:54:28 -04:00
legop3 1aecab66e7 Merge pull request #19 from Saul5662/feat/fun-commands
feat(commands): add a fun command category with 18 public `rs` commands
2026-07-29 01:55:28 -04:00
Saul5662andClaude Opus 5 dc8267073b feat(commands): play a bonk sound on the bonked user's rover
`rs bonk` now publishes a `fun.bonked` event carrying the rover the target is
currently driving, and a new audioForwardService listener plays a sound file on
it. Wired as an event rather than a direct call so the command layer stays
unaware of ffmpeg, matching how the charging-complete cue is already done.

The sound file goes at `server/assets/bonk.wav` and is NOT committed here. Note
that `server/assets` is the correct home rather than `server/public`: the webui
builds to `../server/public` with `emptyOutDir: true`, so anything stored there
is deleted by the next build.

Details:

- The audio is rate limited per rover on a 20s window, separate from the 4s text
  cooldown. Playback interrupts whatever that rover is forwarding, including a
  live microphone, so a group of people cannot chain it against one driver.
- No sound plays if the target is not currently driving, is not a real user, or
  is the caller themselves. The text bonk and the tally still work in all cases.
- A missing sound file logs once and skips, so the command works on a server that
  never installs one. A playback failure is caught and logged rather than
  surfacing as a failed chat command.
- Discord bonks play the sound too; only commands needing the caller's own socket
  are unavailable from there.

Server suite: 138 passing, 0 failing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 05:05:36 +01:00
Saul5662andClaude Opus 5 a2fbbc100e feat(commands): add a fun command category with 18 public rs commands
Adds a `fun` category to the operator command registry, reachable identically
from site chat and Discord:

- text: bonk, hug, slap, 8ball, roll, coin, ship, rate, uwu, wanted
- counters: bonkboard, pet, snitch
- hardware: honk, boo, spin, disco, vibecheck

Supporting pieces:

- `permission: 'public'` in the registry. The dispatcher previously decided
  non-admin access with a hardcoded chain of `action !== '...'` comparisons, so
  every new public command needed a dispatcher edit. That chain is replaced by a
  registry lookup plus SELF_GATED_ACTIONS, which names the commands that enforce
  their own permissions internally (goal/reason are read-public write-admin;
  verify/deter reject non-lockdown-admins themselves). Existing behavior for
  every pre-existing command is unchanged.
- `cooldowns.js`, a per-actor per-command in-memory gate. Site chat's own rate
  limit is per-socket-per-message and does not bound a specific command, so
  without this one person could turn `rs honk` into a siren. Site chat rebuilds
  its router per message, so the gate is created at module scope there and
  injected.
- `funStatsService`, a small JSON store for the persistent tallies. Counters are
  keyed by an actor key spanning transports (`user:<id>` / `discord:<id>`), and a
  Discord id has no row in `users`, so `user_feature_state` could not hold them
  without violating its foreign key.

Safety notes:

- `issueCommand` is the raw rover transport and performs none of the ownership,
  deterrence, or private-safety checks the socket `command` handler applies, so
  honk and spin re-check `canDrive` themselves and spin re-applies
  `applyPrivateDriveSafety`. Both are therefore site-chat only: a Discord message
  has no socket and can never satisfy those checks.
- `boo` speaks a canned taunt rather than caller-supplied text, so it cannot
  become an unmoderated TTS channel aimed at whoever is nearest a rover.
- `disco` obeys the existing room-light lock and the homeAssistant feature gate.
- The whole fun category is suspended in lockdown mode.
- Mute and deterrence already stop command-shaped chat before the router runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 04:51:40 +01:00
Saul5662andClaude 09c1257578 feat(commands): add 'rs gain' to grant the VIP audio gain boost
Admins can now run 'rs gain list|grant <vip>|revoke <vip>' from web chat or
Discord. Grant matches only against the verified list and revoke only
against current holders, so a nickname shared with an unverified visitor
reports not-found rather than resolving to someone ineligible. The action
joins the moderation set so lockdown narrows it to lockdown admins.

Also extracts the ceiling math into audioLevelsService/gainMath.js and
covers both it and the command with node:test suites.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-29 04:07:44 +01:00
legop3 8642fbac3c slopreporting 2026-07-25 15:54:38 -04:00
legop3 b26daed93f better banning, new deter mute, replay discord fixes. 2026-07-21 22:50:12 -04:00
legop3 358aa0b1d6 replay timestamps in filenamess 2026-07-21 16:29:10 -04:00
legop3 90d4f778a5 SLOP ANALYTICS!! 2026-07-19 22:43:56 -04:00
legop3 3a8a2ebb13 the big 2026-07-15 00:35:39 -04:00
legop3 7fe5730953 idle service and lght lock improvements 2026-07-14 17:38:17 -04:00
legop3 e254eea9e4 bwaha 2026-07-12 15:36:48 -04:00
legop3 6a31d8bc35 configurable discord prefix! yay 2026-07-10 00:50:19 -04:00
legop3 b526beb712 driver removal information finaly! 2026-07-05 22:45:38 -04:00
legop3 b083938338 light lock rs command 2026-07-04 21:07:13 -04:00
legop3 79be3e1583 improvements and bug fixes 2026-06-29 20:19:24 -04:00
legop3 3c1b1dab6e here goes nothin' 2026-06-27 04:23:58 -04:00
legop3 e95eeeb526 fixe? 2026-06-20 00:51:35 -04:00
legop3 e6c16c3af9 better commanding and bridging slopping 2026-06-20 00:21:55 -04:00
legop3 f0a7d72f94 better discord commands, rs commands should work in chat 2026-06-19 23:15:14 -04:00
legop3 031e23103f chat bridge command fix lol AND chat box resizing!!! 2026-06-07 22:27:34 -04:00
legop3 a994759eb5 replay popups on spectator page 2026-06-07 17:39:31 -04:00
legop3 b2bd3a5e41 better popuping vs not 2026-06-07 17:02:54 -04:00
legop3 3cff250ba0 better bettter replayses 2026-06-07 16:39:50 -04:00
legop3 889f660f3e remove neato plsy sound and update user pings 2026-06-06 16:08:45 -04:00
legop3 2e83a142ec crashing lol 2026-06-01 21:53:59 -04:00
legop3 b96ae5f553 user alerts channel redo 2026-06-01 21:50:19 -04:00
legop3 955b613527 reboot your own rover 2026-05-28 16:12:42 -04:00
legop3 4d179b4372 okay render tools above messages.. yay 2026-05-19 17:59:45 -04:00
legop3 133ea3f6d2 args and no more emojis 2026-05-19 17:29:08 -04:00
legop3 f9e472c832 wording and overseer tool embeds 2026-05-19 16:51:02 -04:00
legop3 384f97cdcf @everyone button box reward 2026-05-15 00:53:40 -04:00
legop3 71494da1a8 fix [BOT] [SPECTATOR] 2026-05-14 22:30:53 -04:00
legop3 bc8a13dd65 bot tag and profile images yay urls only though... 2026-05-14 16:54:13 -04:00
legop3 02d5d6ca13 trying to 2026-05-01 01:50:35 -04:00
legop3 7e7eb97ff6 whue 2026-05-01 01:32:02 -04:00
legop3 b491d91ec5 community goal? never jnew her 2026-05-01 01:18:21 -04:00
legop3 b2a2296d98 fixes, changes, no more periodic sync. since theres enough activity at this point... 2026-04-30 13:18:19 -04:00
legop3 963499fa8e risk of fling 2 2026-04-30 02:53:22 -04:00
legop3 0ae60ef4f9 discord unregressions 2026-04-30 01:53:11 -04:00
legop3 9bf449ca19 awaa 2026-04-29 18:45:41 -04:00
legop3 d7f34af66f replay beroke 2026-04-29 13:35:24 -04:00
legop3 bc6770f407 replay 2026-04-29 13:21:44 -04:00
legop3 e2bd29e2c2 splite 2026-04-29 13:12:04 -04:00
legop3 2eafcce95b rah 2026-04-29 13:07:42 -04:00
legop3 c20c22eafc discord bot 2026-04-29 13:01:21 -04:00
legop3 49f801330f gahew 2026-04-28 19:53:10 -04:00