mirror of
https://github.com/weyne85/DCS-ExportScripts.git
synced 2025-10-29 16:58:18 +00:00
fix for F-86 multiplayer export
add the variable ExportScript.NoLuaExportBeforeNextFrame to avoid errors during multiplayer export of F-86
This commit is contained in:
parent
2e88b87126
commit
b6009e5d33
@ -22,6 +22,8 @@ ExportScript.LastDataDAC = {}
|
|||||||
ExportScript.lastExportTimeHI = 0
|
ExportScript.lastExportTimeHI = 0
|
||||||
ExportScript.lastExportTimeLI = 0
|
ExportScript.lastExportTimeLI = 0
|
||||||
|
|
||||||
|
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||||
|
|
||||||
local PrevExport = {}
|
local PrevExport = {}
|
||||||
PrevExport.LuaExportStart = LuaExportStart
|
PrevExport.LuaExportStart = LuaExportStart
|
||||||
PrevExport.LuaExportStop = LuaExportStop
|
PrevExport.LuaExportStop = LuaExportStop
|
||||||
@ -29,6 +31,7 @@ PrevExport.LuaExportBeforeNextFrame = LuaExportBeforeNextFrame
|
|||||||
PrevExport.LuaExportAfterNextFrame = LuaExportAfterNextFrame
|
PrevExport.LuaExportAfterNextFrame = LuaExportAfterNextFrame
|
||||||
|
|
||||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
|
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
|
||||||
|
ExportScript.utf8 = dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\utf8.lua]])
|
||||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.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\genericRadio.lua]])
|
||||||
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]])
|
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]])
|
||||||
@ -69,7 +72,7 @@ function LuaExportStart()
|
|||||||
end
|
end
|
||||||
|
|
||||||
--local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
|
--local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
|
||||||
ExportScript.logFile = io.open(ExportScript.Config.LogPath, "w+")
|
ExportScript.logFile = io.open(ExportScript.Config.LogPath, "wa") -- "W+"
|
||||||
if ExportScript.logFile then
|
if ExportScript.logFile then
|
||||||
ExportScript.logFile:write('\239\187\191') -- create a UTF-8 BOM
|
ExportScript.logFile:write('\239\187\191') -- create a UTF-8 BOM
|
||||||
end
|
end
|
||||||
@ -79,6 +82,7 @@ function LuaExportStart()
|
|||||||
|
|
||||||
ExportScript.AF = {} -- Table for Auxiliary functions
|
ExportScript.AF = {} -- Table for Auxiliary functions
|
||||||
|
|
||||||
|
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||||
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||||
|
|
||||||
-- Chain previously-included export as necessary
|
-- Chain previously-included export as necessary
|
||||||
@ -95,7 +99,9 @@ function LuaExportBeforeNextFrame()
|
|||||||
coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame)
|
coStatus = coroutine.resume(ExportScript.coProcessArguments_BeforeNextFrame)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ExportScript.NoLuaExportBeforeNextFrame == false then
|
||||||
ExportScript.Tools.ProcessOutput()
|
ExportScript.Tools.ProcessOutput()
|
||||||
|
end
|
||||||
|
|
||||||
-- Chain previously-included export as necessary
|
-- Chain previously-included export as necessary
|
||||||
if PrevExport.LuaExportBeforeNextFrame then
|
if PrevExport.LuaExportBeforeNextFrame then
|
||||||
@ -104,6 +110,10 @@ function LuaExportBeforeNextFrame()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function LuaExportAfterNextFrame()
|
function LuaExportAfterNextFrame()
|
||||||
|
if ExportScript.NoLuaExportBeforeNextFrame then
|
||||||
|
ExportScript.Tools.ProcessOutput()
|
||||||
|
end
|
||||||
|
|
||||||
-- Chain previously-included export as necessary
|
-- Chain previously-included export as necessary
|
||||||
if PrevExport.LuaExportAfterNextFrame then
|
if PrevExport.LuaExportAfterNextFrame then
|
||||||
PrevExport.LuaExportAfterNextFrame()
|
PrevExport.LuaExportAfterNextFrame()
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
-- F-86 Export
|
-- F-86 Export
|
||||||
-- Version 1.0.0 BETA
|
-- Version 1.0.1
|
||||||
|
|
||||||
ExportScript.FoundDCSModule = true
|
ExportScript.FoundDCSModule = true
|
||||||
|
ExportScript.NoLuaExportBeforeNextFrame = true
|
||||||
|
|
||||||
ExportScript.ConfigEveryFrameArguments =
|
ExportScript.ConfigEveryFrameArguments =
|
||||||
{
|
{
|
||||||
|
|||||||
@ -79,7 +79,9 @@ function ExportScript.Tools.ProcessOutput()
|
|||||||
local lMyInfo = LoGetSelfData()
|
local lMyInfo = LoGetSelfData()
|
||||||
if lMyInfo ~= nil then
|
if lMyInfo ~= nil then
|
||||||
if ExportScript.ModuleName ~= lMyInfo.Name then
|
if ExportScript.ModuleName ~= lMyInfo.Name then
|
||||||
|
ExportScript.NoLuaExportBeforeNextFrame = false
|
||||||
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
ExportScript.Tools.SelectModule() -- point globals to Module functions and data.
|
||||||
|
return
|
||||||
end
|
end
|
||||||
lMyInfo = nil
|
lMyInfo = nil
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user