Use new AGRP prefix on console msg

This commit is contained in:
Vortrex
2022-09-20 02:27:25 -05:00
parent 6ed7cd9bc6
commit 655a784d27
66 changed files with 579 additions and 564 deletions

View File

@@ -44,8 +44,8 @@ let serverCommands = [];
// ===========================================================================
function initCommandScript() {
logToConsole(LOG_INFO, "[VRR.Command]: Initializing commands script ...");
logToConsole(LOG_INFO, "[VRR.Command]: Initialized commands script!");
logToConsole(LOG_INFO, "[AGRP.Command]: Initializing commands script ...");
logToConsole(LOG_INFO, "[AGRP.Command]: Initialized commands script!");
}
// ===========================================================================
@@ -704,7 +704,7 @@ function addAllCommandHandlers() {
let commands = getCommands();
for (let i in commands) {
for (let j in commands[i]) {
logToConsole(LOG_DEBUG, `[VRR.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
logToConsole(LOG_DEBUG, `[AGRP.Command] Adding command handler for ${i} - ${commands[i][j].command}`);
addCommandHandler(commands[i][j].command, processPlayerCommand);
commandCount++;
}
@@ -713,7 +713,7 @@ function addAllCommandHandlers() {
removeCommandHandler("help");
addCommandHandler("help", helpCommand);
logToConsole(LOG_INFO, `[VRR.Command] ${commandCount} command handlers added!`);
logToConsole(LOG_INFO, `[AGRP.Command] ${commandCount} command handlers added!`);
}
// ===========================================================================
@@ -881,7 +881,7 @@ function processPlayerCommand(command, params, client) {
}
if (!doesCommandExist(toLowerCase(command))) {
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (invalid command): /${command} ${paramsDisplay}`);
let possibleCommand = getCommandFromParams(command);
if (possibleCommand != false && doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(possibleCommand.command)))) {
@@ -893,7 +893,7 @@ function processPlayerCommand(command, params, client) {
}
if (!commandData.enabled) {
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (command is disabled): /${command} ${paramsDisplay}`);
messagePlayerError(client, `The command {ALTCOLOUR}/${command}{MAINCOLOUR} is disabled!`);
messagePlayerError(client, getLocaleString(client, "CommandDisabled", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
return false;
@@ -901,7 +901,7 @@ function processPlayerCommand(command, params, client) {
if (doesCommandRequireLogin(toLowerCase(command))) {
if (!isPlayerLoggedIn(client)) {
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (requires login first): /${command} ${paramsDisplay}`);
messagePlayerError(client, getLocaleString(client, "CommandRequiresLogin", `{ALTCOLOUR}/${command}{MAINCOLOUR}`));
return false;
}
@@ -909,7 +909,7 @@ function processPlayerCommand(command, params, client) {
if (isClientFromDiscord(client)) {
if (!isCommandAllowedOnDiscord(command)) {
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command from discord, but failed (not available on discord): /${command} ${paramsDisplay}`);
messagePlayerError(client, `The {ALTCOLOUR}/${command}{MAINCOLOUR} command isn't available on discord!`);
return false;
}
@@ -917,13 +917,13 @@ function processPlayerCommand(command, params, client) {
if (!isConsole(client)) {
if (!doesPlayerHaveStaffPermission(client, getCommandRequiredPermissions(toLowerCase(command)))) {
logToConsole(LOG_WARN, `[VRR.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
logToConsole(LOG_WARN, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} attempted to use command, but failed (no permission): /${command} ${paramsDisplay}`);
messagePlayerError(client, getLocaleString(client, "CommandNoPermissions", `{ALTCOLOUR}/${toLowerCase(command)}{MAINCOLOUR}`));
return false;
}
}
logToConsole(LOG_DEBUG, `[VRR.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
logToConsole(LOG_DEBUG, `[AGRP.Command] ${getPlayerDisplayForConsole(client)} used command: /${command} ${paramsDisplay}`);
commandData.handlerFunction(toLowerCase(command), params, client);
}