diff options
| author | mat <github@matdoes.dev> | 2021-12-06 21:15:38 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-06 21:15:38 +0000 |
| commit | 1a2c034b411e3d0dceb7b4a921ddd42226719bd0 (patch) | |
| tree | 8c59abf5388c4ced1cb4c3dc798eadc68f7d3e16 /minecraft-protocol/src/server_status_pinger.rs | |
| parent | 0b484df40c356cf4fe87f3d3a20eadf59eef42c9 (diff) | |
| download | azalea-drasl-1a2c034b411e3d0dceb7b4a921ddd42226719bd0.tar.xz | |
remove struct from friendly byte byffer
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() { |
