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

feat: add whitelist feature #451

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

smuu
Copy link
Contributor

@smuu smuu commented Jan 4, 2025

Description

I accidentally closed the other PR. Recreated it here.

  • This PR adds the whitelist command and the corresponding whitelist.json file to keep track of the whitelisted users.

Testing

Please follow our Coding Guidelines

/// Whether to enable the whitelist
pub white_list: bool,
/// Whether to enforce the whitelist
pub enforce_whitelist: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both variables are used in the vanilla server.properties file. You can enable the whitelist but not enforce it. If you enforce it, players will be kicked when you reload the whitelist if they are not whitelisted.
From the Minecraft wiki:

white-list

Whether the whitelist is enabled.

With a whitelist enabled, users not on the whitelist cannot connect. Intended for private servers, such as those for real-life friends or strangers carefully selected via an application process, for example.

false - No white list is used.
true - The file whitelist.json is used to generate the white list.

Note: Ops are automatically whitelisted, and there is no need to add them to the whitelist.

enforce-whitelist

Whether to enforce changes to the whitelist.

When this option as well as the whitelist is enabled, players not present on the whitelist get kicked from the server after the server reloads the whitelist file.

false - Online players that are not on the whitelist are not kicked.
true - Online players that are not on the whitelist are kicked.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh okay, I mean, I'm fine with leaving it then

@smuu smuu changed the title Smuu/20250101 add whitelist feature feat: add whitelist feature Jan 4, 2025
@Snowiiii
Copy link
Member

Snowiiii commented Jan 4, 2025

You can always reopen PR's, I would prefer this next time instead of making a new one

@smuu
Copy link
Contributor Author

smuu commented Jan 4, 2025

You can always reopen PR's, I would prefer this next time instead of making a new one

I tried. First, it said I can only do that when adding a new commit. Then I added a new commit but could still not reopen the PR. I'm unsure if this was a permission issue or if I missed something.

@Snowiiii
Copy link
Member

Snowiiii commented Jan 6, 2025

Okay @smuu can you may fix Ci and conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants