Skip to content

Get server addresses from QuakeWorld master servers.

License

Notifications You must be signed in to change notification settings

vikpe/masterstat-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

masterstat Test crates docs.rs

Get server addresses from QuakeWorld master servers.

Installation

cargo add masterstat

Usage

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?;
}

See also

About

Get server addresses from QuakeWorld master servers.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Languages