Set headless to host when headless
This commit is contained in:
parent
c6a4c44b9c
commit
158bd3252d
@ -1,6 +1,9 @@
|
|||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
use godot::{classes::Os, prelude::*};
|
use godot::{
|
||||||
|
classes::{DisplayServer, Os},
|
||||||
|
prelude::*,
|
||||||
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
game::{Game, GameManager},
|
game::{Game, GameManager},
|
||||||
@ -88,7 +91,9 @@ impl INode3D for CliParser {
|
|||||||
.connect_other(self, |s| s.on_join_lobby());
|
.connect_other(self, |s| s.on_join_lobby());
|
||||||
|
|
||||||
if let Some(port) = options.host {
|
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 {
|
} else if let Some(addr) = options.join {
|
||||||
NetworkManager::singleton().bind_mut().join_directly(addr);
|
NetworkManager::singleton().bind_mut().join_directly(addr);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user