Cleanup
This commit is contained in:
@@ -16,7 +16,7 @@ function initMessagingScript() {
|
||||
|
||||
function announceAdminAction(localeString, ...args) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
for (let i in clients) {
|
||||
let argsArray = [clients[i], localeString];
|
||||
argsArray = argsArray.concat(args);
|
||||
let messageText = getLocaleString.apply(null, argsArray);
|
||||
@@ -61,8 +61,8 @@ function messageAdmins(messageText, colour = getColourByName("softRed")) {
|
||||
//logToConsole(LOG_WARN, `🛡️ ${plainMessage}`);
|
||||
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
||||
for (let i in clients) {
|
||||
if (doesPlayerHaveStaffPermission(clients[i], getStaffFlagValue("BasicModeration"))) {
|
||||
messagePlayerNormal(clients[i], `🛡️ ${messageText}`, colour);
|
||||
}
|
||||
}
|
||||
@@ -74,12 +74,12 @@ function messageAdmins(messageText, colour = getColourByName("softRed")) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerError(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `❌ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `❌ ${messageText}`, getColourByName("white"));
|
||||
} else {
|
||||
messageDiscordUser(client, `❌ ${messageText}`);
|
||||
@@ -89,12 +89,12 @@ function messagePlayerError(client, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerSyntax(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `⌨️ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `⌨️ USAGE: {MAINCOLOUR} ${messageText}`, getColourByType("syntaxMessage"));
|
||||
} else {
|
||||
messageDiscordUser(client, `⌨️ ${messageText}`);
|
||||
@@ -104,12 +104,12 @@ function messagePlayerSyntax(client, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerAlert(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `⚠️ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `⚠️ ${messageText}`, getColourByName("white"));
|
||||
} else {
|
||||
messageDiscordUser(client, `⚠️ ${messageText}`);
|
||||
@@ -119,12 +119,12 @@ function messagePlayerAlert(client, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerSuccess(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `✔️ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `✔️ ${messageText}`, getColourByName("white"));
|
||||
} else {
|
||||
messageDiscordUser(client, `✔️ ${messageText}`);
|
||||
@@ -134,12 +134,12 @@ function messagePlayerSuccess(client, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerInfo(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `ℹ️ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white"));
|
||||
} else {
|
||||
messageDiscordUser(client, `:information_source: ${messageText}`);
|
||||
@@ -149,12 +149,12 @@ function messagePlayerInfo(client, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerTip(client, messageText) {
|
||||
if(isConsole(client)) {
|
||||
if (isConsole(client)) {
|
||||
logToConsole(LOG_INFO, `ℹ️ ${messageText}`);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `ℹ️ ${messageText}`, getColourByName("white"));
|
||||
} else {
|
||||
messageDiscordUser(client, `:information_source: ${messageText}`);
|
||||
@@ -188,7 +188,7 @@ function messagePlayerShout(client, shoutingClient, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerDoAction(client, doingActionClient, messageText) {
|
||||
if(!isClientFromDiscord(client)) {
|
||||
if (!isClientFromDiscord(client)) {
|
||||
messagePlayerNormal(client, `${messageText} * (${getClientSubAccountName(doingActionClient)})`, getColourByType("doActionMessage"));
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ function messagePlayerAdminChat(client, adminChattingClient, messageText) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerNewbieTip(client, message) {
|
||||
if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoActionTips"))) {
|
||||
if (!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoActionTips"))) {
|
||||
messagePlayerNormal(client, `💡 ${message}`);
|
||||
}
|
||||
}
|
||||
@@ -222,8 +222,8 @@ function messagePlayerNewbieTip(client, message) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayerTimedRandomTip(client, message) {
|
||||
if(isPlayerLoggedIn(client) && isPlayerSpawned(client)) {
|
||||
if(!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoRandomTips"))) {
|
||||
if (isPlayerLoggedIn(client) && isPlayerSpawned(client)) {
|
||||
if (!hasBitFlag(getPlayerData(client).accountData.settings, getAccountSettingsFlagValue("NoRandomTips"))) {
|
||||
messagePlayerNormal(client, `💡 ${message}`);
|
||||
}
|
||||
}
|
||||
@@ -233,7 +233,7 @@ function messagePlayerTimedRandomTip(client, message) {
|
||||
|
||||
function makeChatBoxSectionHeader(name) {
|
||||
let resultString = `{clanOrange}== {jobYellow}${name} `;
|
||||
let endFiller = fillStringWithCharacter("=", getGlobalConfig().chatSectionHeaderLength-resultString.length);
|
||||
let endFiller = fillStringWithCharacter("=", getGlobalConfig().chatSectionHeaderLength - resultString.length);
|
||||
return `${resultString} {clanOrange}${endFiller}`;
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ function makeChatBoxSectionHeader(name) {
|
||||
|
||||
function clearChatBox(client) {
|
||||
//game.messages.clear();
|
||||
for(let i = 0; i <= 20; i++) {
|
||||
for (let i = 0; i <= 20; i++) {
|
||||
messageClient(" ", client, COLOUR_WHITE);
|
||||
}
|
||||
}
|
||||
@@ -255,8 +255,8 @@ function messagePlayerHelpContent(client, messageString) {
|
||||
// ===========================================================================
|
||||
|
||||
function messagePlayersInRace(raceId, message) {
|
||||
for(let i in clients) {
|
||||
if(getPlayerRace(clients[i]) == raceId) {
|
||||
for (let i in clients) {
|
||||
if (getPlayerRace(clients[i]) == raceId) {
|
||||
messagePlayerNormal(clients[i], message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user