Crates.io | gsi-csgo |
lib.rs | gsi-csgo |
version | 0.1.1 |
source | src |
created_at | 2022-11-11 04:18:43.779066 |
updated_at | 2023-03-21 20:57:41.341809 |
description | A library containing ready-made structures for deserializing or reverse serializing data provided by CSGO GSI using serde. With examples. |
homepage | https://github.com/sam-ai56/gsi-csgo |
repository | https://github.com/sam-ai56/gsi-csgo |
max_upload_size | |
id | 712656 |
size | 45,587 |
A library containing ready-made structures for deserializing or reverse serializing data provided by CSGO GSI using serde.
First you need to install gamestate_integration_fast.cfg
in csgo/cfg
folder.
use poem::{handler, listener::TcpListener, post, Route, Server, web::Json};
use gsi_csgo::Body;
#[handler]
async fn update(data: Json<Body>) {
println!("{:#?}", data);
}
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
tracing_subscriber::fmt::init();
let app = Route::new().at("/", post(update));
Server::new(TcpListener::bind("127.0.0.1:3000"))
.run(app)
.await
}
You need add this to your Cargo.toml
[dependencies]
gsi-csgo = "0.1.0"
poem = "1.3.48"
tokio = { version = "1.21.2", features = ["rt-multi-thread", "macros"] }
tracing-subscriber = "0.3.16"
or just use cargo run --example payload
Another examples
can be found in the github repository.
MIT