NilsIrl / DynaWhite

A Bukkit plugin that allows to whitelist people based on identity verification written in Rust
GNU General Public License v3.0
4 stars 0 forks source link

Use the Configuration API instead of environment variables #8

Open NilsIrl opened 4 years ago

NilsIrl commented 4 years ago

Introduction Reference

FileConfiguration

NilsIrl commented 4 years ago

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:

NilsIrl commented 4 years ago

https://www.spigotmc.org/wiki/config-files/

NilsIrl commented 4 years ago

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.