diff --git a/kubi-server/src/server.rs b/kubi-server/src/server.rs index cdf7909..cb996b2 100644 --- a/kubi-server/src/server.rs +++ b/kubi-server/src/server.rs @@ -35,7 +35,7 @@ pub fn bind_server( endpoint_config: EndpointConfig { active_timeout_ms: config.server.timeout_ms, keepalive: true, - keepalive_interval_ms: 300, + keepalive_interval_ms: 5000, ..Default::default() }, ..Default::default() diff --git a/kubi/src/networking.rs b/kubi/src/networking.rs index fffa723..af3bf0b 100644 --- a/kubi/src/networking.rs +++ b/kubi/src/networking.rs @@ -74,7 +74,7 @@ fn connect_client( endpoint_config: EndpointConfig { active_timeout_ms: 10000, keepalive: true, - keepalive_interval_ms: 300, + keepalive_interval_ms: 5000, ..Default::default() }, }).expect("Client connection failed"); @@ -102,7 +102,6 @@ fn flush_client( client.0.flush(); } - fn handle_disconnect( network_events: View, mut join_state: UniqueViewMut diff --git a/kubi/src/world/loading.rs b/kubi/src/world/loading.rs index f8ab0a0..3ea7c08 100644 --- a/kubi/src/world/loading.rs +++ b/kubi/src/world/loading.rs @@ -97,6 +97,7 @@ fn unload_downgrade_chunks( return } //TODO refactor this + //TODO unsubscibe if in multiplayer vm_world.chunks.retain(|_, chunk| { if chunk.desired_state == DesiredChunkState::ToUnload { if let Some(mesh_index) = chunk.mesh_index { @@ -135,6 +136,7 @@ fn start_required_tasks( DesiredChunkState::Loaded | DesiredChunkState::Rendered if chunk.current_state == CurrentChunkState::Nothing => { //start load task if let Some(client) = &mut udp_client { + //crappy rate limiting client.0.send( postcard::to_allocvec(&ClientToServerMessage::ChunkSubRequest { chunk: position,