Crates.io | masterstat |
lib.rs | masterstat |
version | 0.1.3 |
source | src |
created_at | 2024-04-25 15:33:57.787306 |
updated_at | 2024-05-04 11:07:16.213942 |
description | Get server addresses from QuakeWorld master servers. |
homepage | |
repository | https://github.com/vikpe/masterstat-rust |
max_upload_size | |
id | 1220409 |
size | 11,436 |
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?;
}