sakurawald / fuji

A mod that ports EssentialsX / CMI from bukkit to fabric.
GNU General Public License v3.0
31 stars 3 forks source link

Suggestions on configuration files #31

Closed yizexiaomu closed 2 months ago

yizexiaomu commented 2 months ago

The current update of each mod version involves extensive formatting changes to the configuration file, which has a poor user experience. It is recommended to extend the format update of the configuration file appropriately or ensure that the old version of the configuration file can still be used in the case of a new version update

sakurawald commented 2 months ago

WIP, currently the configuration system will generate the missing confiration keys automatically, but if the key already exists, then fuji must ignore the key and throw the error, to avoid override user's data.

Maybe we should select a better solution, or provide a more flexible configuration structure.

sakurawald commented 2 months ago

We have added a friendly configuration checker in the server start stage.

[09:40:33] [main/INFO] (FabricLoader/Mixin) SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/sakurawald/.gradle/caches/modules-2/files-2.1/net.fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/9527e6b0d2449408958fd1302594dc65ec5ade9c/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER
[09:40:33] [main/INFO] (FabricLoader/Mixin) Loaded Fabric development mappings for mixin remapper!
[09:40:33] [main/INFO] (FabricLoader/Mixin) Compatibility level set to JAVA_17
[09:40:33] [main/WARN] (Fuji) 
# What happened ?
There is an incompatibility issue in the configuration file `/home/sakurawald/Workspace/github/fuji-fabric/run/./config/fuji/config.json`.
  - Actual value of key `common.language.default_language` does not match the expected type.

Possible reason:
  1. In the new version of fuji, the key has changed its type.
  2. The configuration file was been accidentally modified.

How can I solve this ?

  - Manually:
    1. Backup the folder `<your-server-root>/config/fuji`
    2. Use your `text-editor` to open the file `/home/sakurawald/Workspace/github/fuji-fabric/run/./config/fuji/config.json`
    3. Find the `key` in path `common.language.default_language`
    4. Make sure again you have backup your folder in `step 1`
    5. Delete the `key`, and re-start the server. Fuji will re-generate the missing keys.

  - Automatically:
    If you want to `back up the folder` and `delete the key`, press "y" and enter. (y/n)
sakurawald commented 2 months ago

Added since v1.3.3