diff options
| author | mat <github@matdoes.dev> | 2021-12-10 00:54:58 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-10 00:54:58 -0600 |
| commit | be762fc5d37ba48386996afb4c5ba0c94aaf5883 (patch) | |
| tree | a7c96227c51e291e4e59eab7a66c6bc223973e06 /minecraft-protocol/src/server_status_pinger.rs | |
| parent | f64750afdd9b18379f706df66c32806b6d21bbe8 (diff) | |
| download | azalea-drasl-be762fc5d37ba48386996afb4c5ba0c94aaf5883.tar.xz | |
rust is driving me insane
Diffstat (limited to 'minecraft-protocol/src/server_status_pinger.rs')
| -rw-r--r-- | minecraft-protocol/src/server_status_pinger.rs | 25 |
1 files changed, 16 insertions, 9 deletions
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(); |
