diff --git a/rust/src/cli_parser.rs b/rust/src/cli_parser.rs index b6ffdc5..3983384 100644 --- a/rust/src/cli_parser.rs +++ b/rust/src/cli_parser.rs @@ -1,6 +1,9 @@ use std::net::SocketAddr; -use godot::{classes::Os, prelude::*}; +use godot::{ + classes::{DisplayServer, Os}, + prelude::*, +}; use crate::{ game::{Game, GameManager}, @@ -88,7 +91,9 @@ impl INode3D for CliParser { .connect_other(self, |s| s.on_join_lobby()); if let Some(port) = options.host { - NetworkManager::singleton().bind_mut().host(port, false); + NetworkManager::singleton() + .bind_mut() + .host(port, DisplayServer::singleton().get_name() == "headless"); } else if let Some(addr) = options.join { NetworkManager::singleton().bind_mut().join_directly(addr); }