The definitive open-source tool for connecting to Source Engine servers
T

The definitive open-source tool for connecting to Source Engine servers

The definitive open-source tool for connecting to Source Engine servers

80 stars
N/A forks
N/A contributors

README

Project documentation from GitHub

Source.NET: The Definitive Tool for Connecting to Source Engine Servers

If you've ever wanted to build a tool that interacts with a Counter-Strike, Team Fortress 2, or any other Source Engine game server, you know the initial hurdle: the protocol. Parsing server info, player lists, and rules directly from a game server's A2S protocol isn't trivial. That's where Source.NET comes in.

This open-source library cuts through the complexity. It's a clean, modern .NET implementation that handles the gritty details of communicating with Source servers, so you can focus on building your dashboard, server browser, or admin tool.

What It Does

Source.NET is a .NET library that provides a straightforward API for querying Source Engine game servers. It handles the low-level network communication and data parsing for the A2S (Authoritative Server) queries defined by Valve. With just a server's IP and port, you can easily retrieve:

  • Server Info: Map, player count, server name, and game mode.
  • Player Details: A list of current players and their scores.
  • Server Rules: A key-value list of the server's configuration (sv_tags, etc.).

It abstracts the socket management, byte order handling, and challenge response flow into simple, awaitable methods.

Why It's Cool

The clever part is in its design. Instead of being a monolithic application, it's a focused library. This makes it incredibly easy to drop into any .NET project—be it a console app, a web backend, or a desktop utility. The API is intuitive; getting server info is essentially a one-liner.

It's also a great example of a library doing one thing and doing it well. It doesn't try to be a full RCON client or a server manager. It excels at querying public server data, which is the foundation for so many other tools. For developers, it's a massive time-saver. You don't have to re-implement the protocol or wrestle with binary readers; you just get structured data back.

How to Try It

Getting started is standard .NET fare. You can add it to your project via NuGet.

dotnet add package SourceQuery

Or, if you prefer to browse the code and see how it's built (it's a great learning resource for network programming), clone the repository:

git clone https://github.com/marchc1/Source.NET.git

Here's a minimal example of what your code might look like:

using SourceQuery; var info = await SourceServer.GetInfoAsync("127.0.0.1", 27015);
Console.WriteLine($"Server: {info.Name}");
Console.WriteLine($"Map: {info.Map}");
Console.WriteLine($"Players: {info.Players}/{info.MaxPlayers}");

Final Thoughts

As a developer, I appr

Did you like this issue?

Join our weekly newsletter

Love discovering amazing projects?

Help us continue bringing you the best open-source discoveries every week.

Back to Projects
Last updated: Mar 17, 2026