#valve #gsi #cs-go #tokio #api-bindings

csgo-gsi2

Rust library for CS:GO's Game State Integration API

2 releases

0.3.4 Oct 5, 2022
0.3.3 Sep 1, 2022
0.3.2 Sep 1, 2022
0.3.1 Sep 1, 2022

#304 in Games

Custom license

36KB
702 lines

csgo-gsi2

Crates.io version Crates.io downloads Crates.io license

Helper library for the CS:GO Game State Integration (GSI) API.

Best used with the tokio async ecosystem.

Forked from https://github.com/rosefromthedead/csgo-gsi

Usage

Add this to your Cargo.toml:

[dependencies]
csgo-gsi2 = "0.3.4"
tokio = { version = "1.20.1", features = ["full"] }

Simple Example

examples/simple.rs Can be run with cargo run --example simple.

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 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 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.

Dependencies

~11–25MB
~322K SLoC