Compare commits

..

2 commits

View file

@ -42,12 +42,14 @@ pub async fn complete_status_request(
/// Disconnects the client. /// Disconnects the client.
/// ///
/// It works if the client is in the login state, and it /// It works if the client is in the login state, and it
/// has *already* and *only* sent the **handshake** and **login_start** packet. /// has *already* and *only* sent the handshake packet.
#[tracing::instrument(skip(client_stream))] #[tracing::instrument(skip(client_stream))]
pub async fn send_disconnect( pub async fn send_disconnect(
client_stream: &mut TcpStream, client_stream: &mut TcpStream,
reason: &str, reason: &str,
) -> Result<(), OpaqueError> { ) -> Result<(), OpaqueError> {
let _client_packet = Packet::parse(client_stream).await?;
let disconnect_packet = let disconnect_packet =
crate::packets::clientbound::login::Disconnect::set_reason(reason.to_owned()) crate::packets::clientbound::login::Disconnect::set_reason(reason.to_owned())
.await .await