StrikeLink 1.2.0

dotnet add package StrikeLink --version 1.2.0
                    
NuGet\Install-Package StrikeLink -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StrikeLink" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StrikeLink" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="StrikeLink" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StrikeLink --version 1.2.0
                    
#r "nuget: StrikeLink, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StrikeLink@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StrikeLink&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=StrikeLink&version=1.2.0
                    
Install as a Cake Tool

StrikeLInk is a modern, cross-platform .NET library for integrating with Counter-Strike 2 and related Valve ecosystem services. It provides structured access to chat events, game state changes, client services, and Valve configuration formats, all using modern C# and .NET APIs.

📦 Available on NuGet as StrikeLInk

Documentation: https://github.com/RiisDev/StrikeLink/blob/main/docs/index.md

C# Support Server GitHub Nuget All Releases


✨ Features

  • ✅ Modern C# targeting .NET 8, 9, and 10
  • 🧩 Event-driven architecture
  • 🎮 Counter-Strike 2 client & console integration
  • 💬 Global & team chat handling
  • 🗺️ Game state tracking (map, player, round)
  • ⚙️ Valve config reader & writer (JSON-styled)
  • 🌍 Cross-platform design Built on windows, untested on linux

📦 Installation

Install via NuGet:

dotnet add package StrikeLInk

Or via the NuGet Package Manager:

Install-Package StrikeLInk

🧠 Core Concepts

StrikeLInk is structured around services, events, and state integration. Consumers subscribe to events and invoke methods to interact with the game client.


💬 Chat Service

Provides access to in-game chat messages and sending capabilities.

Events

  • OnTeamChat
  • OnGlobalChat

Methods

  • SendChatAsync(NewChatMessage message)
public enum ChatChannel
{
	Team,
	Global
}

public record NewChatMessage(ChatChannel Channel, string Message);

🎮 Game State Integration

Track live game state changes through event-based updates.

Based on GameStateInteraction with help from this reddit post

Supported State Events

  • Gsi Listener

    • Offers a base event OnPostReceived for all incoming GSI payloads
  • Map State

    • MapState events
  • Player State

    • PlayerState events
  • Round State

    • RoundState events

These events allow real-time reactions to gameplay changes such as round transitions, player updates, and map changes.


🧩 Client Services

🟦 SteamService

Provides access to Steam and CS2 client data.

Methods
  • GetSteamPath()
  • TryGetGamePath(int gameId, out string path)
  • GetGamePath(int gameId)
  • GetUserConfig(long? userId)
  • GetGameLaunchOptions(int gameId)
  • GetCurrentUserId()

🖥️ ConsoleService (CS2 Console Integration)

Interact directly with the CS2 console and listen to runtime events.

Events
  • OnLogReceived
  • OnPlayerConnected
  • OnMapJoined
  • OnGlobalChatMessageReceived
  • OnTeamChatMessageReceived
  • OnUiStateChanged
  • OnAddonProgress
  • OnAddonFinished
  • OnServerJoining
  • OnServerConnected
  • OnServerDisconnected

This service enables advanced automation, monitoring, and addon integration.


⚙️ Valve Config Reader / Writer

A flexible configuration system built around JsonDocument-style APIs.

Supported Formats

  • .vcfg
  • .cfg
  • .vdf
  • .acf

Capabilities

  • Read and parse Valve configuration formats
  • Modify values using structured JSON-style access
  • Write configurations back to disk safely
  • Designed for tooling, modding, and automation

Ai Disclosure

This was made as a hobby project that I use personally to make small little programs for fun, all of my software is free and open source via MIT licensing, if you have a problem with AI do not take it up with me.

Some form of AI was used for the following items

  • Readme - I'm notoriously bad at writing readmes, but was proof read and modified after initial creation.
  • Incode ///summary Statements - I use the built in CoPilot summary auto complete to get a base summary which is then proof read and modified.
  • /DemoParser/Parsing - I extensively looked into how to do it properly and couldn't figure it out, so it wrote the files located within. (PS valve please update documentation page).
  • /Services/WebService/SqlService - I didn't want to use further nuget packages when all I needed to do was query a DB.
  • /Services/Config - Same reason as SqlService
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 95 4/7/2026
1.1.0 97 3/23/2026
1.0.0 119 1/13/2026

## New Fatures
* Static TokenService class which can be used to retreive Auth Code, Match Code, Dev API Key
* Cs2DemoParser built in demo parser (still early testing, report issues) that pull most content from a demo recording
* DemoNetwork class to Decode/Encode match share codes, as well as retrieving latest match code from API
* Cs2DemoDownloader class to download demos based on share codes (uses boiler-writer)

## Fixes
* Fixed LoginSecureService returning invalid tokens
* Fixed LoginSecureService not deleting files after creating the,
* Fixed some disposable items not being declared properly
* Fixed GsiManager not grabbing old port information
* Fixed GSI MapState Enum from erroring when a team surrenders
* Fixed GSI PlayerState Weapon Enum from erroring when using an SMG
* Fixed CoPlayService param documentation

## Changes
* ServerListener has been renamed to GsiListener to improve readability
* Win32 -> NativeMethods
* PDB is now embedded to improve debugging / error reporting
* Made a global shared HttpClient to lessen socket exhaustion