1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
//! 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
//!
//! ## Usage
//!
//! Add this to your `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! csgo-gsi2 = "0.3.3"
//! ```
//!
//! ## Simple Example
//!
//! [examples/simple.rs](https://github.com/redsuitman/csgo-gsi2/blob/main/examples/simple.rs) Can be run with `cargo run --example simple`.
//!
//! ```no_run
//! 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_csgo-gsi.cfg in the csgo folder.
#![deny(missing_docs)]
#![doc(html_root_url = "https://docs.rs/csgo-gsi2/0.3.3")]
#[macro_use]
extern crate gotham_derive;
mod config;
mod error;
mod install_dir;
mod server;
pub mod update;
pub use config::{Subscription, GSIConfigBuilder, GSIConfig};
pub use error::Error;
pub use server::GSIServer;
pub use update::Update;