mirror of
https://github.com/s-d-a/DCS-ExportScripts.git
synced 2026-08-22 16:05:20 +00:00
Add the Maps.lua file to find the map.
Change UDP listener and sender timeout. Optimize export stop send values.
This commit is contained in:
@@ -22,6 +22,7 @@ ExportScript.LastDataDAC = {}
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\genericRadio.lua]])
|
||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]])
|
||||
|
||||
for i = 1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.PacketSizeDAC[i] = 0
|
||||
@@ -54,14 +55,12 @@ function LuaExportStart()
|
||||
|
||||
ExportScript.UDPsender = ExportScript.socket.udp()
|
||||
ExportScript.UDPsender:setsockname("*", 0)
|
||||
ExportScript.UDPsender:setoption('broadcast', true)
|
||||
ExportScript.UDPsender:settimeout(.001) -- set the timeout for reading the socket
|
||||
ExportScript.UDPsender:settimeout(.004) -- set the timeout for reading the socket; 250 fps
|
||||
|
||||
if ExportScript.Config.Listener then
|
||||
ExportScript.UDPListener = ExportScript.socket.udp()
|
||||
ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort)
|
||||
ExportScript.UDPListener:setoption('broadcast', true)
|
||||
ExportScript.UDPListener:settimeout(.001) -- set the timeout for reading the socket
|
||||
ExportScript.UDPListener:settimeout(.004) -- set the timeout for reading the socket; 250 fps
|
||||
end
|
||||
|
||||
--local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
|
||||
@@ -87,13 +86,17 @@ end
|
||||
|
||||
function LuaExportStop()
|
||||
-- Works once just after mission stop.
|
||||
if ExportScript.Config.DACExport then
|
||||
ExportScript.Tools.SendDataDAC("DAC", "stop")
|
||||
for i=1, #ExportScript.Config.DAC, 1 do
|
||||
ExportScript.Tools.FlushDataDAC(i)
|
||||
end
|
||||
end
|
||||
|
||||
if ExportScript.Config.IkarusExport then
|
||||
ExportScript.Tools.SendData("Ikarus", "stop")
|
||||
ExportScript.Tools.FlushData()
|
||||
end
|
||||
|
||||
ExportScript.UDPsender:close()
|
||||
if ExportScript.Config.Listener then
|
||||
|
||||
Reference in New Issue
Block a user