dofile
to Load Pelican Before SanitizationTo use Pelican in the MSE, you will need to load your lua script using dofile
before DCS sanitizes the
environment.
This file is located in the Scripts
folder of your DCS World installation, for example:
-- C:\Program Files\Eagle Dynamics\DCS World\Scripts\MissionScripting.lua
--Initialization script for the Mission lua Environment (SSE)
dofile("Scripts/ScriptingSystem.lua")
dofile(lfs.writedir() .. "/Scripts/PelicanTestMission.lua")
--Sanitize Mission Scripting environment
--This makes unavailable some unsecure functions.
--Mission downloaded from server to client may contain potentialy harmful lua code that may use these functions.
--You can remove the code below and make availble these functions at your own risk.
local function sanitizeModule(name)
_G[name] = nil
package.loaded[name] = nil
end
do
sanitizeModule("os")
sanitizeModule("io")
sanitizeModule("lfs")
_G["require"] = nil
_G["loadlib"] = nil
_G["package"] = nil
end