Compare commits
2 commits
ec71d35710
...
c70527ded5
| Author | SHA1 | Date | |
|---|---|---|---|
| c70527ded5 | |||
| d531ba59a0 |
1 changed files with 1 additions and 3 deletions
|
|
@ -42,14 +42,12 @@ 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 packet.
|
/// has *already* and *only* sent the **handshake** and **login_start** 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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue