From c6048ec4fbbcb2319ef29a65bb13d69d8d7dea2c Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 8 Dec 2024 15:34:03 -0500 Subject: [PATCH] Start Logger After Launcher UI --- launcher/src/client/configuration.cpp | 8 ++++---- launcher/src/main.cpp | 16 ++++++++-------- mods/src/feature/feature.cpp | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/launcher/src/client/configuration.cpp b/launcher/src/client/configuration.cpp index 169a9fad69..c93a6c795a 100644 --- a/launcher/src/client/configuration.cpp +++ b/launcher/src/client/configuration.cpp @@ -56,21 +56,21 @@ void handle_non_launch_client_only_commands(const options_t &options) { void configure_client(const options_t &options) { // Load Cache State state; - if (!options.no_cache) { + bool save_settings = !options.no_cache; + if (save_settings) { state = load_cache(); } // Read From Environment state.update(false); - // --default - bool save_settings = !options.no_cache; + // Show UI if (!options.use_default) { - // Show UI ConfigurationUI *ui = new ConfigurationUI(state, save_settings); const int ret = ui->run(); delete ui; if (ret <= 0) { + // Cancel Launch exit(EXIT_SUCCESS); } } diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index 3f70320c0a..b1d69c34c4 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -52,30 +52,30 @@ static void start_game(const options_t &options) { // Disable stdout Buffering setvbuf(stdout, nullptr, _IONBF, 0); - // Setup Crash Reporting - if (!options.disable_logger) { - setup_logger(); - } - // Configure Client Options if (!reborn_is_server()) { configure_client(options); } + // Start Logging + if (!options.disable_logger) { + setup_logger(); + } + // Bootstrap bootstrap(options); } // Main -int main(int argc, char *argv[]) { +int main(const int argc, char *argv[]) { // Parse Options - options_t options = parse_options(argc, argv); + const options_t options = parse_options(argc, argv); // Set Debug Tag reborn_debug_tag = "(Launcher) "; // Debug Logging - unsetenv(_MCPI_LOG_FD_ENV); + reborn_set_log(-1); bind_to_env(MCPI_DEBUG_ENV, options.debug); // Setup Environment diff --git a/mods/src/feature/feature.cpp b/mods/src/feature/feature.cpp index c5875ddf88..64bb56b036 100644 --- a/mods/src/feature/feature.cpp +++ b/mods/src/feature/feature.cpp @@ -20,7 +20,7 @@ bool _feature_has(const char *name, const int server_default) { if (!loaded) { const char *env = getenv(MCPI_FEATURE_FLAGS_ENV); if (env) { - flags.from_string(env); + env_value_to_obj(flags, env); } loaded = true; }