From 9be85f04a61720dad2f0729bf2b135db9d4090bb Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Tue, 5 Jun 2018 19:32:29 +0100 Subject: [PATCH] Added module: ExpGamingCore.Commands --- FactorioSoftmodManager.lua | 5 +- doc/index.html | 8 +- doc/modules/ExpGamingCore.Commands.html | 400 ++++++++++++++++++ doc/modules/ExpGamingCore.Ranking.html | 4 +- doc/modules/ExpGamingCore.Server.html | 20 +- doc/modules/ExpGamingCore.Sync.html | 4 +- doc/modules/ExpGamingLib.html | 4 +- doc/modules/FSM.html | 4 +- doc/modules/StdLib.Color.html | 4 +- doc/modules/StdLib.Game.html | 4 +- doc/modules/StdLib.String.html | 4 +- doc/modules/StdLib.Table.html | 4 +- doc/modules/StdLib.Time.html | 4 +- ...odules.expgamingcore.commands.control.html | 131 ------ .../modules.expgamingcore.gui.control.html | 4 +- ...les.expgamingcore.gui.guiparts.center.html | 4 +- ...les.expgamingcore.gui.guiparts.inputs.html | 4 +- ...dules.expgamingcore.gui.guiparts.left.html | 4 +- ...ules.expgamingcore.gui.guiparts.popup.html | 4 +- ...es.expgamingcore.gui.guiparts.toolbar.html | 4 +- locale/en/ExpGamingCore.Commands.cfg | 13 +- locale/en/ExpGamingCore.Server.cfg | 2 + modules/ExpGamingCore/Commands/control.lua | 249 +++++++---- modules/ExpGamingCore/Ranking/control.lua | 4 + modules/ExpGamingCore/Server/control.lua | 24 +- modules/ExpGamingCore/Server/src/commands.lua | 6 +- modules/ExpGamingCore/Sync/control.lua | 1 + modules/ExpGamingCore/softmod.json | 43 +- modules/ExpGamingLib/control.lua | 1 + modules/ExpGamingLib/softmod.json | 6 +- modules/index.lua | 2 +- 31 files changed, 686 insertions(+), 289 deletions(-) create mode 100644 doc/modules/ExpGamingCore.Commands.html delete mode 100644 doc/modules/modules.expgamingcore.commands.control.html create mode 100644 locale/en/ExpGamingCore.Server.cfg diff --git a/FactorioSoftmodManager.lua b/FactorioSoftmodManager.lua index e1916ba0..e501e76a 100644 --- a/FactorioSoftmodManager.lua +++ b/FactorioSoftmodManager.lua @@ -69,6 +69,7 @@ end Manager.verbose = function(rtn,action) local settings = Manager.setVerbose local state = Manager.currentState + if Manager.error and state == Manager.error.__crash then return end -- if ran in a module the the global module_name is present local rtn = type(rtn) == table and serpent.line(rtn) or tostring(rtn) if module_name then rtn='['..module_name..'] '..rtn @@ -341,6 +342,7 @@ Manager.loadModules = setmetatable({}, -- @usage #Manager.error -- returns the number of error handlers that are present -- @usage pairs(Manager.error) -- loops over only the error handlers handler_name,hander Manager.error = setmetatable({ + __crash=false, __error_call=error, __error_const={}, __error_handler=function(handler_name,callback) @@ -400,7 +402,7 @@ Manager.error = setmetatable({ local function next_pair(tbl,k) local v k, v = next(tbl, k) - if k == '__error_call' or k == '__error_const' or k == '__error_handler' then return next_pair(tbl,k) end + if k == '__error_call' or k == '__error_const' or k == '__error_handler' or k == '__crash' then return next_pair(tbl,k) end if type(v) == 'function' then return k,v end end return next_pair, tbl, nil @@ -437,6 +439,7 @@ Manager.event = setmetatable({ },{ __metatable=false, __call=function(tbl,event_name,new_callback,...) + if Manager.error.__crash then Manager.error.__error_call('No error handlers loaded; Game not loaded; Forced crash: '..tostring(Manager.error.__crash)) end -- if no params then return the stop constant if event_name == nil then return rawget(tbl,'__stop') end -- if the event name is a table then loop over each value in that table diff --git a/doc/index.html b/doc/index.html index 27be2284..221fde79 100644 --- a/doc/index.html +++ b/doc/index.html @@ -32,7 +32,7 @@

Modules