33 Commits

Author SHA1 Message Date
8cca25266a Changed access-types 2024-01-14 02:12:45 +01:00
54c82c93e2 Changed default IntensityRange to 20-60 2024-01-14 02:10:37 +01:00
8526c6b00b Only handle events of own steamid 2024-01-14 02:10:24 +01:00
f77f5bc3b4 Add "Over" Roundstate 2024-01-14 02:09:54 +01:00
5824e24748 gsi.cfg timeout, buffer, throttle changes 2024-01-14 02:09:40 +01:00
45eea0c7c5 Do nothing when action is nothing 2024-01-14 01:13:09 +01:00
671fdc5314 Working 2024-01-14 01:10:58 +01:00
66f234e19a Fixed Auth for OpenShock 2024-01-14 01:10:52 +01:00
0303efac16 Corrected json parsing for messagehandling 2024-01-14 01:10:36 +01:00
47b721d419 Settings ToString 2024-01-14 01:04:55 +01:00
d102c970ec Output always what is could happen 2024-01-14 01:04:46 +01:00
850d9c842b Fix Missing Directory 2024-01-14 00:42:14 +01:00
ceb7fb087c Adjusted default values. 2024-01-14 00:42:05 +01:00
bc43aba60e Generalized implementation and added log for Shockers 2024-01-14 00:37:52 +01:00
c418bb0460 Cleanup 2024-01-14 00:32:05 +01:00
bd41858a17 Write CS2 Events to seperate directory 2024-01-14 00:30:59 +01:00
6eb1c2c25a OpenShock, Range for Duration and Intensity (ConfiuguredInteger), CS2 Message Handler 2024-01-14 00:30:25 +01:00
685a3f4f41 Settings File 2024-01-14 00:07:55 +01:00
4b90db389d Added list of shockerIds to abstract class Shocker 2024-01-13 23:54:15 +01:00
ae278b402e Happy IntelliJ 2024-01-13 23:24:51 +01:00
cfd5d2e2c3 Fix IsRunning in GSIServer 2024-01-13 23:11:44 +01:00
1673310db6 Dictionary 2024-01-13 23:11:33 +01:00
3dabf95bb0 GSI Server 2024-01-13 22:31:48 +01:00
24821b84e9 prefix ending 2024-01-13 21:46:38 +01:00
18543a14e5 abstract class Shocker 2024-01-13 21:44:04 +01:00
48097a6319 GSI Post Server 2024-01-13 21:43:53 +01:00
bf2acf6835 Main Method 2024-01-13 21:43:43 +01:00
f3fd128173 gamestate.cfg file and ressource 2024-01-13 21:43:21 +01:00
f3dabc0e3f Dictionary 2024-01-13 21:43:04 +01:00
fb23f94e4e Install GSI 2024-01-13 21:42:48 +01:00
e5ba8b1871 Directory 2024-01-13 20:59:23 +01:00
5e4d9599ba GetInstallDirectory(appId) for any SteamApp 2024-01-13 20:58:54 +01:00
bc25d7d384 Directory 2024-01-13 20:56:26 +01:00
15 changed files with 586 additions and 1 deletions

View File

