From 4a44c58444c901d939a8594669c819ab2bfbac13 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 7 Dec 2021 22:12:16 +0000 Subject: keep doing packet stuff --- minecraft-protocol/src/server_status_pinger.rs | 4 ++++ 1 file changed, 4 insertions(+) (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 df53b897..342c4f44 100644 --- a/minecraft-protocol/src/server_status_pinger.rs +++ b/minecraft-protocol/src/server_status_pinger.rs @@ -13,6 +13,7 @@ pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { println!("resolved_address {}", &resolved_address.ip); println!("writing intention packet {}", address.host); + // send the client intention packet and switch to the status state conn.send_packet(&ClientIntentionPacket { protocol_version: 757, hostname: &address.host, @@ -20,6 +21,9 @@ pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { intention: ConnectionProtocol::Status, }) .await; + conn.switch_state(ConnectionProtocol::Status); + + // send the empty status request packet conn.send_packet(&ServerboundStatusRequestPacket {}).await; conn.read_packet().await.unwrap(); -- cgit v1.2.3