Updates To Sync

This commit is contained in:
Cooldude2606
2018-11-02 20:08:31 +00:00
parent 218d700aba
commit d815fd4e75
2 changed files with 9 additions and 9 deletions

View File

@@ -4,8 +4,8 @@
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
local Game = require('FactorioStdLib.Game')
local Color = require('FactorioStdLib.Color')
local Game = require('FactorioStdLib.Game@^0.8.0')
local Color = require('FactorioStdLib.Color@^0.8.0')
local Sync = {}
local Sync_updates = {}
@@ -309,9 +309,9 @@ script.on_event('on_pre_player_left_game',Sync.emit_update)
script.on_event('on_rocket_launched',Sync.emit_update)
function Sync:on_init()
if loaded_modules['ExpGamingCore.Gui'] then verbose('ExpGamingCore.Gui is installed; Loading gui src') require(module_path..'/src/gui',{Sync=Sync,module_path=module_path}) end
if loaded_modules['ExpGamingCore.Role'] then verbose('ExpGamingCore.Role is installed; Loading role src') require(module_path..'/src/ranking',{Sync=Sync}) end
if loaded_modules['ExpGamingCore.Server'] then require('ExpGamingCore.Server').add_module_to_interface('Sync','ExpGamingCore.Sync') end
if loaded_modules['ExpGamingCore.Gui@^4.0.0'] then verbose('ExpGamingCore.Gui is installed; Loading gui src') require(module_path..'/src/gui',{Sync=Sync,module_path=module_path}) end
if loaded_modules['ExpGamingCore.Role@^4.0.0'] then verbose('ExpGamingCore.Role is installed; Loading role src') require(module_path..'/src/ranking',{Sync=Sync}) end
if loaded_modules['ExpGamingCore.Server@^4.0.0'] then require('ExpGamingCore.Server@^4.0.0').add_module_to_interface('Sync','ExpGamingCore.Sync') end
end
function Sync:on_post()

View File

@@ -7,14 +7,14 @@
--- This file will be loaded when ExpGamingCore.Role is present
-- @function _comment
local Game = require('FactorioStdLib.Game')
local Color = require('FactorioStdLib.Color')
local Role = require('ExpGamingCore.Role')
local Game = require('FactorioStdLib.Game@^0.8.0')
local Color = require('FactorioStdLib.Color@^0.8.0')
local Role = require('ExpGamingCore.Role@^4.0.0')
--- Used as a redirect to Role._base_preset that will set the rank given to a player apon joining
-- @usage Sync.set_roles{player_name=rank_name,...}
function Sync.set_roles(...)
Role._base_preset(...)
Role.set_preassign(...)
end
--- Used to get the number of players in each rank and currently online