From 534ca30378ef6656fa1a256de6ccc9d6c8001519 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 15 Jan 2024 20:49:09 +0100 Subject: [PATCH] Add own Steamid --- CS2GSIJsonParser.cs | 1 + GameState/CS2GameState.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CS2GSIJsonParser.cs b/CS2GSIJsonParser.cs index 9ad24c4..56565dd 100644 --- a/CS2GSIJsonParser.cs +++ b/CS2GSIJsonParser.cs @@ -10,6 +10,7 @@ internal static class CS2GSIJsonParser JObject jsonObject = JObject.Parse(jsonString); return new CS2GameState() { + ProviderSteamId = jsonObject.SelectToken("provider.steamid")!.Value()!, Timestamp = jsonObject.SelectToken("provider.timestamp")!.Value(), Map = ParseMapFromJObject(jsonObject), Player = ParsePlayerFromJObject(jsonObject) diff --git a/GameState/CS2GameState.cs b/GameState/CS2GameState.cs index 4bd110d..d15a900 100644 --- a/GameState/CS2GameState.cs +++ b/GameState/CS2GameState.cs @@ -2,6 +2,7 @@ public struct CS2GameState { + public string ProviderSteamId; public int Timestamp; public Map? Map; public Player? Player; @@ -9,7 +10,7 @@ public struct CS2GameState public override string ToString() { return $"{GetType()}\n" + - $"\tTime: {Timestamp}\n" + + $"\tTime: {Timestamp}\tSteamId: {ProviderSteamId}\n" + $"\t{Map}\n" + $"\t{Player}\n"; }