From ab4106e568a6344d7b1d97aed060abf74aacd4fc Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 29 Sep 2022 11:16:29 -0500 Subject: [PATCH] Shutdown server if required module fail --- scripts/server/startup.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/server/startup.js b/scripts/server/startup.js index 3e945cd3..cb27c1ee 100644 --- a/scripts/server/startup.js +++ b/scripts/server/startup.js @@ -69,6 +69,15 @@ function checkForHashingModule() { // =========================================================================== +function checkForGeoIPModule() { + if (typeof module.geoip == "undefined") { + return false; + } + return true; +} + +// =========================================================================== + function checkForMySQLModule() { if (typeof module.mysql == "undefined") { return false; @@ -94,14 +103,14 @@ function checkForAllRequiredModules() { if (!checkForHashingModule()) { logToConsole(LOG_WARN, "[AGRP.Startup]: Hashing module is not loaded!"); - logToConsole(LOG_WARN, "[AGRP.Startup]: This resource will now shutdown."); - thisResource.stop(); + logToConsole(LOG_ERROR, "[AGRP.Startup]: This server will now shutdown."); + shutdownServer(); } if (!checkForMySQLModule()) { logToConsole(LOG_WARN, "[AGRP.Startup]: MySQL module is not loaded!"); - logToConsole(LOG_WARN, "[AGRP.Startup]: This resource will now shutdown."); - thisResource.stop(); + logToConsole(LOG_ERROR, "[AGRP.Startup]: This server will now shutdown."); + shutdownServer(); } //if (!checkForSMTPModule()) {