Get server addresses from QuakeWorld master servers.
cargo add masterstat
Get server addresses from a single master server
use std::time::Duration;
let master = "master.quakeworld.nu:27000";
let timeout = Some(Duration::from_secs(2));
match masterstat::server_addresses(&master, timeout) {
Ok(addresses) => { println!("found {} server addresses", addresses.len()) },
Err(e) => { eprintln!("error: {}", e); }
}
Get server addresses from multiple master servers (async, in parallel)
use std::time::Duration;
async fn test() {
let masters = ["master.quakeworld.nu:27000", "master.quakeservers.net:27000"];
let timeout = Some(Duration::from_secs(2));
let server_addresses = masterstat::server_addresses_from_many(&masters, timeout).await?;
}
- masterstat - golang version
- masterstat-cli - CLI version