# csgo-gsi2 [![Crates.io version](https://img.shields.io/crates/v/csgo-gsi2)](https://crates.io/crates/csgo-gsi2) [![Crates.io downloads](https://img.shields.io/crates/d/csgo-gsi2)](https://crates.io/crates/csgo-gsi2) ![Crates.io license](https://img.shields.io/crates/l/csgo-gsi2) Helper library for the [CS:GO Game State Integration (GSI) API][gsi]. Best used with the [tokio](https://tokio.rs/) async ecosystem. [gsi]: https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Game_State_Integration > Forked from https://github.com/rosefromthedead/csgo-gsi ## Usage Add this to your `Cargo.toml`: ```toml [dependencies] csgo-gsi2 = "0.3.4" tokio = { version = "1.20.1", features = ["full"] } ``` ## Simple Example [examples/simple.rs](https://github.com/redsuitman/csgo-gsi2/blob/main/examples/simple.rs) Can be run with `cargo run --example simple`. ```rust use csgo_gsi2::{GSIConfigBuilder, GSIServer, Subscription}; #[tokio::main] async fn main() { let config = GSIConfigBuilder::new("csgo-gsi") .subscribe_multiple(Subscription::UNRESTRICTED) .build(); let mut server = GSIServer::new(config, 3000); server.add_listener(|update| println!("Got an update {:#?}", update)); server .run() .await .expect("server didn't start"); } ``` Check [examples/verbose.rs](https://github.com/redsuitman/csgo-gsi2/blob/main/examples/verbose.rs) for the verbose example. Can be run with `cargo run --example verbose`. ### Features * `autoinstall` - Automatically install the gamestate_integration_NAME.cfg in the csgo folder ## License Licensed under the [Anti-Capitalist Software License](https://anticapitalist.software/) version 1.4. ## Contribution Unless you explicitly state otherwise, any contribution you submit shall be also under the Anti-Capitalist Software License version 1.4, without any additional terms or conditions.