You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
641 B
33 lines
641 B
use std::fs;
|
|
|
|
use once_cell::sync::Lazy;
|
|
use serde::Deserialize;
|
|
use valence::uuid::Uuid;
|
|
|
|
#[derive(Deserialize, Clone)]
|
|
pub struct Config {
|
|
// USE ONLY FOR DEVELOPMENT PURPOSES
|
|
pub no_auto_stop: Option<bool>,
|
|
|
|
pub spawn_y: i32,
|
|
|
|
pub platforms: i32,
|
|
pub platform_gap: i32,
|
|
pub platform_size: i32,
|
|
|
|
pub operators: Vec<Uuid>,
|
|
|
|
pub db: DBConfig,
|
|
}
|
|
|
|
#[derive(Deserialize, Clone)]
|
|
pub struct DBConfig {
|
|
pub address: String,
|
|
}
|
|
|
|
pub static CONFIG: Lazy<Config> = Lazy::new(|| {
|
|
let config = fs::read_to_string("./config.toml").expect("Failed to read config.toml!");
|
|
|
|
toml::from_str(&config).unwrap()
|
|
});
|