NilsIrl/DynaWhite

Use the Configuration API instead of environment variables

Opened this issue · 3 comments

It might be nice to perform this using just rust rather than having to go through the JVM and the Configuration API.

It will also reduce the overhead of calling using the JNI though this has to be benchmarked.

This would make it a lot easier. Possible crates to use to parse YAML files:

  1. https://github.com/dtolnay/serde-yaml
  2. https://github.com/chyh1990/yaml-rust

I would prefer serde-yaml because it would allow to derive Deserialize into a struct, allowing to have a struct containing all the settings.

Disadvantage of using this approach:

  • This might collide with Bukkit. This can especially be problematic on windows.
  • Getting the file location might require some JNI calls (though less than using the whole API)

It seems that a convention of the minecraft community is to have all settings explicitly set in config.yml

This doesn't really work well when there are no default settings.