CodeLogic.GameNetQuery 4.5.2-preview.68

This is a prerelease version of CodeLogic.GameNetQuery.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeLogic.GameNetQuery --version 4.5.2-preview.68
                    
NuGet\Install-Package CodeLogic.GameNetQuery -Version 4.5.2-preview.68
                    
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="CodeLogic.GameNetQuery" Version="4.5.2-preview.68" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.GameNetQuery" Version="4.5.2-preview.68" />
                    
Directory.Packages.props
<PackageReference Include="CodeLogic.GameNetQuery" />
                    
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 CodeLogic.GameNetQuery --version 4.5.2-preview.68
                    
#r "nuget: CodeLogic.GameNetQuery, 4.5.2-preview.68"
                    
#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 CodeLogic.GameNetQuery@4.5.2-preview.68
                    
#: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=CodeLogic.GameNetQuery&version=4.5.2-preview.68&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.GameNetQuery&version=4.5.2-preview.68&prerelease
                    
Install as a Cake Tool

CodeLogic.GameNetQuery

NuGet

Game server query library for CodeLogic — Valve Source Engine (CSS, CS2) and Minecraft server queries via UDP and RCON.

Install

dotnet add package CodeLogic.GameNetQuery

Quick Start

// Valve Source Engine -- UDP query (no password needed)
var serverInfo = await ValveUdpQuery.GetServerInfoAsync("192.168.1.10", 27015);
Console.WriteLine($"{serverInfo?.Hostname} - {serverInfo?.PlayerCount}/{serverInfo?.MaxPlayers}");

var players = await ValveUdpQuery.GetPlayerListAsync("192.168.1.10", 27015);

// Valve RCON -- authenticated commands
using var rcon = new ValveRconClient("192.168.1.10", 27015, "rconpassword");
if (await rcon.ConnectAsync())
{
    var response = await rcon.SendCommandAsync("status");
    Console.WriteLine(response);
}

// High-level CS2 admin wrapper over RCON
using var cs2 = new CounterStrike2("192.168.1.10", 27015, "rconpassword");
if (await cs2.ConnectAsync())
{
    var (info, players) = await cs2.GetStatusAsync();
    await cs2.ChangeMapAsync("de_dust2");
    await cs2.SayAsync("gg");
}

// Minecraft -- UDP query (synchronous; returns key:value lines)
var mcResponse = MinecraftQueryClient.QueryServer("192.168.1.20", 25565);
var motd = MinecraftQueryClient.GetStatusValue(mcResponse, "hostname");

// Minecraft -- RCON
using var mcRcon = new MinecraftRconClient("192.168.1.20", 25575, "rconpassword");
if (await mcRcon.ConnectAsync())
    Console.WriteLine(await mcRcon.SendCommandAsync("list"));

Features

  • Valve A2S_INFO -- query Source Engine server name, map, player count, and metadata via UDP
  • Valve A2S_PLAYER -- retrieve the full player list with scores and play durations
  • Valve RCON -- authenticate and execute remote console commands over TCP (string or IPAddress host)
  • CS2 / CSS admin wrappers -- CounterStrike2 and CounterStrikeSource expose typed helpers (map change, kick, ban/unban, cvars, exec config, say) plus parsed GetStatusAsync; CS2 adds cheats, friendly-fire, team-balance, and slay
  • status parsers -- ValveStatusParser (Source 1) and ValveStatusParserCS2 turn raw status output into ServerInfo + PlayerInfo, including tags, version, address, and CS2 spawngroups
  • Minecraft query -- GameSpy4 UDP protocol for server status and player info
  • Minecraft RCON -- remote console over the Source RCON protocol
  • Zero configuration -- all query classes are static or standalone; no config file needed

Configuration

CL.GameNetQuery does not require a configuration file. All query clients accept connection parameters directly.

Documentation

Full API docs: https://github.com/Media2A/CodeLogic.Libs

Requirements

License

MIT — see LICENSE

Product Compatible and additional computed target framework versions.
.NET 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. 
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
4.6.72 41 6/20/2026
4.6.69-preview 32 6/20/2026
4.5.2 112 5/24/2026
4.5.2-preview.68 54 6/20/2026
4.5.1 97 5/24/2026
4.5.1-preview.56 54 5/24/2026
4.4.2-preview.53 58 5/24/2026
4.4.1 106 5/24/2026
4.0.5 101 5/15/2026
4.0.4 109 5/9/2026
4.0.3 111 5/9/2026
3.2.12 606 4/18/2026
3.2.11 112 4/18/2026
3.2.10 106 4/18/2026
3.2.9 106 4/18/2026
3.2.8 104 4/18/2026
3.2.7 104 4/18/2026
3.2.6 106 4/18/2026
3.2.5 116 4/18/2026
3.2.4 110 4/17/2026
Loading failed

# CL.GameNetQuery — Changelog

All notable changes to **CodeLogic.GameNetQuery** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).

## [4.5.2] — 2026-06-20

### Documentation

- Documented the `CounterStrike2` / `CounterStrikeSource` admin wrappers, including the
 CS2-only helpers (`UnbanPlayerAsync`, `SetHostnameAsync`, `ExecConfigAsync`, `GetCvarAsync`,
 `EnableCheatsAsync`/`DisableCheatsAsync`, `SetFriendlyFireAsync`, `SetTeamBalanceAsync`,
 `SlayPlayerAsync`, `GetStatusRawAsync`) and the shared command subset.
- Documented the `status` parsers — `ValveStatusParser` (`GetServerAddress`, `GetVersion`,
 `GetTags`, `GetPlayerList`, `ParseStatus`/`ParseStatusWithPlayers`) and `ValveStatusParserCS2`
 (`GetPlayerList`, `GetSpawngroups`).
- Documented the `ValveRconClient(IPAddress, …)` overload, the `ushort` port and `timeoutMs`
 parameters, and the no-throw failure contracts of the UDP/RCON clients.
- Documented the full `ServerInfo`, `PlayerInfo`, and `QueryResult` shapes (with `Ok`/`Fail`).
- Corrected the docs to match the API: `ServerInfo.Hostname` (not `Name`); `QueryResult.DurationMs`
 (not `LatencyMs`) with non-null `Players`; and `MinecraftQueryClient.QueryServer` is synchronous
 and returns key/value text read via `GetStatusValue` (not an awaited `QueryResult`).
- No functional code changes.

## [4.5.0] — 2026-05-24

### Changed

- **Unified versioning.** All CodeLogic.Libs now share a single version line
 controlled by `version.txt` in the repo root. This is a version alignment
 release — no functional changes to this library.
## [4.0.4] — 2026-04-16

### Changed

- README + manifest refresh for the v4 baseline. No functional changes vs 4.0.3.
- `LibraryManifest.Version` now reads from assembly metadata.

## [4.0.2] — 2026-04-09

### Changed

- Aligned with the v4 baseline across all libraries.

## [4.0.0] — 2026-04-09

Major rewrite. Republished as v4.0.0 to reset the version line under the
unified v4 baseline. Valve A2S + Minecraft Server List Ping queries with
typed request/response models and full XML documentation.

### Notes

- Earlier history is retained in the
 [git log](https://github.com/Media2A/CodeLogic.Libs/commits/main/CL.GameNetQuery).