Added ExpGamingAdmin

This commit is contained in:
Cooldude2606
2018-08-26 17:28:18 +01:00
parent 121d983b08
commit 95233ebb40
48 changed files with 1410 additions and 604 deletions

View File

@@ -0,0 +1,93 @@
--- Desction <get from json>
-- @module ExpGamingAdmin.AdminLib@4.0.0
-- @author <get from json>
-- @license <get from json>
-- @alais Admin
-- Module Require
local Game = require('FactorioStdLib@^0.8.0')
local Ranking -- ExpGamingCore.Ranking@^4.0.0
local Sync -- ExpGamingCore.Sync@^4.0.0
-- Module Define
local module_verbose = false
local Admin = {
on_init=function()
if loaded_modules['ExpGamingCore.Ranking@^4.0.0'] then Ranking = require('ExpGamingCore.Ranking@^4.0.0') end
if loaded_modules['ExpGamingCore.Sync@^4.0.0'] then Sync = require('ExpGamingCore.Sync@^4.0.0') end
end,
actions={},
action_names={}
}
-- Global Define
local global = global{
banned = {}
}
-- Function Define
function Admin.create_reason(reason,name)
local reason = reason or 'No Reason'
if not string.find(string.lower(reason),string.lower(name)) then reason = reason..' - '..name end
if Sync and Sync.info.date ~= '0000/00/00' and not string.find(string.lower(reason),Sync.info.date) then reason = reason..' - '..Sync.info.date end
if not string.find(string.lower(reason),'appeal') then reason = reason..' - Vist www.explosivegaming.nl to appeal.' end
return reason end
end
function Admin.open(player,pre_select_player,pre_select_action)
if Admin.center then Gui.center.clear(player) Admin.center.open(player,pre_select_player,pre_select_action) end
end
function Admin.allowed(player)
local player = Game.get_player(player)
if Ranking then
local lowest_admin_power = Ranking.get_group('Admin').lowest.power
return lowest_admin_power >= Ranking.get_rank(player).power
else return player.admin
end
function Admin.set_banned(player,set)
local player=Game.get_player(player)
if not player then return false end
global.banned[player.name] = set
end
function Admin.is_banned(player,detail)
local player=Game.get_player(player)
if not player then return false end
local banned = global.banned[player.name]
if banned == true then return true end
if not banned then return false end
if detail then return banned
else return true end
end
function Admin.add_action(action,callback)
table.insert(Admin.action_names,action)
Admin.actions[string.lower(action)] = callback
end
function Admin.take_action(action,player,by_player,reason)
if Admin[action] then Admin[action](player,by_player,reason) end
if Admin.actions[string.lower(action)] then Admin.actions[string.lower(action)](player,by_player,reason) end
end
function Admin.clear_player(player,by_player)
local player, by_player_name = valid_players(player,by_player)
if not player then return end
if Admin.is_banned(player,true) == true then Server.interface(game.unban_player,true,player,by_player) end
if Admin.clear_warings then Admin.clear_warings(player,by_player,true) end
if Admin.clear_reports then Admin.clear_reports(player,by_player,true) end
if Ranking.get_rank(player).group.name == 'Jail' then Server.interface(Ranking.revert,true,player,by_player) end
if Sync then Sync.emit_embeded{
title='Player Clear',
color=Color.to_hex(defines.text_color.low),
description='A player had their reports and warnings cleared.',
['Player:']='<<inline>>'..player.name,
['By:']='<<inline>>'..by_player_name,
} end
Admin.set_banned(player,false)
end
-- Module Return
return Admin

View File

@@ -0,0 +1,15 @@
[ExpGamingAdmin@4-0-0]
name=Admin-Befehle
tooltip=Die mächtigsten Befehle sind hier zuhause.
no-info-file=Die Informationsdatei wurde nicht gefunden.
message=Wähle einen Spieler und eine Aktion. Stell vor dem Ausführen sicher, dass der Richtige ist!
warning=Achtung, dieser Spieler hat einen höheren Rang als du selbst, weshalb du seinen Rang nicht ändern kannst.
short-reason=Achtung, dies ist ein sehr kurzer Grund. Bitte versuche, mehr Informationen anzugeben. (Warning: The reason is too short. UPDATE)
rank-high=Dieser Spieler hat einen hohen Rang. Bitte benutze nur Ingame-Befehle gegen diese Person, wenn du dir sicher bist!
invalid=Der Spieler oder die Aktion war ungültig. Bitte versuche es noch einmal!
take-action= Ergreife Maßnahme
tooltip-ban=Banne Spieler
tooltip-kick=Kicke Spieler
tooltip-jail=Sperre Spieler ins Gefängnis
tooltip-go-to=Gehe zum Spieler
tooltip-bring=Bringe den Spieler zu dir

