diff --git a/src/main.rs b/src/main.rs index 74e3942..2e4ca0b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ use std::{ const MAX_CLIENTS: usize = 10; const CLIENT_TIMEOUT: u32 = 300; +const MY_SPEED: u8 = 20; #[derive(Hash, Eq, PartialEq, Debug, Clone)] struct Client { @@ -151,7 +152,6 @@ fn main() -> std::io::Result<()> { time: Local::now(), }; let speed = buf[1] >> 2; - println!("Speed: {speed} WPM"); let data = &buf[0..number_of_bytes]; @@ -163,11 +163,11 @@ fn main() -> std::io::Result<()> { if receivers.len() < MAX_CLIENTS { receivers.insert(client.clone()); socket - .send_to(mopp(speed, b"hi").as_slice(), &client.name) + .send_to(mopp(MY_SPEED, b"hi").as_slice(), &client.name) .unwrap(); } else { socket - .send_to(mopp(speed, b":qrl").as_slice(), &client.name) + .send_to(mopp(MY_SPEED, b":qrl").as_slice(), &client.name) .unwrap(); } } else { @@ -178,7 +178,7 @@ fn main() -> std::io::Result<()> { for cl in &receivers { if cl.time + Duration::seconds(CLIENT_TIMEOUT as i64) < timestamp { socket - .send_to(mopp(speed, b":bye").as_slice(), &client.name) + .send_to(mopp(MY_SPEED, b":bye").as_slice(), &client.name) .unwrap(); } }