teestatus

Crates.ioteestatus
lib.rsteestatus
version0.2.1
sourcesrc
created_at2021-01-24 17:40:46.214794
updated_at2021-01-30 11:40:54.979943
descriptionLibrary to retrieve information from teeworlds servers and related mods.
homepage
repositoryhttps://github.com/edg-l/teestatus
max_upload_size
id346106
size35,845
Edgar (edg-l)

documentation

https://docs.rs/teestatus

README

teestatus

Crates.io Rust Docs

Request info about teeworlds servers.

Example

use teestatus::*;
use std::net::UdpSocket;

fn main() {
	env_logger::init();
	let sock = UdpSocket::bind("0.0.0.0:0").expect("can't bind socket");
	sock.connect("0.0.0.0:8303")
		.expect("can't connect socket");
	println!("info: {:#?}", ServerInfo::new(&sock).unwrap());
}

Example to fetch servers from a master server:

let master = MasterServer {
	hostname: Cow::Borrowed("49.12.97.180"),
	port: 8300,
};
let sock = UdpSocket::bind("0.0.0.0:0").expect("can't bind socket");
let servers = master.get_server_list(&sock).unwrap();
Commit count: 20

cargo fmt