mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Fixed many small bugs
This commit is contained in:
@@ -8,13 +8,13 @@ local Role -- ExpGamingCore.Role@^4.0.0
|
||||
local Sync -- ExpGamingCore.Sync@^4.0.0
|
||||
|
||||
local function get_allowed_afk_time(player)
|
||||
local role
|
||||
if Role then role = Role.get_highest(player)
|
||||
else if player.admin then return else role = Role.meta.default end end
|
||||
local count = #game.connected_players
|
||||
local base = not role.allow_afk_kick and role.index or false
|
||||
local player = Game.get_player(player)
|
||||
local role = Role and Role.get_highest(player) or {index=1,allow_afk_kick=not player.admin}
|
||||
local player_count = #game.connected_players
|
||||
local role_count = Role and Role.meta.count or 1
|
||||
local role_index = role.allow_afk_kick and role.index or false
|
||||
if not base then return false end
|
||||
return (Role.meta.count/base)*count
|
||||
return (role_count/role_index)*count
|
||||
end
|
||||
|
||||
script.on_event(defines.events.on_tick,function(event)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Admin = require('ExpGamingAdmin.AdminLib')
|
||||
local Admin = require('ExpGamingAdmin')
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Role -- ExpGamingCore.Role@^4.0.0
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"ExpGamingAdmin.Warnings": "^4.0.0",
|
||||
"ExpGamingCore.Role": "?^4.0.0",
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingAdmin.AdminLib": "^4.0.0"
|
||||
"ExpGamingAdmin": "^4.0.0"
|
||||
},
|
||||
"collection": "ExpGamingPlayer@4.0.0",
|
||||
"submodules": {}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Gui = require('ExpGamingCore.Gui')
|
||||
local Admin -- ExpGamingAdmin.AdminLib@^4.0.0
|
||||
local Admin -- ExpGamingAdmin@^4.0.0
|
||||
local AdminGui -- ExpGamingAdmin.Gui@^4.0.0
|
||||
|
||||
-- Local Varibles
|
||||
@@ -31,7 +31,7 @@ local ThisModule = {
|
||||
on_init=function(self)
|
||||
if loaded_modules['ExpGamingPlayer.playerInfo'] then playerInfo = require('ExpGamingPlayer.playerInfo') end
|
||||
if loaded_modules['ExpGamingCore.Role'] then getPlayers = require(module_path..'/src/ranking',{self=self}) end
|
||||
if loaded_modules['ExpGamingAdmin.AdminLib'] then Admin = require('ExpGamingAdmin.AdminLib') end
|
||||
if loaded_modules['ExpGamingAdmin'] then Admin = require('ExpGamingAdmin') end
|
||||
if loaded_modules['ExpGamingAdmin.Gui'] then AdminGui = require('ExpGamingAdmin.Gui') end
|
||||
end
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"FactorioStdLib.Game": "^0.8.0",
|
||||
"ExpGamingCore.Gui": "^4.0.0",
|
||||
"ExpGamingCore.Role": "?^4.0.0",
|
||||
"ExpGamingAdmin.AdminLib": "?^4.0.0",
|
||||
"ExpGamingAdmin": "?^4.0.0",
|
||||
"ExpGamingAdmin.buttonFlow": "?^4.0.0",
|
||||
"ExpGamingAdmin.reports": "?^4.0.0",
|
||||
"ExpGamingPlayer.playerInfo": "?^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user