View File

@@ -0,0 +1,21 @@
[ExpGamingAdmin@4-0-0]
name=Admin Commands
tooltip=Admin commands make their home here
no-info-file=No info file was found
message=Please select a player and an action to take. Make sure to choose the correct one!
warning=Warning: This player outranks you. Therefore, you cannot edit their rank.
short-reason=Warning: The reason is too short.
rank-high=Warning: This player outranks you. Therefore, you cannot edit their rank.
invalid=The player or the action is invalid. Please try again!
take-action=Take Action
tooltip-ban=Ban Player
tooltip-kick=Kick Player
tooltip-jail=Jail Player
tooltip-go-to=Go To Player
tooltip-bring=Bring Player
temp-ban=__1__ was temporary banned by __2__ and will remain in jail until next reset
report=Report Player
cant-report-ban=Invalid player as player is banned; Either unban or use /clear-all <player_name>
low-print=__1__ has been reported by a user for: __2__
high-print=__1__ has been reported by __2__ for: __3__
cant-report=This player can't be reported.

View File

@@ -0,0 +1,15 @@
[ExpGamingAdmin@4-0-0]
name=Commandes Admin
tooltip=Des commandes très puissantes résident ici.
no-info-file=Aucun fichier info trouvé
message=Veuillez sélectionner un joueur et une action, faites en sorte que ce soit la bonne !
warning=Attention, ce joueur est de rang supérieur au vôtre, vous ne pouvez le modifier.
short-reason=Attention, la raison indiquée est trop courte. Soyez concis mais aussi précis. (Warning: The reason is too short. UPDATE)
rank-high=Ce joueur est de rang supérieur, veuillez utiliser une commande dont vous maîtriser l'utilisation !
invalid=Le Joueur ou l'action est invalide, ré-essayez !
take-action=Agir
tooltip-ban=Bannir un Joueur
tooltip-kick=Exclure un Joueur
tooltip-jail=Emprisonner un Joueur
tooltip-go-to=Aller à la position d'un Joueur
tooltip-bring=Amener le Joueur à soi

View File

@@ -0,0 +1,15 @@
[ExpGamingAdmin@4-0-0]
name=Admin Commands
tooltip=Admin Commands kan je hier vinden.
no-info-file=Infobestand niet gevonden.
message=Selecteer een speler en de bijbehorende actie. Wees er zeker van dat je de correcte actie kiest.
warning=Fout: Je kan de rank van deze speler niet aanpassen omdat het jouw rank overtreft.
short-reason=Fout: De reden is te kort. (Warning: The reason is too short. UPDATE)
rank-high=Fout: Deze speler overtreft jouw rank.
invalid=Fout: De speler kan niet gevonden worden en/of de actie is onjuist. Probeer opnieuw!
take-action=Actie ondernemen
tooltip-ban=Ban speler
tooltip-kick=Kick speler
tooltip-jail=Jail speler
tooltip-go-to=Ga naar speler
tooltip-bring=Breng speler

View File

@@ -0,0 +1,19 @@
[ExpGamingAdmin@4-0-0]
name=Adminkommandon
tooltip=Adminkommando gör dit hem här
no-info-file=Ingen informationsfil kunde hittas
message=Var snäll och välj en spelare och en åtgärd att utfärda, se till att du väljer den rätta!
warning=Warning: Den här spelaren har högre rang än dig. Därför kan du inte redigera dess rang.
short-reason=Warning: Skälet är för kort.
rank-high=Warning: Den här spelaren har högre rang än dig. Därför kan du inte redigera dess rang.
invalid=Spelaren eller åtgärden är ogiltig. Var vänlig och försök igen!
take-action=Utför åtgärd.
tooltip-ban=Bannlys Spelare
tooltip-kick=Sparka Spelare
tooltip-jail=Fängsla Spelare
tooltip-go-to=Gå till Spelare
tooltip-bring=Hämta spelare
report=Rapportera Spelare
low-print=__1__ har blivit rapporterad av __2__ för: __3__
high-print=__1__ har blivit rapporterad av __2__ för: __3__
cant-report=Den här spelaren kan inte bli rapporterad.

View File

@@ -0,0 +1,20 @@
{
"name": "AdminLib",
"version": "4.0.0",
"type": "Submodule",
"description": "The base functions required to make the others work.",
"location": "<blank>",
"keywords": [
"lib",
"ExpGaming",
"Admin"
],
"author": "<blank>",
"contact": "<blank>",
"license": "<blank>",
"dependencies": {
"FactorioStdLib": "^0.8.0",
"ExpGamingCore.Ranking": "?^4.0.0",
"ExpGamingCore.Sync": "?^4.0.0"
}
}