aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src/plugins')
-rw-r--r--azalea-client/src/plugins/join.rs23
1 files changed, 9 insertions, 14 deletions
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<Proxy>,
/// 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<LoginConn, ConnectionError> {
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?;