Move bool settings for server config to bitflags

This commit is contained in:
Vortrex
2022-02-26 21:31:48 -06:00
parent a5f5558bc9
commit f22c001c48
3 changed files with 37 additions and 41 deletions

View File

@@ -162,13 +162,13 @@ function saveServerConfigToDatabase() {
let dbConnection = connectToDatabase();
if(dbConnection) {
let data = [
["svr_logo", boolToInt(getServerConfig().showLogo)],
["svr_gui", boolToInt(getServerConfig().useGUI)],
["svr_logo", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("ServerLogo")))],
["svr_gui", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GUI")))],
["svr_start_time_hour", getServerConfig().hour],
["svr_start_time_min", getServerConfig().minute],
["svr_start_weather", getServerConfig().weather],
["svr_start_snow_falling", boolToInt(getServerConfig().fallingSnow)],
["svr_start_snow_ground", boolToInt(getServerConfig().groundSnow)],
["svr_start_snow_falling", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("FallingSnow")))],
["svr_start_snow_ground", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GroundSnow")))],
["svr_newchar_pos_x", getServerConfig().newCharacter.spawnPosition.x],
["svr_newchar_pos_y", getServerConfig().newCharacter.spawnPosition.y],
["svr_newchar_pos_z", getServerConfig().newCharacter.spawnPosition.z],
@@ -200,16 +200,16 @@ function saveServerConfigToDatabase() {
["svr_charselect_int", getServerConfig().characterSelectInterior],
["svr_charselect_vw", getServerConfig().characterSelectDimension],
["svr_inflation_multiplier", getServerConfig().inflationMultiplier],
["svr_ac_enabled", boolToInt(getServerConfig().antiCheat.enabled)],
["svr_ac_check_scripts", boolToInt(getServerConfig().antiCheat.checkGameScripts)],
["svr_ac_script_wl", boolToInt(getServerConfig().antiCheat.gameScriptWhiteListEnabled)],
["svr_ac_script_bl", boolToInt(getServerConfig().antiCheat.gameScriptBlackListEnabled)],
["svr_job_pickups", boolToInt(getServerConfig().createJobPickups)],
["svr_job_blips", boolToInt(getServerConfig().createJobBlips)],
["svr_biz_pickups", boolToInt(getServerConfig().createBusinessPickups)],
["svr_biz_blips", boolToInt(getServerConfig().createBusinessBlips)],
["svr_house_pickups", boolToInt(getServerConfig().createHousePickups)],
["svr_house_blips", boolToInt(getServerConfig().createHouseBlips)],
["svr_ac_enabled", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("Anticheat")))],
["svr_ac_check_scripts", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("CheckGameScripts")))],
["svr_ac_script_wl", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GameScriptWhiteList")))],
["svr_ac_script_bl", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("GameScriptBlackList")))],
["svr_job_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobPickups")))],
["svr_job_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("JobBlips")))],
["svr_biz_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessPickups")))],
["svr_biz_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("BusinessBlips")))],
["svr_house_pickups", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HousePickups")))],
["svr_house_blips", boolToInt(hasBitFlag(getServerConfig().settings, getServerSettingsFlagValue("HouseBlips")))],
["svr_intro_music", getServerConfig().introMusicURL],
];