Respond to iris opening quicker
This commit is contained in:
12
handlers.lua
12
handlers.lua
@ -82,8 +82,9 @@ function handlers.handlePasswordInput()
|
||||
elseif eventType == "stargate_message_received" then
|
||||
-- Pass to message handler
|
||||
handlers.handleMessage(table.unpack(event))
|
||||
-- Check if iris opened
|
||||
if state.lastReceivedMessage == "IRIS_OPEN" then
|
||||
-- Check if iris opened (via password or GDO)
|
||||
if state.lastReceivedMessage == "IRIS_OPEN" or state.lastReceivedMessage == "GDO_IRIS_OPEN" then
|
||||
utils.log("Received iris open confirmation: " .. state.lastReceivedMessage)
|
||||
state.lastReceivedMessage = nil
|
||||
state.enteringPassword = false
|
||||
return "IRIS_OPENED"
|
||||
@ -258,6 +259,13 @@ function handlers.handleGDOTransmission(eventType, side, frequency, idc, matches
|
||||
utils.log("Valid GDO code received - opening iris")
|
||||
utils.debug("Valid GDO - opening iris")
|
||||
utils.openIris()
|
||||
|
||||
-- Send message to remote gate that iris opened via GDO
|
||||
if config.enableMessaging then
|
||||
gate.sendStargateMessage("GDO_IRIS_OPEN")
|
||||
utils.log("Sent GDO iris open notification to remote gate")
|
||||
utils.debug("Sent: GDO_IRIS_OPEN")
|
||||
end
|
||||
end
|
||||
|
||||
return "gdo_received"
|
||||
|
||||
Reference in New Issue
Block a user