Properly disable antiTP and sched security when dayz_antihack=0;

This prevents them being called unnecessarily on loop.
This commit is contained in:
ebaydayz
2017-01-25 15:02:05 -05:00
parent 7d6319fa30
commit c641bc20a8
4 changed files with 18 additions and 14 deletions

View File

@@ -6,8 +6,8 @@
*/
sched_antiTP_init = {
if (dayz_antihack == 1) then { diag_log [ diag_ticktime, __FILE__, "Anti Teleport inited"]; };
[dayz_antihack == 1, [], 0, 0, objNull, respawn_west_original]
diag_log [ diag_ticktime, __FILE__, "Anti Teleport inited"];
[true, [], 0, 0, objNull, respawn_west_original]
};
sched_antiTP = {
@@ -21,7 +21,7 @@ sched_antiTP = {
_lastVehicle = _this select 4;
_debug = _this select 5;
if (((_antihack) and {(typeName player == "OBJECT")}) AND {((player in playableUnits) AND {(alive player)})}) then {
if (typeName player == "OBJECT" && {(player in playableUnits) && (alive player)}) then {
if (count _lastpos != 3) then {
_lastpos = getPosATL (vehicle player);
_lastheight = (ATLtoASL _lastpos) select 2;

View File

@@ -7,8 +7,6 @@ call compile preprocessFileLineNumbers (_base+"sched_bloodstains.sqf");
call compile preprocessFileLineNumbers (_base+"sched_animals.sqf");
call compile preprocessFileLineNumbers (_base+"sched_buriedZeds.sqf");
call compile preprocessFileLineNumbers (_base+"sched_gravity.sqf");
call compile preprocessFileLineNumbers (_base+"sched_security.sqf");
call compile preprocessFileLineNumbers (_base+"sched_antiTeleport.sqf");
call compile preprocessFileLineNumbers (_base+"sched_newDay.sqf");
call compile preprocessFileLineNumbers (_base+"sched_spawnCheck.sqf");
call compile preprocessFileLineNumbers (_base+"sched_playerActions.sqf");
@@ -17,6 +15,11 @@ call compile preprocessFileLineNumbers (_base+"sched_medical.sqf");
call compile preprocessFileLineNumbers (_base+"sched_gui.sqf");
call compile preprocessFileLineNumbers (_base+"sched_buildingBubble.sqf");
if (dayz_antihack == 1) then {
call compile preprocessFileLineNumbers (_base+"sched_security.sqf");
call compile preprocessFileLineNumbers (_base+"sched_antiTeleport.sqf");
};
if (dayz_townGenerator) then {
call compile preprocessFileLineNumbers (_base+"sched_towngenerator.sqf");
call compile preprocessFileLineNumbers (_base+"sched_planthint.sqf");
@@ -29,8 +32,6 @@ if (count _list == 0) then {
// period offset loop code <-> ctx, init code ->ctx
[ 0, 0, sched_onEachFrame, sched_onEachFrame_init ], // SPECIAL: nul period -> code returns boolean requesting to skip other tasks
[ 0.2, 20, sched_gravity, sched_gravity_init ],
[ 0.2, 0.15, sched_security, sched_security_init ],
[ 0.2, 0.05, sched_antiTP, sched_antiTP_init ],
[ 0.1, 0.01, sched_playerActions ],
[ 0.2, 0.12, sched_gui, sched_gui_init ],
[ 2, 0.13, sched_medical_effects, sched_medical_effects_init ],
@@ -47,6 +48,11 @@ if (count _list == 0) then {
[ 1, 0.51, sched_buriedZeds, sched_buriedZeds_init ]
];
if (dayz_antihack == 1) then {
_list set [count _list, [0.2, 0.15, sched_security, sched_security_init]];
_list set [count _list, [0.2, 0.05, sched_antiTP, sched_antiTP_init]];
};
//Disable townGenerator for alternative maps or when junk is not wanted on Chernarus
if (dayz_townGenerator) then {
_list set [count _list, [0.2, 0.07, sched_townGenerator, sched_townGenerator_init]];

View File

@@ -1,15 +1,13 @@
// (c) facoptere@gmail.com, licensed to DayZMod for the community
sched_security_init = {
if (dayz_antihack == 1) then { diag_log [ diag_ticktime, __FILE__, "Some security routines inited"]; };
if (dayz_antihack == 1) then { [ "", time, 0, 0, grpNull ] } else { [] }
diag_log [ diag_ticktime, __FILE__, "Some security routines inited"];
[ "", time, 0, 0, grpNull ]
};
sched_security = {
private ["_netid","_timeTrickCount","_idTrickCount","_time","_otime","_pid", "_quit", "_list"];
if (count _this != 5) exitWith { [] };
_netid = _this select 0;
_otime = _this select 1;
_idTrickCount = _this select 2;
@@ -50,7 +48,7 @@ sched_security = {
};
};
if (isNull _grp) then { _grp = group ((allmissionobjects 'FunctionsManager') select 0); };
if (isNull _grp) then { _grp = group ((entities 'FunctionsManager') select 0); };
if (!isNull _grp) then {
_list = units _grp;
if (count _list > 1) then {

View File

@@ -1,7 +1,7 @@
//new2
5 allDead !"} count allDead;\nif (!_found) then {deleteMarkerLocal \"MyBody\";};"
5 allGroups !"publicVariableServer \"PVDZ_Server_UpdateGroup\";\n};\n} count allGroups;"
5 allMissionObjects !"allMissionObjects \"RoadFlare\"" !"allMissionObjects \"ChemLight\"" !"[_x,2,0,false,false] spawn BIS_Effects_Burn;\n};\n} count allMissionObjects \"SpawnableWreck\";" !"if (isNull _grp) then { _grp = group ((allmissionobjects 'FunctionsManager') select 0); };"
5 allMissionObjects !"allMissionObjects \"RoadFlare\"" !"allMissionObjects \"ChemLight\"" !"[_x,2,0,false,false] spawn BIS_Effects_Burn;\n};\n} count allMissionObjects \"SpawnableWreck\";"
5 allowDammage
5 allUnits !"} count allUnits;\nlbSort _playerList;" !"if (getPlayerUID _x == _this) exitWith {\n_player = _x;\n};\n} count allUnits;" !"owner _x publicVariableClient \"PVDZ_groupInvite\";\n};\n} count allUnits;"
5 attachTo !"riation),((random (_variation * 2)) - _variation)];\n_bolt attachTo [_hitObject,_val,_hitMemoryPt];\n_dir = ([_hitObject,_unit]" !"select 3;\nplayer playActionNow \"PutDown\";\nuiSleep 2;\n_flare attachTo [player,[0,0,0],\"granat2\"];\n[_flare, -90, -10] call object" !"tchmove \"ainjpfalmstpsnonwrfldnon_carried_still\";\n_dragee attachto [_unit,[-0.2, 0.2, 0]];\n\n\nwhile {r_carry_sqf} do\n{\n_anim_n" !"0, 0.1], 0, 0, 10];\n_source setDropInterval 0.02;\n_point attachTo [_unit,_modelPos,_wound];\n};\n\nuiSleep 5;\n\nwhile {((_unit getV" !"_objGhost attachTo [_object, [0, 0, 0.7]];\n};\n\n_boundingBox = boundingBox" !" attachto [_v,[0,0,0],\"destructionEffect" !"rag = [_dragee];\npublicVariable \"PVDZ_drg_RaDrag\";\n\n_dragee attachto [_unit,[0.1, 1.01, 0]];\nuiSleep 0.02;\n\n\n\n\n_dragee setDir 180;" !"_objectHelper attachTo [player,_offset];" !"_object attachTo [player,_offset];\n\n_position = getPosATL _object;" !="_vehicle attachTo [_liftHeli,[0,0,-7]];" !="_obj attachTo [_axis];" !"_objectSnapGizmo attachTo [_object,[_x select 0,_x select 1,_x select 2]];" !="_vehicle attachTo [_towTruck,[1.3,-2,2.3]];" !"localize \"STR_EPOCH_ACTIONS_ATTACHTOHELI\"," !="_l1 attachTo [_lh,[0,0,0],\"light\"];"
@@ -27,7 +27,7 @@
5 lbCurSel !="_selectedMissionIndex = lbCurSel _lbMissionsControl;" !="_selectedUserIndex = lbCurSel _lbUsersControl;" !="profileNamespace setVariable ['streamerMode',(lbCurSel (_this select 0))];" !="_index = lbCurSel _lbcontrol;" !="_selected = lbCurSel _list;" !="_friendName = _userList lbText (lbCurSel _userList);" !")] call Z_" !"(lbCurSel 7421) call Z_fillCategoryList" !"] call Door" !"] call Plot" !")] spawn TraderDialog" !="[(lbCurSel 21000), ((ctrlParent (_this select 0)) displayCtrl 21001)] spawn EpochDeathBoardClick;" !"((ctrlParent (_this select 0)) closeDisplay 2);" !="_uid = _playerList lbData (lbCurSel _playerList);" !"_myGroup lbData (lbCurSel _myGroup);"
5 lbSet !="_lbUsersControl lbSetColor [_x, [1,0,0,1]];" !="_lbUsersControl lbSetValue [_x, _rating];" !="_control lbSetColor [_x, _color];" !"_weaponsLBSetFocus" !="(_this select 0) displayCtrl 140 lbSetCurSel (profileNamespace getVariable ['streamerMode',0]);" !="(_display displayCtrl 105) lbSetColor [_i, [0.06, 0.05, 0.03, 1]];" !"[7421," !"lbSetPicture [7422, _index" !"lbSetPicture [7402, _index" !"lbSetPicture [7401, _index" !="_userList lbSetData [(lbSize _userList) -1,_friendUID];" !" [TraderDialogItemList, _index, " !"_myGroup lbSetData [_index,getPlayerUID _x];"
5 onMapSingleClick
5 playableUnits !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };"
5 playableUnits !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\" && {(player in playableUnits" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };"
5 selectPlayer !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;"
5 serverCommand !="_character = if (serverCommandAvailable \"#kick\") then { call sched_tg_follow } else { player };" !"serverCommand (\"#kick \" + _selectedName);"
5 setDamage !"([4654,9595,0] nearestObject 145259) setDamage 1;\n([4654,9595,0] nearestObject 145260) setDamage 1;" !"if (_entity isKindOf \"Animal\") then {\n_entity setDamage 1;" !"_tree setDamage 1;\ndayz_choppedTrees set [count dayz_choppedTrees,_tree];" !"player setDamage 1;\n\nif (dayz_onBack != \"\") then {\n_body addWeapon dayz_onBack;" !"\n_obj setDamage (damage _obj) + _damage;\n" !"if(\"\" == typeOf _tree) then {\n_tree setDamage 1;\n};" !"if (_ent isKindOf \"Animal\" || _ent isKindOf \"zZombie_base\") then {\n_ent setDamage 1;"