Large config file parsing refactor, also ensured all fields actually affect stack

This commit is contained in:
Wouter Bokslag
2026-02-26 00:00:37 +01:00
parent d52eb57537
commit 52fac5d511
39 changed files with 655 additions and 811 deletions

View File

@@ -3,7 +3,7 @@ use clap::Parser;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use tetra_config::{PhyBackend, SharedConfig, StackMode, toml_config};
use tetra_config::bluestation::{PhyBackend, SharedConfig, StackMode, parsing};
use tetra_core::{TdmaTime, debug};
use tetra_entities::MessageRouter;
use tetra_entities::brew::entity::BrewEntity;
@@ -20,7 +20,7 @@ use tetra_entities::{
/// Load configuration file
fn load_config_from_toml(cfg_path: &str) -> SharedConfig {
match toml_config::from_file(cfg_path) {
match parsing::from_file(cfg_path) {
Ok(c) => c,
Err(e) => {
println!("Failed to load configuration from {}: {}", cfg_path, e);
@@ -98,6 +98,7 @@ fn main() {
let args = Args::parse();
let mut cfg = load_config_from_toml(&args.config);
eprintln!("Loaded configuration from {:?}", cfg.config());
let _log_guard = debug::setup_logging_default(cfg.config().debug_log.clone());
let mut router = match cfg.config().stack_mode {