Compare commits

..

No commits in common. "6ea9bc27a398f0db420126afe39f32bc687c495d" and "c6a4c44b9cb312773b4bbb5427c1387c1bf376ca" have entirely different histories.

2 changed files with 9 additions and 20 deletions

View File

@ -1,9 +1,6 @@
use std::net::SocketAddr; use std::net::SocketAddr;
use godot::{ use godot::{classes::Os, prelude::*};
classes::{DisplayServer, Os},
prelude::*,
};
use crate::{ use crate::{
game::{Game, GameManager}, game::{Game, GameManager},
@ -91,9 +88,7 @@ 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() NetworkManager::singleton().bind_mut().host(port, false);
.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);
} }

View File

@ -51,20 +51,14 @@ impl IPanel for GameFinishedScreen {
.connect_other(self, Self::save_replay); .connect_other(self, Self::save_replay);
} }
if let Some(game) = &mut Game::singleton() { if let Some(game) = &mut Game::singleton()
if let Some(recorder) = &mut game.bind_mut().replay_recorder { && let Some(recorder) = &mut game.bind_mut().replay_recorder
{
recorder recorder
.signals() .signals()
.on_saved() .on_saved()
.connect_other(self, Self::on_replay_saved); .connect_other(self, Self::on_replay_saved);
} }
if game.bind().is_host() && game.bind().self_id.is_none() {
game.bind_mut().reset_game();
self.run_deferred(|_| {
GameManager::singleton().bind().go_to_lobby();
});
}
}
if let Some(focus) = &mut self.base_mut().find_next_valid_focus() { if let Some(focus) = &mut self.base_mut().find_next_valid_focus() {
focus.grab_focus(); focus.grab_focus();