From 91b0ef3193f4cb0b68d9d5b6907c8ba0ce8908d8 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 7 Mar 2023 21:29:05 +0100 Subject: [PATCH] ew --- kubi-server/src/world.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kubi-server/src/world.rs b/kubi-server/src/world.rs index 29006c3..36f7070 100644 --- a/kubi-server/src/world.rs +++ b/kubi-server/src/world.rs @@ -70,6 +70,7 @@ fn process_finished_tasks( task_manager: UniqueView, mut chunk_manager: UniqueViewMut, ) { + let mut limit: usize = 8; while let Some(res) = task_manager.receive() { let ChunkTaskResponse::ChunkLoaded { chunk_position, blocks, queue } = res; let Some(chunk) = chunk_manager.chunks.get_mut(&chunk_position) else { @@ -89,7 +90,12 @@ fn process_finished_tasks( queued: queue.iter().map(|item| (item.position.to_array(), item.block_type)).collect() }).map_err(log_error).ok(); } - log::debug!("Chunk {chunk_position} loaded, {} subs", chunk.subscriptions.len()) + log::debug!("Chunk {chunk_position} loaded, {} subs", chunk.subscriptions.len()); + //HACK: Implement proper flow control/reliable transport in kubi-udp + limit -= 1; + if limit == 0 { + break; + } } }