Small cleanup in server-cli/src/main.rs

This commit is contained in:
Imbris 2022-02-19 19:22:13 -05:00
parent b5bac97c2e
commit d7d8d8d2da

View File

@ -49,9 +49,9 @@ fn main() -> io::Result<()> {
let _ = signal_hook::flag::register(signal_hook::consts::SIGUSR1, Arc::clone(&sigusr1_signal)); let _ = signal_hook::flag::register(signal_hook::consts::SIGUSR1, Arc::clone(&sigusr1_signal));
let (_guards, _guards2) = if basic { let (_guards, _guards2) = if basic {
(vec![], common_frontend::init_stdout(None)) (Vec::new(), common_frontend::init_stdout(None))
} else { } else {
(common_frontend::init(None, &|| LOG.clone()), vec![]) (common_frontend::init(None, &|| LOG.clone()), Vec::new())
}; };
// Load settings // Load settings
@ -154,10 +154,6 @@ fn main() -> io::Result<()> {
info!("Starting server..."); info!("Starting server...");
if no_auth {
server_settings.auth_server_address = None;
}
let protocols_and_addresses = server_settings.gameserver_protocols.clone(); let protocols_and_addresses = server_settings.gameserver_protocols.clone();
let metrics_port = &server_settings.metrics_address.port(); let metrics_port = &server_settings.metrics_address.port();
// Create server // Create server
@ -170,17 +166,17 @@ fn main() -> io::Result<()> {
) )
.expect("Failed to create server instance!"); .expect("Failed to create server instance!");
let mut gameserver_addresses = vec![]; // Collect addresses that the server is listening to log.
for protocol in protocols_and_addresses { let gameserver_addresses = protocols_and_addresses
gameserver_addresses.push(match protocol { .into_iter()
.map(|protocol| match protocol {
Protocol::Tcp { address } => ("TCP", address), Protocol::Tcp { address } => ("TCP", address),
Protocol::Quic { Protocol::Quic {
address, address,
cert_file_path: _, cert_file_path: _,
key_file_path: _, key_file_path: _,
} => ("QUIC", address), } => ("QUIC", address),
}) });
}
info!( info!(
?metrics_port, ?metrics_port,