From 6dbdec5c8fe84106604f230511a0e6061d4417bd Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 15 Oct 2017 00:07:26 +0100 Subject: [PATCH] server-interface clean --- locale/ExpGaming-Core/ExpGaming - Lib.lua | 4 ++-- .../ExpGaming - Server Interface.lua | 21 ++++--------------- locale/en/exp_core.cfg | 13 +++++++++++- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/locale/ExpGaming-Core/ExpGaming - Lib.lua b/locale/ExpGaming-Core/ExpGaming - Lib.lua index a6b38c4f..6af74532 100644 --- a/locale/ExpGaming-Core/ExpGaming - Lib.lua +++ b/locale/ExpGaming-Core/ExpGaming - Lib.lua @@ -44,8 +44,8 @@ function table.val_to_str ( v ) return '"' .. string.gsub(v,'"', '\\"' ) .. '"' else return "table" == type( v ) and table.tostring( v ) or - "function" == type( v ) and '"cant_display_function"' or - "userdata" == type( v ) and '"cant_display_userdata"' or + "function" == type( v ) and '"cant-display-function"' or + "userdata" == type( v ) and '"cant-display-userdata"' or tostring( v ) end end diff --git a/locale/ExpGaming-Core/ExpGaming - Server Interface.lua b/locale/ExpGaming-Core/ExpGaming - Server Interface.lua index 2996d64c..40624478 100644 --- a/locale/ExpGaming-Core/ExpGaming - Server Interface.lua +++ b/locale/ExpGaming-Core/ExpGaming - Server Interface.lua @@ -5,21 +5,10 @@ This file can be used with permission but this and the credit below must remain Contact a member of management on our discord to seek permission to use our code. Any changes that you may make to the code are yours but that does not make the script yours. Discord: https://discord.gg/XSsBV6b - -The credit below may be used by another script do not remove. ]] -local credits = {{ - name='Explosive Gaming Server Interface', - owner='Explosive Gaming', - dev='Cooldude2606', - description='A way of talking with the server with out breaking achievements', - factorio_version='0.15.23', - show=true - }} -local function credit_loop(reg) for _,cred in pairs(reg) do table.insert(credits,cred) end end --Please Only Edit Below This Line----------------------------------------------------------- --this command is just a way or using loadstring from in game while keeping achievements -define_command('server-interface','For use of the highest staff only',{'command',true},function(player,event,args) +define_command('server-interface',{'server-interface.command-help'},{'command',true},function(player,event,args) if player == '' then local returned,value = pcall(loadstring(event.parameter)) if type(value) == 'table' then game.write_file('server-interface.log', '\n'..game.tick..' Ran by: Code: '..event.parameter..'\n Returned: '..table.tostring(value), true, 0) print(table.tostring(value)) @@ -31,7 +20,7 @@ define_command('server-interface','For use of the highest staff only',{'command' end end) --runs a server interface command with debug on and does not return any values to the user -define_command('debug','For use of the highest staff only, this will lag A LOT',{'command',true},function(player,event,args) +define_command('debug',{'server-interface.debug-command-help'},{'command',true},function(player,event,args) global.exp_core.debug.state = true debug_write({'START'},game.tick..' '..event.parameter) global.exp_core.debug.triggered = false @@ -77,7 +66,7 @@ end function get_sudo_info(string) local lenth = 0 for _,v in pairs(global.exp_core.sudo.temp_varibles) do lenth = lenth + 1 end - if string then return 'At game tick: '..game.tick..' Queue Lenth: '..#global.exp_core.sudo.commands..' Number of temp vars: '..lenth + if string then return {'server-interface.sudo-info',game.tick,#global.exp_core.sudo.commands,lenth} else return {tick=game.tick,commands=#global.exp_core.sudo.commands,temp_varibles=#global.exp_core.sudo.temp_varibles} end end -- stops all sudo commands @@ -114,6 +103,4 @@ Event.register(defines.events.on_tick, function(event) if data.remove_time <= game.tick then global.exp_core.sudo.temp_varibles[name] = nil end end end) -Event.register(Event.soft_init,function() global.exp_core.sudo = {commands={},temp_varibles={}} end) ---Please Only Edit Above This Line----------------------------------------------------------- -return credits \ No newline at end of file +Event.register(Event.soft_init,function() global.exp_core.sudo = {commands={},temp_varibles={}} end) \ No newline at end of file diff --git a/locale/en/exp_core.cfg b/locale/en/exp_core.cfg index 9b397a3e..7a3ea2d1 100644 --- a/locale/en/exp_core.cfg +++ b/locale/en/exp_core.cfg @@ -3,4 +3,15 @@ all-rank-print=\[Everyone\]: __1__ rank-up=__1__ was promoted to __2__ by __3__ rank-down=__1__ was demoted to __2__ by __3__ rank-given=You have been given the __1__ Rank! -tag-reset=Your Tag was reset due to a Rank change \ No newline at end of file +tag-reset=Your Tag was reset due to a Rank change + +[commands] +no-help=__1__ No Help Given +unauthorized=401 - Unauthorized: Access is denied due to invalid credentials +invalid-inputs=Invalid Input, /__1__ __2__ +command-ran=Command Complete + +[server-interface] +command-help=For use of the highest staff only +debug-command-help=For use of the highest staff only, this will lag A LOT +sudo-info=At game tick: __1__ Queue Lenth: __2__ Number of temp vars: __3__ \ No newline at end of file