RustRcon_Client 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RustRcon_Client --version 1.1.0                
NuGet\Install-Package RustRcon_Client -Version 1.1.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="RustRcon_Client" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RustRcon_Client --version 1.1.0                
#r "nuget: RustRcon_Client, 1.1.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 RustRcon_Client as a Cake Addin
#addin nuget:?package=RustRcon_Client&version=1.1.0

// Install RustRcon_Client as a Cake Tool
#tool nuget:?package=RustRcon_Client&version=1.1.0                

Welcome to RustRcon!

Features:

  • Server
  • Get ServerInfo.
  • Stop/Restart server.
  • Send console command.
  • On chat/console message events.
  • Player
  • Kick/Ban player.
  • Get players ban list.
  • Kill player.
  • Get player info.
  • Oxide
  • Get plugin list.
  • Reload plugin.
  • Load/Unload plugin.

Install:

Self Build:

You should compile the library project and add a dependency to your project RustRcon.dll

RustRcon is available on the NuGet Gallery, as still a release version:

You can add RustRcon to your project with the NuGet Package Manager, by using the following command in the Package Manager Console.

PM> Install-Package RustRcon_Client 

Usage

Step 1:

Required namespace.

using RustRcon;

The RconClient class exists in the RustRcon namespace.

Step 2:

Creating a new instance of the RconClient class with the adress, port and password.

RconClient rconClient = new RconClient("localhost", 28016, "root");
Step 3:

Setting the events, example:

rconClient.OnChatMessage += (e) =>
{
    Console.WriteLine($"{e.Username}: {e.Message}");
    e.Dispose();
};

rconClient.OnConsoleMessage += (e) =>
{
    Console.WriteLine($"{e.Message}");
    e.Dispose();
};
Step 4:

Connecting to server.

await rconClient.ConnectAsync();
Step 5:

When sending a command to the server, commands take the necessary arguments in their constructor, after asynchronous waiting for the result the response will be in command.ServerResponse.Content (json) and if the command has a unique response, it will be in command.Result

var command = GetServerInfo.Create();
await rconClient.SendCommandAsync(command);

Console.WriteLine($"{command.Id} - {command.ServerResponse?.Id} : {command.Result?.Hostname}");
command.Dispose();

Attention: If the function does not have a specific return value, the Result will also contain ServerResponse <br> And don't forget to call Dispose on commands and messages after use.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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
1.1.1 139 7/21/2024
1.1.0 95 7/10/2024
1.0.4 642 3/13/2022
1.0.3 427 3/13/2022
1.0.2 434 3/13/2022
1.0.1 434 3/8/2022
1.0.0 441 3/8/2022