feat(server): more logging

main
Skye 2 years ago
parent ff0831c89d
commit afa62d4ab6
Signed by: me
GPG Key ID: 0104BC05F41B77B8

@ -364,6 +364,7 @@ async fn accept_minecraft_connection(mut stream: TcpStream) -> Result<()> {
return Ok(());
}
let handshake = Handshake::new(&packet?).await?;
info!("Minecraft client {} is connecting to {}", addr, handshake.server_address);
if let Some(sender) = ROUTING_MAP.read().await.get(&handshake.server_address) {
let mut handle = ChannelHandle::new(sender, addr).await?;
let mut buf = vec![];
@ -447,6 +448,7 @@ async fn get_random_domain() -> String {
);
let map = ROUTING_MAP.read().await;
while map.contains_key(&domain) {
warn!("Randomly selected domain {} conflicts; trying again", domain);
domain = format!(
"{}-{}.{}",
wordlist::ID_WORDS.choose(&mut rand::thread_rng()).unwrap(),

Loading…
Cancel
Save