FactorioSharp.Rcon 0.3.2

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

// Install FactorioSharp.Rcon as a Cake Tool
#tool nuget:?package=FactorioSharp.Rcon&version=0.3.2

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 FactorioSharp.Rcon.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 FactorioSharp.Rcon;

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 SpecificationCompiler project.

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 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 (1)

Showing the top 1 NuGet packages that depend on FactorioSharp.Rcon:

Package Downloads
FactorioSharp.Instrumentation

Factorio instrumentation for .NET Standard 2.1

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.16 195 4/7/2024
0.3.15 263 4/4/2024
0.3.14 81 4/3/2024
0.3.13 148 4/2/2024
0.3.12 96 4/2/2024
0.3.10 153 4/1/2024
0.3.9 108 4/1/2024
0.3.8 173 4/1/2024
0.3.7 126 4/1/2024
0.3.6 142 3/31/2024
0.3.5 121 3/30/2024
0.3.4 108 3/30/2024
0.3.3 114 3/30/2024
0.3.2 132 3/30/2024
0.3.1 95 3/30/2024
0.3.0 119 3/30/2024