Pre-allocate global config

This commit is contained in:
Vortrex
2021-10-15 22:38:33 -05:00
parent 4cc67d9c29
commit fe8d6d4f03

View File

@@ -10,13 +10,11 @@
let serverConfig = {}; let serverConfig = {};
let databaseConfig = {}; let databaseConfig = {};
let emailConfig = {}; let emailConfig = {};
let globalConfig = {};
let gameConfig = {}; let gameConfig = {};
// =========================================================================== // ===========================================================================
function loadGlobalConfig() { let globalConfig = {
return {
accountPasswordHash: "SHA512", accountPasswordHash: "SHA512",
npcFarProximity: 100, npcFarProximity: 100,
npcMediumProximity: 40, npcMediumProximity: 40,
@@ -68,7 +66,6 @@ function loadGlobalConfig() {
geoIPCityDatabaseFilePath: "geoip-city.mmdb", geoIPCityDatabaseFilePath: "geoip-city.mmdb",
randomTipInterval: 600000, randomTipInterval: 600000,
}; };
}
// =========================================================================== // ===========================================================================
@@ -80,7 +77,6 @@ function loadGameConfig() {
function initConfigScript() { function initConfigScript() {
logToConsole(LOG_INFO, "[VRR.Config]: Initializing config script ..."); logToConsole(LOG_INFO, "[VRR.Config]: Initializing config script ...");
globalConfig = loadGlobalConfig();
gameConfig = loadGameConfig(); gameConfig = loadGameConfig();
serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod()); serverConfig = loadServerConfigFromGameAndPort(server.game, server.port, getMultiplayerMod());
applyConfigToServer(serverConfig); applyConfigToServer(serverConfig);