From 1db988095e276c3e72c72a82f03d4cfabf071077 Mon Sep 17 00:00:00 2001 From: vbawol Date: Thu, 29 Dec 2016 12:18:09 -0600 Subject: [PATCH] booleans in configs - change bools in config files to string or a number. - EPOCH_fnc_returnConfigEntry(V2) now also supports 0/1 via config when default input is a bool. Note: this commit may address issue with Bad conversion: bool rpt spam. It is suggested to use the following format for storing booleans in config: 1 = true "true"=true 0 = false "false"=false --- Server_Install_Pack/@epochhive/epochah.hpp | 6 ++-- .../@epochhive/epochconfig.hpp | 28 +++++++++---------- .../EPOCH_fn_returnConfigEntryV2.sqf | 2 +- Sources/epoch_config/sandbox_config.hpp | 6 ++-- .../epoch_server/init/server_variables.sqf | 2 +- .../configs/security/security_checks.h | 4 +-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Server_Install_Pack/@epochhive/epochah.hpp b/Server_Install_Pack/@epochhive/epochah.hpp index c88786ad..6b21571d 100644 --- a/Server_Install_Pack/@epochhive/epochah.hpp +++ b/Server_Install_Pack/@epochhive/epochah.hpp @@ -1,8 +1,8 @@ // Anti Hack -antihack_Enabled = true; // built-in Anti-Hack +antihack_Enabled = "true"; // built-in Anti-Hack antihack_maxTravelDistance = 30; // anti-teleport max travel distance antihack_TPcenterDistance = 30; // anti-teleport distance from start -antihack_cfgPatchesCheck = true; // cfgPatches (AddOn Check) +antihack_cfgPatchesCheck = "true"; // cfgPatches (AddOn Check) antihack_PVSPrefix = "EPAH_"; // used to help whitelist pveh variables in BE without BEC and watchdog, leave blank to use no prefix. antihack_cfgPatchesMode[] = {2}; // 0 == BAN - 1 = LOG, 2 = KICK antihack_ahInitAuthCfg[] = {0,180}; // 0 == BAN - 1 = LOG, 60 = ban or log if anti hack is not started in 180 seconds @@ -24,7 +24,7 @@ antihack_checkFiles[] = { //script check, leave it blank to disable it {"epoch_code\compile\setup\EPOCH_clientRespawn.sqf", "EPOCH_clientRespawn"}, {"epoch_code\compile\interface_event_handlers\EPOCH_KeyDown.sqf", "EPOCH_KeyDown"} }; -antihack_addActionCheck = true; // false to disable addAction checks +antihack_addActionCheck = "true"; // false to disable addAction checks adminMenu_Owner[] = {}; adminMenu_OwnerSetting[] = { "ESP-PLAYER", diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index 3a93d922..4fa8612e 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -1,4 +1,4 @@ -serverRestart = false; // true sends #shutdown command to server after the time specified in ForceRestartTime +serverRestart = "false"; // true sends #shutdown command to server after the time specified in ForceRestartTime forceRestartTime = 14400; // 4 hour restarts StorageSlotsLimit = 1500; // Max storage slots allowed. Warning! Higher the number lower performance. @@ -28,7 +28,7 @@ antagonistChanceLoot = 0.09; //9% chance when player click "SEARCH" on a loot ob cloneCost = 100; // debt incurred on player death // vehicles - Max vehicle slots is calculated from per vehicle limits below. Warning! Higher the number lower the performance. -simulationHandlerOld = false; // When enabled this feature disables simulation on vehicles that are not nea players. Can help improve client fps at the cost of server fps. +simulationHandlerOld = "false"; // When enabled this feature disables simulation on vehicles that are not nea players. Can help improve client fps at the cost of server fps. vehicleLockTime = 1800; // Controls how many seconds it takes to allow another person/group to unlock vehicle. removevehweapons[] = { // remove these Weapons from spawned Vehicles "missiles_DAR","gatling_30mm","gatling_20mm","missiles_DAGR","cannon_30mm_Plane_CAS_02_F","Missile_AA_03_Plane_CAS_02_F","Missile_AGM_01_Plane_CAS_02_F","Rocket_03_HE_Plane_CAS_02_F", @@ -41,7 +41,7 @@ removevehmagazinesturret[] = { // Remove these Magazines from the given Turret f }; // BaseBuilding -UseIndestructible = false; // Enable / Disable Indestructible BaseObjects +UseIndestructible = "false"; // Enable / Disable Indestructible BaseObjects IndestructibleBaseObjects[] = { // Can be Names or Classes "Constructions_static_F", "Buildable_Storage", @@ -60,15 +60,15 @@ ExceptedBaseObjects[] = { // Not Indestructible, also if in a Class of Indestr taxRate = 0.1; // controls the price increase for purchases starterTraderItems[] = { { "ItemSodaBurst", "meatballs_epoch", "MortarBucket", "CinderBlocks", "VehicleRepair", "CircuitParts", "ItemCorrugated", "PartPlankPack", "ItemRock", "ItemRope", "ItemStick" }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 } }; // Starter Items for fresh spawned trader first array is classnames second is quantity. NPCSlotsLimit = 20; // Max number of traders static or dynamic. Warning! Higher the number lower performance. -forceStaticTraders = true; // disables traders moving from work to home +forceStaticTraders = "true"; // disables traders moving from work to home // Markers -showEarthQuakes = true; // show mineral viens caused by earthquakes -showShippingContainers = true; // Show location of events based loots (plants, shipping container, Carnival) -SHOW_TRADERS = true; // Show locations of traders -SHOW_JAMMERS = false; // Shows location of base jammers -SHOW_BOATLOOT = true; // Shows the location of shipwreck loot -DEBUG_VEH = false; // DEBUG ONLY used to debug spawing of vehicles +showEarthQuakes = "true"; // show mineral viens caused by earthquakes +showShippingContainers = "true"; // Show location of events based loots (plants, shipping container, Carnival) +SHOW_TRADERS = "true"; // Show locations of traders +SHOW_JAMMERS = "false"; // Shows location of base jammers +SHOW_BOATLOOT = "true"; // Shows the location of shipwreck loot +DEBUG_VEH = "false"; // DEBUG ONLY used to debug spawing of vehicles // Hive Related expiresBuilding = "604800"; // expiration date in seconds for buildings @@ -76,12 +76,12 @@ expiresPlayer = "2592000"; // expiration date in seconds for players expiresBank = "7776000"; // expiration date in seconds for players bank expiresVehicle = "604800"; // expiration date in seconds for vehicles expiresAIdata = "604800"; // expiration date in seconds for NPC Trader inventory -hiveAsync = true; // true = asynchronous hive calls (non blocking), false = synchronous hive calls (blocking) +hiveAsync = "true"; // true = asynchronous hive calls (non blocking), false = synchronous hive calls (blocking) // Admin Features -hiveAdminCmdExec = false; // true = enables extra (To Be Released) feature to allow execution of code via hive. -hiveAdminSavePlayerList = true; // true = enables saving of playerUID array to hive value PLAYERS:#InstanceID. +hiveAdminCmdExec = "false"; // true = enables extra (To Be Released) feature to allow execution of code via hive. +hiveAdminSavePlayerList = "true"; // true = enables saving of playerUID array to hive value PLAYERS:#InstanceID. hiveAdminCmdTime = 5; // how many seconds between each command queue call. // DEBUG -useOldLoadVehicles = false; +useOldLoadVehicles = "false"; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf b/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf index 9baf7249..d9766585 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf @@ -40,7 +40,7 @@ if (isClass(_config)) then{ if (configName(_finalconfig) == _variableName) then{ _varData = switch (typeName _defaultData) do { case "SCALAR": {if (isNumber (_finalconfig)) then { getNumber _finalconfig } else {_defaultData} }; - case "BOOL": {if (isText (_finalconfig)) then { (getText _finalconfig) isEqualTo "true" } else {_defaultData} }; + case "BOOL": {if (isText (_finalconfig)) then {(getText _finalconfig) isEqualTo "true"} else {if (isNumber (_finalconfig)) then {(getNumber _config) isEqualTo 1} else {_defaultData}}}; case "ARRAY": {if (isArray (_finalconfig)) then { getArray _finalconfig } else {_defaultData} }; case "STRING": {if (isText (_finalconfig)) then { getText _finalconfig } else {_defaultData} }; default {_defaultData}; diff --git a/Sources/epoch_config/sandbox_config.hpp b/Sources/epoch_config/sandbox_config.hpp index 3ab87bbc..cb6a82ec 100644 --- a/Sources/epoch_config/sandbox_config.hpp +++ b/Sources/epoch_config/sandbox_config.hpp @@ -26,10 +26,10 @@ onPauseScript = "epoch_code\gui\scripts\Epoch_onPause.sqf"; onLoadMission= "Epoch"; OnLoadIntro = "Welcome to Epoch Mod"; loadScreen = "\x\addons\a3_epoch_assets\pictures\loadScreen_ca.paa"; -OnLoadIntroTime = False; -OnLoadMissionTime = False; +OnLoadIntroTime = 0; +OnLoadMissionTime = 0; onLoadName = "Epoch Mod"; -disabledAI = true; +disabledAI = 1; scriptedPlayer = 1; disableChannels[]={{0,true,true},{1,false,true},{2,true,true},{6,true,true}}; // allow text only on side chat enableItemsDropping = 0; diff --git a/Sources/epoch_server/init/server_variables.sqf b/Sources/epoch_server/init/server_variables.sqf index e5815b6f..b0438802 100644 --- a/Sources/epoch_server/init/server_variables.sqf +++ b/Sources/epoch_server/init/server_variables.sqf @@ -70,7 +70,7 @@ EPOCH_fnc_returnConfigEntry = { _config = (_this select 0) >> (_this select 1); _varData = switch (typeName _defaultData) do { case "SCALAR": {if (isNumber (_config)) then { getNumber _config } else {_defaultData} }; - case "BOOL": {if (isText (_config)) then { (getText _config) isEqualTo "true" } else {_defaultData} }; + case "BOOL": {if (isText (_config)) then {(getText _config) isEqualTo "true"} else {if (isNumber (_config)) then {(getNumber _config) isEqualTo 1} else {_defaultData}}}; case "ARRAY": {if (isArray (_config)) then { getArray _config } else {_defaultData} }; case "STRING": {if (isText (_config)) then { getText _config } else {_defaultData} }; default {_defaultData}; diff --git a/Sources/epoch_server_settings/configs/security/security_checks.h b/Sources/epoch_server_settings/configs/security/security_checks.h index a5e33e52..b8a07b86 100644 --- a/Sources/epoch_server_settings/configs/security/security_checks.h +++ b/Sources/epoch_server_settings/configs/security/security_checks.h @@ -14,7 +14,7 @@ */ class CfgSecConf { - debug = false; + debug = "false"; class remoteExecClient{ functions[] = {"bankBalance", "resetGroup", "groupUpdate", "groupUidUpdate", "healPlayer","tradeComplete"}; @@ -28,7 +28,7 @@ class CfgSecConf }; class learning { - mode = false; // true = only trust uids below, false = trust everyone (use only with a passworded server and trusted players) + mode = "false"; // true = only trust uids below, false = trust everyone (use only with a passworded server and trusted players) trustedUsers[] = {}; };