FactorioRconSharp 0.2.4
dotnet add package FactorioRconSharp --version 0.2.4
NuGet\Install-Package FactorioRconSharp -Version 0.2.4
<PackageReference Include="FactorioRconSharp" Version="0.2.4" />
paket add FactorioRconSharp --version 0.2.4
#r "nuget: FactorioRconSharp, 0.2.4"
// Install FactorioRconSharp as a Cake Addin #addin nuget:?package=FactorioRconSharp&version=0.2.4 // Install FactorioRconSharp as a Cake Tool #tool nuget:?package=FactorioRconSharp&version=0.2.4
Factorio RCON
Provide an RCON client for Factorio in .NET Standard 2.1. This library provides two clients:
FactorioRemoteConsole
: a low-level client that provides direct access to the factorio console, it allows to execute any string in the Factorio console through the RCON connection.FactorioRconClient
: a high-level client that exposes the runtime API model as C# symbols to help explore and type check the commands being executed
Quick start
The RCON interface must be enabled when running factorio. It must also be secured using a password.
Add the following parameters to the factorio launch command: --rcon-port 25575 --rcon-password factory
For example
bin\x64\factorio.exe --start-server saves/save.zip --rcon-port 27015 --rcon-password password
You should see a log message in the factorio console that looks like:
Info RemoteCommandProcessor.cpp:133: Starting RCON interface at IP ADDR:({0.0.0.0:27015})
Using the console
Once the server is running with RCON enabled, we can attach a client:
using FactorioRconSharp.Core;
using FactorioRemoteConsole console = new("127.0.0.1", 27015);
bool connected = await console.ConnectAsync("password");
Console.WriteLine("Connected: " + connected);
You should now see a new log message in the factorio console:
Info RemoteCommandProcessor.cpp:252: New RCON connection from IP ADDR:({127.0.0.1:57463})
Using the client
The client compiles the C# expressions that it receives into Lua commands that are executed through the console:
using FactorioRconSharp;
using FactorioRconClient client = new("127.0.0.1", 27015);
bool connected = await client.ConnectAsync("password");
Console.WriteLine("Connected: " + connected);
string mapString = await client.ReadAsync(g => g.Game.GetMapExchangeString());
Console.WriteLine($"Map string: {mapString}");
The specification used to generate the model is that of Factorio v1.1.104.
The compiler is available in the FactorioRconSharp.ClientGenerator
project.
Product | Versions 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 | 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. |
-
.NETStandard 2.1
- OneOf (>= 3.0.263)
- OneOf.SourceGenerator (>= 3.0.263)
- RconSharp (>= 2.0.1)
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 |
---|