Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiServer: Prevent invalid *_mode option values. #3149

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

ThePhar
Copy link
Member

@ThePhar ThePhar commented Apr 15, 2024

What is this fixing or adding?

Bug Report Thread: https://discord.com/channels/731205301247803413/1227391160520278066

Server admins are allowed to send any value when using the /option command for release_mode, collect_mode, and remaining_mode which acts like goal when a user runs !release or other variant because of the final else-clause in the command processing methods, if it is not one of the valid options: enabled, disabled, auto, goal, auto_enabled.

These changes add an additional check for explicitly the *_mode options to ensure they are given a valid value or it will fail with a "Unrecognized {*_mode} value" log printed to the standard output.

How was this tested?

Comparing functionality between before and after this patch with /option release_mode off (an invalid value), and confirmed that post-patch the server did not accept the value and printed the list of valid options instead.

If this makes graphical changes, please attach screenshots.

Before:
image

After:
image

@ThePhar ThePhar added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. affects: core Issues/PRs that touch core and may need additional validation. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer. labels Apr 15, 2024
@ThePhar ThePhar self-assigned this Apr 15, 2024
@github-actions github-actions bot added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 15, 2024
@ThePhar ThePhar removed the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Apr 15, 2024
@Berserker66 Berserker66 merged commit 21184b5 into ArchipelagoMW:main Apr 18, 2024
15 checks passed
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. waiting-on: core-review Issue/PR has been peer-reviewed and is ready to be merged or needs input from a core maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants