From be762fc5d37ba48386996afb4c5ba0c94aaf5883 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 10 Dec 2021 00:54:58 -0600 Subject: rust is driving me insane --- minecraft-protocol/src/server_status_pinger.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 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 342c4f44..1e523511 100644 --- a/minecraft-protocol/src/server_status_pinger.rs +++ b/minecraft-protocol/src/server_status_pinger.rs @@ -1,7 +1,10 @@ use crate::{ connection::Connection, - mc_buf, - packets::{ClientIntentionPacket, ConnectionProtocol, ServerboundStatusRequestPacket}, + packets::{ + handshake::client_intention_packet::ClientIntentionPacket, + status::serverbound_status_request_packet::ServerboundStatusRequestPacket, + ConnectionProtocol, PacketTrait, + }, resolver, ServerAddress, }; @@ -14,17 +17,21 @@ pub async fn ping_server(address: &ServerAddress) -> Result<(), String> { 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, - port: address.port, - intention: ConnectionProtocol::Status, - }) + conn.send_packet( + ClientIntentionPacket { + protocol_version: 757, + hostname: &address.host, + port: address.port, + intention: ConnectionProtocol::Status, + } + .get(), + ) .await; conn.switch_state(ConnectionProtocol::Status); // send the empty status request packet - conn.send_packet(&ServerboundStatusRequestPacket {}).await; + conn.send_packet(ServerboundStatusRequestPacket {}.get()) + .await; conn.read_packet().await.unwrap(); -- cgit v1.2.3