aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/examples
diff options
context:
space:
mode:
authorLuis <luis@lu15.dev>2024-04-27 07:03:20 +0100
committerGitHub <noreply@github.com>2024-04-27 01:03:20 -0500
commit6553d9510ddc52469dd7557aa9675982cb5187ab (patch)
treee2d0cc0e36be8b2d4be5857c2790cb79eb84dece /azalea-protocol/examples
parent84f66a55a5e5b1618111e522c25704ac96d45806 (diff)
downloadazalea-drasl-6553d9510ddc52469dd7557aa9675982cb5187ab.tar.xz
Use ClientIntention over ConnectionProtocol for ClientIntentionPacket (#143)
* fix!: use ClientIntention over ConnectionProtocol for ClientIntentionPacket * chore: remove McBufRead/Writable from ConnectionProtocol * chore: use From over Into for ClientIntention to ConnectionProtocol conversion * chore: organise imports in existing style
Diffstat (limited to 'azalea-protocol/examples')
-rw-r--r--azalea-protocol/examples/handshake_proxy.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-protocol/examples/handshake_proxy.rs b/azalea-protocol/examples/handshake_proxy.rs
index a7ac67c7..442db386 100644
--- a/azalea-protocol/examples/handshake_proxy.rs
+++ b/azalea-protocol/examples/handshake_proxy.rs
@@ -16,7 +16,7 @@ use azalea_protocol::{
},
ServerboundStatusPacket,
},
- ConnectionProtocol, PROTOCOL_VERSION,
+ ClientIntention, PROTOCOL_VERSION,
},
read::ReadPacketError,
};
@@ -95,7 +95,7 @@ async fn handle_connection(stream: TcpStream) -> anyhow::Result<()> {
match intent.intention {
// If the client is pinging the proxy,
// reply with the information below.
- ConnectionProtocol::Status => {
+ ClientIntention::Status => {
let mut conn = conn.status();
loop {
match conn.read().await {
@@ -135,7 +135,7 @@ async fn handle_connection(stream: TcpStream) -> anyhow::Result<()> {
// wait for them to send the `Hello` packet to
// log their username and uuid, then forward the
// connection along to the proxy target.
- ConnectionProtocol::Login => {
+ ClientIntention::Login => {
let mut conn = conn.login();
loop {
match conn.read().await {
@@ -169,8 +169,8 @@ async fn handle_connection(stream: TcpStream) -> anyhow::Result<()> {
}
}
}
- _ => {
- warn!("Client provided weird intent: {:?}", intent.intention);
+ ClientIntention::Transfer => {
+ warn!("Client attempted to join via transfer")
}
}