mcpe_query

Crates.iomcpe_query
lib.rsmcpe_query
version0.1.2
sourcesrc
created_at2022-05-26 13:48:38.341883
updated_at2022-09-13 08:33:23.388364
descriptionA library to get information of minecraft using the status ping [https://wiki.vg/Server_List_Ping#Client_to_server]
homepage
repositoryhttps://github.com/xerenahmed/mcpe_query
max_upload_size
id594121
size11,790
Eren A. Akyol (xerenahmed)

documentation

README

crates.io docs.rs

Rust port of gophertunnel/query

A library to get information of minecraft using the status ping https://wiki.vg/Server_List_Ping#Client_to_server

Installation

Add to Cargo.toml [depencidies]

mcpe_query = "0.1.2"

Basic Usage

Default timeout is 5 seconds for query.

let uri = "play.redmc.me:19132";
let info = mcpe_query::handle(uri, None).unwrap();
println!("{:?}", info);

Timeout

let uri = "play.redmc.me:19132";
let timeout = std::time::Duration::from_secs(10); // 10 seconds
let info = mcpe_query::handle(uri, Some(timeout)).unwrap();
println!("{:?}", info);

Example Repsonse Information

Information {
	players: ["Arial w", "darly4990", "LegendAdam3456", "BugraBcrr00", "RTshadow6686"],
	other: {
		"hostip": "0.0.0.0",
		"maxplayers": "60",
		"hostport": "19132",
		"hostname": "RedMC",
		"numplayers": "10",
		"map": "Spawn",
		"plugins": "PocketMine-MP 4.7.1+dev",
		"gametype": "SMP",
		"version": "v1.19.21",
		"server_engine": "PocketMine-MP 4.7.1+dev",
		"whitelist": "off",
		"game_id": "MINECRAFTPE"
	}
}
Commit count: 11

cargo fmt