mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
Global Fixed :D
This commit is contained in:
@@ -196,7 +196,16 @@ Manager.global=setmetatable({__defaults={},__global={
|
|||||||
end
|
end
|
||||||
return setmetatable(Global,{
|
return setmetatable(Global,{
|
||||||
__call=function(tbl,default) return Manager.global(default,tbl) end,
|
__call=function(tbl,default) return Manager.global(default,tbl) end,
|
||||||
__index=function(tbl,key) return rawget(Manager.global(),key) or moduleIndex[key] and Manager.global(key) end,
|
__index=function(tbl,key) return rawget(Manager.global(nil,tbl),key) or moduleIndex[key] and Manager.global(key) end,
|
||||||
|
__newindex=function(tbl,key,value) rawset(Manager.global(nil,tbl),key,value) end,
|
||||||
|
__pairs=function(tbl)
|
||||||
|
local tbl = Manager.global(nil,tbl)
|
||||||
|
local function next_pair(tbl,k)
|
||||||
|
k, v = next(tbl, k)
|
||||||
|
if type(v) ~= nil then return k,v end
|
||||||
|
end
|
||||||
|
return next_pair, tbl, nil
|
||||||
|
end,
|
||||||
path=module_path,name=module_name
|
path=module_path,name=module_name
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ function _log(...) log(...) end -- do not remove this is used for smaller verbos
|
|||||||
Manager = require("FactorioSoftmodManager")
|
Manager = require("FactorioSoftmodManager")
|
||||||
Manager.setVerbose{
|
Manager.setVerbose{
|
||||||
selfInit=true, -- called while the manager is being set up
|
selfInit=true, -- called while the manager is being set up
|
||||||
moduleLoad=true, -- when a module is required by the manager
|
moduleLoad=false, -- when a module is required by the manager
|
||||||
moduleInit=true, -- when and within the initation of a module
|
moduleInit=false, -- when and within the initation of a module
|
||||||
modulePost=true, -- when and within the post of a module
|
modulePost=false, -- when and within the post of a module
|
||||||
moduleEnv=true, -- during module runtime, this is a global option set within each module for fine control
|
moduleEnv=false, -- during module runtime, this is a global option set within each module for fine control
|
||||||
eventRegistered=false, -- when a module registers its event handlers
|
eventRegistered=false, -- when a module registers its event handlers
|
||||||
errorCaught=true, -- when an error is caught during runtime
|
errorCaught=true, -- when an error is caught during runtime
|
||||||
output=Manager._verbose -- can be: can be: print || log || other function
|
output=Manager._verbose -- can be: can be: print || log || other function
|
||||||
|
|||||||
@@ -326,7 +326,6 @@ end
|
|||||||
function Role._prototype:get_players(online)
|
function Role._prototype:get_players(online)
|
||||||
if not self_test(self,'role','get_players') then return end
|
if not self_test(self,'role','get_players') then return end
|
||||||
if online and not type_error(online,'boolean','Invalid argument #1 to role:get_players, online is not a boolean.') then return end
|
if online and not type_error(online,'boolean','Invalid argument #1 to role:get_players, online is not a boolean.') then return end
|
||||||
log(serpent.line(global))
|
|
||||||
if not global.roles[self.name] then global.roles[self.name] = {} end
|
if not global.roles[self.name] then global.roles[self.name] = {} end
|
||||||
local rtn = {}
|
local rtn = {}
|
||||||
for _,player_index in pairs(global.roles[self.name]) do
|
for _,player_index in pairs(global.roles[self.name]) do
|
||||||
|
|||||||
Reference in New Issue
Block a user