Skip to main content

cs2_gsi/model/
provider.rs

1//! Provider node — describes the game client that produced the payload.
2
3use super::helpers::{de_num_or_str, de_opt_num_or_str};
4use serde::{Deserialize, Serialize};
5
6/// Identifies the producer of the game state — for CS2 this is always the
7/// game client itself (`appid: 730`).
8#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq)]
9pub struct Provider {
10    /// Display name of the producing client (e.g. `"Counter-Strike 2"`).
11    #[serde(default)]
12    pub name: String,
13    /// Steam app id. `730` for CS2.
14    #[serde(default, deserialize_with = "de_num_or_str")]
15    pub appid: u32,
16    /// Game client build version.
17    #[serde(default, deserialize_with = "de_num_or_str")]
18    pub version: u64,
19    /// 64-bit SteamID of the local player.
20    #[serde(default)]
21    pub steamid: String,
22    /// Unix timestamp (seconds) at which the payload was emitted.
23    #[serde(default, deserialize_with = "de_opt_num_or_str")]
24    pub timestamp: Option<u64>,
25}