Updated Module to use require

This commit is contained in:
Cooldude2606
2018-06-22 19:17:36 +01:00
parent 5602a2aece
commit 90450056bf
47 changed files with 1042 additions and 504 deletions

View File

@@ -4,6 +4,9 @@
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
local Game = require('FactorioStdLib.Game')
local Color = require('FactorioStdLib.Color')
local Server = {}
local module_verbose = false --true|false
@@ -464,7 +467,7 @@ end)
function Server:on_init()
for name,id in pairs(defines.events) do if not script.get_event_handler(id) then script.on_event(id,Server._thread_handler) end end
if loaded_modules.commands then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands') end
if loaded_modules['ExpGamingCore.Commands'] then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands',{Server=Server}) end
end
return Server

View File

@@ -1,7 +1,10 @@
{
"name": "Server",
"version": "4.0.0",
"module": "Server",
"type": "Submodule",
"description": "Adds a thread system and event listening and a admin bypass (recommend to disable /c and use optional /interface)",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
"keywords": [
"Library",
"Lib",
@@ -12,15 +15,15 @@
"Interface",
"Events"
],
"version": "4.0.0",
"location": "https://github.com/explosivegaming/scenario/releases/download/v4.0-core/ExpGamingCore.Server.zip",
"author": "<blank>",
"contact": "<blank>",
"license": "<blank>",
"dependencies": {
"ExpGamingLib": "^4.0.0",
"FactorioStdLib.Table": "^0.8.0",
"FactorioStdLib.Color": "^0.8.0",
"FactorioStdLib.String": "^0.8.0",
"FactorioStdLib.Game": "^0.8.0",
"ExpGamingCore.Ranking": "?^4.0.0",
"ExpGamingCore.Commands": "?^4.0.0"
}
}

View File

@@ -7,6 +7,8 @@
--- This file will be loaded when ExpGamingCore.Commands is present
-- @function _comment
local Game = require('FactorioStdLib.Game')
--- Runs the given input from the script
-- @command interface
-- @param code The code that will be ran