CodeLogic.GameNetQuery
4.6.69-preview
See the version list below for details.
dotnet add package CodeLogic.GameNetQuery --version 4.6.69-preview
NuGet\Install-Package CodeLogic.GameNetQuery -Version 4.6.69-preview
<PackageReference Include="CodeLogic.GameNetQuery" Version="4.6.69-preview" />
<PackageVersion Include="CodeLogic.GameNetQuery" Version="4.6.69-preview" />
<PackageReference Include="CodeLogic.GameNetQuery" />
paket add CodeLogic.GameNetQuery --version 4.6.69-preview
#r "nuget: CodeLogic.GameNetQuery, 4.6.69-preview"
#:package CodeLogic.GameNetQuery@4.6.69-preview
#addin nuget:?package=CodeLogic.GameNetQuery&version=4.6.69-preview&prerelease
#tool nuget:?package=CodeLogic.GameNetQuery&version=4.6.69-preview&prerelease
CodeLogic.GameNetQuery
Query and administer game servers from CodeLogic 4 — Valve A2S over UDP, Source RCON, and Minecraft GameSpy4 / RCON.
Speaks the wire protocols used by Source-engine and Minecraft servers: A2S over UDP for live server info and player lists, the Source RCON TCP protocol for remote console commands (with high-level Counter-Strike 2 / Counter-Strike: Source admin wrappers), and Minecraft's GameSpy4 UDP query plus RCON. No external NuGet dependencies.
Install
dotnet add package CodeLogic.GameNetQuery
Quick start
The query clients are used directly by namespace — they don't need a library instance. Load the library only when you want its lifecycle and health-check integration.
using CL.GameNetQuery.Valve;
using CL.GameNetQuery.Models;
// A2S UDP — live server info (no library load required)
ServerInfo? info = await ValveUdpQuery.GetServerInfoAsync("203.0.113.10", 27015);
if (info is { IsOnline: true })
Console.WriteLine($"{info.Hostname} — {info.Map} ({info.PlayerCount}/{info.MaxPlayers})");
List<PlayerInfo> players = await ValveUdpQuery.GetPlayerListAsync("203.0.113.10", 27015);
foreach (var p in players)
Console.WriteLine($"{p.Name} score {p.Score} {p.Ping}ms");
// Source RCON — remote console command
using var rcon = new ValveRconClient("203.0.113.10", 27015, "rcon-password");
if (await rcon.ConnectAsync())
Console.WriteLine(await rcon.SendCommandAsync("status"));
To wire the library into CodeLogic's lifecycle (so it participates in health checks):
using CL.GameNetQuery;
await Libraries.LoadAsync<GameNetQueryLibrary>(); // register before ConfigureAsync()
await CodeLogic.ConfigureAsync();
await CodeLogic.StartAsync();
Features
- Valve A2S UDP query —
ValveUdpQuery.GetServerInfoAsync/GetPlayerListAsyncreturn typedServerInfo?andList<PlayerInfo>; failures returnnull/ an empty list rather than throwing. - Source RCON —
ValveRconClientconnects over TCP and runs console commands, returning the raw server response string. - Counter-Strike admin wrappers —
CounterStrike2andCounterStrikeSourceexpose named helpers (change map, kick/ban, say, cvars, restart…) over RCON; CS2 adds cheats, friendly-fire, team-balance, and slay. statusparsers —ValveStatusParserandValveStatusParserCS2turn rawstatusoutput intoServerInfo/PlayerInfo.- Minecraft —
MinecraftQueryClient(GameSpy4 UDP query withGetStatusValuefield lookup) andMinecraftRconClient(RCON).
Configuration
None. CL.GameNetQuery is a zero-config library — it writes no config file. Every connection parameter (IP, port, RCON password, timeout) is passed directly to the query clients at call time.
Documentation
Full guide: CL.GameNetQuery documentation
Requirements
- CodeLogic 4 · .NET 10
- No external NuGet dependencies.
License
MIT — see LICENSE.
| Product | Versions 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. |
-
net10.0
- CodeLogic (>= 4.0.0 && < 5.0.0)
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 | 40 | 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 |
# CL.GameNetQuery — Changelog
All notable changes to **CodeLogic.GameNetQuery** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).
## 2026-06-20
### Documentation
- Full rewrite of the README and the `docs/libs/gamenetquery.md` deep-dive to the current
CodeLogic house style.
- Clarified that the library is zero-config and that the query clients (`ValveUdpQuery`,
`ValveRconClient`, `CounterStrike2`/`CounterStrikeSource`, the status parsers, and the
Minecraft clients) are used directly by namespace — the `GameNetQueryLibrary` instance is
only needed for lifecycle/health integration.
- Documented that the query clients return model types directly (`ServerInfo?`,
`List<PlayerInfo>`, response strings) rather than the framework `Result`, including the
no-throw failure contracts.
- Added field tables for `ServerInfo` and `PlayerInfo`, method tables for both Counter-Strike
wrappers (shared set vs. CS2-only extras), and the `ValveStatusParser` /
`ValveStatusParserCS2` parser surfaces.
- No functional code changes.
## [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).