aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol')
-rw-r--r--azalea-protocol/Cargo.toml3
-rw-r--r--azalea-protocol/src/connect.rs8
2 files changed, 9 insertions, 2 deletions
diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml
index 1ab25a12..4128faae 100644
--- a/azalea-protocol/Cargo.toml
+++ b/azalea-protocol/Cargo.toml
@@ -43,9 +43,10 @@ uuid.workspace = true
indexmap.workspace = true
[features]
+default = ["packets", "online-mode"]
connecting = []
-default = ["packets"]
packets = ["connecting", "dep:azalea-core"]
+online-mode = ["azalea-auth/online-mode"]
[lints]
workspace = true
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index febb2337..556f0f1c 100644
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -7,6 +7,7 @@ use std::{
net::SocketAddr,
};
+#[cfg(feature = "online-mode")]
use azalea_auth::{
game_profile::GameProfile,
sessionserver::{ClientSessionServerError, ServerSessionServerError},
@@ -21,15 +22,18 @@ use tokio::{
},
};
use tracing::{error, info};
+#[cfg(feature = "online-mode")]
use uuid::Uuid;
+#[cfg(feature = "online-mode")]
+use crate::packets::login::ClientboundHello;
use crate::{
packets::{
ProtocolPacket,
config::{ClientboundConfigPacket, ServerboundConfigPacket},
game::{ClientboundGamePacket, ServerboundGamePacket},
handshake::{ClientboundHandshakePacket, ServerboundHandshakePacket},
- login::{ClientboundLoginPacket, ServerboundLoginPacket, c_hello::ClientboundHello},
+ login::{ClientboundLoginPacket, ServerboundLoginPacket},
status::{ClientboundStatusPacket, ServerboundStatusPacket},
},
read::{ReadPacketError, deserialize_packet, read_raw_packet, try_read_raw_packet},
@@ -453,6 +457,7 @@ impl Connection<ClientboundLoginPacket, ServerboundLoginPacket> {
/// # Ok(())
/// # }
/// ```
+ #[cfg(feature = "online-mode")]
pub async fn authenticate(
&self,
access_token: &str,
@@ -526,6 +531,7 @@ impl Connection<ServerboundLoginPacket, ClientboundLoginPacket> {
/// Verify connecting clients have authenticated with Minecraft's servers.
/// This must happen after the client sends a `ServerboundLoginPacket::Key`
/// packet.
+ #[cfg(feature = "online-mode")]
pub async fn authenticate(
&self,
username: &str,