diff --git a/modules/ExpGamingAdmin/Jail/control.lua b/modules/ExpGamingAdmin/Jail/control.lua index 69798cbf..793c5a2a 100644 --- a/modules/ExpGamingAdmin/Jail/control.lua +++ b/modules/ExpGamingAdmin/Jail/control.lua @@ -28,21 +28,21 @@ AdminGui.add_button('jail','utility/clock',{'ExpGamingAdmin.tooltip-jail'},funct end) function Admin.jail(player,by_player,reason) - local player = Game.get_player(player) - local by_player_name = Game.get_player(by_player) and Game.get_player(by_player).name or '' - local reason = Admin.create_reason(reason,by_player_name) + local player, by_player = Admin.valid_players(player,by_player) + if not player then return end + local reason = Admin.create_reason(reason,by_player.name) Admin.set_banned(player,'jail') if Sync then Sync.emit_embeded{ title='Player Jail', color=Color.to_hex(defines.textcolor.med), description='There was a player jailed.', ['Player:']='<>'..player.name, - ['By:']='<>'..by_player_name, + ['By:']='<>'..by_player.name, ['Reason:']=reason } end Role.meta.last_jail = player.name - Server.interface(Role.unassign,true,player,Role.get(player),by_player_name) - Server.interface(Role.assign,true,player,'Jail',by_player_name) + Server.interface(Role.assign,true,player,'Jail',by_player.name) + Server.interface(Role.unassign,true,player,Role.get(player),by_player.name) end Admin.add_action('Jail',Admin.jail) diff --git a/modules/ExpGamingCore/Server/control.lua b/modules/ExpGamingCore/Server/control.lua index 7ed86cd4..0d3f4b32 100644 --- a/modules/ExpGamingCore/Server/control.lua +++ b/modules/ExpGamingCore/Server/control.lua @@ -222,7 +222,7 @@ function Server.interface(callback,use_thread,env,...) local callback = table.remove(thread.data,1) callback = is_type(callback,'function') and callback or loadstring(callback) local env = table.remove(thread.data,1) - if is_type(env,'table') and env._env == true then + if is_type(env,'table') and not is_type(env.__self,'userdata') and env._env == true then local success, err = Manager.sandbox(callback,env,unpack(thread.data)) if not success then error(err) end return err @@ -242,7 +242,7 @@ function Server.interface(callback,use_thread,env,...) if err then return false, err end _callback = rtn end - if is_type(env,'table') and env._env == true then + if is_type(env,'table') and not is_type(env.__self,'userdata') and env._env == true then local success, err = Manager.sandbox(_callback,env,...) if not success then return success,err else return success, unpack(err) end diff --git a/modules/ExpGamingPlayer/playerList/control.lua b/modules/ExpGamingPlayer/playerList/control.lua index d7153c42..56405202 100644 --- a/modules/ExpGamingPlayer/playerList/control.lua +++ b/modules/ExpGamingPlayer/playerList/control.lua @@ -17,7 +17,7 @@ local playerInfo = function(player,frame) end local getPlayers = function() - local rtn = {{{r=233,g=63,b=233},'Admin',{}},{{r=255,g=159,b=27},'',{}}} + local rtn = {{{r=233,g=63,b=233},'Admin',{},true},{{r=255,g=159,b=27},'',{},false}} for _,player in pairs(game.connected_players) do if player.admin then table.insert(rtn[2][3],player) else table.insert(rtn[1][3],player) end diff --git a/modules/ExpGamingPlayer/playerList/src/ranking.lua b/modules/ExpGamingPlayer/playerList/src/ranking.lua index e7f96896..e94e61ee 100644 --- a/modules/ExpGamingPlayer/playerList/src/ranking.lua +++ b/modules/ExpGamingPlayer/playerList/src/ranking.lua @@ -4,9 +4,12 @@ script.on_event(defines.events.on_role_change,self.update) return function() local rtn = {} + local default = {} for _,role_name in pairs(Role.order) do local role = Role.get(role_name) - table.insert(rtn,{role.colour,role.short_hand,role:get_players(true),role.not_reportable}) + if role.is_default then default = {role.colour,role.short_hand,role:get_players(true),role.not_reportable} + else table.insert(rtn,{role.colour,role.short_hand,role:get_players(true),role.not_reportable}) end end + table.insert(rtn,default) return rtn end \ No newline at end of file