@ -0,0 +1,7 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CS/@EntryIndexedValue">CS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GSI/@EntryIndexedValue">GSI</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=appmanifest/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=freezetime/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=libraryfolders/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=steamapps/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -0,0 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/ResxEditorPersonal/CheckedGroups/=OpenCS2hock_002FResources/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/ResxEditorPersonal/Initialized/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -0,0 +1,76 @@
using Newtonsoft.Json.Linq;
namespace OpenCS2hock;
internal class CS2MessageHandler
{
internal delegate void CS2EventHandler();
internal event CS2EventHandler? OnKill;
internal event CS2EventHandler? OnDeath;
internal event CS2EventHandler? OnRoundStart;
internal event CS2EventHandler? OnRoundEnd;
internal event CS2EventHandler? OnRoundWin;
internal event CS2EventHandler? OnRoundLoss;
internal void HandleCS2Message(string message, string mySteamId)
{
JObject messageJson = JObject.Parse(message);
string? steamId = messageJson.SelectToken("player.steamid", false)?.Value<string>();
if (steamId is null || steamId != mySteamId)
{
Console.WriteLine("Not my steamid");
return;
}
RoundState currentRoundState = ParseRoundStateFromString(messageJson.SelectToken("round.phase", false)?.Value<string>());
RoundState previousRoundState = ParseRoundStateFromString(messageJson.SelectToken("previously.round.phase", false)?.Value<string>());
if(previousRoundState == RoundState.Over && currentRoundState == RoundState.Live)
OnRoundStart?.Invoke();
if(previousRoundState == RoundState.Live && currentRoundState == RoundState.FreezeTime)
OnRoundEnd?.Invoke();
if(previousRoundState == RoundState.Live && currentRoundState == RoundState.Over)
OnRoundEnd?.Invoke();
Team playerTeam = ParseTeamFromString(messageJson.SelectToken("player.team", false)?.Value<string>());
Team winnerTeam = ParseTeamFromString(messageJson.SelectToken("round.win_team", false)?.Value<string>());
if(winnerTeam != Team.None && playerTeam == winnerTeam)
OnRoundWin?.Invoke();
else if(winnerTeam != Team.None && playerTeam != winnerTeam)
OnRoundLoss?.Invoke();
int? previousDeaths = messageJson.SelectToken("previously.player.match_stats.deaths", false)?.Value<int>();
int? currentDeaths = messageJson.SelectToken("player.match_stats.deaths", false)?.Value<int>();
if(currentDeaths > previousDeaths)
OnDeath?.Invoke();
int? previousKills = messageJson.SelectToken("previously.player.match_stats.kills", false)?.Value<int>();
int? currentKills = messageJson.SelectToken("player.match_stats.kills", false)?.Value<int>();
if(currentKills > previousKills)
OnKill?.Invoke();
}
private RoundState ParseRoundStateFromString(string? str)
{
return str switch
{
"live" => RoundState.Live,
"freezetime" => RoundState.FreezeTime,
"over" => RoundState.Over,
_ => RoundState.Unknown
};
}
private Team ParseTeamFromString(string? str)
{
return str switch
{
"T" => Team.T,
"CT" => Team.CT,
_ => Team.None
};
}
private enum RoundState {FreezeTime, Live, Over, Unknown}
private enum Team {T, CT, None}
}

View File

@ -0,0 +1,17 @@
namespace OpenCS2hock;
internal class ConfiguredInteger
{
private readonly int _min, _max;
internal ConfiguredInteger(int min = 0, int max = 50)
{
this._min = min;
this._max = max;
}
internal int GetValue()
{
return Random.Shared.Next(_min, _max);
}
}

51
OpenCS2hock/GSIServer.cs Normal file
View File

@ -0,0 +1,51 @@
using System.Net;
using System.Text;
namespace OpenCS2hock;
internal class GSIServer
{
private HttpListener HttpListener { get; init; }
internal delegate void OnMessageEventHandler(string content);
internal event OnMessageEventHandler? OnMessage;
private bool _keepRunning = true;
internal bool IsRunning { get; private set; }
internal GSIServer(int port)
{
HttpListener = new HttpListener();
HttpListener.Prefixes.Add($"http://127.0.0.1:{port}/");
HttpListener.Start();
Thread connectionListener = new (HandleConnection);
connectionListener.Start();
IsRunning = true;
}
private async void HandleConnection()
{
while (_keepRunning)
{
HttpListenerContext context = await HttpListener.GetContextAsync();
HttpListenerRequest request = context.Request;
Console.WriteLine($"[{request.HttpMethod}] {request.Url} - {request.UserAgent}");
HttpResponseMessage responseMessage = new (HttpStatusCode.Accepted);
context.Response.OutputStream.Write(Encoding.UTF8.GetBytes(responseMessage.ToString()));
StreamReader reader = new (request.InputStream, request.ContentEncoding);
string content = await reader.ReadToEndAsync();
OnMessage?.Invoke(content);
}
HttpListener.Close();
IsRunning = false;
}
internal void Dispose()
{
_keepRunning = false;
}
}

