mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-22 03:48:21 -06:00
minor changes to netwrok code
This commit is contained in:
parent
4dde1651ab
commit
e8e3863d47
|
@ -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()
|
||||
|
|
|
@ -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<NetworkEvent>,
|
||||
mut join_state: UniqueViewMut<ClientJoinState>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue