From 0256c954f4bf2b74dec137a37faacd34d5d258de Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 10 Feb 2023 22:05:10 +0100 Subject: [PATCH] server --- kubi-server/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kubi-server/src/main.rs b/kubi-server/src/main.rs index 82bd08a..0525209 100644 --- a/kubi-server/src/main.rs +++ b/kubi-server/src/main.rs @@ -1,6 +1,7 @@ use shipyard::{World, AllStoragesView, Unique, Workload, IntoWorkload, UniqueView, UniqueViewMut}; use kubi_udp::server::{Server, ServerConfig}; use kubi_shared::networking::messages::{ClientToServerMessage, ServerToClientMessage}; +use std::{thread, time::Duration}; #[derive(Unique)] #[repr(transparent)] @@ -9,6 +10,7 @@ pub struct UdpServer(Server); fn bind_server( storages: AllStoragesView, ) { + log::info!("Binding server"); let server: Server = Server::bind( "0.0.0.0:1234".parse().unwrap(), ServerConfig::default() @@ -20,7 +22,7 @@ fn update_server( mut server: UniqueViewMut ) { if let Err(error) = server.0.update() { - println!("Server error: {error:?}") + log::error!("Server error: {error:?}") } } @@ -44,5 +46,6 @@ fn main() { world.run_workload(initialize).unwrap(); loop { world.run_workload(update).unwrap(); + thread::sleep(Duration::from_millis(16)); } }