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:
parent
6ed7b6e38f
commit
2c3bf3b79e
5 changed files with 6 additions and 12 deletions
|
@ -1,11 +1,10 @@
|
|||
use minecraft_client::ping;
|
||||
use minecraft_protocol::ServerAddress;
|
||||
use tokio::runtime::Runtime;
|
||||
|
||||
async fn bot() {
|
||||
let address = ServerAddress::parse(&"mc.hypixel.net".to_string()).unwrap();
|
||||
let response = minecraft_protocol::server_status_pinger::ping_server(&address)
|
||||
.await
|
||||
.unwrap();
|
||||
let response = ping::ping_server(&address).await.unwrap();
|
||||
println!("{}", response.description.to_ansi(None));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
pub mod ping;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use crate::{
|
||||
///! Ping Minecraft servers.
|
||||
|
||||
use minecraft_protocol::{
|
||||
connection::Connection,
|
||||
packets::{
|
||||
handshake::client_intention_packet::ClientIntentionPacket,
|
|
@ -7,7 +7,6 @@ pub mod connection;
|
|||
pub mod mc_buf;
|
||||
pub mod packets;
|
||||
pub mod resolver;
|
||||
pub mod server_status_pinger;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ServerAddress {
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
struct ServerStatus {
|
||||
description: Component,
|
||||
players: Players,
|
||||
version: Version,
|
||||
favicon: String,
|
||||
}
|
Loading…
Add table
Reference in a new issue