Crate q3tool

source ·
Expand description

A Rust library for interacting with ioq3 (Quake 3) based game servers.

Provides an interface for getting C_VARs and a player list.

use q3tool::Q3Tool;

let q = Q3Tool::new("someserverhost:27960", Some("supersecretpassword".to_owned()));
let server_info = q.get_status().unwrap();
    
// Print all public server c_vars
for (k, v) in server_info.vars() {
    println!("{}: {}", k, v);
}

// Print a single server c_var
println!("Hostname: {}", server_info.vars().get("sv_hostname").unwrap());

// Print all players
for player in server_info.players() {
    println!("Name: {}, Score: {}, Ping: {}", player.name(), player.score(), player.ping());
}

// Send an rcon command
let response = q.rcon("map ut4_casa").unwrap();

Modules

Structs