From f4a3c53eee7d29bade0c074f402c4a45aa98eca8 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 12 Dec 2025 01:29:49 -0600 Subject: Delete `StartError` and `JoinError` (#296) * delete StartError and JoinError * update changelog --- azalea-client/src/plugins/join.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'azalea-client/src/plugins/join.rs') diff --git a/azalea-client/src/plugins/join.rs b/azalea-client/src/plugins/join.rs index 538369b0..f1e27165 100644 --- a/azalea-client/src/plugins/join.rs +++ b/azalea-client/src/plugins/join.rs @@ -1,8 +1,8 @@ -use std::{net::SocketAddr, sync::Arc}; +use std::sync::Arc; use azalea_entity::{LocalEntity, indexing::EntityUuidIndex}; use azalea_protocol::{ - ServerAddress, + address::ResolvedAddr, common::client_information::ClientInformation, connect::{Connection, ConnectionError, Proxy}, packets::{ @@ -59,16 +59,11 @@ pub struct StartJoinServerEvent { /// Options for how the connection to the server will be made. /// -/// These are persisted on reconnects. -/// -/// This is inserted as a component on clients to make auto-reconnecting work. +/// These are persisted on reconnects. This is inserted as a component on +/// clients to make auto-reconnecting work. #[derive(Debug, Clone, Component)] pub struct ConnectOpts { - /// The unresolved address that we're going to tell the server that we used - /// to connect. - pub address: ServerAddress, - /// The actual IP and port that we're going to make a connection to. - pub resolved_address: SocketAddr, + pub address: ResolvedAddr, /// The SOCKS5 proxy used for connecting to the Minecraft server. pub server_proxy: Option, /// The SOCKS5 proxy that will be used when authenticating our server join @@ -172,15 +167,15 @@ async fn create_conn_and_send_intention_packet( opts: ConnectOpts, ) -> Result { let mut conn = if let Some(proxy) = opts.server_proxy { - Connection::new_with_proxy(&opts.resolved_address, proxy).await? + Connection::new_with_proxy(&opts.address.socket, proxy).await? } else { - Connection::new(&opts.resolved_address).await? + Connection::new(&opts.address.socket).await? }; conn.write(ServerboundIntention { protocol_version: PROTOCOL_VERSION, - hostname: opts.address.host.clone(), - port: opts.address.port, + hostname: opts.address.server.host.clone(), + port: opts.address.server.port, intention: ClientIntention::Login, }) .await?; -- cgit v1.2.3