diff --git a/scripts/server/config.js b/scripts/server/config.js index 215cec32..1e0a4afa 100644 --- a/scripts/server/config.js +++ b/scripts/server/config.js @@ -178,12 +178,12 @@ let gameConfig = false; let globalConfig = { keyBind: [], - economy: {}, database: {}, locale: {}, accents: {}, discord: {}, email: {}, + security: {}, accountPasswordHash: "SHA512", npcFarProximity: 100, npcMediumProximity: 40, @@ -333,6 +333,13 @@ function loadGlobalConfig() { thisResource.stop(); } + try { + getGlobalConfig().security = loadSecurityConfig(); + } catch (error) { + logToConsole(LOG_ERROR, `[V.RP.Config] Failed to load security configuration. Error: ${error}`); + thisResource.stop(); + } + logToConsole(LOG_DEBUG, "[V.RP.Config] Loaded global configuration successfully!"); } @@ -1075,6 +1082,17 @@ function loadEmailConfig() { // =========================================================================== +function loadSecurityConfig() { + logToConsole(LOG_DEBUG, "[V.RP.Config] Loading security configuration ..."); + let securityConfig = JSON.parse(loadTextFile("config/security.json")); + if (securityConfig != null) { + return securityConfig; + } + return false; +} + +// =========================================================================== + function doesServerHaveGUIEnabled() { return getServerConfig().useGUI; }