RCON.Net
1.1.1
dotnet add package RCON.Net --version 1.1.1
NuGet\Install-Package RCON.Net -Version 1.1.1
<PackageReference Include="RCON.Net" Version="1.1.1" />
<PackageVersion Include="RCON.Net" Version="1.1.1" />
<PackageReference Include="RCON.Net" />
paket add RCON.Net --version 1.1.1
#r "nuget: RCON.Net, 1.1.1"
#:package RCON.Net@1.1.1
#addin nuget:?package=RCON.Net&version=1.1.1
#tool nuget:?package=RCON.Net&version=1.1.1
RCON.Net.Core
The core RCON client library - a lightweight, dependency-free implementation of the RCON protocol.
Overview
RCON.Net.Core provides the fundamental building blocks for RCON communication:
- RconClient - The main client for connecting to and executing commands on RCON-enabled servers
- RconClientBuilder - A fluent builder for configuring and creating RCON client instances
- Command Framework - Base interfaces and classes for building typed command objects
- RCON Protocol - Implementation of the RCON packet format and protocol handling
Installation
Install via NuGet:
dotnet add package RCON.Net
Key Components
RconClient
Manages RCON connections and command execution.
var client = new RconClient("127.0.0.1", 25575, "password");
await client.ConnectAsync();
var response = await client.ExecuteAsync("command");
await client.DisconnectAsync();
RconClientBuilder
Fluent API for configuring RCON clients with validation and default values.
var client = RconClientBuilder.Create()
.WithHost("127.0.0.1")
.WithPort(25575)
.WithPassword("your-password")
.WithTimeout(TimeSpan.FromSeconds(5))
.Build();
Configuration Options:
WithHost(string)- Server hostname or IP addressWithPort(int)- Server RCON port (default: 25575)WithPassword(string)- RCON authentication passwordWithTimeout(TimeSpan)- Command execution timeout
ICommand Interface
Base interface for all command implementations.
public interface ICommand
{
string Build();
T? Parse<T>(string response) where T : class;
}
Commands implement:
Build()- Generates the command string to send to the serverParse<T>()- Parses server response into a typed result object
RCON Protocol
The RCON protocol is handled internally:
- Packet Structure - Standard RCON packet format with ID, type, and payload
- Authentication - Secure password-based authentication
- Request/Response - Async request/response communication
- Error Handling - Comprehensive exception handling for connection and protocol errors
Exceptions
RconException- Base exception for all RCON-related errorsRconConnectionException- Connection failuresRconAuthenticationException- Authentication failuresRconTimeoutException- Command execution timeouts
Multi-Targeting
- .NET 8.0, .NET 9.0, .NET 10.0
Usage Example
using RCON.Core;
// Create and configure client
var client = RconClientBuilder.Create()
.WithHost("127.0.0.1")
.WithPort(25575)
.WithPassword("admin-password")
.WithTimeout(TimeSpan.FromSeconds(10))
.Build();
try
{
// Connect to server
await client.ConnectAsync();
// Execute raw command
var response = await client.ExecuteAsync("say Hello World");
Console.WriteLine(response);
}
finally
{
await client.DisconnectAsync();
client.Dispose();
}
Features
? No external dependencies
? Async/await support
? Configurable timeouts
? Connection pooling support
? Thread-safe operations
? Comprehensive error handling
Documentation
For more information about the RCON protocol, see:
Related Packages
- RCON.Net.Commands - Generic command helpers
- RCON.Net.Commands.Minecraft.Java - Minecraft Java Edition commands
License
MIT License - See LICENSE file for details.
| Product | Versions 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. 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. 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
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RCON.Net:
| Package | Downloads |
|---|---|
|
RCON.Net.Commands
RCON command lib. |
GitHub repositories
This package is not used by any popular GitHub repositories.