diff options
Diffstat (limited to 'minecraft-protocol/src/server_status_pinger.rs')
| -rw-r--r-- | minecraft-protocol/src/server_status_pinger.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/minecraft-protocol/src/server_status_pinger.rs b/minecraft-protocol/src/server_status_pinger.rs index 5608ebea..ad3d4e52 100644 --- a/minecraft-protocol/src/server_status_pinger.rs +++ b/minecraft-protocol/src/server_status_pinger.rs @@ -1,9 +1,10 @@ use crate::{ connection::Connection, + mc_buf, packets::{ClientIntentionPacket, ConnectionProtocol, ServerboundStatusRequestPacket}, resolver, ServerAddress, }; -use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::io::AsyncReadExt; pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { let resolved_address = resolver::resolve_address(&address).await?; @@ -22,6 +23,9 @@ pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { .await; conn.send_packet(&ServerboundStatusRequestPacket {}).await; + let data = mc_buf::read_varint(conn.stream); + println!("data {}", data); + // log what the server sends back loop { if 0 == conn.stream.read_buf(&mut conn.buffer).await.unwrap() { |
