aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-02-24 03:55:29 +0000
committermat <git@matdoes.dev>2025-02-24 03:55:29 +0000
commitb9767424f3393a0aed65b713e19a265189a872b0 (patch)
tree30406dc4af41a003644d3436dc839f939a734fb0 /azalea-protocol/src
parent6a5ab34a2db56c22e1051dfaabf98322c50f53bd (diff)
downloadazalea-drasl-b9767424f3393a0aed65b713e19a265189a872b0.tar.xz
don't remove LocalEntity from disconnected players, add new debug logs, and make GameProfile clones cheaper
Diffstat (limited to 'azalea-protocol/src')
-rwxr-xr-xazalea-protocol/src/connect.rs9
-rw-r--r--azalea-protocol/src/lib.rs2
-rw-r--r--azalea-protocol/src/packets/game/c_player_info_update.rs4
3 files changed, 12 insertions, 3 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index 99a8a6b4..a4c558a1 100755
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -243,6 +243,15 @@ where
pub fn into_split(self) -> (ReadConnection<R>, WriteConnection<W>) {
(self.reader, self.writer)
}
+
+ /// Split the reader and writer into the state-agnostic
+ /// [`RawReadConnection`] and [`RawWriteConnection`] types.
+ ///
+ /// This is meant to help with some types of proxies.
+ #[must_use]
+ pub fn into_split_raw(self) -> (RawReadConnection, RawWriteConnection) {
+ (self.reader.raw, self.writer.raw)
+ }
}
#[derive(Error, Debug)]
diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs
index f9d29785..e0304979 100644
--- a/azalea-protocol/src/lib.rs
+++ b/azalea-protocol/src/lib.rs
@@ -35,7 +35,7 @@ pub mod write;
/// assert_eq!(addr.host, "localhost");
/// assert_eq!(addr.port, 25565);
/// ```
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ServerAddress {
pub host: String,
pub port: u16,
diff --git a/azalea-protocol/src/packets/game/c_player_info_update.rs b/azalea-protocol/src/packets/game/c_player_info_update.rs
index eb019167..32bfe934 100644
--- a/azalea-protocol/src/packets/game/c_player_info_update.rs
+++ b/azalea-protocol/src/packets/game/c_player_info_update.rs
@@ -80,7 +80,7 @@ impl AzaleaRead for ClientboundPlayerInfoUpdate {
if actions.add_player {
let action = AddPlayerAction::azalea_read(buf)?;
entry.profile.name = action.name;
- entry.profile.properties = action.properties;
+ entry.profile.properties = action.properties.into();
}
if actions.initialize_chat {
let action = InitializeChatAction::azalea_read(buf)?;
@@ -129,7 +129,7 @@ impl AzaleaWrite for ClientboundPlayerInfoUpdate {
if self.actions.add_player {
AddPlayerAction {
name: entry.profile.name.clone(),
- properties: entry.profile.properties.clone(),
+ properties: (*entry.profile.properties).clone(),
}
.azalea_write(buf)?;
}