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

Notify abount missing config options #69

Open
RoboMWM opened this issue May 22, 2019 · 4 comments
Open

Notify abount missing config options #69

RoboMWM opened this issue May 22, 2019 · 4 comments

Comments

@RoboMWM
Copy link

RoboMWM commented May 22, 2019

When checking to see if there was an option to preserve armor while in a game, I found that my config was outdated despite being on gamebox 2.2.4. It seems you don't update the config; I assume it only copies over from jar on first install. Would you mind programmatically adding missing entries, or at least notifying if some entries are missing?

@NiklasEi
Copy link
Owner

I don't want to add them because saving the config would remove all comments. Logging missing entries might be a solution, but could get anoying rather fast since there can be several new entries in an update.

@RoboMWM
Copy link
Author

RoboMWM commented May 22, 2019

I believe mcmmo does something where they update the config and preserve comments - but I'm not sure, maybe I'm not recalling. But yea, the bukkit YAML will delete comments. Another way which might not be as neat is to put all of the comments and examples in the header like SimpleBackup does. NCP does the "notify" in console (and in-game too), but it also writes to the config if entries are missing and doesn't have comments.

I'd opt for a config option for printing/updating the config (also present in mcmmo and essentials IIRC), but if you really don't want to "be annoying" you could save the last time you printed out missing config options and not start up if the missing nodes printed last time haven't changed.

@NiklasEi
Copy link
Owner

NiklasEi commented Jun 7, 2019

[...] but if you really don't want to "be annoying" you could save the last time you printed out missing config options and not start up if the missing nodes printed last time haven't changed.

I think that would be even more annoying. In most cases almost all users will keep the default settings. Meaning it's no use for them to actually add the options to the file.

What do you think about a "diff file" and a short notice on startup about it. This file would contain all missing nodes with default settings. To get rid of the notice one could simply copy paste the diff file content to the config. This would keep the logging short (only point to diff file, no node listing) and make it easier to get rid of the message. Oc there also can be an option to turn that behaviour off.

@RoboMWM
Copy link
Author

RoboMWM commented Jun 7, 2019

I meant not start up as in not print the missing nodes again. Sorry for the confusion.

@NiklasEi NiklasEi changed the title Update config with new entries Notify abount missing config options May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants