aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-08-03 16:11:59 +0200
committermetamuffin <metamuffin@disroot.org>2024-08-03 16:11:59 +0200
commitaa44c28c4c7fabf5018976833d9f45f875ec0da5 (patch)
treed47fddad27116628fa825e292a119a0817d0726c /src
parent535bce5fc8de87ab86b0df182e607b53e09679fb (diff)
downloadtrash-proxy-aa44c28c4c7fabf5018976833d9f45f875ec0da5.tar
trash-proxy-aa44c28c4c7fabf5018976833d9f45f875ec0da5.tar.bz2
trash-proxy-aa44c28c4c7fabf5018976833d9f45f875ec0da5.tar.zst
update version
Diffstat (limited to 'src')
-rw-r--r--src/main.rs9
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,