mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 08:18:43 -06:00
ew
This commit is contained in:
parent
ce454f0611
commit
d7c3b6f6ba
|
@ -70,6 +70,7 @@ fn process_finished_tasks(
|
||||||
task_manager: UniqueView<ChunkTaskManager>,
|
task_manager: UniqueView<ChunkTaskManager>,
|
||||||
mut chunk_manager: UniqueViewMut<ChunkManager>,
|
mut chunk_manager: UniqueViewMut<ChunkManager>,
|
||||||
) {
|
) {
|
||||||
|
let mut limit: usize = 8;
|
||||||
while let Some(res) = task_manager.receive() {
|
while let Some(res) = task_manager.receive() {
|
||||||
let ChunkTaskResponse::ChunkLoaded { chunk_position, blocks, queue } = res;
|
let ChunkTaskResponse::ChunkLoaded { chunk_position, blocks, queue } = res;
|
||||||
let Some(chunk) = chunk_manager.chunks.get_mut(&chunk_position) else {
|
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()
|
queued: queue.iter().map(|item| (item.position.to_array(), item.block_type)).collect()
|
||||||
}).map_err(log_error).ok();
|
}).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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue