mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
57 lines
2.2 KiB
Plaintext
57 lines
2.2 KiB
Plaintext
|
|
-- If you want to use the debugger, move these 3 lines into MissionScripting.lua of DCS world.
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------------------------------------------------------
|
|
-- MissionScripting.lua modifications
|
|
---------------------------------------------------------------------------------------------------------------------------
|
|
|
|
-- --Initialization script for the Mission lua Environment (SSE)
|
|
--
|
|
-- dofile('Scripts/ScriptingSystem.lua')
|
|
--
|
|
-- package.path = package.path..";.\\LuaSocket\\?.lua;"
|
|
-- local initconnection = require("debugger")
|
|
-- initconnection( "127.0.0.1", 10000, "dcsserver", nil, "win", "" )
|
|
--
|
|
-- --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')
|
|
-- require = nil
|
|
-- loadlib = nil
|
|
-- end
|
|
|
|
---------------------------------------------------------------------------------------------------------------------------
|
|
---------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- So for clarity, these are the three lines of code that matter!
|
|
|
|
-- Add LuaSocket to the LUAPATH, so that it can be found.
|
|
package.path = package.path..";.\\LuaSocket\\?.lua;"
|
|
|
|
-- Connect to the debugger, first require it.
|
|
local initconnection = require("debugger")
|
|
|
|
-- Now make the connection..
|
|
-- "127.0.0.1" is the localhost.
|
|
-- 10000 is the port. If you wanna use another port in LDT, change this number too!
|
|
-- "dcsserver" is the name of the server. If you wanna use another name, change the name here too!
|
|
-- nil (is for transport protocol, but not using this)
|
|
-- "win" don't touch. But is important to indicate that we are in a windows environment to the debugger script.
|
|
initconnection( "127.0.0.1", 10000, "dcsserver", nil, "win", "" )
|
|
|