Skip to content

Add rcon exec and rcon eval commands #87

@sakuro

Description

@sakuro

Summary

Add factorix rcon exec and factorix rcon eval commands using the rcon-client gem to control a running Factorio server via RCON.

Commands

  • factorix rcon exec <command> — send a Factorio console command (e.g. /server-save)
  • factorix rcon eval <script> — evaluate a Lua script (e.g. rcon.print(game.tick))

Details

  • Add rcon-client gem dependency
  • Add setting :rcon block to Factorix config (host, port, password); each command accepts --host, --port, --password options to override config values
  • rcon eval wraps the script in /c <script> before sending
  • RCon::Client must be opened with sentinel_command: "/c" — Factorio does not respond to an empty sentinel, which would cause execute to hang
  • Map RCon::Client::ConnectionError / AuthenticationError to a new Factorix::RCONError hierarchy under InfrastructureError

New error classes

RCONError < InfrastructureError
  RCONConnectionError < RCONError
  RCONAuthenticationError < RCONError

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions