From 1a2c034b411e3d0dceb7b4a921ddd42226719bd0 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 6 Dec 2021 21:15:38 +0000 Subject: remove struct from friendly byte byffer --- minecraft-protocol/src/server_status_pinger.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'minecraft-protocol/src/server_status_pinger.rs') 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() { -- cgit v1.2.3