Add notifications for incoming mail - #4817
Open
RogueVoidling wants to merge 4 commits into
Open
Conversation
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.
About the PR
Mail carriers(technically, anyone with a MailMetrics cartridge installed on their PDA) will now receive notifications whenever teleporters warp a batch of mail in.
Why / Balance
I just thought it would be nice for mail carriers to know when mail was warped in, so they could know when they needed to fly back and pick more up. I also added a button to toggle the notification so SRs don't have to get spammed with it, and carriers can turn it off at their preference.
Technical details
Changes to the MailMetrics: Added a new field that controls if notifications are on or off, defaulting to on. This is passed to the client whenever the state of the mail stats is updated. The server will also now listen for an event indicating notification preference has been changed, and upon receiving it, toggle the server side variable. The client side UI will also display this value, and send a message whenever its toggled.
Changes to MailSystem: Added a method that pushes a notification to everyone with the MailMetrics installed, and notifications enabled.
How to test
Spawn in a MailMetrics cartridge and install it
Use the
mailnowcommand to spawn in mail, notice you get a notificationToggle the notifications on and off, using the button in MailMetrics, while using
mailnowto ensure the toggle works(Remember to clear the mail teleporter so more mail can spawn!)
Media
Requirements
Breaking changes
Changelog
🆑