mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
fix(protocol): banned and whitelist message not showing to players (#2936)
This commit is contained in:
@@ -9,6 +9,7 @@ use pumpkin_protocol::{
|
||||
java::{
|
||||
client::config::CConfigDisconnect,
|
||||
client::login::CLoginDisconnect,
|
||||
client::play::CPlayDisconnect,
|
||||
packet_decoder::TCPNetworkDecoder,
|
||||
packet_encoder::TCPNetworkEncoder,
|
||||
server::config::{
|
||||
@@ -160,6 +161,9 @@ impl PendingConnection {
|
||||
self.send_packet_now(&CConfigDisconnect::new(&reason.get_text()))
|
||||
.await;
|
||||
}
|
||||
ConnectionState::Play => {
|
||||
self.send_packet_now(&CPlayDisconnect::new(&reason)).await;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
debug!("Closing connection for {}", self.id);
|
||||
@@ -357,11 +361,11 @@ impl PendingConnection {
|
||||
return Ok(Some(PacketHandlerResult::Stop));
|
||||
};
|
||||
let config = self.config.clone().unwrap_or_default();
|
||||
self.connection_state.store(ConnectionState::Play);
|
||||
if let Some(reason) = can_not_join(&profile, &self.address, server).await {
|
||||
self.kick(reason).await;
|
||||
Ok(Some(PacketHandlerResult::Stop))
|
||||
} else {
|
||||
self.connection_state.store(ConnectionState::Play);
|
||||
Ok(Some(PacketHandlerResult::ReadyToPlay(profile, config)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user