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

Server whitelist/blacklist #146

Merged

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Dec 31, 2023

Overview

Includes the same config-extension refactoring commit from #143.

Allows the user to setup a whitelist or blacklist in their Freecam config.

If enabled, this will prevent freecam from activating on the restricted servers.

If notifications are enabled, "Freecam is restricted on the current server (server_ip_here)." will be shown when attempting to toggle freecam.

Not convinced my naming/wording (or my config layout) is optimal, so I'm open to feedback & suggestions.

I noticed when testing that cloth-config's StringListListEntry is kinda janky; adding a list-entry doesn't focus the new text field; the text field is invisible, so it's not obvious you can click on it. We may be able to work around this with some mixins and/or autoconfig extensions.

Testing logged in

To test out using DevLogin, you'll want to uncomment the dependency and add this to line 74 of fabric/build.gradle:

loom.runs.create("${variant}LoggedIn") {
    inherit run
    configName "Run logged in"
    programArg "--msa"
}

Then run runNormalLoggedIn or runModrinthLoggedIn. The runLoggedIn task created in the root build.gradle won't work (I'll fix that at some point, will probably wait for devlogin to finish their neoforge support).

Alternatively, use DevAuth by either dropping it into mods and setting defaultEnabled or devauth.enabled as required, or using the devauth PR.

Fixes #117

@MattSturgeon MattSturgeon force-pushed the config/server-whitelist branch 2 times, most recently from 18e5da9 to 6b913b4 Compare January 2, 2024 12:11
Comment on lines 111 to 124
public List<String> whitelist = Collections.emptyList();
public List<String> blacklist = Collections.emptyList();
Copy link
Member Author

Choose a reason for hiding this comment

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

These might benefit from some PrefixText or a Tooltip. Perhaps something along the lines of

Add server IPs to this list using the button marked ⊕.
Freecam will only be usable on servers whose IP exactly matches something in this list (case-insensitive).

@MattSturgeon MattSturgeon force-pushed the config/server-whitelist branch 2 times, most recently from 64a944a to ff41d10 Compare January 2, 2024 13:35
@MattSturgeon MattSturgeon added the enhancement New feature or request label Jan 9, 2024
@MattSturgeon MattSturgeon force-pushed the config/server-whitelist branch 2 times, most recently from 7632973 to cc44153 Compare April 20, 2024 23:52
Allow switching between whitelist, blacklist, & no restriction.
Show Whitelist config in whitelist mode, and Blacklist in blacklist mode.

Don't show either in "no restriction" mode.
@MattSturgeon MattSturgeon merged commit 08ccc93 into MinecraftFreecam:main Apr 21, 2024
@MattSturgeon MattSturgeon deleted the config/server-whitelist branch April 21, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request | Server whitelist
2 participants