mirror of
https://github.com/Tribufu/rust-gamedig
synced 2026-08-08 22:51:06 +00:00
* Initial minecraft support * Made previews_chat an option * Better error handling and removed version structure * Minecraft Server types * Fixed compilation and renamed stuff * 'extract till you drop!' extracted sockets * extracted java version and fixed socket udp receive * Legacy 1.4 and 1.6 implementation (incomplete) * Furter implementation * Implementations work * Protocol beta v1.8+ implemented * Removed bedrock support * Added auto query * Renamed minecraft to mc and added to md's * Docs, renames and small optimization changes * Changed java version to be able to return None on players sample
18 lines
558 B
Rust
18 lines
558 B
Rust
use crate::GDResult;
|
|
use crate::protocols::minecraft;
|
|
use crate::protocols::minecraft::{Server, Response};
|
|
|
|
pub fn query(address: &str, port: Option<u16>) -> GDResult<Response> {
|
|
minecraft::query(address, port_or_default(port), None)
|
|
}
|
|
|
|
pub fn query_specific(mc_type: Server, address: &str, port: Option<u16>) -> GDResult<Response> {
|
|
minecraft::query_specific(mc_type, address, port_or_default(port), None)
|
|
}
|
|
|
|
fn port_or_default(port: Option<u16>) -> u16 {
|
|
match port {
|
|
None => 25565,
|
|
Some(port) => port
|
|
}
|
|
}
|