diff options
| author | mat <github@matdoes.dev> | 2021-12-06 22:12:43 +0000 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-06 22:12:43 +0000 |
| commit | 515ad377b314cd97a8b663dbd738681917434434 (patch) | |
| tree | cb1cf65c8e726121ed002aa913132375ab5dc1e7 /minecraft-protocol/src/server_status_pinger.rs | |
| parent | 1a2c034b411e3d0dceb7b4a921ddd42226719bd0 (diff) | |
| download | azalea-drasl-515ad377b314cd97a8b663dbd738681917434434.tar.xz | |
start implementing reading
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() { |