59
OpenCS2hock/Installer.cs Normal file
View File

@ -0,0 +1,59 @@
using Microsoft.Win32;
using Newtonsoft.Json;
namespace OpenCS2hock;
public static class Installer
{
internal static Settings GetSettings(string? path = null)
{
string settingsFilePath = path ?? "config.json";
if (!File.Exists(settingsFilePath))
File.WriteAllText(settingsFilePath, JsonConvert.SerializeObject(new Settings(), Formatting.Indented));
return JsonConvert.DeserializeObject<Settings>(File.ReadAllText(settingsFilePath));
}
internal static List<Shocker> GetShockers(Settings settings)
{
List<Shocker> shockers = new();
shockers.Add(new OpenShock(settings.OpenShockSettings.Endpoint, settings.OpenShockSettings.ApiKey,
settings.OpenShockSettings.Shockers,
new ConfiguredInteger(settings.IntensityRange.Min, settings.IntensityRange.Max),
new ConfiguredInteger(settings.DurationRange.Min, settings.DurationRange.Max)));
return shockers;
}
internal static void InstallGsi()
{
string installLocation = Path.Combine(GetInstallDirectory(), "game\\csgo\\cfg\\gamestate_integration_opencs2hock.cfg");
File.WriteAllText(installLocation, Resources.GSI_CFG_Content);
}
private static string GetInstallDirectory(int appId = 730)
{
string steamInstallation =
#pragma warning disable CA1416 //Registry only available on Windows
(string)(Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Valve\Steam", "SteamPath", null) ??
#pragma warning restore CA1416
throw new DirectoryNotFoundException("No Steam Installation found."));
string libraryFolderFilepath = Path.Combine(steamInstallation, "steamapps\\libraryfolders.vdf");
string? libraryPath = null;
string? appManifestFolderPath = null;
foreach (string line in File.ReadAllLines(libraryFolderFilepath))
if (line.Contains("path"))
libraryPath = line.Split("\"").Last(split => split.Length > 0);
else if (line.Contains($"\"{appId}\""))
appManifestFolderPath = Path.Combine(libraryPath!, $"steamapps\\appmanifest_{appId}.acf");
string installationPath = "";
if (appManifestFolderPath is null)
throw new DirectoryNotFoundException($"No {appId} Installation found.");
foreach(string line in File.ReadAllLines(appManifestFolderPath))
if (line.Contains("installdir"))
installationPath = Path.Combine(libraryPath!, "steamapps\\common", line.Split("\"").Last(split => split.Length > 0));
return installationPath;
}
}

View File

@ -0,0 +1,69 @@
namespace OpenCS2hock;
public class OpenCS2hock
{
private GSIServer GSIServer { get; init; }
private readonly CS2MessageHandler _cs2MessageHandler;
private readonly List<Shocker> _shockers;
private readonly Settings _settings;
public OpenCS2hock(string? settingsPath = null)
{
_settings = Installer.GetSettings(settingsPath);
this._shockers = Installer.GetShockers(_settings);
Console.WriteLine(_settings);
Installer.InstallGsi();
this._cs2MessageHandler = new CS2MessageHandler();
this.SetupEventHandlers();
this.GSIServer = new GSIServer(3000);
this.GSIServer.OnMessage += OnGSIMessage;
Thread runningThread = new(() =>
{
while (GSIServer.IsRunning)
Thread.Sleep(10);
});
runningThread.Start();
}
private void SetupEventHandlers()
{
foreach (Shocker shocker in this._shockers)
{
foreach (KeyValuePair<string, string> kv in _settings.Actions)
{
switch (kv.Key)
{
case "OnKill":
this._cs2MessageHandler.OnKill += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
case "OnDeath":
this._cs2MessageHandler.OnDeath += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
case "OnRoundStart":
this._cs2MessageHandler.OnRoundStart += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
case "OnRoundEnd":
this._cs2MessageHandler.OnRoundEnd += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
case "OnRoundLoss":
this._cs2MessageHandler.OnRoundLoss += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
case "OnRoundWin":
this._cs2MessageHandler.OnRoundWin += () => shocker.Control(Settings.StringToAction(kv.Value));
break;
}
}
}
}
private void OnGSIMessage(string content)
{
Directory.CreateDirectory(Path.Combine(Environment.CurrentDirectory, "CS2Events"));
string fileName = Path.Combine(Environment.CurrentDirectory, "CS2Events" ,$"{DateTime.Now.ToLongTimeString().Replace(':','.')}.json");
File.WriteAllText(fileName, content);
_cs2MessageHandler.HandleCS2Message(content, _settings.SteamId);
}
}

