1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

move ping over to minecraft-client

This commit is contained in:
mat 2021-12-12 13:52:32 -06:00
parent 6ed7b6e38f
commit 2c3bf3b79e
5 changed files with 6 additions and 12 deletions

View file

@ -1,11 +1,10 @@
use minecraft_client::ping;
use minecraft_protocol::ServerAddress; use minecraft_protocol::ServerAddress;
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
async fn bot() { async fn bot() {
let address = ServerAddress::parse(&"mc.hypixel.net".to_string()).unwrap(); let address = ServerAddress::parse(&"mc.hypixel.net".to_string()).unwrap();
let response = minecraft_protocol::server_status_pinger::ping_server(&address) let response = ping::ping_server(&address).await.unwrap();
.await
.unwrap();
println!("{}", response.description.to_ansi(None)); println!("{}", response.description.to_ansi(None));
} }

View file

@ -1,4 +1,4 @@
pub mod ping;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {

View file

@ -1,4 +1,6 @@
use crate::{ ///! Ping Minecraft servers.
use minecraft_protocol::{
connection::Connection, connection::Connection,
packets::{ packets::{
handshake::client_intention_packet::ClientIntentionPacket, handshake::client_intention_packet::ClientIntentionPacket,

View file

@ -7,7 +7,6 @@ pub mod connection;
pub mod mc_buf; pub mod mc_buf;
pub mod packets; pub mod packets;
pub mod resolver; pub mod resolver;
pub mod server_status_pinger;
#[derive(Debug)] #[derive(Debug)]
pub struct ServerAddress { pub struct ServerAddress {

View file

@ -1,6 +0,0 @@
struct ServerStatus {
description: Component,
players: Players,
version: Version,
favicon: String,
}