diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index db4d237..12d2cdb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use azalea_protocol::{ packets::{ handshaking::{client_intention_packet::ClientIntentionPacket, ServerboundHandshakePacket}, login::ServerboundLoginPacket, - ConnectionProtocol, + ClientIntention, ConnectionProtocol, }, read::read_packet, write::write_packet, @@ -92,11 +92,11 @@ async fn handle_client(config: Arc<Config>, sock: TcpStream) -> Result<(), anyho bail!("protocol version unsupported") } match p.intention { - ConnectionProtocol::Status => { + ClientIntention::Status => { handle_status_intent(config, downstream_writer, downstream_reader).await?; return Ok(()); } - ConnectionProtocol::Login => {} + ClientIntention::Login => {} _ => bail!("unsupported intent"), } p @@ -127,6 +127,7 @@ async fn handle_client(config: Arc<Config>, sock: TcpStream) -> Result<(), anyho ServerboundLoginPacket::LoginAcknowledged(_) => bail!("wtf?"), ServerboundLoginPacket::Key(_) => bail!("key not supported"), ServerboundLoginPacket::CustomQueryAnswer(_) => bail!("custom query not supported"), + ServerboundLoginPacket::CookieResponse(_) => bail!("cookie response not supported"), }; let upstream = TcpStream::connect(config.backend).await?; @@ -184,7 +185,7 @@ async fn handle_status_intent( protocol_version: config.protocol, hostname: config.backend.ip().to_string(), port: config.backend.port(), - intention: ConnectionProtocol::Status, + intention: ClientIntention::Status, }), &mut upstream_writer, None, |