CoreRCON 5.4.0

dotnet add package CoreRCON --version 5.4.0
NuGet\Install-Package CoreRCON -Version 5.4.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="CoreRCON" Version="5.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CoreRCON --version 5.4.0
#r "nuget: CoreRCON, 5.4.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.
// Install CoreRCON as a Cake Addin
#addin nuget:?package=CoreRCON&version=5.4.0

// Install CoreRCON as a Cake Tool
#tool nuget:?package=CoreRCON&version=5.4.0

CoreRcon

Nuget Nuget

CoreRCON is an implementation of the RCON protocol on .NET Core. It currently supports connecting to a server, sending commands and receiving their output, multi-packat responses, and receiving logs from logaddress.

Supports:

Quick Start

Connect to an RCON server and send a command

The IP address supplied here is the server you wish to connect to.

using CoreRCON;
using CoreRCON.Parsers.Standard;
using System.Net;
// ...

// Connect to a server
var rcon = new RCON(IPAddress.Parse("10.0.0.1"), 27015, "secret-password");
await rcon.ConnectAsync();

// Send a simple command and retrive response as string
string respnose = await rcon.SendCommandAsync("echo hi");

// Send "status" and try to parse the response
Status status = await rcon.SendCommandAsync<Status>("status");

Console.WriteLine($"Connected to: {status.Hostname}");

Listen for chat messages on the server

This assumes you have been added to the server's logaddress list. You do not need to make an rcon connection to receive logs from a server.

The port specified must be open (check your router settings) and unused. Pass a value of 0 to use the first-available port. Access log.ResolvedPort to see which port it chose.

Finally, pass an array (or list of params) of IPEndPoints to express which servers you would like to receive logs from. This is because any server can send your server logs if they know which port you are listening on, as it's just UDP.

using CoreRCON;
using CoreRCON.Parsers.Standard;
// ...

// Listen on port 50000 for log packets coming from 10.0.0.1:27015
var log = new LogReceiver(50000, new IPEndPoint(IPAddress.Parse("10.0.0.1"), 27015));
log.Listen<ChatMessage>(chat =>
{
	Console.WriteLine($"Chat message: {chat.Player.Name} said {chat.Message} on channel {chat.Channel}");
});

Troubleshooting

Can't install via NuGet

"Could not install package 'CoreRCON X.X.X'. You are trying to install this package into a project that targets '.NETFramework,Version=vy.y.y', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."

If you are seeing an error similar to this, try changing your project's targeted .NET Framework version [#11]. If you are using Visual Studio 2015, the minimum resolvable framework version is 4.7. Visual Studio 2017 has improved support for .NET Core packages, allowing CoreRCON to resolve for versions as low as 4.6.1.

Changelog

See Github Releases

Big thanks to ScottKaye for developing the original version

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CoreRCON:

Package Downloads
MinecraftConnectionCore

It is based on CoreRCON and extended for minecraft. This library can be used without being aware of asynchronous processing. It also provides basic minecraft commands, so that you can easily execute commands without knowing them.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on CoreRCON:

Repository Stars
LANCommander/LANCommander
Version Downloads Last updated
5.4.0 786 2/18/2024
5.3.2 299 1/30/2024
5.3.1 209 1/24/2024
5.3.0 80 1/24/2024
5.2.1 1,325 10/30/2023
5.2.0 147 10/26/2023
5.1.0 245 10/5/2023
5.0.5 3,986 5/9/2022
5.0.3 502 4/20/2022
5.0.2 2,316 2/24/2021
5.0.0 1,820 9/22/2020
4.7.1 565 9/22/2020
4.7.0 1,677 5/26/2020
4.6.0 949 3/19/2020
4.5.1 1,315 12/8/2019
3.0.0 2,380 7/25/2017
2.0.0 1,458 12/11/2016
1.1.0 1,299 12/10/2016
1.0.1 1,188 11/26/2016
0.0.5 1,331 11/17/2016
0.0.4 1,160 11/14/2016
0.0.3 1,146 11/12/2016
0.0.2 1,689 11/8/2016
0.0.1 1,576 11/8/2016