maybe I fixed it

This commit is contained in:
2026-01-02 01:10:34 -05:00
parent 049a712780
commit e1af4945c1

View File

@ -697,37 +697,22 @@ local function handleOutgoingDial()
end end
end end
-- Check if remote iris is closed using transceiver
local remoteIrisState = nil
if transceiver then
remoteIrisState = transceiver.checkConnectedShielding()
end
local connectionSafe = false local connectionSafe = false
if remoteIrisState and remoteIrisState > 0 then -- If remote computer requested a password, show the prompt
-- Remote iris is closed (partially or fully) - UNSAFE if state.remotePasswordRequired then
utils.log("Password required by remote gate")
-- Close local iris to protect travelers -- Close local iris to protect travelers
if config.irisEnabled then if config.irisEnabled then
utils.closeIris() utils.closeIris()
end end
if remoteIrisState == 100 then
utils.log("WARNING: Remote iris is fully closed!")
else
utils.log("WARNING: Remote iris is " .. remoteIrisState .. "% closed!")
end
-- If password is required and remote has computer, show prompt now
if state.remotePasswordRequired and remoteIrisState == 100 then
utils.log("Showing password prompt for remote gate")
local result = HandlePasswordEntry() local result = HandlePasswordEntry()
-- Check if iris opened during password entry (via GDO) -- Check if iris opened during password entry (via GDO)
if result == "IRIS_OPENED" then if result == "IRIS_OPENED" then
connectionSafe = true connectionSafe = true
-- Show success message briefly
display.showPasswordResult(true) display.showPasswordResult(true)
sleep(1) sleep(1)
elseif result then elseif result then
@ -736,7 +721,7 @@ local function handleOutgoingDial()
-- Wait for response -- Wait for response
local function WaitForResponse() local function WaitForResponse()
sleep(3) -- Wait up to 3 seconds for response sleep(3)
return nil return nil
end end
@ -757,38 +742,22 @@ local function handleOutgoingDial()
end end
end end
-- Re-check iris state after password/GDO attempt -- If still not safe, show warning
if transceiver then if not connectionSafe then
remoteIrisState = transceiver.checkConnectedShielding()
if not remoteIrisState or remoteIrisState == 0 then
connectionSafe = true
end
end
end
-- Show warning screen if iris still closed
if not connectionSafe and remoteIrisState and remoteIrisState > 0 then
utils.log("DEBUG: connectionSafe=" ..
tostring(connectionSafe) .. ", remoteIrisState=" .. tostring(remoteIrisState))
mon.setBackgroundColor(colors.red) mon.setBackgroundColor(colors.red)
mon.clear() mon.clear()
mon.setTextScale(1) mon.setTextScale(1)
mon.setCursorPos(6, 5) mon.setCursorPos(6, 5)
mon.write("REMOTE IRIS") mon.write("REMOTE IRIS")
mon.setCursorPos(8, 7) mon.setCursorPos(8, 7)
if remoteIrisState == 100 then
mon.write("CLOSED!") mon.write("CLOSED!")
else
mon.write(remoteIrisState .. "% CLOSED")
end
mon.setCursorPos(3, 10) mon.setCursorPos(3, 10)
mon.write("Connection unsafe") mon.write("Connection unsafe")
display.drawIrisStatus() display.drawIrisStatus()
display.drawDisconnectButton() display.drawDisconnectButton()
end end
else else
-- Remote iris is open or no iris present -- No password required - connection is safe
utils.log("DEBUG: Remote iris is open or no iris present")
connectionSafe = true connectionSafe = true
end end