mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-16 21:22:57 +03:00
cleanup plus opt.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_hasKnife","_qty","_item","_text","_string","_type","_started","_finished","_animState","_isMedic","_hasHarvested","_hasKnifeBlunt","_humanity"];
|
||||
private [];
|
||||
|
||||
player removeAction s_player_SurrenderedGear;
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ if (count _list < dayz_maxAnimals) then {
|
||||
if (player distance _Pos < dayz_animalDistance and NOT surfaceIsWater _Pos and (count _list <= 1)) then {
|
||||
if (_type == "DZ_Pastor") then { _agent = createAgent [_type, _Pos, [], 0, "NONE"]; } else { _agent = createAgent [_type, _Pos, [], 0, "FORM"]; };
|
||||
_agent setpos _Pos;
|
||||
|
||||
PVDZE_zed_Spawn = [_agent];
|
||||
publicVariableServer "PVDZE_zed_Spawn";
|
||||
|
||||
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
|
||||
};
|
||||
sleep 1;
|
||||
|
||||
@@ -7,13 +7,6 @@ _playerID = _this select 3;
|
||||
_playerName = _this select 4;
|
||||
_infected = _this select 5;
|
||||
|
||||
_victim removeAllEventHandlers "MPHit";
|
||||
_victim enableSimulation false;
|
||||
_victim removeAllEventHandlers "HandleDamage";
|
||||
_victim removeAllEventHandlers "Killed";
|
||||
_victim removeAllEventHandlers "Fired";
|
||||
_victim removeAllEventHandlers "FiredNear";
|
||||
|
||||
_victim = _newObject;
|
||||
_victimName = _victim getVariable["bodyName", "nil"];
|
||||
|
||||
@@ -81,7 +74,7 @@ if (isnil "dayz_disco") then {
|
||||
*/
|
||||
|
||||
// dayz_disco = dayz_disco - [_playerID];
|
||||
_newObject setVariable["processedDeath",time];
|
||||
_newObject setVariable["processedDeath",diag_tickTime];
|
||||
|
||||
if (typeName _minutes == "STRING") then
|
||||
{
|
||||
|
||||
@@ -575,20 +575,41 @@ dayz_recordLogin = {
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
|
||||
dayz_perform_purge = {
|
||||
_this removeAllMPEventHandlers "mpkilled";
|
||||
_this removeAllMPEventHandlers "mphit";
|
||||
_this removeAllMPEventHandlers "mprespawn";
|
||||
_this removeAllEventHandlers "FiredNear";
|
||||
_this removeAllEventHandlers "HandleDamage";
|
||||
_this removeAllEventHandlers "Killed";
|
||||
_this removeAllEventHandlers "Fired";
|
||||
_this removeAllEventHandlers "GetOut";
|
||||
_this removeAllEventHandlers "Local";
|
||||
clearVehicleInit _this;
|
||||
deleteVehicle _this;
|
||||
deleteGroup (group _this);
|
||||
_this = nil;
|
||||
};
|
||||
|
||||
server_cleanDead = {
|
||||
private ["_objectPos","_noPlayerNear"];
|
||||
private ["_deathTime"];
|
||||
{
|
||||
_objectPos = getPosATL _x;
|
||||
_noPlayerNear = {isPlayer _x} count (_objectPos nearEntities ["CAManBase",35]) == 0;
|
||||
if (_noPlayerNear) then
|
||||
{
|
||||
if (local _x) then {
|
||||
|
||||
if (_x isKindOf "zZombie_Base") then
|
||||
{
|
||||
deleteVehicle _x;
|
||||
_x call dayz_perform_purge;
|
||||
};
|
||||
if (_x isKindOf "CAManBase") then {
|
||||
_deathTime = _x getVariable ["processedDeath", diag_tickTime];
|
||||
if (diag_tickTime - _deathTime > 3600) then {
|
||||
_x call dayz_perform_purge;
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach allDead;
|
||||
};
|
||||
|
||||
server_cleanLoot =
|
||||
{
|
||||
private ["_deletedLoot","_startTime","_looted","_objectPos","_noPlayerNear","_nearObj","_endTime"];
|
||||
@@ -605,7 +626,7 @@ private ["_deletedLoot","_startTime","_looted","_objectPos","_noPlayerNear","_ne
|
||||
|
||||
if (_noPlayerNear) then
|
||||
{
|
||||
_nearObj = nearestObjects [_objectPos,["ReammoBox","WeaponHolder","WeaponHolderBase"],((sizeOf (typeOf _x)) + 5)];
|
||||
_nearObj = nearestObjects [_objectPos,["ReammoBox"],((sizeOf (typeOf _x)) + 5)];
|
||||
{
|
||||
deleteVehicle _x;
|
||||
_deletedLoot = _deletedLoot + 1;
|
||||
|
||||
@@ -5,7 +5,7 @@ item0[] = {"init",0,250,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"i
|
||||
item1[] = {"true",8,218,-75.000000,-175.000000,25.000000,-125.000000,0.000000,"true"};
|
||||
item2[] = {"waiting",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"waiting"};
|
||||
item3[] = {"time_sync",4,218,-275.000000,-25.000000,-175.000000,25.000000,1.000000,"time" \n "sync"};
|
||||
item4[] = {"sync_the_time",2,4346,-275.000000,50.000000,-175.000000,100.000000,0.000000,"sync" \n "the time"};
|
||||
item4[] = {"sync_the_time",2,250,-275.000000,50.000000,-175.000000,100.000000,0.000000,"sync" \n "the time"};
|
||||
item5[] = {"true",8,218,-75.000000,125.000000,25.000000,175.000000,0.000000,"true"};
|
||||
item6[] = {"general_cleanup",2,250,-75.000000,200.000000,25.000000,250.000000,0.000000,"general" \n "cleanup" \n "loop"};
|
||||
item7[] = {"",7,210,-304.000000,220.999985,-296.000000,229.000015,0.000000,""};
|
||||
@@ -18,9 +18,9 @@ item13[] = {"update_objects",2,250,100.000000,50.000000,200.000000,100.000000,0.
|
||||
item14[] = {"need_update",4,218,100.000000,-25.000000,200.000000,25.000000,1.000000,"need update"};
|
||||
item15[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
|
||||
item16[] = {"cleanup_groups",4,218,-150.000000,-25.000000,-50.000000,25.000000,1.000000,"cleanup" \n "groups"};
|
||||
item17[] = {"group_cleanup",2,250,-150.000000,50.000000,-50.000000,100.000000,0.000000,"group" \n "cleanup"};
|
||||
item18[] = {"cleanup_vehicles",4,218,-25.000000,-25.000000,75.000000,25.000000,1.000000,"cleanup" \n "vehicles"};
|
||||
item19[] = {"vehicle_cleanup",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"vehicle" \n "cleanup"};
|
||||
item17[] = {"group_cleanup",2,4346,-150.000000,50.000000,-50.000000,100.000000,0.000000,"group" \n "cleanup"};
|
||||
item18[] = {"cleanup",4,218,-25.000000,-25.000000,75.000000,25.000000,1.000000,"cleanup"};
|
||||
item19[] = {"cleanup_objects",2,250,-25.000000,50.000000,75.000000,100.000000,0.000000,"cleanup" \n "objects"};
|
||||
link0[] = {0,11};
|
||||
link1[] = {1,2};
|
||||
link2[] = {2,3};
|
||||
@@ -45,8 +45,8 @@ link20[] = {16,17};
|
||||
link21[] = {17,5};
|
||||
link22[] = {18,19};
|
||||
link23[] = {19,5};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,30,6316128,1,-419.782135,377.473389,510.243530,-212.601486,675,612,1};
|
||||
window[] = {0,-1,-1,-1,-1,940,182,1460,182,1,693};
|
||||
globals[] = {25.000000,1,0,0,0,640,480,1,30,6316128,1,-297.511841,255.202637,337.360535,-163.767258,675,612,1};
|
||||
window[] = {0,-1,-1,-1,-1,784,1706,2984,26,1,693};
|
||||
*//*%FSM</HEAD>*/
|
||||
class FSM
|
||||
{
|
||||
@@ -89,7 +89,7 @@ class FSM
|
||||
priority = 1.000000;
|
||||
to="update_objects";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"( (count needUpdate_objects) > 0 && (diag_tickTime -_lastNeedUpdate>40) )"/*%FSM</CONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5))"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
@@ -99,17 +99,17 @@ class FSM
|
||||
priority = 1.000000;
|
||||
to="group_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupGroups) > 10)"/*%FSM</CONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupGroups) > 1)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastCleanupGroups = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
/*%FSM<LINK "cleanup_vehicles">*/
|
||||
class cleanup_vehicles
|
||||
/*%FSM<LINK "cleanup">*/
|
||||
class cleanup
|
||||
{
|
||||
priority = 1.000000;
|
||||
to="vehicle_cleanup";
|
||||
to="cleanup_objects";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupVehicles) > 5)"/*%FSM</CONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupVehicles) > 60)"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/"_lastCleanupVehicles = diag_tickTime;"/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
@@ -236,10 +236,10 @@ class FSM
|
||||
class update_objects
|
||||
{
|
||||
name = "update_objects";
|
||||
init = /*%FSM<STATEINIT""">*/"//diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
|
||||
init = /*%FSM<STATEINIT""">*/"diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
|
||||
"{" \n
|
||||
" needUpdate_objects = needUpdate_objects - [_x];" \n
|
||||
" [_x,""all""] call server_updateObject;" \n
|
||||
" [_x,""damage"",true] call server_updateObject;" \n
|
||||
"" \n
|
||||
"} forEach needUpdate_objects;"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
@@ -270,28 +270,8 @@ class FSM
|
||||
" // diag_log (""CLEANUP: DELETING A GROUP"");" \n
|
||||
" };" \n
|
||||
"} forEach allGroups;" \n
|
||||
""/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="general_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "vehicle_cleanup">*/
|
||||
class vehicle_cleanup
|
||||
{
|
||||
name = "vehicle_cleanup";
|
||||
init = /*%FSM<STATEINIT""">*/"_safety = PVDZE_serverObjectMonitor;" \n
|
||||
"" \n
|
||||
"_safety = PVDZE_serverObjectMonitor;" \n
|
||||
"" \n
|
||||
"//Check for hackers" \n
|
||||
" {" \n
|
||||
@@ -319,6 +299,63 @@ class FSM
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
/*%FSM<STATE "cleanup_objects">*/
|
||||
class cleanup_objects
|
||||
{
|
||||
name = "cleanup_objects";
|
||||
init = /*%FSM<STATEINIT""">*/"_weaponholders = allMissionObjects ""ReammoBox"";" \n
|
||||
"_fireplaces = allMissionObjects ""Land_Fire_DZ"";" \n
|
||||
"" \n
|
||||
"_delQtyFP = 0;" \n
|
||||
"_delQty = 0;" \n
|
||||
"" \n
|
||||
"diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
|
||||
"" \n
|
||||
"_dateNow = (DateToNumber date);" \n
|
||||
"_delQty = 0;" \n
|
||||
"{" \n
|
||||
" if (local _x) then {" \n
|
||||
" _created = (_x getVariable [""created"",-0.1]);" \n
|
||||
" if (_created == -0.1) then {" \n
|
||||
" _x setVariable [""created"",_dateNow,false];" \n
|
||||
" _created = _dateNow;" \n
|
||||
" };" \n
|
||||
" _keep = _x getVariable [""permaLoot"",false];" \n
|
||||
" _age = (_dateNow - _created) * 525948;" \n
|
||||
" _nearby = {(isPlayer _x) and (alive _x)} count (_x nearEntities [[""CAManBase"",""AllVehicles""], 130]);" \n
|
||||
" if ( (!_keep) && (_nearby==0) && (_age > 20)) then {" \n
|
||||
" deleteVehicle _x;" \n
|
||||
" _delQty = _delQty + 1;" \n
|
||||
" };" \n
|
||||
" };" \n
|
||||
"} forEach _weaponholders;" \n
|
||||
"" \n
|
||||
"{" \n
|
||||
" if (local _x) then {" \n
|
||||
" deleteVehicle _x;" \n
|
||||
" _delQtyFP = _delQtyFP + 1;" \n
|
||||
" };" \n
|
||||
"} forEach _fireplaces;" \n
|
||||
"" \n
|
||||
"if (_delQty > 0 or _delQtyFP > 0) then {" \n
|
||||
" diag_log (format[""CLEANUP: Deleted %1 loot bags, %2 fireplaces"",_delQty,_delQtyFP]);" \n
|
||||
"};"/*%FSM</STATEINIT""">*/;
|
||||
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
|
||||
class Links
|
||||
{
|
||||
/*%FSM<LINK "true">*/
|
||||
class true
|
||||
{
|
||||
priority = 0.000000;
|
||||
to="general_cleanup";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
};
|
||||
};
|
||||
/*%FSM</STATE>*/
|
||||
};
|
||||
initState="init";
|
||||
finalStates[] =
|
||||
|
||||
Reference in New Issue
Block a user