px p3: fenrir /notice + /reply, reboot_events at every countdown start, pack-update event notice - #48
Draft
alppp wants to merge 6 commits into
Draft
px p3: fenrir /notice + /reply, reboot_events at every countdown start, pack-update event notice#48alppp wants to merge 6 commits into
alppp wants to merge 6 commits into
Conversation
create/broadcast/list/expire/enable/translate/show, staff-gated. doc building lives in util/noticeDoc.js so it is testable without an interaction: id charset and caps mirror the proxy's store, tips store their text under card, events need an endsAt, and a body carrying <click:/<hover: is refused. mongo gets the write helpers (upsert/list/get/enable/translate/search + insertMail for /reply).
resolves the username to a uuid via bifrost.players and inserts an unread bifrost.mail doc; the proxy's change stream delivers it inline when they are online, else it waits for their next login. unknown player writes nothing, and <click:/<hover: is refused like /notice.
right after the discord announcement each update path posts event.update.<tag>.<yyyymmdd> into bifrost.notices (3-day window, targeted at that tag) telling players to restart their launcher. fire-and-forget: it swallows its own errors and can never fail or delay an update. gated by notices.packUpdateEvents (default true, added to the initializer template). readme documents /notice, /reply and both doc shapes.
the proxy renders reboot countdowns itself and suppresses the crash relay while one runs; valhallamc.reboot_events is its only source, so one doc is written at the choke point every path shares (executeRebootWarningsEnhanced) — daily batch, staff /reboot job, player vote. fire-and-forget, so a mongo outage can never fail or delay a reboot. cancels stamp cancelledAt from cancelServerReboot and from /reboot-cancel per instance, the stop step stamps completedAt.
…, anchored id search) a tip overrides ONE guide card looked up by its fixed id, so a generated tip.<slug>-<ts> is a doc nobody ever sees: /notice create type:tip now requires an id starting with tip. and warns (not refuses) when it isn't one the guide reads. /notice list shows startsAt as well as expiresAt/endsAt for every type. searchNoticeIds anchors the prefix and only falls back to contains when nothing starts with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to Bifrost PR valhallamcio/Bifrost#79 (PX wave P3). Not deployed. Adds staff slash commands
/notice create|broadcast|list|expire|enable|translate|show(authorsbifrost.notices),/reply <player> <text>(insertsbifrost.mailadmin mail the proxy delivers in-game),modules/notices.jspostPackUpdateEvent(aneventnotice per finished pack update; confignotices.packUpdateEvents), andvalhallamc.reboot_eventswritten inexecuteRebootWarningsEnhancedat every countdown start (daily/scheduled/vote) withcancelledAtstamps fromcancelServerReboot//reboot-canceland the retry path (configscheduler.rebootScheduler.rebootEvents; TTL 48 h) — the proxy's relay renders countdowns from it and suppresses false crash relays.config/is gitignored: the local file carries the two keys,rebootScheduler.defaultConfig+ README document them. Tests 68 → 106. When both sides are live, setplayerAlerts.channels.bossbar/actionbar: falseso bars aren't doubled.