View File

@ -8,4 +8,23 @@
<RootNamespace>OpenCS2Hock</RootNamespace> <RootNamespace>OpenCS2Hock</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<EmbeddedResource Update="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Update="Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project> </Project>

44
OpenCS2hock/OpenShock.cs Normal file
View File

@ -0,0 +1,44 @@
using System.Net.Http.Headers;
using System.Text;
namespace OpenCS2hock;
internal class OpenShock : Shocker
{
protected override void ControlInternal(ControlAction action, string shockerId, int intensity, int duration)
{
HttpRequestMessage request = new (HttpMethod.Post, $"{Endpoint}/1/shockers/control")
{
Headers =
{
UserAgent = { new ProductInfoHeaderValue("OpenCS2hock", "1") },
Accept = { new MediaTypeWithQualityHeaderValue("application/json") }
},
Content = new StringContent(@"[ { "+
$"\"id\": \"{shockerId}\"," +
$"\"type\": {ControlActionToByte(action)},"+
$"\"intensity\": {intensity},"+
$"\"duration\": {duration}"+
"}]", Encoding.UTF8, new MediaTypeHeaderValue("application/json"))
};
request.Headers.Add("OpenShockToken", ApiKey);
HttpResponseMessage response = this.HttpClient.Send(request);
Console.WriteLine($"{request.RequestUri} response: {response.StatusCode}");
}
private byte ControlActionToByte(ControlAction action)
{
return action switch
{
ControlAction.Beep => 3,
ControlAction.Vibrate => 2,
ControlAction.Shock => 1,
_ => 0
};
}
internal OpenShock(string endpoint, string apiKey, string[] shockerIds, ConfiguredInteger intensity, ConfiguredInteger duration) : base(endpoint, apiKey, shockerIds, intensity, duration)
{
}
}

View File

@ -4,6 +4,6 @@ public class Program
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
OpenCS2hock openCS2Hock = new OpenCS2hock();
} }
} }

88
OpenCS2hock/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,88 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenCS2hock {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenCS2Hock.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to &quot;OpenCS2hock&quot;
///{
///&quot;uri&quot; &quot;http://127.0.0.1:3000&quot;
///&quot;timeout&quot; &quot;5.0&quot;
///&quot;buffer&quot; &quot;0.1&quot;
///&quot;throttle&quot; &quot;0.5&quot;
///&quot;heartbeat&quot; &quot;60.0&quot;
///&quot;output&quot;
/// {
/// &quot;precision_time&quot; &quot;3&quot;
/// &quot;precision_position&quot; &quot;1&quot;
/// &quot;precision_vector&quot; &quot;3&quot;
/// }
///&quot;data&quot;
/// {
/// &quot;provider&quot; &quot;1&quot; // general info about client being listened to: game name, appid, client steamid, etc.
/// &quot;map&quot; &quot;1&quot; // map, gamemode, and current match phase (&apos;warmup&apos;, &apos;intermission&apos;, &apos;gameover&apos;, &apos;live&apos;) and current score
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string GSI_CFG_Content {
get {
return ResourceManager.GetString("GSI_CFG_Content", resourceCulture);
}
}
}
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="GSI_CFG_Content" type="System.Resources.ResXFileRef">
<value>gamestate_integration_opencs2hock.cfg;System.String, mscorlib, Version=4.0.0.0, Culture=neutral</value>
</data>
</root>

