From 86e8feaabc64398e6923fbd1ea2ad0dd4ff16079 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 14 Oct 2023 10:07:56 -0400 Subject: [PATCH] #358 fixed non-networked PLC operation --- reactor-plc/plc.lua | 18 +++++++++++------- reactor-plc/startup.lua | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/reactor-plc/plc.lua b/reactor-plc/plc.lua index 02d7c3d..a2dfd73 100644 --- a/reactor-plc/plc.lua +++ b/reactor-plc/plc.lua @@ -54,13 +54,17 @@ function plc.load_config() cfv.assert_type_bool(config.Networked) cfv.assert_type_int(config.UnitID) cfv.assert_type_bool(config.EmerCoolEnable) - cfv.assert_channel(config.SVR_Channel) - cfv.assert_channel(config.PLC_Channel) - cfv.assert_type_int(config.ConnTimeout) - cfv.assert_min(config.ConnTimeout, 2) - cfv.assert_type_num(config.TrustedRange) - cfv.assert_min(config.TrustedRange, 0) - cfv.assert_type_str(config.AuthKey) + + if config.Networked == true then + cfv.assert_channel(config.SVR_Channel) + cfv.assert_channel(config.PLC_Channel) + cfv.assert_type_int(config.ConnTimeout) + cfv.assert_min(config.ConnTimeout, 2) + cfv.assert_type_num(config.TrustedRange) + cfv.assert_min(config.TrustedRange, 0) + cfv.assert_type_str(config.AuthKey) + end + cfv.assert_type_int(config.LogMode) cfv.assert_type_str(config.LogPath) cfv.assert_type_bool(config.LogDebug) diff --git a/reactor-plc/startup.lua b/reactor-plc/startup.lua index 7ad0d27..dde862e 100644 --- a/reactor-plc/startup.lua +++ b/reactor-plc/startup.lua @@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc") local renderer = require("reactor-plc.renderer") local threads = require("reactor-plc.threads") -local R_PLC_VERSION = "v1.6.0" +local R_PLC_VERSION = "v1.6.1" local println = util.println local println_ts = util.println_ts @@ -69,7 +69,7 @@ local function main() ppm.mount_all() -- message authentication init - if string.len(config.AuthKey) > 0 then + if type(config.AuthKey) == "string" and string.len(config.AuthKey) > 0 then network.init_mac(config.AuthKey) end