Start Logger After Launcher UI

This commit is contained in:
TheBrokenRail 2024-12-08 15:34:03 -05:00
parent 0ccf578478
commit c6048ec4fb
3 changed files with 13 additions and 13 deletions

View File

@ -56,21 +56,21 @@ void handle_non_launch_client_only_commands(const options_t &options) {
void configure_client(const options_t &options) { void configure_client(const options_t &options) {
// Load Cache // Load Cache
State state; State state;
if (!options.no_cache) { bool save_settings = !options.no_cache;
if (save_settings) {
state = load_cache(); state = load_cache();
} }
// Read From Environment // Read From Environment
state.update(false); state.update(false);
// --default // Show UI
bool save_settings = !options.no_cache;
if (!options.use_default) { if (!options.use_default) {
// Show UI
ConfigurationUI *ui = new ConfigurationUI(state, save_settings); ConfigurationUI *ui = new ConfigurationUI(state, save_settings);
const int ret = ui->run(); const int ret = ui->run();
delete ui; delete ui;
if (ret <= 0) { if (ret <= 0) {
// Cancel Launch
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
} }

View File

@ -52,30 +52,30 @@ static void start_game(const options_t &options) {
// Disable stdout Buffering // Disable stdout Buffering
setvbuf(stdout, nullptr, _IONBF, 0); setvbuf(stdout, nullptr, _IONBF, 0);
// Setup Crash Reporting
if (!options.disable_logger) {
setup_logger();
}
// Configure Client Options // Configure Client Options
if (!reborn_is_server()) { if (!reborn_is_server()) {
configure_client(options); configure_client(options);
} }
// Start Logging
if (!options.disable_logger) {
setup_logger();
}
// Bootstrap // Bootstrap
bootstrap(options); bootstrap(options);
} }
// Main // Main
int main(int argc, char *argv[]) { int main(const int argc, char *argv[]) {
// Parse Options // Parse Options
options_t options = parse_options(argc, argv); const options_t options = parse_options(argc, argv);
// Set Debug Tag // Set Debug Tag
reborn_debug_tag = "(Launcher) "; reborn_debug_tag = "(Launcher) ";
// Debug Logging // Debug Logging
unsetenv(_MCPI_LOG_FD_ENV); reborn_set_log(-1);
bind_to_env(MCPI_DEBUG_ENV, options.debug); bind_to_env(MCPI_DEBUG_ENV, options.debug);
// Setup Environment // Setup Environment

View File

@ -20,7 +20,7 @@ bool _feature_has(const char *name, const int server_default) {
if (!loaded) { if (!loaded) {
const char *env = getenv(MCPI_FEATURE_FLAGS_ENV); const char *env = getenv(MCPI_FEATURE_FLAGS_ENV);
if (env) { if (env) {
flags.from_string(env); env_value_to_obj(flags, env);
} }
loaded = true; loaded = true;
} }