Crates.io | quake_clientinfo |
lib.rs | quake_clientinfo |
version | 0.3.0 |
source | src |
created_at | 2024-05-02 12:27:24.677731 |
updated_at | 2024-06-04 13:55:22.126725 |
description | Parse QuakeWorld clientinfo strings. |
homepage | |
repository | https://github.com/vikpe/quake_clientinfo |
max_upload_size | |
id | 1227708 |
size | 5,895 |
Parse QuakeWorld clientinfo strings
use quake_clientinfo::Clientinfo;
let info = Clientinfo::from(r#"\team\red\name\Alpha\*spectator\1"#);
assert_eq!(info.name, Some("Alpha".to_string()));
assert_eq!(info.team, Some("red".to_string()));
assert_eq!(info.spectator, Some(1));
assert_eq!(info.topcolor, None);
pub struct Clientinfo {
pub name: Option<String>,
pub team: Option<String>,
pub topcolor: Option<i32>,
pub bottomcolor: Option<i32>,
pub spectator: Option<i32>,
pub client: Option<String>,
pub bot: Option<i32>,
pub chat: Option<i32>,
}