diff --git a/azalea-protocol/src/resolver.rs b/azalea-protocol/src/resolver.rs index af59be72c..23a4ff00f 100755 --- a/azalea-protocol/src/resolver.rs +++ b/azalea-protocol/src/resolver.rs @@ -31,36 +31,7 @@ pub async fn resolve_address(address: &ServerAddress) -> Result - let srv_redirect_result = resolver - .srv_lookup(format!("_minecraft._tcp.{}", address.host).as_str()) - .await; - - // if it resolves that means it's a redirect so we call resolve_address again - // with the new host - if let Ok(redirect_result) = srv_redirect_result { - let redirect_srv = redirect_result - .iter() - .next() - .ok_or(ResolverError::NoSrvRecord)?; - let redirect_address = ServerAddress { - host: redirect_srv.target().to_ascii(), - port: redirect_srv.port(), - }; - - if redirect_address.host == address.host { - let lookup_ip_result = resolver.lookup_ip(redirect_address.host).await; - let lookup_ip = lookup_ip_result.map_err(|_| ResolverError::NoIp)?; - return Ok(SocketAddr::new( - lookup_ip.iter().next().unwrap(), - redirect_address.port, - )); - } - - return resolve_address(&redirect_address).await; - } - + // there's no redirect, try to resolve this as an ip address let name = Name::from_ascii(&address.host).map_err(|_| ResolverError::NoIp)?; let lookup_ip_result = resolver.lookup_ip(name).await;