diff --git a/expcore/commands.lua b/expcore/commands.lua index 9c209dbe..feea499f 100644 --- a/expcore/commands.lua +++ b/expcore/commands.lua @@ -29,7 +29,7 @@ -- adds a parse that will cover numbers within the given range -- input, player and reject are common to all parse functions -- range_min and range_max are passed to the function from add_param - Commands.add_parse('number_range_int',function(input,player,reject,range_min,range_max) + Commands.add_parse('number-range-int',function(input,player,reject,range_min,range_max) local rtn = tonumber(input) and math.floor(tonumber(input)) or nil -- converts input to number if not rtn or rtn < range_min or rtn > range_max then -- check if it is nil or out of the range -- invalid input for we will reject the input, they are a few ways to do this: @@ -48,8 +48,8 @@ -- adds a command that will print the players name a given number of times -- and can only be used by admin to show how auth works - Commands.add_command('repeat-name','Will repeat you name a number of times in chat.') -- creates the new command with the name "repeat-name" and a help message - :add_param('repeat-count',false,'number_range_int',1,5) -- adds a new param called "repeat-count" that is required and is type "number_range_int" the name can be used here as add_parse was used + Commands.new_command('repeat-name','Will repeat you name a number of times in chat.') -- creates the new command with the name "repeat-name" and a help message + :add_param('repeat-count',false,'number-range-int',1,5) -- adds a new param called "repeat-count" that is required and is type "number_range_int" the name can be used here as add_parse was used :add_param('smiley',true,function(input,player,reject) -- this param is optional and has a custom parse function where add_parse was not used before hand if not input then return end -- when they is an optional param input may be nil, you can return a default value here, but using nil will allow add_defaults to pick a default if input:lower() == 'true' or input:lower() == 'yes' then @@ -109,7 +109,7 @@ end end) - Commands.add_command('repeat-name','Will repeat you name a number of times in chat.') + Commands.new_command('repeat-name','Will repeat you name a number of times in chat.') :add_param('repeat-count',false,'number_range_int',1,5) :add_param('smiley',true,function(input,player,reject) if not input then return end @@ -143,6 +143,7 @@ Commands.add_parse(name,callback) --- Adds a parse function which can be called by name rather than callback (used in add_param) Commands.remove_parse(name) --- Removes a parse function, see add_parse for adding them + Commands.parse(name,input,player,reject,...) --- Intended to be used within other parse functions, runs a parse and returns success and new value Commands.add_command(name,help) --- Creates a new command object to added details to, note this does not register the command to the game Commands._prototype:add_param(name,optional,parse,...) --- Adds a new param to the command this will be displayed in the help and used to parse the input @@ -233,7 +234,7 @@ function Commands.authorize(player,command_name) -- function passed to authorization callback to make it simpler to use local auth_fail = function(error_message) - failed = error_message or {'ExpGamingCore_Command.unauthorized'} + failed = error_message or {'expcore-commands.unauthorized'} return Commands.defines.unauthorized end @@ -250,7 +251,7 @@ function Commands.authorize(player,command_name) end elseif rtn == false or rtn == Commands.defines.unauthorized or rtn == auth_fail or failed then -- the callback returned unauthorized, failed be now be set if no value returned - failed = failed or {'ExpGamingCore_Command.unauthorized'} + failed = failed or {'expcore-commands.unauthorized'} break end end @@ -333,11 +334,24 @@ function Commands.remove_parse(name) Commands.parse[name] = nil end +--- Intended to be used within other parse functions, runs a parse and returns success and new value +-- @tparam name string the name of the parse to call, must be registered and cant be a function +-- @tparam input string the input to pass to the parse, will always be a string but might not be the orginal input +-- @treturn any the new value for the input, may be nil, if nil then either there was an error or input was nil +function Commands.parse(name,input,player,reject,...) + if not Commands.parse[name] then return end + local success,rtn = pcall(Commands.parse[name],input,player,reject,...) + if not success then error(rtn,2) return end + if not rtn then return end + if rtn == Commands.defines.error then return end + return rtn +end + --- Creates a new command object to added details to, note this does not register the command to the game -- @tparam name string the name of the command to be created -- @tparam help string the help message for the command -- @treturn Commands._prototype this will be used with other functions to generate the command functions -function Commands.add_command(name,help) +function Commands.new_command(name,help) local command = setmetatable({ name=name, help=help, @@ -474,7 +488,7 @@ end -- @treturn Commands.defines.error return this to command handler to exit execution function Commands.error(error_message,play_sound) error_message = error_message or '' - player_return({'ExpGamingCore_Command.command-fail',error_message},'orange_red') + player_return({'expcore-commands.command-fail',error_message},'orange_red') if play_sound ~= false then play_sound = play_sound or 'utility/wire_pickup' if game.player then game.player.play_sound{path=play_sound} end @@ -502,7 +516,7 @@ end -- @treturn Commands.defines.success return this to the command handler to prevent two success messages function Commands.success(value) if value then player_return(value) end - player_return({'ExpGamingCore_Command.command-ran'},'cyan') + player_return({'expcore-commands.command-ran'},'cyan') return Commands.defines.success end @@ -521,7 +535,7 @@ function Commands.run_command(command_event) -- null param check if command_data.min_param_count > 0 and not command_event.parameter then - Commands.error({'ExpGamingCore_Command.invalid-inputs',command_data.name,command_data.description}) + Commands.error({'expcore-commands.invalid-inputs',command_data.name,command_data.description}) return end @@ -549,7 +563,7 @@ function Commands.run_command(command_event) -- there are too many params given to the command if not command_data.auto_concat then -- error as they should not be more - Commands.error({'ExpGamingCore_Command.invalid-inputs',command_data.name,command_data.description}) + Commands.error({'expcore-commands.invalid-inputs',command_data.name,command_data.description}) return else -- concat to the last param @@ -575,7 +589,7 @@ function Commands.run_command(command_event) -- checks param count local param_count = #raw_params if param_count < command_data.min_param_count then - Commands.error({'ExpGamingCore_Command.invalid-inputs',command_data.name,command_data.description}) + Commands.error({'expcore-commands.invalid-inputs',command_data.name,command_data.description}) return end @@ -628,4 +642,5 @@ function Commands.run_command(command_event) if err ~= Commands.defines.error and err ~= Commands.defines.success then Commands.success(err) end end +require 'expcore.parse.command' -- loads some common parse types return Commands \ No newline at end of file diff --git a/expcore/locale/de.cfg b/expcore/locale/de.cfg index 1ea17d9b..e872b325 100644 --- a/expcore/locale/de.cfg +++ b/expcore/locale/de.cfg @@ -1,9 +1,9 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Unbefugt: Zugang verweigert. Du hast keinen Zugriff auf diese Befehle! +reject-number-range=ungültige Reichweite, Min: __1__, Max: __2__ +reject-string-max-length=ungültige Länge, Max: __1__ +reject-player=ungültiger Spieler Name, __1__ , Versuche "Tab" zu benutzen, damit sich der Name automatisch vervollständigt. +reject-player-online=Der betroffene Spieler ist offline, Befehl konnte nicht ausgeführt werden. +reject-player-alive=Der betroffene Spieler ist Tod, Befehl konnte nicht ausgeführt werden. invalid-inputs=ungültige Eingabe, /__1__ __2__ -invalid-range=ungültige Reichweite, Min: __1__, Max: __2__ -invalid-length=ungültige Länge, Max: __1__ -invalid-player=ungültiger Spieler Name, __1__ , Versuche "Tab" zu benutzen, damit sich der Name automatisch vervollständigt. -offline-player=Der betroffene Spieler ist offline, Befehl konnte nicht ausgeführt werden. -dead-player=Der betroffene Spieler ist Tod, Befehl konnte nicht ausgeführt werden. command-ran=Befehl ausgeführt. \ No newline at end of file diff --git a/expcore/locale/en.cfg b/expcore/locale/en.cfg index bdc9fb41..6486cb5b 100644 --- a/expcore/locale/en.cfg +++ b/expcore/locale/en.cfg @@ -1,14 +1,14 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=Unauthorized, Access is denied due to invalid credentials -error-string-list=Invalid Option, Must be one of: __1__ -error-string-len=Invalid Length, Max: __1__ -error-number=Invalid Number -error-number-range=Invalid Range, Min (exclusive): __1__, Max (inclusive): __2__ -error-player=Invaild Player Name, __1__ ,try using tab key to auto-complete the name -error-player-online=Player is offline. -error-player-alive=Player is dead. -error-player-rank=Player is of Higher Rank. +reject-string-options=Invalid Option, Must be one of: __1__ +reject-string-max-length=Invalid Length, Max: __1__ +reject-number=Invalid Number +reject-number-range=Invalid Range, Min (inclusive): __1__, Max (inclusive): __2__ +reject-player=Invaild Player Name, __1__ ,try using tab key to auto-complete the name +reject-player-online=Player is offline. +reject-player-alive=Player is dead. +reject-force=Invaild Force Name +reject-surface=Invaild surface Name invalid-inputs=Invalid Input, /__1__ __2__ -invalid-parse=Invalid Input, There was a problem prasing the paramaters command-ran=Command Complete command-fail=Command failed to run: __1__ \ No newline at end of file diff --git a/expcore/locale/fr.cfg b/expcore/locale/fr.cfg deleted file mode 100644 index 5d271090..00000000 --- a/expcore/locale/fr.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[ExpGamingCore_Command] -unauthorized=401 - Unauthorized: Access is denied due to invalid credentials -invalid-inputs=Invalid Input, /__1__ __2__ -invalid-range=Invalid Range, Min: __1__, Max: __2__ -invalid-length=Invalid Length, Max: __1__ -invalid-player=Invaild Player Name, __1__ ,try using tab key to auto-complete the name -offline-player=Player is offline, Command Failed To Run -dead-player=Player is dead, Command Failed To Run -command-ran=Command Complete \ No newline at end of file diff --git a/expcore/locale/nl.cfg b/expcore/locale/nl.cfg index 3742ef49..21e1ed58 100644 --- a/expcore/locale/nl.cfg +++ b/expcore/locale/nl.cfg @@ -1,9 +1,9 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Onbevoegd: toegang wordt geweigerd vanwege ongeldige inloggegevens +reject-number-range=Onjuiste radius, Min: __1__, Max: __2__ +reject-string-max-length=Onjuiste lengte, Max: __1__ +reject-player=Onjuiste naam, __1__ , probeer tab te gebruiken om de naam automatisch in te vullen +reject-player-online=Speler is offline. +reject-player-alive=Speler is dood. invalid-inputs=Onjuiste invoer, /__1__ __2__ -invalid-range=Onjuiste radius, Min: __1__, Max: __2__ -invalid-length=Onjuiste lengte, Max: __1__ -invalid-player=Onjuiste naam, __1__ , probeer tab te gebruiken om de naam automatisch in te vullen -offline-player=Speler is offline. -dead-player=Speler is dood. command-ran=Commando uitgevoerd. diff --git a/expcore/locale/sv-SE.cfg b/expcore/locale/sv-SE.cfg index 5ee344f0..078b7f17 100644 --- a/expcore/locale/sv-SE.cfg +++ b/expcore/locale/sv-SE.cfg @@ -1,9 +1,9 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Otillåten: Tillgång nekas på grund av otillräcklig säkerhetsprövning. +reject-number-range=Invalid räckvid, Min: __1__, Max: __2__ +reject-string-max-length=ogiltig längd, Max: __1__ +reject-player=Ogiltigt spelarnamn, __1__ , försök använda tab-tangenten för att auto-slutföra namn. +reject-player-online=Spelare är offline. Kommando misslyckades med att köras. +reject-player-alive=Spelare är död. Kommando misslyckades med att köras. invalid-inputs=Igiltig inmatning, /__1__ __2__ -invalid-range=Invalid räckvid, Min: __1__, Max: __2__ -invalid-length=ogiltig längd, Max: __1__ -invalid-player=Ogiltigt spelarnamn, __1__ , försök använda tab-tangenten för att auto-slutföra namn. -offline-player=Spelare är offline. Kommando misslyckades med att köras. -dead-player=Spelare är död. Kommando misslyckades med att köras. command-ran=Kommandot slutfört diff --git a/expcore/parse.command.lua b/expcore/parse.command.lua new file mode 100644 index 00000000..d5c706bf --- /dev/null +++ b/expcore/parse.command.lua @@ -0,0 +1,142 @@ +local Commands = require 'expcore.commands' +local Game = require 'utils.game' + +--[[ +>>>>Adds parses: + boolean + string-options - options: array + string-max-length - max_length: number + number + integer + number-range - range_min: number, range_max: number + integer-range - range_min: number, range_max: number + player + player-online + player-alive + force + surface +]] + +Commands.add_parse('boolean',function(input,player,reject) + if not input then return end -- nil check + input = input:lower() + if input == 'yes' + or input == 'y' + or input == 'true' + or input == '1' then + return true + else + return false + end +end) + +Commands.add_parse('string-options',function(input,player,reject,options) + if not input then return end -- nil check + input = input:lower() + for option in options do + if input == option:lower() then + return true + end + end + return reject{'reject-string-options',options:concat(', ')} +end) + +Commands.add_parse('string-max-length',function(input,player,reject,max_length) + if not input then return end -- nil check + local length = input:len() + if length > max_length then + return reject{'expcore-commands.reject-string-max-length',max_length} + else + return input + end +end) + +Commands.add_parse('number',function(input,player,reject) + if not input then return end -- nil check + local number = tonumber(input) + if not number then + return reject{'expcore-commands.reject-number'} + else + return number + end +end) + +Commands.add_parse('integer',function(input,player,reject) + if not input then return end -- nil check + local number = tonumber(input) + if not number then + return reject{'expcore-commands.reject-number'} + else + return number:floor() + end +end) + +Commands.add_parse('number-range',function(input,player,reject,range_min,range_max) + local number = Commands.parse('number',input,player,reject) + if not number then return end -- nil check + if number < range_min or number > range_max then + return reject{'expcore-commands.reject-number-range',range_min,range_max} + else + return number + end +end) + +Commands.add_parse('integer-range',function(input,player,reject,range_min,range_max) + local number = Commands.parse('integer',input,player,reject) + if not number then return end -- nil check + if number < range_min or number > range_max then + return reject{'expcore-commands.reject-number-range',range_min,range_max} + else + return number + end +end) + +Commands.add_parse('player',function(input,player,reject) + if not input then return end -- nil check + local input_player = Game.get_player_from_any(input) + if not player then + return reject{'expcore-commands.reject-player',input} + else + return input_player + end +end) + +Commands.add_parse('player-online',function(input,player,reject) + local input_player = Commands.parse('player',input,player,reject) + if not input_player then return end -- nil check + if not input_player.connected then + return reject{'expcore-commands.reject-player-online'} + else + return input_player + end +end) + +Commands.add_parse('player-alive',function(input,player,reject) + local input_player = Commands.parse('player-online',input,player,reject) + if not input_player then return end -- nil check + if not input_player.character or not input_player.character.health > 0 then + return reject{'expcore-commands.reject-player-alive'} + else + return input_player + end +end) + +Commands.add_parse('force',function(input,player,reject) + if not input then return end -- nil check + local force = game.forces[input] + if not force then + return reject{'expcore-commands.reject-force'} + else + return force + end +end) + +Commands.add_parse('surface',function(input,player,reject) + if not input then return end + local surface = game.surfaces[input] + if not surface then + return reject{'expcore-commands.reject-surface'} + else + return surface + end +end) \ No newline at end of file diff --git a/locale/en/expcore.cfg b/locale/en/expcore.cfg new file mode 100644 index 00000000..6486cb5b --- /dev/null +++ b/locale/en/expcore.cfg @@ -0,0 +1,14 @@ +[expcore-commands] +unauthorized=Unauthorized, Access is denied due to invalid credentials +reject-string-options=Invalid Option, Must be one of: __1__ +reject-string-max-length=Invalid Length, Max: __1__ +reject-number=Invalid Number +reject-number-range=Invalid Range, Min (inclusive): __1__, Max (inclusive): __2__ +reject-player=Invaild Player Name, __1__ ,try using tab key to auto-complete the name +reject-player-online=Player is offline. +reject-player-alive=Player is dead. +reject-force=Invaild Force Name +reject-surface=Invaild surface Name +invalid-inputs=Invalid Input, /__1__ __2__ +command-ran=Command Complete +command-fail=Command failed to run: __1__ \ No newline at end of file diff --git a/modules/commands/me.lua b/modules/commands/me.lua new file mode 100644 index 00000000..4482bf70 --- /dev/null +++ b/modules/commands/me.lua @@ -0,0 +1,7 @@ +local Commands = require 'expcore.commands' + +Commands.new_command('me','Sends an action message in the chat') +:add_param('action',false) +:register(function(player,action,raw) + game.print(string.format('%s %s',player.name,action)) +end) \ No newline at end of file diff --git a/modules/test.lua b/modules/test.lua index f9607b7a..870a8b5f 100644 --- a/modules/test.lua +++ b/modules/test.lua @@ -33,7 +33,7 @@ Commands.add_parse('number_range_int',function(input,player,reject,range_min,ran end end) -Commands.add_command('repeat-name','Will repeat you name a number of times in chat.') +Commands.new_command('repeat-name','Will repeat you name a number of times in chat.') :add_param('repeat-count',false,'number_range_int',1,5) :add_param('smiley',true,function(input,player,reject) if not input then return end @@ -54,5 +54,5 @@ end) end for i = 1,repeat_count do Commands.print(i..msg) -end + end end) \ No newline at end of file diff --git a/locale/en/DeconControl.cfg b/old/locale/en/DeconControl.cfg similarity index 100% rename from locale/en/DeconControl.cfg rename to old/locale/en/DeconControl.cfg diff --git a/locale/en/ExpGamingAdmin.AdminLib.cfg b/old/locale/en/ExpGamingAdmin.AdminLib.cfg similarity index 100% rename from locale/en/ExpGamingAdmin.AdminLib.cfg rename to old/locale/en/ExpGamingAdmin.AdminLib.cfg diff --git a/locale/en/ExpGamingAdmin.Warnings.cfg b/old/locale/en/ExpGamingAdmin.Warnings.cfg similarity index 100% rename from locale/en/ExpGamingAdmin.Warnings.cfg rename to old/locale/en/ExpGamingAdmin.Warnings.cfg diff --git a/locale/en/ExpGamingAdmin.cfg b/old/locale/en/ExpGamingAdmin.cfg similarity index 100% rename from locale/en/ExpGamingAdmin.cfg rename to old/locale/en/ExpGamingAdmin.cfg diff --git a/locale/en/ExpGamingBot.autoChat.cfg b/old/locale/en/ExpGamingBot.autoChat.cfg similarity index 100% rename from locale/en/ExpGamingBot.autoChat.cfg rename to old/locale/en/ExpGamingBot.autoChat.cfg diff --git a/locale/en/ExpGamingBot.autoMessage.cfg b/old/locale/en/ExpGamingBot.autoMessage.cfg similarity index 100% rename from locale/en/ExpGamingBot.autoMessage.cfg rename to old/locale/en/ExpGamingBot.autoMessage.cfg diff --git a/locale/en/ExpGamingCommands.home.cfg b/old/locale/en/ExpGamingCommands.home.cfg similarity index 100% rename from locale/en/ExpGamingCommands.home.cfg rename to old/locale/en/ExpGamingCommands.home.cfg diff --git a/locale/en/ExpGamingCore.Command.cfg b/old/locale/en/ExpGamingCore.Command.cfg similarity index 96% rename from locale/en/ExpGamingCore.Command.cfg rename to old/locale/en/ExpGamingCore.Command.cfg index bdc9fb41..66af8ae2 100644 --- a/locale/en/ExpGamingCore.Command.cfg +++ b/old/locale/en/ExpGamingCore.Command.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=Unauthorized, Access is denied due to invalid credentials error-string-list=Invalid Option, Must be one of: __1__ error-string-len=Invalid Length, Max: __1__ diff --git a/locale/en/ExpGamingCore.Gui.cfg b/old/locale/en/ExpGamingCore.Gui.cfg similarity index 100% rename from locale/en/ExpGamingCore.Gui.cfg rename to old/locale/en/ExpGamingCore.Gui.cfg diff --git a/locale/en/ExpGamingCore.Ranking.cfg b/old/locale/en/ExpGamingCore.Ranking.cfg similarity index 100% rename from locale/en/ExpGamingCore.Ranking.cfg rename to old/locale/en/ExpGamingCore.Ranking.cfg diff --git a/locale/en/ExpGamingCore.Role.cfg b/old/locale/en/ExpGamingCore.Role.cfg similarity index 100% rename from locale/en/ExpGamingCore.Role.cfg rename to old/locale/en/ExpGamingCore.Role.cfg diff --git a/locale/en/ExpGamingCore.Server.cfg b/old/locale/en/ExpGamingCore.Server.cfg similarity index 100% rename from locale/en/ExpGamingCore.Server.cfg rename to old/locale/en/ExpGamingCore.Server.cfg diff --git a/locale/en/ExpGamingInfo.Readme.cfg b/old/locale/en/ExpGamingInfo.Readme.cfg similarity index 100% rename from locale/en/ExpGamingInfo.Readme.cfg rename to old/locale/en/ExpGamingInfo.Readme.cfg diff --git a/locale/en/ExpGamingInfo.Rockets.cfg b/old/locale/en/ExpGamingInfo.Rockets.cfg similarity index 100% rename from locale/en/ExpGamingInfo.Rockets.cfg rename to old/locale/en/ExpGamingInfo.Rockets.cfg diff --git a/locale/en/ExpGamingInfo.Science.cfg b/old/locale/en/ExpGamingInfo.Science.cfg similarity index 100% rename from locale/en/ExpGamingInfo.Science.cfg rename to old/locale/en/ExpGamingInfo.Science.cfg diff --git a/locale/en/ExpGamingInfo.Tasklist.cfg b/old/locale/en/ExpGamingInfo.Tasklist.cfg similarity index 100% rename from locale/en/ExpGamingInfo.Tasklist.cfg rename to old/locale/en/ExpGamingInfo.Tasklist.cfg diff --git a/locale/en/ExpGamingPlayer.inventorySearch.cfg b/old/locale/en/ExpGamingPlayer.inventorySearch.cfg similarity index 100% rename from locale/en/ExpGamingPlayer.inventorySearch.cfg rename to old/locale/en/ExpGamingPlayer.inventorySearch.cfg diff --git a/locale/en/ExpGamingPlayer.playerInfo.cfg b/old/locale/en/ExpGamingPlayer.playerInfo.cfg similarity index 100% rename from locale/en/ExpGamingPlayer.playerInfo.cfg rename to old/locale/en/ExpGamingPlayer.playerInfo.cfg diff --git a/locale/en/ExpGamingPlayer.playerList.cfg b/old/locale/en/ExpGamingPlayer.playerList.cfg similarity index 100% rename from locale/en/ExpGamingPlayer.playerList.cfg rename to old/locale/en/ExpGamingPlayer.playerList.cfg diff --git a/locale/en/ExpGamingPlayer.polls.cfg b/old/locale/en/ExpGamingPlayer.polls.cfg similarity index 100% rename from locale/en/ExpGamingPlayer.polls.cfg rename to old/locale/en/ExpGamingPlayer.polls.cfg diff --git a/locale/en/GameSettingsGui.cfg b/old/locale/en/GameSettingsGui.cfg similarity index 100% rename from locale/en/GameSettingsGui.cfg rename to old/locale/en/GameSettingsGui.cfg diff --git a/locale/en/GuiAnnouncements.cfg b/old/locale/en/GuiAnnouncements.cfg similarity index 100% rename from locale/en/GuiAnnouncements.cfg rename to old/locale/en/GuiAnnouncements.cfg diff --git a/locale/en/WarpPoints.cfg b/old/locale/en/WarpPoints.cfg similarity index 100% rename from locale/en/WarpPoints.cfg rename to old/locale/en/WarpPoints.cfg diff --git a/locale/fr/DeconControl.cfg b/old/locale/fr/DeconControl.cfg similarity index 100% rename from locale/fr/DeconControl.cfg rename to old/locale/fr/DeconControl.cfg diff --git a/locale/fr/ExpGamingAdmin.AdminLib.cfg b/old/locale/fr/ExpGamingAdmin.AdminLib.cfg similarity index 100% rename from locale/fr/ExpGamingAdmin.AdminLib.cfg rename to old/locale/fr/ExpGamingAdmin.AdminLib.cfg diff --git a/locale/fr/ExpGamingAdmin.Warnings.cfg b/old/locale/fr/ExpGamingAdmin.Warnings.cfg similarity index 100% rename from locale/fr/ExpGamingAdmin.Warnings.cfg rename to old/locale/fr/ExpGamingAdmin.Warnings.cfg diff --git a/locale/fr/ExpGamingAdmin.cfg b/old/locale/fr/ExpGamingAdmin.cfg similarity index 100% rename from locale/fr/ExpGamingAdmin.cfg rename to old/locale/fr/ExpGamingAdmin.cfg diff --git a/locale/fr/ExpGamingBot.autoChat.cfg b/old/locale/fr/ExpGamingBot.autoChat.cfg similarity index 100% rename from locale/fr/ExpGamingBot.autoChat.cfg rename to old/locale/fr/ExpGamingBot.autoChat.cfg diff --git a/locale/fr/ExpGamingBot.autoMessage.cfg b/old/locale/fr/ExpGamingBot.autoMessage.cfg similarity index 100% rename from locale/fr/ExpGamingBot.autoMessage.cfg rename to old/locale/fr/ExpGamingBot.autoMessage.cfg diff --git a/locale/fr/ExpGamingCore.Command.cfg b/old/locale/fr/ExpGamingCore.Command.cfg similarity index 94% rename from locale/fr/ExpGamingCore.Command.cfg rename to old/locale/fr/ExpGamingCore.Command.cfg index 5d271090..2fbd4aee 100644 --- a/locale/fr/ExpGamingCore.Command.cfg +++ b/old/locale/fr/ExpGamingCore.Command.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Unauthorized: Access is denied due to invalid credentials invalid-inputs=Invalid Input, /__1__ __2__ invalid-range=Invalid Range, Min: __1__, Max: __2__ diff --git a/locale/fr/ExpGamingCore.Commands.cfg b/old/locale/fr/ExpGamingCore.Commands.cfg similarity index 94% rename from locale/fr/ExpGamingCore.Commands.cfg rename to old/locale/fr/ExpGamingCore.Commands.cfg index 5d271090..2fbd4aee 100644 --- a/locale/fr/ExpGamingCore.Commands.cfg +++ b/old/locale/fr/ExpGamingCore.Commands.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Unauthorized: Access is denied due to invalid credentials invalid-inputs=Invalid Input, /__1__ __2__ invalid-range=Invalid Range, Min: __1__, Max: __2__ diff --git a/locale/fr/ExpGamingCore.Gui.cfg b/old/locale/fr/ExpGamingCore.Gui.cfg similarity index 100% rename from locale/fr/ExpGamingCore.Gui.cfg rename to old/locale/fr/ExpGamingCore.Gui.cfg diff --git a/locale/fr/ExpGamingCore.Ranking.cfg b/old/locale/fr/ExpGamingCore.Ranking.cfg similarity index 100% rename from locale/fr/ExpGamingCore.Ranking.cfg rename to old/locale/fr/ExpGamingCore.Ranking.cfg diff --git a/locale/fr/ExpGamingInfo.Readme.cfg b/old/locale/fr/ExpGamingInfo.Readme.cfg similarity index 100% rename from locale/fr/ExpGamingInfo.Readme.cfg rename to old/locale/fr/ExpGamingInfo.Readme.cfg diff --git a/locale/fr/ExpGamingInfo.Rockets.cfg b/old/locale/fr/ExpGamingInfo.Rockets.cfg similarity index 100% rename from locale/fr/ExpGamingInfo.Rockets.cfg rename to old/locale/fr/ExpGamingInfo.Rockets.cfg diff --git a/locale/fr/ExpGamingInfo.Science.cfg b/old/locale/fr/ExpGamingInfo.Science.cfg similarity index 100% rename from locale/fr/ExpGamingInfo.Science.cfg rename to old/locale/fr/ExpGamingInfo.Science.cfg diff --git a/locale/fr/ExpGamingInfo.Tasklist.cfg b/old/locale/fr/ExpGamingInfo.Tasklist.cfg similarity index 100% rename from locale/fr/ExpGamingInfo.Tasklist.cfg rename to old/locale/fr/ExpGamingInfo.Tasklist.cfg diff --git a/locale/fr/ExpGamingPlayer.inventorySearch.cfg b/old/locale/fr/ExpGamingPlayer.inventorySearch.cfg similarity index 100% rename from locale/fr/ExpGamingPlayer.inventorySearch.cfg rename to old/locale/fr/ExpGamingPlayer.inventorySearch.cfg diff --git a/locale/fr/ExpGamingPlayer.playerInfo.cfg b/old/locale/fr/ExpGamingPlayer.playerInfo.cfg similarity index 100% rename from locale/fr/ExpGamingPlayer.playerInfo.cfg rename to old/locale/fr/ExpGamingPlayer.playerInfo.cfg diff --git a/locale/fr/ExpGamingPlayer.playerList.cfg b/old/locale/fr/ExpGamingPlayer.playerList.cfg similarity index 100% rename from locale/fr/ExpGamingPlayer.playerList.cfg rename to old/locale/fr/ExpGamingPlayer.playerList.cfg diff --git a/locale/fr/ExpGamingPlayer.polls.cfg b/old/locale/fr/ExpGamingPlayer.polls.cfg similarity index 100% rename from locale/fr/ExpGamingPlayer.polls.cfg rename to old/locale/fr/ExpGamingPlayer.polls.cfg diff --git a/locale/fr/GameSettingsGui.cfg b/old/locale/fr/GameSettingsGui.cfg similarity index 100% rename from locale/fr/GameSettingsGui.cfg rename to old/locale/fr/GameSettingsGui.cfg diff --git a/locale/fr/GuiAnnouncements.cfg b/old/locale/fr/GuiAnnouncements.cfg similarity index 100% rename from locale/fr/GuiAnnouncements.cfg rename to old/locale/fr/GuiAnnouncements.cfg diff --git a/locale/fr/WarpPoints.cfg b/old/locale/fr/WarpPoints.cfg similarity index 100% rename from locale/fr/WarpPoints.cfg rename to old/locale/fr/WarpPoints.cfg diff --git a/locale/nl/DeconControl.cfg b/old/locale/nl/DeconControl.cfg similarity index 100% rename from locale/nl/DeconControl.cfg rename to old/locale/nl/DeconControl.cfg diff --git a/locale/nl/ExpGamingAdmin.AdminLib.cfg b/old/locale/nl/ExpGamingAdmin.AdminLib.cfg similarity index 100% rename from locale/nl/ExpGamingAdmin.AdminLib.cfg rename to old/locale/nl/ExpGamingAdmin.AdminLib.cfg diff --git a/locale/nl/ExpGamingAdmin.Warnings.cfg b/old/locale/nl/ExpGamingAdmin.Warnings.cfg similarity index 100% rename from locale/nl/ExpGamingAdmin.Warnings.cfg rename to old/locale/nl/ExpGamingAdmin.Warnings.cfg diff --git a/locale/nl/ExpGamingAdmin.cfg b/old/locale/nl/ExpGamingAdmin.cfg similarity index 100% rename from locale/nl/ExpGamingAdmin.cfg rename to old/locale/nl/ExpGamingAdmin.cfg diff --git a/locale/nl/ExpGamingBot.autoChat.cfg b/old/locale/nl/ExpGamingBot.autoChat.cfg similarity index 100% rename from locale/nl/ExpGamingBot.autoChat.cfg rename to old/locale/nl/ExpGamingBot.autoChat.cfg diff --git a/locale/nl/ExpGamingBot.autoMessage.cfg b/old/locale/nl/ExpGamingBot.autoMessage.cfg similarity index 100% rename from locale/nl/ExpGamingBot.autoMessage.cfg rename to old/locale/nl/ExpGamingBot.autoMessage.cfg diff --git a/locale/nl/ExpGamingCore.Command.cfg b/old/locale/nl/ExpGamingCore.Command.cfg similarity index 94% rename from locale/nl/ExpGamingCore.Command.cfg rename to old/locale/nl/ExpGamingCore.Command.cfg index 3742ef49..77ad98b9 100644 --- a/locale/nl/ExpGamingCore.Command.cfg +++ b/old/locale/nl/ExpGamingCore.Command.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Onbevoegd: toegang wordt geweigerd vanwege ongeldige inloggegevens invalid-inputs=Onjuiste invoer, /__1__ __2__ invalid-range=Onjuiste radius, Min: __1__, Max: __2__ diff --git a/locale/nl/ExpGamingCore.Commands.cfg b/old/locale/nl/ExpGamingCore.Commands.cfg similarity index 94% rename from locale/nl/ExpGamingCore.Commands.cfg rename to old/locale/nl/ExpGamingCore.Commands.cfg index 3742ef49..77ad98b9 100644 --- a/locale/nl/ExpGamingCore.Commands.cfg +++ b/old/locale/nl/ExpGamingCore.Commands.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Onbevoegd: toegang wordt geweigerd vanwege ongeldige inloggegevens invalid-inputs=Onjuiste invoer, /__1__ __2__ invalid-range=Onjuiste radius, Min: __1__, Max: __2__ diff --git a/locale/nl/ExpGamingCore.Gui.cfg b/old/locale/nl/ExpGamingCore.Gui.cfg similarity index 100% rename from locale/nl/ExpGamingCore.Gui.cfg rename to old/locale/nl/ExpGamingCore.Gui.cfg diff --git a/locale/nl/ExpGamingCore.Ranking.cfg b/old/locale/nl/ExpGamingCore.Ranking.cfg similarity index 100% rename from locale/nl/ExpGamingCore.Ranking.cfg rename to old/locale/nl/ExpGamingCore.Ranking.cfg diff --git a/locale/nl/ExpGamingInfo.Readme.cfg b/old/locale/nl/ExpGamingInfo.Readme.cfg similarity index 100% rename from locale/nl/ExpGamingInfo.Readme.cfg rename to old/locale/nl/ExpGamingInfo.Readme.cfg diff --git a/locale/nl/ExpGamingInfo.Rockets.cfg b/old/locale/nl/ExpGamingInfo.Rockets.cfg similarity index 100% rename from locale/nl/ExpGamingInfo.Rockets.cfg rename to old/locale/nl/ExpGamingInfo.Rockets.cfg diff --git a/locale/nl/ExpGamingInfo.Science.cfg b/old/locale/nl/ExpGamingInfo.Science.cfg similarity index 100% rename from locale/nl/ExpGamingInfo.Science.cfg rename to old/locale/nl/ExpGamingInfo.Science.cfg diff --git a/locale/nl/ExpGamingInfo.Tasklist.cfg b/old/locale/nl/ExpGamingInfo.Tasklist.cfg similarity index 100% rename from locale/nl/ExpGamingInfo.Tasklist.cfg rename to old/locale/nl/ExpGamingInfo.Tasklist.cfg diff --git a/locale/nl/ExpGamingPlayer.inventorySearch.cfg b/old/locale/nl/ExpGamingPlayer.inventorySearch.cfg similarity index 100% rename from locale/nl/ExpGamingPlayer.inventorySearch.cfg rename to old/locale/nl/ExpGamingPlayer.inventorySearch.cfg diff --git a/locale/nl/ExpGamingPlayer.playerInfo.cfg b/old/locale/nl/ExpGamingPlayer.playerInfo.cfg similarity index 100% rename from locale/nl/ExpGamingPlayer.playerInfo.cfg rename to old/locale/nl/ExpGamingPlayer.playerInfo.cfg diff --git a/locale/nl/ExpGamingPlayer.playerList.cfg b/old/locale/nl/ExpGamingPlayer.playerList.cfg similarity index 100% rename from locale/nl/ExpGamingPlayer.playerList.cfg rename to old/locale/nl/ExpGamingPlayer.playerList.cfg diff --git a/locale/nl/ExpGamingPlayer.polls.cfg b/old/locale/nl/ExpGamingPlayer.polls.cfg similarity index 100% rename from locale/nl/ExpGamingPlayer.polls.cfg rename to old/locale/nl/ExpGamingPlayer.polls.cfg diff --git a/locale/nl/GameSettingsGui.cfg b/old/locale/nl/GameSettingsGui.cfg similarity index 100% rename from locale/nl/GameSettingsGui.cfg rename to old/locale/nl/GameSettingsGui.cfg diff --git a/locale/nl/GuiAnnouncements.cfg b/old/locale/nl/GuiAnnouncements.cfg similarity index 100% rename from locale/nl/GuiAnnouncements.cfg rename to old/locale/nl/GuiAnnouncements.cfg diff --git a/locale/nl/WarpPoints.cfg b/old/locale/nl/WarpPoints.cfg similarity index 100% rename from locale/nl/WarpPoints.cfg rename to old/locale/nl/WarpPoints.cfg diff --git a/locale/sv-SE/DeconControl.cfg b/old/locale/sv-SE/DeconControl.cfg similarity index 100% rename from locale/sv-SE/DeconControl.cfg rename to old/locale/sv-SE/DeconControl.cfg diff --git a/locale/sv-SE/ExpGamingAdmin.AdminLib.cfg b/old/locale/sv-SE/ExpGamingAdmin.AdminLib.cfg similarity index 100% rename from locale/sv-SE/ExpGamingAdmin.AdminLib.cfg rename to old/locale/sv-SE/ExpGamingAdmin.AdminLib.cfg diff --git a/locale/sv-SE/ExpGamingAdmin.Warnings.cfg b/old/locale/sv-SE/ExpGamingAdmin.Warnings.cfg similarity index 100% rename from locale/sv-SE/ExpGamingAdmin.Warnings.cfg rename to old/locale/sv-SE/ExpGamingAdmin.Warnings.cfg diff --git a/locale/sv-SE/ExpGamingAdmin.cfg b/old/locale/sv-SE/ExpGamingAdmin.cfg similarity index 100% rename from locale/sv-SE/ExpGamingAdmin.cfg rename to old/locale/sv-SE/ExpGamingAdmin.cfg diff --git a/locale/sv-SE/ExpGamingBot.autoChat.cfg b/old/locale/sv-SE/ExpGamingBot.autoChat.cfg similarity index 100% rename from locale/sv-SE/ExpGamingBot.autoChat.cfg rename to old/locale/sv-SE/ExpGamingBot.autoChat.cfg diff --git a/locale/sv-SE/ExpGamingBot.autoMessage.cfg b/old/locale/sv-SE/ExpGamingBot.autoMessage.cfg similarity index 100% rename from locale/sv-SE/ExpGamingBot.autoMessage.cfg rename to old/locale/sv-SE/ExpGamingBot.autoMessage.cfg diff --git a/locale/sv-SE/ExpGamingCore.Command.cfg b/old/locale/sv-SE/ExpGamingCore.Command.cfg similarity index 95% rename from locale/sv-SE/ExpGamingCore.Command.cfg rename to old/locale/sv-SE/ExpGamingCore.Command.cfg index 5ee344f0..99b1c6f4 100644 --- a/locale/sv-SE/ExpGamingCore.Command.cfg +++ b/old/locale/sv-SE/ExpGamingCore.Command.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Otillåten: Tillgång nekas på grund av otillräcklig säkerhetsprövning. invalid-inputs=Igiltig inmatning, /__1__ __2__ invalid-range=Invalid räckvid, Min: __1__, Max: __2__ diff --git a/locale/sv-SE/ExpGamingCore.Commands.cfg b/old/locale/sv-SE/ExpGamingCore.Commands.cfg similarity index 95% rename from locale/sv-SE/ExpGamingCore.Commands.cfg rename to old/locale/sv-SE/ExpGamingCore.Commands.cfg index 5ee344f0..99b1c6f4 100644 --- a/locale/sv-SE/ExpGamingCore.Commands.cfg +++ b/old/locale/sv-SE/ExpGamingCore.Commands.cfg @@ -1,4 +1,4 @@ -[ExpGamingCore_Command] +[expcore-commands] unauthorized=401 - Otillåten: Tillgång nekas på grund av otillräcklig säkerhetsprövning. invalid-inputs=Igiltig inmatning, /__1__ __2__ invalid-range=Invalid räckvid, Min: __1__, Max: __2__ diff --git a/locale/sv-SE/ExpGamingCore.Gui.cfg b/old/locale/sv-SE/ExpGamingCore.Gui.cfg similarity index 100% rename from locale/sv-SE/ExpGamingCore.Gui.cfg rename to old/locale/sv-SE/ExpGamingCore.Gui.cfg diff --git a/locale/sv-SE/ExpGamingCore.Ranking.cfg b/old/locale/sv-SE/ExpGamingCore.Ranking.cfg similarity index 100% rename from locale/sv-SE/ExpGamingCore.Ranking.cfg rename to old/locale/sv-SE/ExpGamingCore.Ranking.cfg diff --git a/locale/sv-SE/ExpGamingInfo.Readme.cfg b/old/locale/sv-SE/ExpGamingInfo.Readme.cfg similarity index 100% rename from locale/sv-SE/ExpGamingInfo.Readme.cfg rename to old/locale/sv-SE/ExpGamingInfo.Readme.cfg diff --git a/locale/sv-SE/ExpGamingInfo.Rockets.cfg b/old/locale/sv-SE/ExpGamingInfo.Rockets.cfg similarity index 100% rename from locale/sv-SE/ExpGamingInfo.Rockets.cfg rename to old/locale/sv-SE/ExpGamingInfo.Rockets.cfg diff --git a/locale/sv-SE/ExpGamingInfo.Science.cfg b/old/locale/sv-SE/ExpGamingInfo.Science.cfg similarity index 100% rename from locale/sv-SE/ExpGamingInfo.Science.cfg rename to old/locale/sv-SE/ExpGamingInfo.Science.cfg diff --git a/locale/sv-SE/ExpGamingInfo.Tasklist.cfg b/old/locale/sv-SE/ExpGamingInfo.Tasklist.cfg similarity index 100% rename from locale/sv-SE/ExpGamingInfo.Tasklist.cfg rename to old/locale/sv-SE/ExpGamingInfo.Tasklist.cfg diff --git a/locale/sv-SE/ExpGamingPlayer.inventorySearch.cfg b/old/locale/sv-SE/ExpGamingPlayer.inventorySearch.cfg similarity index 100% rename from locale/sv-SE/ExpGamingPlayer.inventorySearch.cfg rename to old/locale/sv-SE/ExpGamingPlayer.inventorySearch.cfg diff --git a/locale/sv-SE/ExpGamingPlayer.playerInfo.cfg b/old/locale/sv-SE/ExpGamingPlayer.playerInfo.cfg similarity index 100% rename from locale/sv-SE/ExpGamingPlayer.playerInfo.cfg rename to old/locale/sv-SE/ExpGamingPlayer.playerInfo.cfg diff --git a/locale/sv-SE/ExpGamingPlayer.playerList.cfg b/old/locale/sv-SE/ExpGamingPlayer.playerList.cfg similarity index 100% rename from locale/sv-SE/ExpGamingPlayer.playerList.cfg rename to old/locale/sv-SE/ExpGamingPlayer.playerList.cfg diff --git a/locale/sv-SE/ExpGamingPlayer.polls.cfg b/old/locale/sv-SE/ExpGamingPlayer.polls.cfg similarity index 100% rename from locale/sv-SE/ExpGamingPlayer.polls.cfg rename to old/locale/sv-SE/ExpGamingPlayer.polls.cfg diff --git a/locale/sv-SE/GameSettingsGui.cfg b/old/locale/sv-SE/GameSettingsGui.cfg similarity index 100% rename from locale/sv-SE/GameSettingsGui.cfg rename to old/locale/sv-SE/GameSettingsGui.cfg diff --git a/locale/sv-SE/GuiAnnouncements.cfg b/old/locale/sv-SE/GuiAnnouncements.cfg similarity index 100% rename from locale/sv-SE/GuiAnnouncements.cfg rename to old/locale/sv-SE/GuiAnnouncements.cfg diff --git a/locale/sv-SE/WarpPoints.cfg b/old/locale/sv-SE/WarpPoints.cfg similarity index 100% rename from locale/sv-SE/WarpPoints.cfg rename to old/locale/sv-SE/WarpPoints.cfg diff --git a/old/modules/ExpGamingCore/Command/control.lua b/old/modules/ExpGamingCore/Command/control.lua index 84b00e49..72cdde36 100644 --- a/old/modules/ExpGamingCore/Command/control.lua +++ b/old/modules/ExpGamingCore/Command/control.lua @@ -59,40 +59,40 @@ commands.validate = { ['string-inf']=function(value) return tostring(value) end, ['string-list']=function(value,event,list) local rtn = tostring(value) and table.includes(list,tostring(value)) and tostring(value) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-string-list',table.concat(list,', ')} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-string-list',table.concat(list,', ')} end return rtn end, ['string-len']=function(value,event,max) local rtn = tostring(value) and tostring(value):len() <= max and tostring(value) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-string-len',max} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-string-len',max} end return rtn end, ['number']=function(value) local rtn = tonumber(value) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-number'} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-number'} end return rtn end, ['number-int']=function(value) local rtn = tonumber(value) and math.floor(tonumber(value)) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-number'} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-number'} end return rtn end, ['number-range']=function(value,event,min,max) local rtn = tonumber(value) and tonumber(value) > min and tonumber(value) <= max and tonumber(value) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-number-range',min,max} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-number-range',min,max} end return rtn end, ['number-range-int']=function(value,event,min,max) local rtn = tonumber(value) and math.floor(tonumber(value)) > min and math.floor(tonumber(value)) <= max and math.floor(tonumber(value)) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-number-range',min,max} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-number-range',min,max} end return rtn end, ['player']=function(value) local rtn = Game.get_player(value) or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-player',value} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-player',value} end return rtn end, ['player-online']=function(value) local player,err = commands.validate['player'](value) if err then return commands.error(err) end local rtn = player.connected and player or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-player-online'} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-player-online'} end return rtn end, ['player-alive']=function(value) local player,err = commands.validate['player-online'](value) if err then return commands.error(err) end local rtn = player.character and player.character.health > 0 and player or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-player-alive'} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-player-alive'} end return rtn end, ['player-rank']=function(value,event) local player,err = commands.validate['player'](value) if err then return commands.error(err) end local rtn = player.admin and Game.get_player(event).admin and player or nil - if not rtn then return commands.error{'ExpGamingCore_Command.error-player-rank'} end return rtn end, + if not rtn then return commands.error{'expcore-commands.error-player-rank'} end return rtn end, ['player-rank-online']=function(value) local player,err = commands.validate['player-online'](value) if err then return commands.error(err) end @@ -212,13 +212,13 @@ local function run_custom_command(command) local success, err = pcall(callback,player,command.name,command) if not success then error(err) elseif not err then - player_return({'ExpGamingCore_Command.command-fail',{'ExpGamingCore_Command.unauthorized'}},defines.textcolor.crit) + player_return({'expcore-commands.command-fail',{'expcore-commands.unauthorized'}},defines.textcolor.crit) logMessage(player.name,command,'Failed to use command (Unauthorized)',commands.validate_args(command)) game.player.play_sound{path='utility/cannot_build'} return end end elseif data.default_admin_only == true and player and not player.admin then - player_return({'ExpGamingCore_Command.command-fail',{'ExpGamingCore_Command.unauthorized'}},defines.textcolor.crit) + player_return({'expcore-commands.command-fail',{'expcore-commands.unauthorized'}},defines.textcolor.crit) logMessage(player.name,command,'Failed to use command (Unauthorized)',commands.validate_args(command)) game.player.play_sound{path='utility/cannot_build'} return @@ -227,7 +227,7 @@ local function run_custom_command(command) local args, err = commands.validate_args(command) if args == commands.error then if is_type(err,'table') then table.insert(err,command.name) table.insert(err,commands.format_inputs(data)) - player_return({'ExpGamingCore_Command.command-fail',err},defines.textcolor.high) else player_return({'ExpGamingCore_Command.command-fail',{'ExpGamingCore_Command.invalid-inputs',command.name,commands.format_inputs(data)}},defines.textcolor.high) end + player_return({'expcore-commands.command-fail',err},defines.textcolor.high) else player_return({'expcore-commands.command-fail',{'expcore-commands.invalid-inputs',command.name,commands.format_inputs(data)}},defines.textcolor.high) end logMessage(player.name,command,'Failed to use command (Invalid Args)',args) player.play_sound{path='utility/deconstruct_big'} return @@ -235,7 +235,7 @@ local function run_custom_command(command) -- runs the command local success, err = pcall(data.callback,command,args) if not success then error(err) end - if err ~= commands.error then player_return({'ExpGamingCore_Command.command-ran'},defines.textcolor.info) end + if err ~= commands.error then player_return({'expcore-commands.command-ran'},defines.textcolor.info) end logMessage(player.name,command,'Used command',args) end