68
OpenCS2hock/Settings.cs Normal file
View File

@ -0,0 +1,68 @@
using Newtonsoft.Json;
namespace OpenCS2hock;
public struct Settings
{
public string SteamId = "";
public OpenShockSettings OpenShockSettings = new()
{
Endpoint = "https://api.shocklink.net",
ApiKey = "",
Shockers = Array.Empty<string>()
};
public Range IntensityRange = new ()
{
Min = 20,
Max = 60
};
public Range DurationRange = new()
{
Min = 1000,
Max = 1000
};
public Dictionary<string, string> Actions = new()
{
{"OnKill", "Nothing"},
{"OnDeath", "Shock"},
{"OnRoundStart", "Vibrate"},
{"OnRoundEnd", "Nothing"},
{"OnRoundWin", "Beep"},
{"OnRoundLoss", "Nothing"}
};
public Settings()
{
}
public override string ToString()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
internal static Shocker.ControlAction StringToAction(string str)
{
return str.ToLower() switch
{
"shock" => Shocker.ControlAction.Shock,
"vibrate" => Shocker.ControlAction.Vibrate,
"beep" => Shocker.ControlAction.Beep,
_ => Shocker.ControlAction.Nothing
};
}
}
public struct OpenShockSettings
{
public string Endpoint, ApiKey;
public string[] Shockers;
}
public struct Range
{
public short Min, Max;
}

37
OpenCS2hock/Shocker.cs Normal file
View File

@ -0,0 +1,37 @@
namespace OpenCS2hock;
internal abstract class Shocker
{
protected readonly HttpClient HttpClient;
protected readonly string ApiKey,Endpoint;
private readonly string[] _shockerIds;
private readonly ConfiguredInteger _intensity, _duration;
internal enum ControlAction { Beep, Vibrate, Shock, Nothing }
internal void Control(ControlAction action, string? shockerId = null)
{
int intensity = _intensity.GetValue();
int duration = _duration.GetValue();
Console.WriteLine($"{action} {intensity} {duration}");
if (action is ControlAction.Nothing)
return;
if(shockerId is null)
foreach (string shocker in _shockerIds)
ControlInternal(action, shocker, intensity, duration);
else
ControlInternal(action, shockerId, intensity, duration);
}
protected abstract void ControlInternal(ControlAction action, string shockerId, int intensity, int duration);
protected Shocker(string endpoint, string apiKey, string[] shockerIds, ConfiguredInteger intensity, ConfiguredInteger duration)
{
this.Endpoint = endpoint;
this.ApiKey = apiKey;
this.HttpClient = new HttpClient();
this._shockerIds = shockerIds;
this._intensity = intensity;
this._duration = duration;
}
}

View File

@ -0,0 +1,23 @@
"OpenCS2hock"
{
"uri" "http://127.0.0.1:3000"
"timeout" "2.0"
"buffer" "0.0"
"throttle" "0.1"
"heartbeat" "60.0"
"output"
{
"precision_time" "3"
"precision_position" "1"
"precision_vector" "3"
}
"data"
{
"provider" "1" // general info about client being listened to: game name, appid, client steamid, etc.
"map" "1" // map, gamemode, and current match phase ('warmup', 'intermission', 'gameover', 'live') and current score
"round" "1" // round phase ('freezetime', 'over', 'live'), bomb state ('planted', 'exploded', 'defused'), and round winner (if any)
"player_id" "1" // player name, clan tag, observer slot (ie key to press to observe this player) and team
"player_state" "1" // player state for this current round such as health, armor, kills this round, etc.
"player_match_stats" "1" // player stats this match such as kill, assists, score, deaths and MVPs
}
}