Respond to iris opening quicker
This commit is contained in:
17
startup.lua
17
startup.lua
@ -11,6 +11,12 @@
|
||||
- Whitelist/blacklist security
|
||||
]]
|
||||
|
||||
---------------------------------------------
|
||||
-- PROGRAM VERSION
|
||||
---------------------------------------------
|
||||
|
||||
local PROGRAM_VERSION = "2.0"
|
||||
|
||||
---------------------------------------------
|
||||
-- LOAD MODULES
|
||||
---------------------------------------------
|
||||
@ -461,8 +467,8 @@ local function handleIncomingWormhole()
|
||||
|
||||
-- Send version message to remote gate
|
||||
sleep(0.5) -- Brief delay to ensure connection is stable
|
||||
utils.sendVersionMessage()
|
||||
utils.debug("Sent: SGCS_V" .. config.programVersion)
|
||||
utils.sendVersionMessage(PROGRAM_VERSION)
|
||||
utils.debug("Sent: SGCS_V" .. PROGRAM_VERSION)
|
||||
|
||||
-- Handle iris
|
||||
if config.autoCloseIrisOnIncoming then
|
||||
@ -753,6 +759,11 @@ local function handleOutgoingDial()
|
||||
utils.log("Remote gate requires password for entry")
|
||||
lastMessageTime = os.clock()
|
||||
break -- Got password request, that's all we need
|
||||
elseif message == "GDO_IRIS_OPEN" then
|
||||
utils.log("Remote iris opened via GDO")
|
||||
state.remotePasswordRequired = false
|
||||
lastMessageTime = os.clock()
|
||||
break -- Iris opened, no password needed
|
||||
end
|
||||
elseif result == 2 then
|
||||
-- GDO transmission received (handled by event system)
|
||||
@ -818,7 +829,7 @@ local function handleOutgoingDial()
|
||||
if waitResult == 1 then
|
||||
local response = state.lastReceivedMessage
|
||||
state.lastReceivedMessage = nil
|
||||
if response == "IRIS_OPEN" then
|
||||
if response == "IRIS_OPEN" or response == "GDO_IRIS_OPEN" then
|
||||
display.showPasswordResult(true)
|
||||
utils.log("Password accepted - iris opened")
|
||||
sleep(1)
|
||||
|
||||
Reference in New Issue
Block a user