Make fake ping exportable

This commit is contained in:
Sofia 2026-08-08 23:51:44 +03:00
parent 953df8d2d0
commit 1f7f412882

View File

@ -27,6 +27,9 @@ use crate::{
#[derive(GodotClass)]
#[class(base=Node)]
pub struct NetworkManager {
#[export]
fake_ping: u64,
pub peer: Option<PeerKind>,
last_hello: Instant,
@ -42,6 +45,7 @@ pub const NETWORK_SINGLETON_NAME: &str = "NetworkManagerGlob";
impl INode for NetworkManager {
fn init(base: Base<Node>) -> Self {
NetworkManager {
fake_ping: 0,
peer: None,
last_hello: Instant::now(),
@ -271,7 +275,7 @@ impl NetworkManager {
None,
PeerConfig::default()
.with_identifier(NetworkManager::identifier())
.with_additional_ping(Duration::from_millis(1000)),
.with_additional_ping(Duration::from_millis(self.fake_ping)),
);
match peer {
Ok(mut peer) => {