From 9a889ae67816c18a145d8407fa2e09d0f67e5450 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 10 Jun 2022 00:10:35 -0500 Subject: [PATCH] Disable email login alerts for now (hangs the server) --- scripts/server/account.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/server/account.js b/scripts/server/account.js index a97083b6..0214fd8f 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -840,9 +840,10 @@ function checkLogin(client, password) { logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`); } - if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { - sendAccountLoginFailedNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); - } + // Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it. + //if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { + // sendAccountLoginFailedNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); + //} return false; } @@ -856,9 +857,10 @@ function checkLogin(client, password) { logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} is being shown the login message (GUI disabled) with ${getPlayerData(client).loginAttemptsRemaining} login attempts remaining alert.`); } - if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { - sendAccountLoginFailedNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); - } + // Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it. + //if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { + // sendAccountLoginFailedNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); + //} return false; } @@ -875,9 +877,10 @@ function checkLogin(client, password) { loginSuccess(client); - if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { - sendAccountLoginSuccessNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); - } + // Disabling email login alerts for now. It hangs the server for a couple seconds. Need a way to thread it. + //if (isAccountEmailVerified(getPlayerData(client).accountData) && !isAccountSettingFlagEnabled(getPlayerData(client).accountData, getAccountSettingsFlagValue("AuthAttemptAlert"))) { + // sendAccountLoginSuccessNotification(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerIP(client), getGame()); + //} } // =========================================================================== @@ -1541,7 +1544,7 @@ function sendAccountLoginSuccessNotification(emailAddress, name, ip, game = getG emailBodyText = emailBodyText.replace("{SERVERNAME}", getServerName()); emailBodyText = emailBodyText.replace("{TIMESTAMP}", new Date().toLocaleString('en-US')); - sendEmail(emailAddress, name, `Login failed on ${getServerName()}`, emailBodyText); + sendEmail(emailAddress, name, `Login successful on ${getServerName()}`, emailBodyText); return true; }