diff --git a/Server_Install_Pack/@epochhive/epochah.hpp b/Server_Install_Pack/@epochhive/epochah.hpp index 52376b04..c9e6fd45 100644 --- a/Server_Install_Pack/@epochhive/epochah.hpp +++ b/Server_Install_Pack/@epochhive/epochah.hpp @@ -16,13 +16,11 @@ antihack_banDuration = 5; // Default 5 minute ban. -1 = permanent ban. antihack_kickReasons[] = { "Mod mismatch, check that the mods you have enabled match server." }; -antihack_checkFiles[] = { //script check, leave it blank to disable it +antihack_checkFilesNew[] = { //script check, leave it blank to disable it {"epoch_code\compile\setup\EPOCH_clientInit.sqf", "EPOCH_clientInit"}, {"epoch_code\compile\EPOCH_onEachFrame.sqf", "EPOCH_onEachFrame"}, - {"epoch_code\compile\setup\EPOCH_masterLoop.sqf", "EPOCH_masterLoop"}, {"epoch_code\compile\setup\EPOCH_client_rejectPlayer.sqf", "EPOCH_client_rejectPlayer"}, - {"epoch_code\compile\setup\EPOCH_clientRespawn.sqf", "EPOCH_clientRespawn"}, - {"epoch_code\compile\interface_event_handlers\EPOCH_KeyDown.sqf", "EPOCH_KeyDown"} + {"epoch_code\compile\setup\EPOCH_clientRespawn.sqf", "EPOCH_clientRespawn"} }; antihack_addActionCheck = "true"; // false to disable addAction checks antihack_antiTeleportCheck = "true"; // false to disable antiTeleport checks diff --git a/Sources/epoch_code/compile/EPOCH_debugMonitor.sqf b/Sources/epoch_code/compile/EPOCH_debugMonitor.sqf deleted file mode 100644 index c3d53548..00000000 --- a/Sources/epoch_code/compile/EPOCH_debugMonitor.sqf +++ /dev/null @@ -1,74 +0,0 @@ -/* - Author: Aaron Clark - EpochMod.com - - Contributors: - - Description: - Epoch debug monitor - - Licence: - Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike - - Github: - https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_debugMonitor.sqf -*/ -//[[[cog import generate_private_arrays ]]] -private ["_customVars","_hours","_val"]; -//[[[end]]] -_hours = floor(servertime/60/60); - -_customVars = ""; -{ - _val = missionNamespace getVariable [format ["EPOCH_player%1",_x],EPOCH_defaultVars select _forEachIndex]; - if !(_x in ["AliveTime","SpawnArray","HitPoints","MissionArray","NotUsed"]) then { - if (_x == "Temp") then { - _customVars = _customVars + format["%1: %2°F | %3°C
", _x,_val,_val call EPOCH_convertTemp]; - } else { - _customVars = _customVars + format["%1: %2
", _x,_val]; - }; - } -}forEach EPOCH_customVars; - -hintSilent parseText format [" - Welcome to Epoch!
- Current Version: %1
- Build: %2
- - " + _customVars + " - Karma: %17
-
- - Fatigue: %3
- Damage: %4
- Bleeding: %5
- Bleed Time: %6
- Oxygen: %7
-
- Air Temp: %8
- Water Temp: %9
- Rain: %10
- Overcast: %11
-
- Hours Alive: %12
- FPS: %13
- Server uptime: %14h %15m
- Server FPS: %16
", - getText(configFile >> "CfgMods" >> "Epoch" >> "version"), - getNumber(missionConfigFile >> "CfgEpochBuild" >> "build"), - (getFatigue player), - (damage player), - (isBleeding player), - (getBleedingRemaining player), - (getOxygenRemaining player), - format ["%1°F | %2°C",EPOCH_CURRENT_WEATHER,EPOCH_CURRENT_WEATHER call EPOCH_convertTemp], - format ["%1°F | %2°C",(EPOCH_CURRENT_WEATHER/2),(EPOCH_CURRENT_WEATHER/2) call EPOCH_convertTemp], - rain, - overcast, - - round(EPOCH_playerAliveTime/360)/10, - round diag_fps, - _hours, - round((serverTime/60)-(_hours*60)), - if (EPOCH_diag_fps isEqualType 0) then [{EPOCH_diag_fps},{"MANIPULATED"}], - missionNamespace getVariable ["EPOCH_totalKarma",0] -]; diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf index 3b26cbeb..29ba5fcc 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf @@ -13,7 +13,7 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unitSpawn.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_aiskill","_arrSkills","_arrUnits","_arrVals","_bomb","_config","_currentLimit","_disableAI","_driver","_grp","_index","_jammerRange","_jammers","_loop","_minAISkill","_missionConfig","_nonJammer","_nonTrader","_nonTraderAIRange","_pos","_restricted","_sapperHndl","_sapperNum","_spawnLimit","_targetPos","_unit","_units"]; +private ["_aiskill","_arrSkills","_arrUnits","_arrVals","_bomb","_config","_currentLimit","_disableAI","_driver","_grp","_index","_jammerRange","_jammers","_loop","_minAISkill","_missionConfig","_nonJammer","_nonTrader","_nonTraderAIRange","_playerSpawnArray","_playerSpawnArrayKey","_pos","_restricted","_sapperHndl","_sapperNum","_spawnLimit","_targetPos","_unit","_units"]; //[[[end]]] params ["_unitClass",["_trgt",player],["_doVariable",false],["_unitCount",1],["_extraData",[]] ]; @@ -22,7 +22,9 @@ _bomb = objNull; _index = EPOCH_spawnIndex find _unitClass; _spawnLimit = 0; if (_index != -1) then { - _spawnLimit = EPOCH_playerSpawnArray select _index; + if (isNil "_playerSpawnArrayKey") then {_playerSpawnArrayKey = "EPOCH_playerSpawnArray"}; + _playerSpawnArray = missionNamespace getVariable [_playerSpawnArrayKey,[]]; + _spawnLimit = _playerSpawnArray select _index; }; _currentLimit = count(_trgt nearEntities[_unitClass, 800]); if (!_doVariable && (_currentLimit >= _spawnLimit)) exitWith { diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawnDecrease.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawnDecrease.sqf index 1badd25b..cd1b4867 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawnDecrease.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawnDecrease.sqf @@ -13,10 +13,12 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unitSpawnDecrease.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_index"]; +private ["_index","_playerSpawnArray","_playerSpawnArrayKey"]; //[[[end]]] params ["_spawnName", ["_decrease",1]]; _index = EPOCH_spawnIndex find _spawnName; if (_index != -1) then{ - EPOCH_playerSpawnArray set[_index, ((EPOCH_playerSpawnArray select _index) - _decrease) max 0]; + if (isNil "_playerSpawnArrayKey") then {_playerSpawnArrayKey = "EPOCH_playerSpawnArray"}; + _playerSpawnArray = missionNamespace getVariable [_playerSpawnArrayKey,[]]; + _playerSpawnArray set[_index, ((_playerSpawnArray select _index) - _decrease) max 0]; }; diff --git a/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf b/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf index 980c294c..217f409e 100644 --- a/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf +++ b/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf @@ -13,10 +13,12 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unitSpawnIncrease.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_index"]; +private ["_index","_playerSpawnArray","_playerSpawnArrayKey"]; //[[[end]]] params ["_spawnName", ["_increase",1]]; _index = EPOCH_spawnIndex find _spawnName; if (_index != -1) then{ - EPOCH_playerSpawnArray set[_index, ((EPOCH_playerSpawnArray select _index) + _increase) min (EPOCH_spawnLimits select _index)]; + if (isNil "_playerSpawnArrayKey") then {_playerSpawnArrayKey = "EPOCH_playerSpawnArray"}; + _playerSpawnArray = missionNamespace getVariable [_playerSpawnArrayKey,[]]; + _playerSpawnArray set[_index, ((_playerSpawnArray select _index) + _increase) min (EPOCH_spawnLimits select _index)]; }; diff --git a/Sources/epoch_code/compile/both/EPOCH_compiler.sqf b/Sources/epoch_code/compile/both/EPOCH_compiler.sqf index 857273bd..bd9e6f47 100644 --- a/Sources/epoch_code/compile/both/EPOCH_compiler.sqf +++ b/Sources/epoch_code/compile/both/EPOCH_compiler.sqf @@ -24,7 +24,7 @@ BOOL */ //[[[cog import generate_private_arrays ]]] -private ["_config","_config_name","_file","_file_raw","_file_tag","_fnc_path","_missionConfig","_tag","_var_name","_version"]; +private ["_code","_config","_config_name","_customVarNames","_customVarsInit","_file","_file_raw","_file_tag","_fnc_path","_header","_missionConfig","_tag","_test","_var_name","_version"]; //[[[end]]] params [["_configName","",[""] ] ]; @@ -33,6 +33,15 @@ _missionConfig = (getMissionConfig _configName); if (isClass _missionConfig) then{ _config = _missionConfig; }; + +// custom header for interscript communications +_customVarsInit = getArray(getMissionConfig "CfgEpochClient" >> "customVarsDefaults"); +_customVarNames = _customVarsInit apply {_x param [0,""]}; +_header = ""; +{ + _header = _header + format["_player%1Key = EPOCH_%2;",_x, round(diag_tickTime + random 99999)]; +} forEach _customVarNames; + _version = getNumber(_config >> "version"); if (_version >= 1) then { { @@ -63,7 +72,13 @@ if (_version >= 1) then { if (_file_raw != "") then { _fnc_path = _file_raw; }; - missionNamespace setvariable [_var_name,compileFinal preprocessFileLineNumbers _fnc_path]; + _code = ""; + if (getNumber(_x >> "customHeader") == 1) then { + _code = _header + (preprocessFileLineNumbers _fnc_path); + } else { + _code = (preprocessFileLineNumbers _fnc_path); + }; + missionNamespace setvariable [_var_name,compileFinal _code]; if (getNumber(_x >> "preInit") == 1) then { call (missionNamespace getvariable _var_name); }; diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 407912dd..14b93b6c 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -172,7 +172,7 @@ if (_class != "") then { _EPOCH_1 = diag_tickTime; if !(isNull EPOCH_target) then { _nearestObjects = nearestObjects[EPOCH_target, _allowedSnapObjects, 12]; - EPOCH_playerEnergy = (EPOCH_playerEnergy - _energyCost) max 0; + ["EPOCH_playerEnergy", -_energyCost, 5000 , 0] call EPOCH_fnc_setVariableLimited; }; }; if !(_currentTargetAttachedTo isequalto EPOCH_target_attachedTo) then { diff --git a/Sources/epoch_code/compile/environment/EPOCH_client_bitePlayer.sqf b/Sources/epoch_code/compile/environment/EPOCH_client_bitePlayer.sqf index f47fe70e..dfb8ff0b 100644 --- a/Sources/epoch_code/compile/environment/EPOCH_client_bitePlayer.sqf +++ b/Sources/epoch_code/compile/environment/EPOCH_client_bitePlayer.sqf @@ -113,13 +113,16 @@ if (_doAttack) then { }; if (random 1 < _toxicChance) then { - EPOCH_digestToxicity = (EPOCH_digestToxicity + random(_toxicAmount)) min 100; + if (isNil "_playerToxicityKey") then {_playerToxicityKey = "EPOCH_playerToxicity"}; + if (isNil "_playerImmunityKey") then {_playerImmunityKey = "EPOCH_playerImmunity"}; + [_playerToxicityKey,random(_toxicAmount - (missionNamespace getVariable [_playerImmunityKey, 0])),100,0] call EPOCH_fnc_setVariableLimited; }; if (random 1 < _bleedChance) then { player setBleedingRemaining((getBleedingRemaining player) + _bleedAmount); }; if (random 1 < _bloodpChance) then { - EPOCH_digestBloodP = (EPOCH_digestBloodP + _bloodpAmount) min 100; + if (isNil "_playerBloodPKey") then {_playerBloodPKey = "EPOCH_playerBloodP"}; + [_playerBloodPKey,_bloodpAmount,100,0] call EPOCH_fnc_setVariableLimited; if !(_ppEffect isEqualTo []) then { [_ppEffect] spawn EPOCH_fnc_spawnEffects; }; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf index 7b65cfd6..36f4e43a 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerDeath.sqf @@ -31,8 +31,11 @@ _playerDeathScreen = getText(_config >> "playerDeathScreen"); _playerRevengeMinAliveTime = getNumber(_config >> "playerRevengeMinAliveTime"); if (_playerDeathScreen isEqualTo "") then {_playerDeathScreen = "TapOut"}; _tapDiag = _playerDeathScreen; -// diag_log format ["DEBUG: EPOCH_playerAliveTime %1",EPOCH_playerAliveTime]; -_doRevenge = ((getNumber(_config >> "playerDisableRevenge") isEqualTo 0) && EPOCH_playerAliveTime >= _playerRevengeMinAliveTime); + +if (isNil "_playerAliveTimeKey") then {_playerAliveTimeKey = "EPOCH_playerAliveTime"}; +_playerAliveTime = missionNamespace getVariable [_playerAliveTimeKey,[]]; + +_doRevenge = ((getNumber(_config >> "playerDisableRevenge") isEqualTo 0) && _playerAliveTime >= _playerRevengeMinAliveTime); // test ejecting unit from vehicle if dead client side if (vehicle _unit != _unit) then { diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerFired.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerFired.sqf index b0e394cf..f25c2b43 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_playerFired.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_playerFired.sqf @@ -28,7 +28,7 @@ NOTHING */ //[[[cog import generate_private_arrays ]]] -private ["_ammoConfig","_attachments","_currentDMG","_currentHIT","_cursorTarget","_gesture","_heal","_highestDMG","_newDMG","_nuisanceLevel","_repaired"]; +private ["_ammoConfig","_attachments","_currentDMG","_currentHIT","_cursorTarget","_gesture","_heal","_highestDMG","_newDMG","_nuisanceLevel","_playerNuisanceKey","_repaired"]; //[[[end]]] params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"]; EPOCH_lastFiredLocation = getPosATL player; @@ -119,6 +119,7 @@ switch true do { }; // Nuisance System 0.1 (EPOCH_customVarLimits select (EPOCH_customVars find "Nuisance")) params [["_playerLimitMax",100],["_playerLimitMin",0]]; - EPOCH_digestNuisance = ((EPOCH_digestNuisance + _nuisanceLevel) min _playerLimitMax) max _playerLimitMin; + if (isNil "_playerNuisanceKey") then {_playerNuisanceKey = "EPOCH_playerNuisance"}; + [_playerNuisanceKey,_nuisanceLevel,_playerLimitMax,_playerLimitMin] call EPOCH_fnc_setVariableLimited; }; }; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_returnHudVar.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_returnHudVar.sqf index 515f1e68..7db75ec1 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fnc_returnHudVar.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_returnHudVar.sqf @@ -25,11 +25,26 @@ Returns: MIXED */ +//[[[cog import generate_private_arrays ]]] +private ["_customVarLimits","_customVarNames","_customVarsInit","_defaultVarValues","_varName","_varNameTmp"]; +//[[[end]]] + params [["_selVarName",""],["_varIndex",0],["_selVarType",""],["_selVarSubData",""]]; switch (_selVarType) do { case "getMissionNamespaceVariable": {missionNamespace getVariable[_selVarName,_selVarSubData]}; case "getPlayerHitPointDamage": {player getHitPointDamage _selVarSubData}; case "getPlayerOxygenRemaining": {getOxygenRemaining player}; case "getPlayerDamage": {damage player}; - default {missionNamespace getVariable[format['EPOCH_player%1', _selVarName],EPOCH_defaultVars select _varIndex]}; + default { + _customVarsInit = getArray(getMissionConfig "CfgEpochClient" >> "customVarsDefaults"); + _customVarNames = _customVarsInit apply {_x param [0,""]}; + _defaultVarValues = _customVarsInit apply {_x param [1,0]}; + _customVarLimits = _customVarsInit apply {_x param [2,[]]}; + _varName = format["EPOCH_player%1",_selectedVarName]; + if (_selVarName in _customVarNames) then { + _varNameTmp = call compile format["_player%1Key",_selVarName]; + if !(isNil "_varNameTmp") then {_varName = _varNameTmp}; + }; + missionNamespace getVariable[_varName,_defaultVarValues select _varIndex] + }; } diff --git a/Sources/epoch_code/compile/functions/EPOCH_fnc_setVariableLimited.sqf b/Sources/epoch_code/compile/functions/EPOCH_fnc_setVariableLimited.sqf new file mode 100644 index 00000000..33a95bfc --- /dev/null +++ b/Sources/epoch_code/compile/functions/EPOCH_fnc_setVariableLimited.sqf @@ -0,0 +1,29 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: + + Description: + Sets GVAR value within min/max limits. + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_setVariableLimited.sqf + + Example: + ["TEST",-30,100,0] call EPOCH_fnc_setVariableLimited; // removes 30 and keeps number within 0-100 range. + + Parameter(s): + _this select 0: STRING - GVar variable key + _this select 1: NUMBER - Change variable + _this select 2: NUMBER - max Value + _this select 3: NUMBER - min Value + Returns: + NUMBER +*/ +params ["_key","_change","_max","_min"]; +private _result = (((missionNamespace getVariable [_key, 0]) + _change) min _max) max _min; +missionNamespace setVariable [_key, _result]; +_result diff --git a/Sources/epoch_code/compile/functions/EPOCH_giveAttributes.sqf b/Sources/epoch_code/compile/functions/EPOCH_giveAttributes.sqf index 6918357b..a41b82cc 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_giveAttributes.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_giveAttributes.sqf @@ -4,7 +4,7 @@ Contributors: Description: - Controls attributes given digest system, and returns text based on these changes. + Controls attributes given custom vars system and returns text based on these changes. Licence: Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike @@ -24,20 +24,26 @@ */ //[[[cog import generate_private_arrays ]]] -private ["_addPlus","_celcuis","_currentVal","_customVarIndex","_customVarLimits","_customVarNames","_customVarsInit","_data","_defaultVarValues","_limits","_max","_min","_newValue","_return","_varName"]; +private ["_addPlus","_celcuis","_celcuisNew","_color","_currentVal","_customVarIndex","_customVarLimits","_customVarNames","_customVarsInit","_data","_defaultVarValues","_limits","_max","_min","_newValue","_return","_varName","_varNameTmp"]; //[[[end]]] params ["_selectedVarName",["_data",0],["_randomizeData",0]]; _addPlus = if (_data > 0) then {"+"} else {""}; _return = ""; -_customVarsInit = ["CfgEpochClient", "customVarsDefaults", EPOCH_customVarsDefaults] call EPOCH_fnc_returnConfigEntryV2; +_customVarsInit = getArray(getMissionConfig "CfgEpochClient" >> "customVarsDefaults"); _customVarNames = _customVarsInit apply {_x param [0,""]}; _defaultVarValues = _customVarsInit apply {_x param [1,0]}; _customVarLimits = _customVarsInit apply {_x param [2,[]]}; _customVarIndex = _customVarNames find _selectedVarName; if (_customVarIndex != -1) then { - _varName = format["EPOCH_digest%1",_selectedVarName]; + + _varName = format["EPOCH_player%1",_selectedVarName]; + if (_selectedVarName in _customVarNames) then { + _varNameTmp = call compile format["_player%1Key",_selectedVarName]; + if !(isNil "_varNameTmp") then {_varName = _varNameTmp}; + }; + _limits = _customVarLimits select _customVarIndex; _limits params [["_max",100],["_min",0]]; if (_max isEqualType "") then { @@ -46,7 +52,7 @@ if (_customVarIndex != -1) then { if (_min isEqualType "") then { _min = missionNamespace getVariable [_min, 0]; }; - _currentVal = missionNamespace getVariable [_varName, 0]; + _currentVal = missionNamespace getVariable [_varName, _defaultVarValues select _customVarIndex]; if (_randomizeData isEqualTo 1) then { _data = round(random _data); }; @@ -55,9 +61,10 @@ if (_customVarIndex != -1) then { missionNamespace setVariable [_varName, _newValue]; if (_selectedVarName == "Temp") then { _celcuis = _data call EPOCH_convertTemp; - _return = format["%1: %2%3°F %2%4°C",(localize format["str_epoch_pvar_%1",_selectedVarName]),_addPlus,_data,_celcuis]; + _celcuisNew = _newValue call EPOCH_convertTemp; + _return = format["%1: %2%3 (%4 °F) %2%5 (%6 °C)",(localize format["str_epoch_pvar_%1",_selectedVarName]),_addPlus,_data,_newValue,_celcuis,_celcuisNew]; } else { - _return = format["%1: %2%3", (localize format["str_epoch_pvar_%1",_selectedVarName]), _addPlus, _data]; + _return = format["%1: %2%3 (%4/%5)", (localize format["str_epoch_pvar_%1",_selectedVarName]), _addPlus, _data, _newValue, _max]; }; }; }; diff --git a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf index 156a0bef..6890cfa4 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -1,21 +1,21 @@ /* Author: Aaron Clark - EpochMod.com - @vbawol - Contributors: @Skaronator @raymix @Fank + Contributors: @Skaronator @raymix @Fank Description: Key Down EH functions - Licence: - Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike - Github: - https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf + Github: + https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf - Example: - _this call EPOCH_KeyDown; + Example: + _this call EPOCH_KeyDown; - Parameter(s): + Parameter(s): _this select 0: CONTROL - _display _this select 1: NUMBER - _dikcode _this select 2: BOOL - Shift State @@ -26,10 +26,12 @@ BOOL */ //[[[cog import generate_private_arrays ]]] -private ["_currentPos","_handled"]; +private ["_adj","_currentPos","_handled","_playerStaminaKey","_step"]; //[[[end]]] params ["_display","_dikCode","_shift","_ctrl","_alt"]; +if (isNil "_playerStaminaKey") then {_playerStaminaKey = "EPOCH_playerStamina"}; + _handled = false; _this call Epoch_custom_EH_KeyDown; @@ -115,10 +117,10 @@ if (_dikCode == EPOCH_keysAction) then { if (vehicle player == player) then { if ((_dikCode == EPOCH_keysBuildMode1 && !EPOCH_favBar_itemConsumed) && EPOCH_buildMode > 0) then { - EPOCH_buildMode = 0; + EPOCH_buildMode = 0; ["Build Mode: Disabled", 5] call Epoch_message; EPOCH_Target = objNull; - _handled = true; + _handled = true; }; // H - holster unholster @@ -202,13 +204,13 @@ if (vehicle player == player) then { if ((primaryWeapon player != "") && (currentWeapon player == primaryWeapon player)) then { player switchMove "AovrPercMrunSrasWrflDf"; [player, "AovrPercMrunSrasWrflDf", Epoch_personalToken] remoteExec ["EPOCH_server_handle_switchMove",2]; - EPOCH_playerStamina = (EPOCH_playerStamina - 30) max 0; + [_playerStaminaKey, -30, 1000 , 0] call EPOCH_fnc_setVariableLimited; _handled = true; } else { if (currentWeapon player == "") then { player switchMove "epoch_unarmed_jump"; [player, "epoch_unarmed_jump", Epoch_personalToken] remoteExec ["EPOCH_server_handle_switchMove",2]; - EPOCH_playerStamina = (EPOCH_playerStamina - 30) max 0; + [_playerStaminaKey, -30, 1000 , 0] call EPOCH_fnc_setVariableLimited; _handled = true; }; }; diff --git a/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf b/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf index 598f9201..9743d779 100644 --- a/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf +++ b/Sources/epoch_code/compile/setup/EPOCH_clientRevive.sqf @@ -24,7 +24,7 @@ NOTHING */ //[[[cog import generate_private_arrays ]]] -private ["_prevPlayerObject"]; +private ["_playerBloodPKey","_prevPlayerObject"]; //[[[end]]] params [ ["_playerObject",objNull,[objNull]], @@ -58,7 +58,8 @@ if !(alive player && alive _playerObject && !isPlayer _playerObject) then { Epoch_personalToken = _personalToken; // reset blood Pressure to warning level - EPOCH_playerBloodP = 120; + if (isNil "_playerBloodPKey") then {_playerBloodPKey = "EPOCH_playerBloodP"}; + missionNamespace setVariable [_playerBloodPKey, 120]; // restart masterloop [] spawn EPOCH_masterLoop; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index d60f2856..b289944d 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -17,9 +17,9 @@ if (!isNull _cursorTarget && {!(EPOCH_target isEqualTo _cursorTarget)}) then { if (isClass(_interaction)) then { _currentTargetMode = getNumber (_interaction >> "interactMode"); _allowTarget = switch (getNumber (_interaction >> "aliveState")) do { - case 1: {!(alive _cursorTarget)}; + case 1: {!(alive _cursorTarget)}; case 2: {(alive _cursorTarget)}; - default {true}; + default {true}; }; if (_allowTarget) then { _currentTarget = _cursorTarget; @@ -90,7 +90,7 @@ EPOCH_currentTargetMode = _currentTargetMode; _forceUpdate = "forceUpdate" in _criticalAttributes; _forceFatigue = "forceFatigue" in _criticalAttributes; _forceBloodRise = "forceBloodRise" in _criticalAttributes; - [_curCtrl,0.55] call epoch_2DCtrlHeartbeat; + [_curCtrl,0.55] call epoch_2DCtrlHeartbeat; }; // todo make this reversable or even limited to a color range. _color = [_playerLimitMin,_playerLimitMax,_currentVarVal,1] call EPOCH_colorRange; @@ -118,25 +118,17 @@ if (_forceFatigue) then { }; }; -// Blood pressure handler -_digestBloodP = missionNamespace getVariable ["EPOCH_digestBloodP", 0]; -if (_digestBloodP > 0) then { - _playerBloodP = ((_playerBloodP + _digestBloodP) min _playerBloodPMax) max _playerBloodPMin; - missionNamespace setVariable ["EPOCH_digestBloodP", 0]; +// force Blood Pressure Rise +if (_forceBloodRise) then { + _playerBloodP = [_playerBloodPKey, 0.05, _playerBloodPMax , _playerBloodPMin] call EPOCH_fnc_setVariableLimited; } else { - if (_forceBloodRise) then { - // force Blood Pressure Rise - _playerBloodP = (_playerBloodP + 0.05) min 190; - } else { - if (_allowBloodDrop) then { - // allow player to bleed out - _lowerBPlimit = [100,0] select (isBleeding player); - _playerBloodP = _playerBloodP - 1 max _lowerBPlimit; - }; + if (_allowBloodDrop) then { + // allow player to bleed out + _lowerBPlimit = [_playerBloodPMin,0] select (isBleeding player); + _playerBloodP = [_playerBloodPKey, -1, _playerBloodPMax , _lowerBPlimit] call EPOCH_fnc_setVariableLimited; }; }; - // check if player On Foot _isOnFoot = isNull objectParent player; if (_isOnFoot) then { @@ -149,11 +141,12 @@ if (_isOnFoot) then { // Decrease Stamina if (_forceStaminaDrop) then { - _playerStamina = (_playerStamina - (_val/4)) max 0; + _playerStamina = [_playerStaminaKey, -(_val/4), EPOCH_playerStaminaMax , 0] call EPOCH_fnc_setVariableLimited; } else { // Increase Stamina if player is not Fatigued if (_increaseStamina && (getFatigue player) == 0) then { - _playerStamina = (_playerStamina + 0.5) min EPOCH_playerStaminaMax; + // EPOCH_playerStamina = (EPOCH_playerStamina + 0.5) min EPOCH_playerStaminaMax; + _playerStamina = [_playerStaminaKey, 0.5, EPOCH_playerStaminaMax , 0] call EPOCH_fnc_setVariableLimited; }; }; @@ -161,7 +154,62 @@ if (_forceStaminaDrop) then { // ~ debug if (EPOCH_debugMode) then { - call EPOCH_debugMonitor; + private _hours = floor(servertime/60/60); + private _customVars = ""; + { + if !(_x in ["AliveTime","SpawnArray","HitPoints","MissionArray","NotUsed"]) then { + private _varName = call compile format["_player%1Key",_x]; + if (isNil "_varName") then {_varName = format["EPOCH_player%1",_x]}; + private _val = missionNamespace getVariable [_varName,_defaultVarValues select _forEachIndex]; + if (_x == "Temp") then { + _customVars = _customVars + format["%1: %2°F | %3°C
", _x,_val,_val call EPOCH_convertTemp]; + } else { + _customVars = _customVars + format["%1: %2
", _x,_val]; + }; + } + }forEach _customVarNames; + hintSilent parseText format [" + Welcome to Epoch!
+ Current Version: %1
+ Build: %2
+ " + _customVars + " + Karma: %17
+
+ + Fatigue: %3
+ Damage: %4
+ Bleeding: %5
+ Bleed Time: %6
+ Oxygen: %7
+
+ Air Temp: %8
+ Water Temp: %9
+ Rain: %10
+ Overcast: %11
+
+ Hours Alive: %12
+ FPS: %13
+ Server uptime: %14h %15m
+ Server FPS: %16
", + getText(configFile >> "CfgMods" >> "Epoch" >> "version"), + getNumber(missionConfigFile >> "CfgEpochBuild" >> "build"), + (getFatigue player), + (damage player), + (isBleeding player), + (getBleedingRemaining player), + (getOxygenRemaining player), + format ["%1°F | %2°C",EPOCH_CURRENT_WEATHER,EPOCH_CURRENT_WEATHER call EPOCH_convertTemp], + format ["%1°F | %2°C",(EPOCH_CURRENT_WEATHER/2),(EPOCH_CURRENT_WEATHER/2) call EPOCH_convertTemp], + rain, + overcast, + + round(_playerAliveTime/360)/10, + round diag_fps, + _hours, + round((serverTime/60)-(_hours*60)), + if (EPOCH_diag_fps isEqualType 0) then [{EPOCH_diag_fps},{"MANIPULATED"}], + missionNamespace getVariable ["EPOCH_totalKarma",0] + ]; }; // player to player trade loop @@ -279,20 +327,8 @@ if !(EPOCH_ActiveTraderMission isequalto []) then { }; // Update read only vars -EPOCH_playerRadiation = _playerRadiation; -EPOCH_playerAliveTime = _playerAliveTime; -EPOCH_playerBloodP = _playerBloodP; -EPOCH_playerNuisance = _playerNuisance; -EPOCH_playerHunger = _playerHunger; -EPOCH_playerThirst = _playerThirst; -EPOCH_playerSoiled = _playerSoiled; -EPOCH_playerToxicity = _playerToxicity; -EPOCH_playerImmunity = _playerImmunity; -EPOCH_playerTemp = _playerTemp; -EPOCH_playerWet = _playerWet; -EPOCH_playerEnergy = _playerEnergy; -EPOCH_playerAlcohol = _playerAlcohol; -EPOCH_playerStamina = _playerStamina; +EPOCH_playerAliveTime = missionNamespace getVariable [_playerAliveTimeKey, 0]; +EPOCH_playerEnergy = missionNamespace getVariable [_playerEnergyKey, 0]; // force update if (EPOCH_forceUpdateNow) then { diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf index ebbb72b9..7f02af62 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf @@ -55,12 +55,7 @@ if (_playerRadiation > 1) then { }; // Energy Handler -_digestEnergy = missionNamespace getVariable ["EPOCH_digestEnergy", 0]; -if (_digestEnergy > 0) then { - _energyValue = _energyValue + _digestEnergy; - missionNamespace setVariable ["EPOCH_digestEnergy", 0]; -}; -_playerEnergy = ((_playerEnergy + _energyValue) min _playerEnergyMax) max _playerEnergyMin; +_playerEnergy = [_playerEnergyKey,_energyValue,_playerEnergyMax,_playerEnergyMin] call EPOCH_fnc_setVariableLimited; if !(_playerEnergy isEqualTo _prevEnergy) then { 9993 cutRsc["EpochGameUI3", "PLAIN", 0, false]; @@ -140,35 +135,34 @@ if ((getFatigue player) >= 0.7 && _airTemp > 100) then { _maxTemp = _airTemp; }; -// Immunity Handler -_digestImmunity = missionNamespace getVariable ["EPOCH_digestImmunity", 0]; -if (_digestImmunity > 0) then { - _playerImmunity = ((_playerImmunity + _digestImmunity) min _playerImmunityMax) max _playerImmunityMin; - missionNamespace setVariable ["EPOCH_digestImmunity", 0]; -}; + // toxic fever and immunity increase if (_playerToxicity > 0) then { - _playerImmunity = ((_playerImmunity + 0.1) min _playerImmunityMax) max _playerImmunityMin; - _playerToxicity = ((_playerToxicity - 0.1) min _playerToxicityMax) max _playerToxicityMin; - _maxTemp = 106.7 + 10; + _playerImmunity = [_playerImmunityKey,0.1,_playerImmunityMax,_playerImmunityMin] call EPOCH_fnc_setVariableLimited; + _playerToxicity = [_playerToxicityKey,-0.1,_playerToxicityMax,_playerToxicityMin] call EPOCH_fnc_setVariableLimited; + // allow player to overheat + _maxTemp = _playerTempMax + 10; }; +// Body Temp handler if (_warming) then { - _playerTemp = (_playerTemp + 0.01) min _maxTemp; + _playerTemp = [_playerTempKey,0.01,_maxTemp,_playerTempMin] call EPOCH_fnc_setVariableLimited; } else { - _playerTemp = (_playerTemp - 0.01) max (95.0 - 10); + _playerTemp = [_playerTempKey,-0.01,_maxTemp,(_playerTempMin - 10)] call EPOCH_fnc_setVariableLimited; }; // wet/dry if (_wet) then { _playerWet = ((_playerWet + _increaseWet) min _playerWetMax) max _playerWetMin; if (_playerWet > 50) then { - _playerSoiled = ((_playerSoiled - 1) min _playerSoiledMax) max _playerSoiledMin; + _soiledLossRate = 1; + _playerSoiled = [_playerSoiledKey,-_soiledLossRate,_playerSoiledMax,_playerSoiledMin] call EPOCH_fnc_setVariableLimited; }; } else { if (_warming) then { - _playerWet = ((_playerWet - 1) min _playerWetMax) max _playerWetMin; + _wetLossRate = 1; + _playerWet = [_playerWetKey,-_wetLossRate,_playerWetMax,_playerWetMin] call EPOCH_fnc_setVariableLimited; }; }; @@ -186,62 +180,28 @@ if (_playerStamina < 100) then { _hungerlossRate = (_hungerlossRate / 2); }; -_digestAlcohol = missionNamespace getVariable ["EPOCH_digestAlcohol", 0]; // Alcohol Handler -if (_digestAlcohol > 0) then { - _playerAlcohol = ((_playerAlcohol + _digestAlcohol) min _playerAlcoholMax) max _playerAlcoholMin; - missionNamespace setVariable ["EPOCH_digestAlcohol", 0]; -} else { - // downtick Alcohol - _alcoholLossRate = 0.17; - _playerAlcohol = ((_playerAlcohol - _alcoholLossRate) min _playerAlcoholMax) max _playerAlcoholMin; -}; +_playerAlcohol = [_playerAlcoholKey,-_alcoholLossRate,_playerAlcoholMax,_playerAlcoholMin] call EPOCH_fnc_setVariableLimited; // Hunger Handler -_digestHunger = missionNamespace getVariable ["EPOCH_digestHunger", 0]; -if (_digestHunger > 0) then { - _playerHunger = ((_playerHunger + _digestHunger) min _playerHungerMax) max _playerHungerMin; - missionNamespace setVariable ["EPOCH_digestHunger", 0]; -} else { - // downtick Hunger - _playerHunger = ((_playerHunger - _hungerlossRate) min _playerHungerMax) max _playerHungerMin; -}; +_playerHunger = [_playerHungerKey,-_hungerlossRate,_playerHungerMax,_playerHungerMin] call EPOCH_fnc_setVariableLimited; // Thirst Handler -_digestThirst = missionNamespace getVariable ["EPOCH_digestThirst", 0]; -if (_digestThirst > 0) then { - _playerThirst = ((_playerThirst + _digestThirst) min _playerThirstMax) max _playerThirstMin; - missionNamespace setVariable ["EPOCH_digestThirst", 0]; -} else { - // downtick Thirst - _playerThirst = ((_playerThirst - _thirstlossRate) min _playerThirstMax) max _playerThirstMin; -}; +_playerThirst = [_playerThirstKey,-_thirstlossRate,_playerThirstMax,_playerThirstMin] call EPOCH_fnc_setVariableLimited; -// Nuisance Handler, this only allows var to increse not decrease -_digestNuisance = missionNamespace getVariable ["EPOCH_digestNuisance", 0]; -if (_digestNuisance > 0) then { - _playerNuisance = ((_playerNuisance + _digestNuisance) min _playerNuisanceMax) max _playerNuisanceMin; - missionNamespace setVariable ["EPOCH_digestNuisance", 0]; -} else { - // downtick Nuisance - _playerNuisance = ((_playerNuisance - 1) min _playerNuisanceMax) max _playerNuisanceMin; -}; +// Nuisance Handler +_playerEnergy = [_playerNuisanceKey,-1,_playerNuisanceMax,_playerNuisanceMin] call EPOCH_fnc_setVariableLimited; // Radiation Handler -_digestRadiation = missionNamespace getVariable ["EPOCH_digestRadiation", 0]; -if (_digestRadiation < 0 && _radsLevel == 0) then { +if (_radsLevel == 0) then { // only lower rads if player has taken medicine and it no longer in a radiation zone. - _playerRadiation = ((_playerRadiation - 0.01) min _playerRadiationMax) max _playerRadiationMin; - missionNamespace setVariable ["EPOCH_digestRadiation", (_digestRadiation + 1) min 0]; + _playerRadiation = [_playerRadiationKey,-0.01,_playerRadiationMax,_playerRadiationMin] call EPOCH_fnc_setVariableLimited; } else { // allow increase rads based on radiation levels and consumed rads - if (_digestRadiation > 0) then { - _radsLevel = _radsLevel + _digestRadiation; - missionNamespace setVariable ["EPOCH_digestRadiation", 0]; - }; - _playerRadiation = ((_playerRadiation + _radsLevel) min _playerRadiationMax) max _playerRadiationMin; + _playerRadiation = [_playerRadiationKey,_radsLevel,_playerRadiationMax,_playerRadiationMin] call EPOCH_fnc_setVariableLimited; }; +// calculate max stamina EPOCH_playerStaminaMax = (100 * (round(_playerAliveTime/360)/10)) min 2500; // process loot diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf index fd33d587..ac6d056b 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event6.sqf @@ -11,7 +11,7 @@ _spawnUnits = []; if (_x > 0) then{ _spawnUnits pushBack(EPOCH_spawnIndex select _forEachIndex); }; -} forEach EPOCH_playerSpawnArray; +} forEach _playerSpawnArray; // test spawning one antagonist every 10 minutes select one unit at random to spawn if !(_spawnUnits isEqualTo[]) then{ diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index d7b4e6c3..de0ed80d 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -14,22 +14,6 @@ _forceUpdate = false; // force update within 1 second EPOCH_forceUpdateNow = false; -// init local player stat vars -_playerRadiation = EPOCH_playerRadiation; -_playerAliveTime = EPOCH_playerAliveTime; -_playerNuisance = EPOCH_playerNuisance; -_playerBloodP = EPOCH_playerBloodP; -_playerHunger = EPOCH_playerHunger; -_playerThirst = EPOCH_playerThirst; -_playerSoiled = EPOCH_playerSoiled; -_playerToxicity = EPOCH_playerToxicity; -_playerImmunity = EPOCH_playerImmunity; -_playerTemp = EPOCH_playerTemp; -_playerWet = EPOCH_playerWet; -_playerEnergy = EPOCH_playerEnergy; -_playerAlcohol = EPOCH_playerAlcohol; -_playerStamina = EPOCH_playerStamina; - // start alive timer _clientAliveTimer = diag_tickTime; @@ -39,27 +23,15 @@ _customVarNames = _customVarsInit apply {_x param [0,""]}; _defaultVarValues = _customVarsInit apply {_x param [1,0]}; _customVarLimits = _customVarsInit apply {_x param [2,[]]}; -// init limits -/* +// init limits and keys { _varLimits = _customVarLimits select _forEachIndex; - call compile format['_varLimits params [["_player%1Max",100],["_player%1Min",0]];',_x]; + _varDefault = _defaultVarValues select _foreachindex; + call compile format['if (isNil "_player%1Key") then {_player%1Key = "EPOCH_player%1"}; + _varLimits params [["_player%1Max",100],["_player%1Min",0]]; + _player%1 = missionNamespace getVariable [_player%1Key, _varDefault]; + ',_x]; } forEach _customVarNames; -*/ - -(_customVarLimits select (_customVarNames find "Temp")) params [["_playerTempMax",100],["_playerTempMin",0]]; -(_customVarLimits select (_customVarNames find "Hunger")) params [["_playerHungerMax",100],["_playerHungerMin",0]]; -(_customVarLimits select (_customVarNames find "Thirst")) params [["_playerThirstMax",100],["_playerThirstMin",0]]; -(_customVarLimits select (_customVarNames find "Energy")) params [["_playerEnergyMax",100],["_playerEnergyMin",0]]; -(_customVarLimits select (_customVarNames find "Wet")) params [["_playerWetMax",100],["_playerWetMin",0]]; -(_customVarLimits select (_customVarNames find "Soiled")) params [["_playerSoiledMax",100],["_playerSoiledMin",0]]; -(_customVarLimits select (_customVarNames find "Immunity")) params [["_playerImmunityMax",100],["_playerImmunityMin",0]]; -(_customVarLimits select (_customVarNames find "Toxicity")) params [["_playerToxicityMax",100],["_playerToxicityMin",0]]; -(_customVarLimits select (_customVarNames find "Stamina")) params [["_playerStaminaMax",100],["_playerStaminaMin",0]]; -(_customVarLimits select (_customVarNames find "BloodP")) params [["_playerBloodPMax",100],["_playerBloodPMin",0]]; -(_customVarLimits select (_customVarNames find "Alcohol")) params [["_playerAlcoholMax",100],["_playerAlcoholMin",0]]; -(_customVarLimits select (_customVarNames find "Radiation")) params [["_playerRadiationMax",100],["_playerRadiationMin",0]]; -(_customVarLimits select (_customVarNames find "Nuisance")) params [["_playerNuisanceMax",100],["_playerNuisanceMin",0]]; EPOCH_playerEnergyMax = _playerEnergyMax; @@ -67,43 +39,9 @@ EPOCH_playerEnergyMax = _playerEnergyMax; _fnc_forceUpdate = { private _customVars = []; { - // use local var from inside master loop - /* - call compile format['_customVars pushBack _player%1;',_x]; - */ - - switch (_x) do { - case ("Radiation"): { - _customVars pushBack _playerRadiation; - }; - case ("Nuisance"): { - _customVars pushBack _playerNuisance; - }; - case ("BloodP"): { - _customVars pushBack _playerBloodP; - }; - case ("AliveTime"):{ - _customVars pushBack _playerAliveTime; - }; - case ("Hunger"):{ - _customVars pushBack _playerHunger; - }; - case ("Thirst"):{ - _customVars pushBack _playerThirst; - }; - case ("Alcohol"):{ - _customVars pushBack _playerAlcohol; - }; - case ("Energy"):{ - _customVars pushBack _playerEnergy; - }; - default { - private _customVarIndex = _customVarNames find _x; - if (_customVarIndex != -1) then { - _customVars pushBack (missionNamespace getVariable [format["EPOCH_player%1",_x],_defaultVarValues select _customVarIndex]); - }; - }; - }; + private _varName = call compile format["_player%1Key",_x]; + if (isNil "_varName") then {_varName = format["EPOCH_player%1",_x]}; + _customVars pushBack (missionNamespace getVariable [_varName,_defaultVarValues select _foreachindex]); } forEach _customVarNames; [player,_customVars,Epoch_personalToken] remoteExec ["EPOCH_fnc_savePlayer",2]; }; @@ -194,9 +132,9 @@ EPOCH_spawnIndex = _spawnIndex; EPOCH_spawnLimits = _spawnLimits; // default data if mismatch -if !(EPOCH_playerSpawnArray isEqualTypeParams _spawnIndex) then{ - EPOCH_playerSpawnArray = []; - { EPOCH_playerSpawnArray pushBack 0 } forEach _spawnIndex; +if !(_playerSpawnArray isEqualTypeParams _spawnIndex) then{ + _playerSpawnArray = []; + { _playerSpawnArray pushBack 0 } forEach _spawnIndex; }; // find radio diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index 14ae3cc0..727d31f9 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -17,8 +17,12 @@ class CfgClientFunctions { file = "epoch_code\compile"; class localCleanup {}; - class unitSpawnIncrease {}; - class unitSpawnDecrease {}; + class unitSpawnIncrease { + customHeader = 1; + }; + class unitSpawnDecrease { + customHeader = 1; + }; class QuickTakeAll {}; class QuickTakeLoad {}; class effectCrypto {}; @@ -26,7 +30,6 @@ class CfgClientFunctions class updateLoadingScreen {}; class EnterBuilding {}; class lootTrash {}; - class debugMonitor {}; class interact {}; class chopWood {}; class fish {}; @@ -37,7 +40,9 @@ class CfgClientFunctions class LootIT {}; class supportCopter {}; class consumeItem {}; - class unitSpawn {}; + class unitSpawn { + customHeader = 1; + }; class onEachFrame {}; class callSapperMigration {}; class zombieSpawn {}; @@ -53,7 +58,9 @@ class CfgClientFunctions class fnc_SelectTargetBuild {}; class isBuildAllowed {}; class simulSwap {}; - class staticMove {}; + class staticMove { + customHeader = 1; + }; class upgradeBUILD {}; class removeBUILD {}; class changeWallState {}; @@ -77,7 +84,9 @@ class CfgClientFunctions }; class interface_event_handlers { - class KeyDown {}; + class KeyDown { + customHeader = 1; + }; class KeyUp {}; class onChar {}; }; @@ -90,10 +99,14 @@ class CfgClientFunctions }; class setup { - class masterLoop {}; + class masterLoop { + customHeader = 1; + }; class clientInit {}; class clientRespawn {}; - class clientRevive {}; + class clientRevive { + customHeader = 1; + }; class client_rejectPlayer {}; class clientKeyMap {}; }; @@ -112,8 +125,12 @@ class CfgClientFunctions class returnConfigV2 {}; class colorRange {}; class convertTemp {}; - class fnc_playerDeath {}; - class fnc_playerFired {}; + class fnc_playerDeath { + customHeader = 1; + }; + class fnc_playerFired { + customHeader = 1; + }; class fnc_isInsideBuilding {}; class fnc_findSafePos {}; class fnc_addItemOverflow {}; @@ -127,7 +144,9 @@ class CfgClientFunctions class fnc_findSapperStalkLocation {}; class fnc_dirToFuzzy {}; class fnc_cursorTarget {}; - class fnc_returnHudVar {}; + class fnc_returnHudVar { + customHeader = 1; + }; class fnc_triggerAntagonist {}; class fnc_playerDeathDetonate {}; class fnc_playerDeathMorph {}; @@ -135,17 +154,22 @@ class CfgClientFunctions class fnc_playerAttachToAntagonist {}; class fnc_dynamicFSM {}; class fnc_vectorDivide {}; - class giveAttributes {}; + class giveAttributes { + customHeader = 1; + }; class fnc_spawnEffects {}; class fnc_arrayStringToBool {}; class client_updatePlayerStat {}; class fnc_getHitPointsDamageAverage {}; + class fnc_setVariableLimited {}; }; class environment { class client_earthQuake {}; class client_loadAnimalBrain {}; - class client_bitePlayer {}; + class client_bitePlayer { + customHeader = 1; + }; }; class vehicles { diff --git a/Sources/epoch_server/init/server_securityfunctions.sqf b/Sources/epoch_server/init/server_securityfunctions.sqf index f951337e..9a95bc86 100644 --- a/Sources/epoch_server/init/server_securityfunctions.sqf +++ b/Sources/epoch_server/init/server_securityfunctions.sqf @@ -66,12 +66,10 @@ _skn_check_addons = [_serverSettingsConfig, "antihack_cfgPatchesCheck", true] ca _checkFiles = [ ["epoch_code\compile\setup\EPOCH_clientInit.sqf", "EPOCH_clientInit"], ["epoch_code\compile\EPOCH_onEachFrame.sqf", "EPOCH_onEachFrame"], - ["epoch_code\compile\setup\EPOCH_masterLoop.sqf", "EPOCH_masterLoop"], ["epoch_code\compile\setup\EPOCH_client_rejectPlayer.sqf", "EPOCH_client_rejectPlayer"], - ["epoch_code\compile\setup\EPOCH_clientRespawn.sqf", "EPOCH_clientRespawn"], - ["epoch_code\compile\interface_event_handlers\EPOCH_KeyDown.sqf", "EPOCH_KeyDown"] + ["epoch_code\compile\setup\EPOCH_clientRespawn.sqf", "EPOCH_clientRespawn"] ]; -_skn_check_files = [_serverSettingsConfig, "antihack_checkFiles", _checkFiles] call EPOCH_fnc_returnConfigEntry; +_skn_check_files = [_serverSettingsConfig, "antihack_checkFilesNew", _checkFiles] call EPOCH_fnc_returnConfigEntry; _skn_whitelist_cfgPatches = [_serverSettingsConfig, "antihack_whitelistedCfgPatches", []] call EPOCH_fnc_returnConfigEntry; _skn_adminsOwner = [_serverSettingsConfig, "adminMenu_Owner", []] call EPOCH_fnc_returnConfigEntry;