New chat stuff (emoji, timestamps, etc)
This commit is contained in:
@@ -11,7 +11,6 @@
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let chatTimeStampsEnabled = false;
|
let chatTimeStampsEnabled = false;
|
||||||
let chatProfanityFilterEnabled = false;
|
|
||||||
let chatEmojiEnabled = false;
|
let chatEmojiEnabled = false;
|
||||||
|
|
||||||
let chatBoxHistory = [];
|
let chatBoxHistory = [];
|
||||||
@@ -53,15 +52,19 @@ function unBindChatBoxKeys() {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function receiveChatBoxMessageFromServer(messageString, colour) {
|
function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Received chatbox message from server: ${messageString}`);
|
logToConsole(LOG_DEBUG, `[VRR.Chat]: Received chatbox message from server: ${messageString}`);
|
||||||
|
|
||||||
// Just in case it's hidden by auto hide
|
// Just in case it's hidden by auto hide
|
||||||
//setChatWindowEnabled(true);
|
//setChatWindowEnabled(true);
|
||||||
|
|
||||||
let timeStamp = findResourceByName("agrp_time").exports.getCurrentUnixTimeStampSquirrel();
|
//let timeStamp = findResourceByName("agrp_time").exports.getCurrentUnixTimeStampSquirrel();
|
||||||
|
|
||||||
addToChatBoxHistory(messageString, colour, timeStamp);
|
hour = fillLeadingZeros(hour, 2);
|
||||||
|
minute = fillLeadingZeros(minute, 2);
|
||||||
|
second = fillLeadingZeros(second, 2);
|
||||||
|
|
||||||
|
addToChatBoxHistory(messageString, colour, hour, minute, second);
|
||||||
|
|
||||||
//let unixTimeStampMS = new Date().getTime();
|
//let unixTimeStampMS = new Date().getTime();
|
||||||
//let timeStampDate = new Date(unixTimeStampMS);
|
//let timeStampDate = new Date(unixTimeStampMS);
|
||||||
@@ -69,23 +72,26 @@ function receiveChatBoxMessageFromServer(messageString, colour) {
|
|||||||
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
||||||
|
|
||||||
let outputString = messageString;
|
let outputString = messageString;
|
||||||
//let timeStampString = "";
|
if (chatTimeStampsEnabled == true) {
|
||||||
//if (chatTimeStampsEnabled == true) {
|
|
||||||
//timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
|
//timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
|
||||||
//}
|
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
|
||||||
|
outputString = `${timeStampString}${messageString}`;
|
||||||
|
}
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Chat]: Changed colours in string: ${outputString}`);
|
logToConsole(LOG_DEBUG, `[VRR.Chat]: Changed colours in string: ${outputString}`);
|
||||||
let colouredString = replaceColoursInMessage(`${timeStampString}${outputString}`);
|
outputString = replaceColoursInMessage(`${outputString}`);
|
||||||
|
|
||||||
if (chatEmojiEnabled == true) {
|
if (chatEmojiEnabled == true) {
|
||||||
colouredString = replaceEmojiInMessage(colouredString);
|
logToConsole(LOG_DEBUG, `[VRR.Chat]: Enabled emoji in string: ${outputString}`);
|
||||||
|
outputString = replaceEmojiInMessage(outputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chatProfanityFilterEnabled == true) {
|
if (profanityFilterEnabled == true) {
|
||||||
colouredString = replaceProfanityInMessage(colouredString);
|
logToConsole(LOG_DEBUG, `[VRR.Chat]: Removed profanity in string: ${outputString}`);
|
||||||
|
outputString = replaceProfanityInMessage(outputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
message(colouredString, colour);
|
message(outputString, colour);
|
||||||
bottomMessageIndex = chatBoxHistory.length - 1;
|
bottomMessageIndex = chatBoxHistory.length - 1;
|
||||||
|
|
||||||
chatLastUse = getCurrentUnixTimestamp();
|
chatLastUse = getCurrentUnixTimestamp();
|
||||||
@@ -106,8 +112,8 @@ function setChatTimeStampsState(state) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function setChatProfanityFilterState(state) {
|
function setChatEmojiState(state) {
|
||||||
chatProfanityFilterEnabled = state;
|
chatEmojiEnabled = state;
|
||||||
updateChatBox();
|
updateChatBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,8 +125,8 @@ function setChatAutoHideDelay(delay) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function addToChatBoxHistory(messageString, colour, timeStamp) {
|
function addToChatBoxHistory(messageString, colour, hour, minute, second) {
|
||||||
chatBoxHistory.push([messageString, colour, timeStamp]);
|
chatBoxHistory.push([messageString, colour, hour, minute, second]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -159,12 +165,22 @@ function updateChatBox() {
|
|||||||
if (chatTimeStampsEnabled == true) {
|
if (chatTimeStampsEnabled == true) {
|
||||||
//let timeStampDate = new Date(chatBoxHistory[i][2]);
|
//let timeStampDate = new Date(chatBoxHistory[i][2]);
|
||||||
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
||||||
let timeStampText = findResourceByName("agrp_time").exports.getTimeStampOutput(chatBoxHistory[i][2]);
|
//let timeStampText = findResourceByName("agrp_time").exports.getTimeStampOutput(chatBoxHistory[i][2]);
|
||||||
|
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
||||||
|
|
||||||
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
|
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputString = replaceColoursInMessage(outputString);
|
outputString = replaceColoursInMessage(outputString);
|
||||||
|
|
||||||
|
if (chatEmojiEnabled == true) {
|
||||||
|
outputString = replaceEmojiInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profanityFilterEnabled == true) {
|
||||||
|
outputString = replaceProfanityInMessage(outputString);
|
||||||
|
}
|
||||||
|
|
||||||
message(outputString, chatBoxHistory[i][1]);
|
message(outputString, chatBoxHistory[i][1]);
|
||||||
} else {
|
} else {
|
||||||
message("", COLOUR_WHITE);
|
message("", COLOUR_WHITE);
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ let guiDownKey = false;
|
|||||||
// Pre-cache all allowed skins
|
// Pre-cache all allowed skins
|
||||||
let allowedSkins = getAllowedSkins(getGame());
|
let allowedSkins = getAllowedSkins(getGame());
|
||||||
|
|
||||||
|
let profanityFilterEnabled = false;
|
||||||
|
|
||||||
let localLocaleId = 0;
|
let localLocaleId = 0;
|
||||||
|
|
||||||
let serverData = {
|
let serverData = {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines);
|
addNetworkEventHandler("agrp.chatScrollLines", setChatScrollLines);
|
||||||
addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay);
|
addNetworkEventHandler("agrp.chatAutoHideDelay", setChatAutoHideDelay);
|
||||||
addNetworkEventHandler("agrp.chatTimeStamps", setChatTimeStampsState);
|
addNetworkEventHandler("agrp.chatTimeStamps", setChatTimeStampsState);
|
||||||
addNetworkEventHandler("agrp.chatProfanityFilter", setChatProfanityFilterState);
|
addNetworkEventHandler("agrp.chatEmoji", setChatEmojiState);
|
||||||
|
|
||||||
// Messaging (like textdraws and stuff)
|
// Messaging (like textdraws and stuff)
|
||||||
addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage);
|
addNetworkEventHandler("agrp.smallGameMessage", showSmallGameMessage);
|
||||||
@@ -154,6 +154,7 @@ function addAllNetworkHandlers() {
|
|||||||
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
|
addNetworkEventHandler("agrp.elementCollisions", setElementCollisionsEnabled);
|
||||||
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
||||||
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
||||||
|
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -617,3 +617,10 @@ function getServerData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setProfanityFilterState(state) {
|
||||||
|
profanityFilterEnabled = state;
|
||||||
|
updateChatBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -298,7 +298,7 @@ function toggleAccountGUICommand(command, params, client) {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login GUI`);
|
||||||
} else {
|
} else {
|
||||||
hideAllPlayerGUI(client);
|
hideAllPlayerGUI(client);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerConfig().name, getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "{ALTCOLOUR}/login{MAINCOLOUR}"));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -307,7 +307,7 @@ function toggleAccountGUICommand(command, params, client) {
|
|||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register GUI`);
|
||||||
} else {
|
} else {
|
||||||
hideAllPlayerGUI(client);
|
hideAllPlayerGUI(client);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerConfig().name, getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "{ALTCOLOUR}/register{MAINCOLOUR}"));
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled)`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -422,6 +422,23 @@ function toggleAccountProfanityFilterCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function toggleAccountReplaceEmojiCommand(command, params, client) {
|
||||||
|
let flagValue = getAccountSettingsFlagValue("ChatEmoji");
|
||||||
|
|
||||||
|
if (hasBitFlag(getPlayerData(client).accountData.settings, flagValue)) {
|
||||||
|
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "ChatEmojiSet", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`));
|
||||||
|
sendPlayerChatEmojiState(client, false);
|
||||||
|
} else {
|
||||||
|
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
|
||||||
|
messagePlayerSuccess(client, getLocaleString(client, "ChatEmojiSet", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`));
|
||||||
|
sendPlayerChatEmojiState(client, true);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function toggleAccountHideBloodCommand(command, params, client) {
|
function toggleAccountHideBloodCommand(command, params, client) {
|
||||||
let flagValue = getAccountSettingsFlagValue("NoBlood");
|
let flagValue = getAccountSettingsFlagValue("NoBlood");
|
||||||
|
|
||||||
@@ -1210,7 +1227,7 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
|
|||||||
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
messagePlayerAlert(client, getLocaleString(client, "RegistrationFailedCreateError"));
|
||||||
}
|
}
|
||||||
|
|
||||||
messagePlayerAlert(client, `${getServerConfig().name} staff have been notified of the problem and will fix it shortly.`);
|
messagePlayerAlert(client, `${getServerName()} staff have been notified of the problem and will fix it shortly.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1469,7 +1486,7 @@ function initClient(client) {
|
|||||||
showPlayerLoginGUI(client);
|
showPlayerLoginGUI(client);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled).`);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerConfig().name, getPlayerName(client), "/login"), getColourByName("softGreen"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeBack", getServerName(), getPlayerName(client), "/login"), getColourByName("softGreen"));
|
||||||
|
|
||||||
//if(checkForGeoIPModule()) {
|
//if(checkForGeoIPModule()) {
|
||||||
// let iso = module.geoip.getCountryISO(getPlayerIP(client));
|
// let iso = module.geoip.getCountryISO(getPlayerIP(client));
|
||||||
@@ -1487,7 +1504,7 @@ function initClient(client) {
|
|||||||
showPlayerRegistrationGUI(client);
|
showPlayerRegistrationGUI(client);
|
||||||
} else {
|
} else {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the register message (GUI disabled).`);
|
||||||
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerConfig().name, getPlayerName(client), "/register"), getColourByName("softGreen"));
|
messagePlayerNormal(client, getLocaleString(client, "WelcomeNewPlayer", getServerName(), getPlayerName(client), "/register"), getColourByName("softGreen"));
|
||||||
}
|
}
|
||||||
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
playRadioStreamForPlayer(client, getServerIntroMusicURL(), true, getPlayerStreamingRadioVolume(client));
|
||||||
}
|
}
|
||||||
@@ -1725,9 +1742,9 @@ function generateEmailVerificationCode() {
|
|||||||
function sendEmailVerificationEmail(client, emailVerificationCode) {
|
function sendEmailVerificationEmail(client, emailVerificationCode) {
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerConfig().name}`, emailBodyText);
|
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1735,9 +1752,9 @@ function sendEmailVerificationEmail(client, emailVerificationCode) {
|
|||||||
function sendPasswordResetEmail(client, verificationCode) {
|
function sendPasswordResetEmail(client, verificationCode) {
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmPasswordReset;
|
let emailBodyText = getEmailConfig().bodyContent.confirmPasswordReset;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", verificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", verificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerConfig().name}`, emailBodyText);
|
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Reset your password on ${getServerName()}`, emailBodyText);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1747,9 +1764,9 @@ function verifyAccountEmail(accountData, verificationCode) {
|
|||||||
|
|
||||||
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
let emailBodyText = getEmailConfig().bodyContent.confirmEmail;
|
||||||
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
emailBodyText = emailBodyText.replace("{VERIFICATIONCODE}", emailVerificationCode);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerConfig().name}`, emailBodyText);
|
sendEmail(getPlayerData(client).accountData.emailAddress, getPlayerData(client).accountData.name, `Confirm email on ${getServerName()}`, emailBodyText);
|
||||||
|
|
||||||
getPlayerData(client).accountData.emailAddress = emailAddress;
|
getPlayerData(client).accountData.emailAddress = emailAddress;
|
||||||
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);
|
getPlayerData(client).accountData.emailVerificationCode = module.hashing.sha512(emailVerificationCode);
|
||||||
@@ -1766,10 +1783,10 @@ function sendAccountLoginFailedNotification(emailAddress, name, ip, game = getGa
|
|||||||
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(game));
|
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(game));
|
||||||
emailBodyText = emailBodyText.replace("{IPADDRESS}", ip);
|
emailBodyText = emailBodyText.replace("{IPADDRESS}", ip);
|
||||||
emailBodyText = emailBodyText.replace("{LOCATION}", `${cityName}, ${subDivisionName}, ${countryName}`);
|
emailBodyText = emailBodyText.replace("{LOCATION}", `${cityName}, ${subDivisionName}, ${countryName}`);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login failed on ${getServerConfig().name}`, emailBodyText);
|
sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1784,10 +1801,10 @@ function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getG
|
|||||||
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(game));
|
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(game));
|
||||||
emailBodyText = emailBodyText.replace("{IPADDRESS}", ip);
|
emailBodyText = emailBodyText.replace("{IPADDRESS}", ip);
|
||||||
emailBodyText = emailBodyText.replace("{LOCATION}", `${cityName}, ${subDivisionName}, ${countryName}`);
|
emailBodyText = emailBodyText.replace("{LOCATION}", `${cityName}, ${subDivisionName}, ${countryName}`);
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US'));
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login successful on ${getServerConfig().name}`, emailBodyText);
|
sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1837,9 +1854,9 @@ function sendAccountTwoFactorAuthCode(emailAddress, name, twoFactorAuthCode) {
|
|||||||
let emailBodyText = getEmailConfig().bodyContent.twoFactorAuthentication;
|
let emailBodyText = getEmailConfig().bodyContent.twoFactorAuthentication;
|
||||||
emailBodyText = emailBodyText.replace("{2FACODE}", twoFactorAuthCode);
|
emailBodyText = emailBodyText.replace("{2FACODE}", twoFactorAuthCode);
|
||||||
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(getGame()));
|
emailBodyText = emailBodyText.replace("{GAMENAME}", getGameName(getGame()));
|
||||||
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerConfig().name);
|
emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName());
|
||||||
|
|
||||||
sendEmail(emailAddress, name, `Login code for ${getServerConfig().name}`, emailBodyText);
|
sendEmail(emailAddress, name, `Login code for ${getServerName()}`, emailBodyText);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,9 +119,10 @@ let serverBitFlagKeys = {
|
|||||||
"NoRandomTips",
|
"NoRandomTips",
|
||||||
"NoActionTips",
|
"NoActionTips",
|
||||||
"ChatBoxTimestamps",
|
"ChatBoxTimestamps",
|
||||||
"ChatProfanityFilter",
|
"ProfanityFilter",
|
||||||
"ChatAutoHide",
|
"ChatAutoHide",
|
||||||
"NoPlayerContent",
|
"NoPlayerContent",
|
||||||
|
"ChatEmoji",
|
||||||
//"NoBlood",
|
//"NoBlood",
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const AGRP_BIZ_TYPE_NORMAL = 1; // Normal business (sells item
|
|||||||
const AGRP_BIZ_TYPE_BANK = 2; // Bank
|
const AGRP_BIZ_TYPE_BANK = 2; // Bank
|
||||||
const AGRP_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
|
const AGRP_BIZ_TYPE_PUBLIC = 3; // Public business (Government, public service, etc)
|
||||||
const AGRP_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
|
const AGRP_BIZ_TYPE_PAINTBALL = 4; // Paintball arena. Player joins paintball/airsoft when they enter
|
||||||
|
const AGRP_BIZ_TYPE_DEALERSHIP = 5; // Vehicle Dealership (also for airplane, boat, etc)
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
@@ -873,7 +874,7 @@ function setBusinessPaintBallCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getBusinessData(businessId).entranceType = AGRP_BIZ_ENTRANCE_TYPE_PAINTBALL;
|
getBusinessData(businessId).type = AGRP_BIZ_TYPE_PAINTBALL;
|
||||||
getBusinessData(businessId).needsSaved = true;
|
getBusinessData(businessId).needsSaved = true;
|
||||||
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
|
messagePlayerSuccess(client, getLocaleString(client, "BusinessIsNowPaintBall"));
|
||||||
}
|
}
|
||||||
@@ -1305,6 +1306,7 @@ function setBusinessEntranceLabelToDealershipCommand(command, params, client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
getBusinessData(businessId).labelHelpType == AGRP_PROPLABEL_INFO_ENTERVEHICLE;
|
||||||
|
getBusinessData(businessId).type = AGRP_BIZ_TYPE_VEHDEALERSHIP;
|
||||||
updateBusinessPickupLabelData(businessId);
|
updateBusinessPickupLabelData(businessId);
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set the business type of {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} to dealership`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -527,7 +527,8 @@ function sendPlayerRemoveFromVehicle(client) {
|
|||||||
|
|
||||||
function sendChatBoxMessageToPlayer(client, messageText, colour) {
|
function sendChatBoxMessageToPlayer(client, messageText, colour) {
|
||||||
//messageClient(messageText, client, colour);
|
//messageClient(messageText, client, colour);
|
||||||
sendNetworkEventToPlayer("m", client, messageText, colour);
|
let date = new Date();
|
||||||
|
sendNetworkEventToPlayer("m", client, messageText, colour, date.getHours(), date.getMinutes(), date.getSeconds());
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -1245,3 +1246,15 @@ function sendPlayerChatBoxTimeStampsState(client, state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
function sendPlayerChatEmojiState(client, state) {
|
||||||
|
sendNetworkEventToPlayer("agrp.chatEmoji", client, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
function sendPlayerProfanityFilterState(client, state) {
|
||||||
|
sendNetworkEventToPlayer("agrp.profanityFilter", client, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==========================================================================
|
||||||
@@ -742,7 +742,7 @@ let serverEmoji = [
|
|||||||
[":dizzy:", "💫"],
|
[":dizzy:", "💫"],
|
||||||
[":speech_balloon:", "💬"],
|
[":speech_balloon:", "💬"],
|
||||||
[":white_flower:", "💮"],
|
[":white_flower:", "💮"],
|
||||||
[":_100:", "💯"],
|
[":100:", "💯"],
|
||||||
[":moneybag:", "💰"],
|
[":moneybag:", "💰"],
|
||||||
[":currency_exchange:", "💱"],
|
[":currency_exchange:", "💱"],
|
||||||
[":heavy_dollar_sign:", "💲"],
|
[":heavy_dollar_sign:", "💲"],
|
||||||
@@ -2462,11 +2462,18 @@ function doesWordStartWithVowel(word) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function replaceEmojiIntoString(message) {
|
/**
|
||||||
for (let i in emojiReplaceString) {
|
* Replaces emoji texts with actual emoji
|
||||||
message = message.replace(emojiReplaceString[i][0], emojiReplaceString[i][1]);
|
*
|
||||||
|
* @param {String} messageString - String with emoji names
|
||||||
|
* @return {String} String with actual emoji images
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function replaceEmojiInMessage(messageString) {
|
||||||
|
for (let i in serverEmoji) {
|
||||||
|
messageString = messageString.replace(serverEmoji[i][0], serverEmoji[i][1]);
|
||||||
}
|
}
|
||||||
return message;
|
return messageString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -2998,24 +3005,6 @@ function removeColoursInMessage(messageText) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
/**
|
|
||||||
* Replaces emoji texts with actual emoji
|
|
||||||
*
|
|
||||||
* @param {String} messageString - String with emoji names
|
|
||||||
* @return {String} String with actual emoji images
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function replaceEmojiInString(messageString) {
|
|
||||||
for (let i in emojiReplaceString) {
|
|
||||||
while (messageString.indexOf(emojiReplaceString[i][0]) != -1) {
|
|
||||||
messageString = messageString.replace(emojiReplaceString[i][0], emojiReplaceString[i][1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return messageString;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces profanity with masked words like: ******
|
* Replaces profanity with masked words like: ******
|
||||||
*
|
*
|
||||||
@@ -3023,7 +3012,7 @@ function replaceEmojiInString(messageString) {
|
|||||||
* @return {String} String with profanity masked
|
* @return {String} String with profanity masked
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function replaceProfanityInString(messageString) {
|
function replaceProfanityInMessage(messageString) {
|
||||||
for (let i in profanityFilterWords) {
|
for (let i in profanityFilterWords) {
|
||||||
while (messageString.indexOf(profanityFilterWords[i]) != -1) {
|
while (messageString.indexOf(profanityFilterWords[i]) != -1) {
|
||||||
messageString = messageString.replace(profanityFilterWords[i], fillStringWithCharacter("*", profanityFilterWords[i].length));
|
messageString = messageString.replace(profanityFilterWords[i], fillStringWithCharacter("*", profanityFilterWords[i].length));
|
||||||
@@ -3163,3 +3152,13 @@ function getAnimationData(animationSlot, gameId = getGame()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function fillLeadingZeros(number, length) {
|
||||||
|
let str = toString(number);
|
||||||
|
while (str.length < length) {
|
||||||
|
str = "0" + str;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user