A light weight and thread-safe RCON library for Minecraft servers written in .NET Standard 2.0 Based on MinecraftServerRCONSharp
If you come across any bugs or issues of the sort (even ideas for things I could add) please feel free to open a new issue outlining your problem :)
Due to limitations with Minecrafts own implementation of RCON, sending multiple commands to the same server from seperate or identical clients on seperate threads can result in unexpected behaviour and is not recommended
Easiest way to use this library is via NuGet
Or download the library from the releases page.
using MinecraftServerRCON;
class RCONTest
{
static void Main(string[] args)
{
using var rcon = new RCONClient();
rcon.SetupStream("127.0.0.1", 25575, "123", new ClientConfiguration());
string answer = rcon.SendMessage(RCONMessageType.Command, "gamemode creative Steve");
Console.WriteLine(answer.RemoveColorCodes());
}
}