Skip to content

vikpe/quake_clientinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quake_clientinfo Test crates docs.rs

Parse QuakeWorld clientinfo strings

Usage

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);

Fields

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>,
}

See also