|
|
@ -365,8 +365,10 @@ async fn accept_minecraft_connection(mut stream: TcpStream) -> Result<()> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let handshake = Handshake::new(&packet?).await?;
|
|
|
|
let handshake = Handshake::new(&packet?).await?;
|
|
|
|
info!("Minecraft client {} is connecting to {}", addr, handshake.server_address);
|
|
|
|
info!("Minecraft client {} is connecting to {}", addr, handshake.server_address);
|
|
|
|
if let Some(sender) = ROUTING_MAP.read().await.get(&handshake.server_address) {
|
|
|
|
let map = ROUTING_MAP.read().await;
|
|
|
|
let mut handle = ChannelHandle::new(sender, addr).await?;
|
|
|
|
if let Some(sender) = map.get(&handshake.server_address).cloned() {
|
|
|
|
|
|
|
|
drop(map);
|
|
|
|
|
|
|
|
let mut handle: ChannelHandle = ChannelHandle::new(&sender, addr).await?;
|
|
|
|
let mut buf = vec![];
|
|
|
|
let mut buf = vec![];
|
|
|
|
handshake.send(&mut buf).await?;
|
|
|
|
handshake.send(&mut buf).await?;
|
|
|
|
handle.send(buf)?;
|
|
|
|
handle.send(buf)?;
|
|
|
|