Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vikpe/masterstat-rust
Get server addresses from QuakeWorld master servers.
https://github.com/vikpe/masterstat-rust
quake quakeworld servers
Last synced: 27 days ago
JSON representation
Get server addresses from QuakeWorld master servers.
- Host: GitHub
- URL: https://github.com/vikpe/masterstat-rust
- Owner: vikpe
- License: mit
- Created: 2024-04-25T13:41:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-04T11:07:01.000Z (6 months ago)
- Last Synced: 2024-09-14T02:07:09.151Z (about 2 months ago)
- Topics: quake, quakeworld, servers
- Language: Rust
- Homepage: https://crates.io/crates/masterstat
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# masterstat [![Test](https://github.com/vikpe/masterstat-rust/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/vikpe/masterstat-rust/actions/workflows/test.yml) [![crates](https://img.shields.io/crates/v/masterstat)](https://crates.io/crates/masterstat) [![docs.rs](https://img.shields.io/docsrs/masterstat)](https://docs.rs/masterstat/)
> Get server addresses from QuakeWorld master servers.
## Installation
```shell
cargo add masterstat
```## Usage
**Get server addresses from a single master server**
```rust
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)
```rust
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
* [masterstat](https://github.com/vikpe/masterstat) - golang version
* [masterstat-cli](https://github.com/vikpe/masterstat-cli) - CLI version