diff options
Diffstat (limited to 'minecraft-protocol/src/server_status_pinger.rs')
| -rw-r--r-- | minecraft-protocol/src/server_status_pinger.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/minecraft-protocol/src/server_status_pinger.rs b/minecraft-protocol/src/server_status_pinger.rs index e9393179..5608ebea 100644 --- a/minecraft-protocol/src/server_status_pinger.rs +++ b/minecraft-protocol/src/server_status_pinger.rs @@ -1,4 +1,8 @@ -use crate::{connection::Connection, resolver, ServerAddress, packets::{ClientIntentionPacket, ServerboundStatusRequestPacket, ConnectionProtocol}}; +use crate::{ + connection::Connection, + packets::{ClientIntentionPacket, ConnectionProtocol, ServerboundStatusRequestPacket}, + resolver, ServerAddress, +}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { @@ -14,10 +18,10 @@ pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { hostname: &address.host, port: address.port, intention: ConnectionProtocol::Status, - }).await; + }) + .await; conn.send_packet(&ServerboundStatusRequestPacket {}).await; - // log what the server sends back loop { if 0 == conn.stream.read_buf(&mut conn.buffer).await.unwrap() { |
