And it's fixed, but also another problem happened. Lets fix that too
This commit is contained in:
69
startup.lua
69
startup.lua
@ -146,7 +146,7 @@ end
|
||||
-- Initialize modules
|
||||
utils.init(config, gate, chatBox)
|
||||
display.init(mon, config, addresses, utils, localGateAddress)
|
||||
handlers.init(config, gate, mon, utils, display, events)
|
||||
handlers.init(config, gate, mon, utils, display, events, transceiver)
|
||||
|
||||
-- Configure transceiver IDC after utils is initialized (so we can use utils.log)
|
||||
if transceiver and config.enableGDO and config.irisPassword then
|
||||
@ -591,14 +591,14 @@ local function dialGate(address)
|
||||
|
||||
if (symbol) ~= 0 then
|
||||
if (gateType == "sgjourney:universe_stargate") or (gateType == "sgjourney:pegasus_stargate") then
|
||||
os.pullEvent("stargate_chevron_engaged")
|
||||
events.pullEvent("stargate_chevron_engaged")
|
||||
end
|
||||
else
|
||||
if gateType == "sgjourney:universe_stargate" then
|
||||
os.pullEvent("stargate_chevron_engaged")
|
||||
events.pullEvent("stargate_chevron_engaged")
|
||||
redstone.setOutput("top", true)
|
||||
elseif (gateType == "sgjourney:pegasus_stargate") then
|
||||
os.pullEvent("stargate_chevron_engaged")
|
||||
events.pullEvent("stargate_chevron_engaged")
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -798,35 +798,44 @@ local function handleOutgoingDial()
|
||||
if state.remotePasswordRequired and remoteIrisState == 100 then
|
||||
utils.log("Showing password prompt for remote gate")
|
||||
|
||||
local password = HandlePasswordEntry()
|
||||
utils.sendPasswordAttempt(password)
|
||||
utils.debug("Sent: IRIS_PASSWORD:" .. password)
|
||||
local result = HandlePasswordEntry()
|
||||
|
||||
-- Wait for response
|
||||
local function WaitForResponse()
|
||||
sleep(3) -- Wait up to 3 seconds for response
|
||||
return nil
|
||||
-- Check if iris opened during password entry (via GDO)
|
||||
if result == "IRIS_OPENED" then
|
||||
utils.log("Iris opened during password entry")
|
||||
connectionSafe = true
|
||||
elseif result then
|
||||
-- Password was entered, send it
|
||||
utils.debug("Sent: IRIS_PASSWORD:" .. result)
|
||||
|
||||
-- Wait for response
|
||||
local function WaitForResponse()
|
||||
sleep(3) -- Wait up to 3 seconds for response
|
||||
return nil
|
||||
end
|
||||
|
||||
local waitResult = parallel.waitForAny(GetMessage, WaitForResponse)
|
||||
if waitResult == 1 then
|
||||
local response = state.lastReceivedMessage
|
||||
state.lastReceivedMessage = nil
|
||||
if response == "IRIS_OPEN" then
|
||||
display.showPasswordResult(true)
|
||||
utils.log("Password accepted - iris opened")
|
||||
sleep(1)
|
||||
connectionSafe = true
|
||||
elseif response == "IRIS_DENIED" then
|
||||
display.showPasswordResult(false)
|
||||
utils.log("Password rejected")
|
||||
sleep(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local result = parallel.waitForAny(GetMessage, WaitForResponse)
|
||||
if result == 1 then
|
||||
local response = state.lastReceivedMessage
|
||||
state.lastReceivedMessage = nil
|
||||
if response == "IRIS_OPEN" then
|
||||
display.showPasswordResult(true)
|
||||
utils.log("Password accepted - iris opened")
|
||||
sleep(1)
|
||||
-- Re-check iris state
|
||||
if transceiver then
|
||||
remoteIrisState = transceiver.checkConnectedShielding()
|
||||
end
|
||||
if not remoteIrisState or remoteIrisState == 0 then
|
||||
connectionSafe = true
|
||||
end
|
||||
elseif response == "IRIS_DENIED" then
|
||||
display.showPasswordResult(false)
|
||||
utils.log("Password rejected")
|
||||
sleep(2)
|
||||
-- Re-check iris state
|
||||
if transceiver then
|
||||
remoteIrisState = transceiver.checkConnectedShielding()
|
||||
if not remoteIrisState or remoteIrisState == 0 then
|
||||
connectionSafe = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user