pin panel shouldn't come up on authorized connections
This commit is contained in:
27
startup.lua
27
startup.lua
@ -177,9 +177,24 @@ local function MonitorRemoteIris()
|
||||
utils.log("ALERT: Remote iris moving: " .. remoteIrisState .. "%")
|
||||
end
|
||||
|
||||
-- If remote has computer and iris just became fully closed, offer password entry
|
||||
-- If remote has computer and iris just became fully closed, wait for password request
|
||||
if state.remoteHasComputer and remoteIrisState == 100 and (not lastIrisState or lastIrisState < 100) then
|
||||
utils.log("Remote iris closed but computer detected - showing password prompt")
|
||||
utils.log("Remote iris closed and computer detected - waiting for password request")
|
||||
|
||||
-- Wait briefly for password request message
|
||||
local function WaitForPasswordRequest()
|
||||
sleep(2) -- Wait up to 2 seconds for password request
|
||||
return nil
|
||||
end
|
||||
|
||||
local result = parallel.waitForAny(GetMessage, WaitForPasswordRequest)
|
||||
if result == 1 then
|
||||
local message = state.lastReceivedMessage
|
||||
state.lastReceivedMessage = nil
|
||||
|
||||
-- Only show password panel if explicitly requested
|
||||
if message == "IRIS_PASSWORD_REQUIRED" then
|
||||
utils.log("Password requested by remote gate - showing password prompt")
|
||||
|
||||
local password = HandlePasswordEntry()
|
||||
|
||||
@ -189,7 +204,7 @@ local function MonitorRemoteIris()
|
||||
return nil
|
||||
end
|
||||
|
||||
local result = parallel.waitForAny(GetMessage, WaitForResponse)
|
||||
result = parallel.waitForAny(GetMessage, WaitForResponse)
|
||||
if result == 1 then
|
||||
local response = state.lastReceivedMessage
|
||||
state.lastReceivedMessage = nil
|
||||
@ -202,6 +217,8 @@ local function MonitorRemoteIris()
|
||||
utils.log("Password rejected")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Re-check iris state after password attempt
|
||||
remoteIrisState = transceiver.checkConnectedShielding()
|
||||
@ -313,6 +330,10 @@ local function handleIncomingWormhole()
|
||||
utils.openIris()
|
||||
else
|
||||
utils.closeIris()
|
||||
-- Send password request if iris is closed and password system is enabled
|
||||
if config.irisPassword and config.enableMessaging then
|
||||
utils.sendPasswordRequest()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -173,4 +173,13 @@ function utils.sendPasswordAttempt(password)
|
||||
return false
|
||||
end
|
||||
|
||||
function utils.sendPasswordRequest()
|
||||
if config.enableMessaging then
|
||||
gate.sendStargateMessage("IRIS_PASSWORD_REQUIRED")
|
||||
utils.log("Sent password request")
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return utils
|
||||
|
||||
Reference in New Issue
Block a user