A library for communicating with Quake III Arena RCon compatible servers.
$ dotnet add package Russlyman.RconRusslyman.Rcon is a C# .NET library for sending RCon messages to game servers that implement the Quake III Arena RCon protocol.
While this library should be compatible with any game server that implements the Quake III Arena RCon protocol, it has only been tested and confirmed working with FiveM.
using Russlyman.Rcon;
using System;
var rcon = new RconClient();
rcon.Connect("127.0.0.1", 30120, "fivem");
var reply = rcon.Send("restart Vita");
rcon.Dispose();
Console.WriteLine(reply);
RconClient(int replyTimeoutMs = 3000)
The RCon client.
replyTimeoutMs - The timeout in milliseconds for how long the client should wait for a reply from the server after a command has been sent.
void Connect(string ip, int port, string password)
Connects to a server.
This method can be used multiple times to connect to other servers without creating a new object.
ip - The IP Address for the server.
port - The RCon port for the server.
password - The RCon password for the server.
string Send(string command)
Sends a command to the server.
command - The command to send to the connected server.
The servers response to the sent command.
async Task<string> SendAsync(string command)
Asynchronously sends a command to the connected server.
command - The command to send to the server.
A task containing the servers response to the sent command.
void Dispose()
Disposes the class.
Should be called when you don't want to send anymore commands and connect to other servers.
This project is licensed under MIT which can be viewed from the LICENSE file.