From 42b79d446af45d78202e4b1db8c822a0699b04d7 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Thu, 23 Jan 2025 21:23:32 +0100 Subject: [PATCH] fix: chat --- .../src/client/play/c_player_chat_message.rs | 1 + pumpkin/src/net/packet/play.rs | 2 +- pumpkin/src/server/mod.rs | 13 ++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pumpkin-protocol/src/client/play/c_player_chat_message.rs b/pumpkin-protocol/src/client/play/c_player_chat_message.rs index 6cf12f3a8..0cced313d 100644 --- a/pumpkin-protocol/src/client/play/c_player_chat_message.rs +++ b/pumpkin-protocol/src/client/play/c_player_chat_message.rs @@ -20,6 +20,7 @@ pub struct CPlayerChatMessage<'a> { previous_messages: &'a [PreviousMessage<'a>], // max 20 unsigned_content: Option, filter_type: FilterType, + /// This should not be zero, (index + 1) chat_type: VarInt, sender_name: TextComponent, target_name: Option, diff --git a/pumpkin/src/net/packet/play.rs b/pumpkin/src/net/packet/play.rs index 4fe147f8b..0325e9142 100644 --- a/pumpkin/src/net/packet/play.rs +++ b/pumpkin/src/net/packet/play.rs @@ -561,7 +561,7 @@ impl Player { &[], Some(TextComponent::text(message.clone())), FilterType::PassThrough, - CHAT.into(), + (CHAT + 1).into(), TextComponent::text(gameprofile.name.clone()), None, )) diff --git a/pumpkin/src/server/mod.rs b/pumpkin/src/server/mod.rs index b70cd7919..8a2eeb22e 100644 --- a/pumpkin/src/server/mod.rs +++ b/pumpkin/src/server/mod.rs @@ -1,6 +1,5 @@ use connection_cache::{CachedBranding, CachedStatus}; use crossbeam::atomic::AtomicCell; -use hmac::digest::consts::U6; use key_store::KeyStore; use pumpkin_config::{ADVANCED_CONFIG, BASIC_CONFIG}; use pumpkin_data::entity::EntityType; @@ -89,12 +88,12 @@ impl Server { pub fn new() -> Self { let auth_client = BASIC_CONFIG.online_mode.then(|| { reqwest::Client::builder() - .connect_timeout(Duration::from_millis( - ADVANCED_CONFIG.networking.authentication.connect_timeout as u64, - )) - .read_timeout(Duration::from_millis( - ADVANCED_CONFIG.networking.authentication.read_timeout as u64, - )) + .connect_timeout(Duration::from_millis(u64::from( + ADVANCED_CONFIG.networking.authentication.connect_timeout, + ))) + .read_timeout(Duration::from_millis(u64::from( + ADVANCED_CONFIG.networking.authentication.read_timeout, + ))) .build() .expect("Failed to to make reqwest client") });