|
|
|
@ -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(),
|
|
|
|
|