Skip to content

Commit

Permalink
Add DCSBIOS_ADD_EXPORT_TARGET and DCSBIOS_REMOVE_EXPORT_TARGET commands
Browse files Browse the repository at this point in the history
Refs #6
  • Loading branch information
jboecker committed Dec 16, 2014
1 parent da74656 commit ae772c9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Scripts/DCS-BIOS/lib/Protocol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ function BIOS.protocol.processInputLine(line)
argumentCache = {}
end
if cmd then
if cmd == "DCSBIOS_ADD_EXPORT_TARGET" then
local ip, port = args:match("^([^:]+):([0-9]+)")
local newIoConnection = BIOS.protocol_io.UDPSender:create({ host = ip, port = port })
newIoConnection:init()
BIOS.protocol_io.connections[#BIOS.protocol_io.connections + 1] = newIoConnection
end
if cmd == "DCSBIOS_REMOVE_EXPORT_TARGET" then
local ip, port = args:match("^([^:]+):([0-9]+)")
local newConns = {}
for _, c in pairs(BIOS.protocol_io.connections) do
if not (c.host == ip and c.port == port) then
newConns[#newConns+1] = c
end
end
BIOS.protocol_io.connections = newConns
end
if acftModule then
if acftModule.inputProcessors[cmd] then
acftModule.inputProcessors[cmd](args)
Expand Down

0 comments on commit ae772c9

Please sign in to comment.