"...Irrlicht/svn:/svn.code.sf.net/p/irrlicht/code/trunk@1613" did not exist on "009e6d440caef9129ea6239fbfa20baea1faebe7"
Commit 9b5424cc authored by nanamicat's avatar nanamicat

clean

parent fa6de2cc
...@@ -41,6 +41,7 @@ async fn main() -> anyhow::Result<()> { ...@@ -41,6 +41,7 @@ async fn main() -> anyhow::Result<()> {
); );
let socket = UdpSocket::bind(config.bind).await?; let socket = UdpSocket::bind(config.bind).await?;
tracing::info!("Listening on {}", config.bind);
let mut timer = time::interval(INTERVAL); let mut timer = time::interval(INTERVAL);
let mut buf = [0; 1500]; let mut buf = [0; 1500];
...@@ -56,7 +57,6 @@ async fn main() -> anyhow::Result<()> { ...@@ -56,7 +57,6 @@ async fn main() -> anyhow::Result<()> {
result = socket.recv_from(&mut buf) => { result = socket.recv_from(&mut buf) => {
let (len, addr) = result?; let (len, addr) = result?;
tracing::info!("{:?} {:?}", addr, server_addr);
if addr.port() == config.bind.port() if addr.port() == config.bind.port()
&& let Some(peer) = Router::get(&mut routers, addr) && let Some(peer) = Router::get(&mut routers, addr)
&& let Ok((hello, _)) = bincode::decode_from_slice(&buf[..len], bincode::config::standard()) && let Ok((hello, _)) = bincode::decode_from_slice(&buf[..len], bincode::config::standard())
......
...@@ -64,16 +64,7 @@ impl Router { ...@@ -64,16 +64,7 @@ impl Router {
} }
} }
let now_ms = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis() as u32; let delay = (SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis() as u32).wrapping_sub(data.time) as i32;
tracing::info!(
"[{:?}] on_message: remote_time (packet)={} local_time (now)={} raw_diff (now-remote)={} delta={}",
self.link_address,
data.time,
now_ms,
now_ms.wrapping_sub(data.time) as i32,
delta
);
let delay = now_ms.wrapping_sub(data.time) as i32;
self.delay = delay; //+= (delay - self.delay) / 4; self.delay = delay; //+= (delay - self.delay) / 4;
......
...@@ -38,7 +38,6 @@ impl Server { ...@@ -38,7 +38,6 @@ impl Server {
config: &Settings, // routers: &mut HashMap<u8, Router>, config: &Settings, // routers: &mut HashMap<u8, Router>,
// self_peer: &Hello, // self_peer: &Hello,
) -> Option<Uplink> { ) -> Option<Uplink> {
tracing::info!("server message {:?}, version = {}", message, message.version);
if message.ack != self.version { if message.ack != self.version {
return None; return None;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment