diff --git a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf
index d4d2940d3..f1ed44a67 100644
--- a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf
+++ b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf
@@ -43,7 +43,7 @@ if (_playerUID in dayz_ghostPlayers) exitwith {
};
//Make sure we know the ID of the object before we try and sync any info to the DB
-if (_characterID != "?") exitwith {
+if (_characterID != "?") then {
//If the player has sepsis before logging off lets give them infected status.
if (_Sepsis) then {
_playerObj setVariable["USEC_infected",true,true];
@@ -81,16 +81,11 @@ if (_characterID != "?") exitwith {
{[_x,"gear"] call server_updateObject} count (nearestObjects [_playerPos,DayZ_GearedObjects,10]);
};
- [_playerUID,_characterID,2,_playerName] call dayz_recordLogin;
+ [_playerUID,_characterID,3,_playerName,((getPosATL _playerObj) call fa_coor2str)] call dayz_recordLogin;
};
-if (isNull _playerObj) then {
- diag_log "Player Object does not exist";
-} else {
-//Lets remove the object.
- if (alive _playerObj) then {
- _myGroup = group _playerObj;
- deleteVehicle _playerObj;
- deleteGroup _myGroup;
- };
+if (alive _playerObj) then {
+ _myGroup = group _playerObj;
+ deleteVehicle _playerObj;
+ deleteGroup _myGroup;
};
\ No newline at end of file
diff --git a/SQF/dayz_server/compile/server_playerLogin.sqf b/SQF/dayz_server/compile/server_playerLogin.sqf
index 5649cf782..1c238268d 100644
--- a/SQF/dayz_server/compile/server_playerLogin.sqf
+++ b/SQF/dayz_server/compile/server_playerLogin.sqf
@@ -154,7 +154,7 @@ if (count dayz_activeInvites > 0) then {
};
//Record Player Login/LogOut
-[_playerID,_charID,1,_playerName] call dayz_recordLogin;
+[_playerID,_charID,2,(_playerObj call fa_plr2str),((getPosATL _playerObj) call fa_coor2str)] call dayz_recordLogin;
PVCDZ_plr_PlayerAccepted = [_playerName,diag_ticktime];
(owner _playerObj) publicVariableClient "PVCDZ_plr_PlayerAccepted";
\ No newline at end of file
diff --git a/SQF/dayz_server/compile/server_playerSetup.sqf b/SQF/dayz_server/compile/server_playerSetup.sqf
index 0d2bb35e7..db05a060d 100644
--- a/SQF/dayz_server/compile/server_playerSetup.sqf
+++ b/SQF/dayz_server/compile/server_playerSetup.sqf
@@ -238,7 +238,8 @@ if ((count _inventory) > 1) then {
};
-//diag_log format["LOGIN PUBLISHING: UID#%1 CID#%2 %3 as %4 should spawn at %5",getPlayerUID _playerObj,_characterID,_playerObj call fa_plr2str,typeOf _playerObj,(_worldspace select 1) call fa_coor2str];
+//Record Player Login/LogOut
+[_playerID,_characterID,1,(_playerObj call fa_plr2str),((_worldspace select 1) call fa_coor2str)] call dayz_recordLogin;
PVDZ_plr_Login1 = null;
PVDZ_plr_Login2 = null;
\ No newline at end of file
diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf
index 2ec88d939..665e21f54 100644
--- a/SQF/dayz_server/compile/server_playerSync.sqf
+++ b/SQF/dayz_server/compile/server_playerSync.sqf
@@ -227,8 +227,9 @@ _key = if (Z_SingleCurrency) then {
} else {
format["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,_kills,_headShots,_distanceFoot,_timeSince,_currentState,_killsH,_killsB,_currentModel,_humanity]
};
-//diag_log ("HIVE: WRITE: "+ str(_key) + " / " + _characterID);
-//diag_log format["HIVE: SYNC: [%1,%2,%3,%4]",_characterID,_playerPos,_playerGear,_playerBackp];
+
+//diag_log str formatText["INFO - %2(UID:%3) PlayerSync, %1",_key,_name,_playerUID];
+
_key call server_hiveWrite;
if (Z_SingleCurrency) then { //update global coins
diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf
index c42aa1383..0c89f889a 100644
--- a/SQF/dayz_server/init/server_functions.sqf
+++ b/SQF/dayz_server/init/server_functions.sqf
@@ -26,7 +26,7 @@ zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\comp
server_Wildgenerate = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_Wildgenerate.sqf";
server_plantSpawner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_plantSpawner.sqf";
base_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
-server_systemCleanup = compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_cleanup.sqf";
+//server_systemCleanup = compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_cleanup.sqf";
spawnComposition = compile preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"; //"\z\addons\dayz_code\compile\object_mapper.sqf";
server_sendToClient = compile preprocessFileLineNumbers "\z\addons\dayz_server\eventHandlers\server_sendToClient.sqf";
@@ -188,8 +188,9 @@ dayz_recordLogin = {
_status = switch (1==1) do {
case ((_this select 2) == 0): { "CLIENT LOADED & PLAYING" };
- case ((_this select 2) == 1): { "LOGGED IN" };
- case ((_this select 2) == 2): { "LOGGED OUT" };
+ case ((_this select 2) == 1): { "LOGIN PUBLISHING, Location " +(_this select 4) };
+ case ((_this select 2) == 2): { "LOGGING IN" };
+ case ((_this select 2) == 3): { "LOGGED OUT, Location " +(_this select 4) };
};
_name = if (typeName (_this select 3) == "ARRAY") then { toString (_this select 3) } else { _this select 3 };
diff --git a/SQF/dayz_server/system/server_cleanup.fsm b/SQF/dayz_server/system/server_cleanup.fsm
deleted file mode 100644
index cca32c1fa..000000000
--- a/SQF/dayz_server/system/server_cleanup.fsm
+++ /dev/null
@@ -1,399 +0,0 @@
-/*%FSM*/
-/*%FSM*/
-/*
-item0[] = {"init",0,250,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"init"};
-item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"};
-item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"};
-item3[] = {"too_many_dead",4,218,-125.000000,0.000000,-25.000000,50.000000,2.000000,"too many" \n "dead"};
-item4[] = {"cleanup_dead",2,250,-125.000000,75.000000,-25.000000,125.000000,0.000000,"cleanup" \n "dead"};
-item5[] = {"too_many_objects",4,218,175.000000,0.000000,275.000000,50.000000,2.000000,"too many" \n "objects"};
-item6[] = {"cleanup_objects",2,4346,175.000000,75.000000,275.000000,125.000000,0.000000,"cleanup" \n "objects"};
-item7[] = {"time_sync",4,218,-225.000000,0.000000,-125.000000,50.000000,1.000000,"time" \n "sync"};
-item8[] = {"sync_the_time",2,250,-225.000000,175.000000,-125.000000,225.000000,0.000000,"sync" \n "the time"};
-item9[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"};
-item10[] = {"general_cleanup",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"general" \n "cleanup"};
-item11[] = {"",7,210,-254.000015,371.000000,-246.000000,379.000031,0.000000,""};
-item12[] = {"",7,210,-254.000015,-179.000000,-246.000000,-171.000000,0.000000,""};
-item13[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"};
-item14[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"};
-item15[] = {"update_objects",2,250,-25.000000,75.000000,75.000000,125.000000,0.000000,"update objects"};
-item16[] = {"Objects_need_upd",4,218,-25.000000,0.000000,75.000000,50.000000,1.000000,"Objects" \n "need update"};
-item17[] = {"",7,210,-29.000000,-41.500000,-21.000000,-33.499996,0.000000,""};
-item18[] = {"",7,210,20.999998,-41.500000,29.000000,-33.500000,0.000000,""};
-item19[] = {"",7,210,121.000000,-41.500000,129.000000,-33.500000,0.000000,""};
-item20[] = {"",7,210,-79.000000,-41.500000,-71.000000,-33.500000,0.000000,""};
-item21[] = {"",7,210,-179.000000,-41.499996,-171.000000,-33.500000,0.000000,""};
-item22[] = {"",7,210,-79.000000,146.000000,-71.000000,154.000000,0.000000,""};
-item23[] = {"",7,210,21.000000,146.000000,28.999998,154.000000,0.000000,""};
-item24[] = {"",7,210,-29.000000,146.000000,-20.999998,154.000000,0.000000,""};
-item25[] = {"",7,210,308.500000,-104.000000,316.500000,-96.000000,0.000000,""};
-item26[] = {"",7,210,308.500031,271.000000,316.499969,279.000000,0.000000,""};
-item27[] = {"",7,210,-179.000000,271.000000,-171.000000,279.000000,0.000000,""};
-item28[] = {"",7,210,221.000000,-41.500000,229.000000,-33.500000,0.000000,""};
-item29[] = {"New_Cleanup_Obje",2,250,375.000000,75.000000,475.000000,125.000000,0.000000,"New Cleanup" \n "Objects"};
-item30[] = {"",7,210,221.000031,271.000000,228.999969,279.000000,0.000000,""};
-link0[] = {0,13};
-link1[] = {1,2};
-link2[] = {2,17};
-link3[] = {2,25};
-link4[] = {3,4};
-link5[] = {4,22};
-link6[] = {5,6};
-link7[] = {6,30};
-link8[] = {7,8};
-link9[] = {8,27};
-link10[] = {9,10};
-link11[] = {10,11};
-link12[] = {11,12};
-link13[] = {12,1};
-link14[] = {13,14};
-link15[] = {14,1};
-link16[] = {15,23};
-link17[] = {16,15};
-link18[] = {17,18};
-link19[] = {17,20};
-link20[] = {18,16};
-link21[] = {18,19};
-link22[] = {19,28};
-link23[] = {20,3};
-link24[] = {20,21};
-link25[] = {21,7};
-link26[] = {22,24};
-link27[] = {23,24};
-link28[] = {24,9};
-link29[] = {25,26};
-link30[] = {26,30};
-link31[] = {27,9};
-link32[] = {28,5};
-link33[] = {30,9};
-globals[] = {25.000000,1,0,0,0,640,480,1,13,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,599,1};
-window[] = {2,-1,-1,-32000,-32000,878,150,1479,150,3,797};
-*//*%FSM*/
-class FSM
-{
- fsmName = "DayZ Server Cleanup";
- class States
- {
- /*%FSM*/
- class init
- {
- name = "init";
- init = /*%FSM*/""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class initialized
- {
- priority = 0.000000;
- to="prepare";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"!isnil ""bis_fnc_init"""/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class waiting
- {
- name = "waiting";
- init = /*%FSM*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
- "" \n
- "_numDead = {local _x} count allDead;" \n
- ""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class too_many_dead
- {
- priority = 2.000000;
- to="cleanup_dead";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(_numDead > 100)"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- /*%FSM*/
- class too_many_objects
- {
- priority = 2.000000;
- to="cleanup_objects";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"((diag_tickTime - _timeNem) > 150)" \n
- "//(((count dayz_deseedloot) > 0) && (!isNil ""sm_done""))"/*%FSM*/;
- action=/*%FSM*/"_timeNem = diag_tickTime;"/*%FSM*/;
- };
- /*%FSM*/
- /*%FSM*/
- class time_sync
- {
- priority = 1.000000;
- to="sync_the_time";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM*/;
- action=/*%FSM*/"_lastUpdate = diag_tickTime;"/*%FSM*/;
- };
- /*%FSM*/
- /*%FSM*/
- class Objects_need_upd
- {
- priority = 1.000000;
- to="update_objects";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5) && (!isNil ""sm_done""))"/*%FSM*/;
- action=/*%FSM*/"_lastNeedUpdate = diag_tickTime;"/*%FSM*/;
- };
- /*%FSM*/
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class cleanup_dead
- {
- name = "cleanup_dead";
- init = /*%FSM*/""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class cleanup_objects
- {
- name = "cleanup_objects";
- init = /*%FSM*/""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class sync_the_time
- {
- name = "sync_the_time";
- init = /*%FSM*/""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class general_cleanup
- {
- name = "general_cleanup";
- init = /*%FSM*/""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class prepare
- {
- name = "prepare";
- init = /*%FSM*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
- "" \n
- "_safety = dayz_serverObjectMonitor;" \n
- "_dateNow = (DateToNumber date);" \n
- "" \n
- "_lastUpdate = diag_tickTime;" \n
- "_timeNem =diag_tickTime;" \n
- "_deadBodies = [];" \n
- "_lastNeedUpdate = diag_tickTime;" \n
- "_timeout = diag_tickTime;" \n
- "_maxBodies = 15;" \n
- "" \n
- "_lootspawnerfdbykr = diag_tickTime; " \n
- "_reseedloot = false;" \n
- "" \n
- "_amount = 0;" \n
- "_hour = 0;" \n
- "_minute = 0;"/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class update_objects
- {
- name = "update_objects";
- init = /*%FSM*/"diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
- "" \n
- "{" \n
- "// _x setVariable [""needUpdate"",false,true];" \n
- " needUpdate_objects = needUpdate_objects - [_x];" \n
- " [_x,""damage"",true] call server_updateObject;" \n
- "} forEach needUpdate_objects;" \n
- ""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- /*%FSM*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"true"/*%FSM*/;
- action=/*%FSM*/""/*%FSM*/;
- };
- /*%FSM*/
- };
- };
- /*%FSM*/
- /*%FSM*/
- class New_Cleanup_Obje
- {
- name = "New_Cleanup_Obje";
- init = /*%FSM*/"diag_log ""DEBUG: New_Cleanup_Obje ""; " \n
- "_lootingrids = [];" \n
- "" \n
- "{" \n
- " _loc = _x select 0;" \n
- " _ref = _x select 1;" \n
- "" \n
- " _nearBy = nearestObjects [_loc, [""ReammoBox""], 1500];" \n
- " {" \n
- " _lootingrids set [count _lootingrids,[_x,_ref]];" \n
- " } foreach _nearBy;" \n
- "" \n
- " dayz_deseedloot set [0,-1];" \n
- " dayz_deseedloot = dayz_deseedloot - [-1];" \n
- "" \n
- "}foreach dayz_deseedloot;" \n
- "" \n
- "_qty = count _lootingrids;" \n
- "diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
- "" \n
- "_delQty = 0;" \n
- "_delQtyDroped = 0;" \n
- "_delQtySpawned = 0;" \n
- "_delQtyPerma = 0;" \n
- "" \n
- "{" \n
- " " \n
- " _obj = _x select 0;" \n
- " _ref = _x select 1;" \n
- "" \n
- " diag_log format [""%1,%2"", _obj, _ref];" \n
- "" \n
- " _Dropped = (_obj getVariable [""Dropped"",false]);" \n
- " _Spawned = (_obj getVariable [""spawnedLoot"",false]);" \n
- " _Perma = (_obj getVariable [""permaLoot"",false]);" \n
- "" \n
- " if (!_Spawned and !_Perma) then {" \n
- " _obj setVariable [""Dropped"",true];" \n
- " };" \n
- "" \n
- " //Dropped loot" \n
- " if (_Dropped) then {" \n
- " " \n
- " [""Dropped_Loot"",_obj,_ref] call server_systemCleanup;" \n
- " _delQtyDroped = _delQtyDroped + 1;" \n
- "" \n
- " };" \n
- "" \n
- " //Spawned Loot" \n
- " if (_Spawned) then {" \n
- "" \n
- " [""Spawned_Loot"",_obj,_ref] call server_systemCleanup;" \n
- " _delQtySpawned = _delQtySpawned + 1; " \n
- " " \n
- " };" \n
- "" \n
- " //Permaloot" \n
- " if (_Perma) then {" \n
- "" \n
- " _delQtyPerma = _delQtyPerma + 1;" \n
- "" \n
- " };" \n
- "" \n
- "} foreach _lootingrids;" \n
- "" \n
- "if ((_delQtySpawned > 0) or (_delQtyDroped > 0) or (_delQtyPerma > 0)) then {" \n
- " //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
- " diag_log format [""CLEANUP: (DELETED, DroppedLoot: %1, SpawnedLoot: %2), (KEPT, PermaLoot: %3)"", _delQtyDroped, _delQtySpawned, _delQtyPerma];" \n
- "};" \n
- ""/*%FSM*/;
- precondition = /*%FSM*/""/*%FSM*/;
- class Links
- {
- };
- };
- /*%FSM*/
- };
- initState="init";
- finalStates[] =
- {
- };
-};
-/*%FSM*/
\ No newline at end of file
diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf
index 8388d5857..9a22011a2 100644
--- a/SQF/dayz_server/system/server_monitor.sqf
+++ b/SQF/dayz_server/system/server_monitor.sqf
@@ -332,7 +332,7 @@ diag_log format["HIVE: BENCHMARK - Server_monitor.sqf finished streaming %1 obje
// # END OF STREAMING #
call server_plantSpawner; // Draw the pseudo random seeds
-[] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm"; // launch the legacy task scheduler
+[] execFSM "\z\addons\dayz_server\system\server_vehicleSync.fsm";
[] execVM "\z\addons\dayz_server\system\scheduler\sched_init.sqf"; // launch the new task scheduler
createCenter civilian;
diff --git a/SQF/dayz_server/system/server_vehicleSync.fsm b/SQF/dayz_server/system/server_vehicleSync.fsm
new file mode 100644
index 000000000..a5e5ff0ca
--- /dev/null
+++ b/SQF/dayz_server/system/server_vehicleSync.fsm
@@ -0,0 +1,230 @@
+/*%FSM*/
+/*%FSM*/
+/*
+item0[] = {"init",0,250,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"init"};
+item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"};
+item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"};
+item3[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"};
+item4[] = {"",7,210,-129.000015,271.000000,-120.999977,279.000031,0.000000,""};
+item5[] = {"",7,210,-129.000000,-104.000000,-120.999992,-96.000000,0.000000,""};
+item6[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"};
+item7[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"};
+item8[] = {"update_objects",2,4346,-75.000000,75.000000,25.000000,125.000000,0.000000,"update objects"};
+item9[] = {"Objects_need_upd",4,218,-75.000000,0.000000,25.000000,50.000000,1.000000,"Objects" \n "need update"};
+item10[] = {"",7,210,58.500000,-104.000000,66.500000,-96.000000,0.000000,""};
+item11[] = {"",7,210,58.500031,271.000000,66.499969,279.000000,0.000000,""};
+item12[] = {"New_Cleanup_Obje",2,250,375.000000,75.000000,475.000000,125.000000,0.000000,"New Cleanup" \n "Objects"};
+link0[] = {0,6};
+link1[] = {1,2};
+link2[] = {2,9};
+link3[] = {2,10};
+link4[] = {3,4};
+link5[] = {4,5};
+link6[] = {5,2};
+link7[] = {6,7};
+link8[] = {7,1};
+link9[] = {8,3};
+link10[] = {9,8};
+link11[] = {10,11};
+link12[] = {11,3};
+globals[] = {25.000000,1,0,0,0,640,480,1,13,6316128,1,-520.235962,640.978394,444.212921,-448.684845,779,598,1};
+window[] = {2,-1,-1,-1,-1,858,130,1459,130,3,797};
+*//*%FSM*/
+class FSM
+{
+ fsmName = "DayZ Server Vehicle Sync";
+ class States
+ {
+ /*%FSM*/
+ class init
+ {
+ name = "init";
+ init = /*%FSM*/""/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class initialized
+ {
+ priority = 0.000000;
+ to="prepare";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"!isnil ""bis_fnc_init"""/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class waiting
+ {
+ name = "waiting";
+ init = /*%FSM*/""/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class Objects_need_upd
+ {
+ priority = 1.000000;
+ to="update_objects";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5) && (!isNil ""sm_done""))"/*%FSM*/;
+ action=/*%FSM*/"_lastNeedUpdate = diag_tickTime;"/*%FSM*/;
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class true
+ {
+ priority = 0.000000;
+ to="waiting";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"true"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class prepare
+ {
+ name = "prepare";
+ init = /*%FSM*/"diag_log (""CLEANUP: INITIALIZING Vehicle SCRIPT"");" \n
+ "" \n
+ "" \n
+ "_lastNeedUpdate = diag_tickTime;" \n
+ "" \n
+ "" \n
+ ""/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class true
+ {
+ priority = 0.000000;
+ to="waiting";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"true"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class update_objects
+ {
+ name = "update_objects";
+ init = /*%FSM*/"diag_log format[""INFO: needUpdate_objects=%1"",needUpdate_objects];" \n
+ "" \n
+ "{" \n
+ " needUpdate_objects = needUpdate_objects - [_x];" \n
+ " [_x,""damage"",true] call server_updateObject;" \n
+ "} forEach needUpdate_objects;" \n
+ ""/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class true
+ {
+ priority = 0.000000;
+ to="waiting";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"true"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class New_Cleanup_Obje
+ {
+ name = "New_Cleanup_Obje";
+ init = /*%FSM*/"diag_log ""DEBUG: New_Cleanup_Obje ""; " \n
+ "_lootingrids = [];" \n
+ "" \n
+ "{" \n
+ " _loc = _x select 0;" \n
+ " _ref = _x select 1;" \n
+ "" \n
+ " _nearBy = nearestObjects [_loc, [""ReammoBox""], 1500];" \n
+ " {" \n
+ " _lootingrids set [count _lootingrids,[_x,_ref]];" \n
+ " } foreach _nearBy;" \n
+ "" \n
+ " dayz_deseedloot set [0,-1];" \n
+ " dayz_deseedloot = dayz_deseedloot - [-1];" \n
+ "" \n
+ "}foreach dayz_deseedloot;" \n
+ "" \n
+ "_qty = count _lootingrids;" \n
+ "diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
+ "" \n
+ "_delQty = 0;" \n
+ "_delQtyDroped = 0;" \n
+ "_delQtySpawned = 0;" \n
+ "_delQtyPerma = 0;" \n
+ "" \n
+ "{" \n
+ " " \n
+ " _obj = _x select 0;" \n
+ " _ref = _x select 1;" \n
+ "" \n
+ " diag_log format [""%1,%2"", _obj, _ref];" \n
+ "" \n
+ " _Dropped = (_obj getVariable [""Dropped"",false]);" \n
+ " _Spawned = (_obj getVariable [""spawnedLoot"",false]);" \n
+ " _Perma = (_obj getVariable [""permaLoot"",false]);" \n
+ "" \n
+ " if (!_Spawned and !_Perma) then {" \n
+ " _obj setVariable [""Dropped"",true];" \n
+ " };" \n
+ "" \n
+ " //Dropped loot" \n
+ " if (_Dropped) then {" \n
+ " " \n
+ " [""Dropped_Loot"",_obj,_ref] call server_systemCleanup;" \n
+ " _delQtyDroped = _delQtyDroped + 1;" \n
+ "" \n
+ " };" \n
+ "" \n
+ " //Spawned Loot" \n
+ " if (_Spawned) then {" \n
+ "" \n
+ " [""Spawned_Loot"",_obj,_ref] call server_systemCleanup;" \n
+ " _delQtySpawned = _delQtySpawned + 1; " \n
+ " " \n
+ " };" \n
+ "" \n
+ " //Permaloot" \n
+ " if (_Perma) then {" \n
+ "" \n
+ " _delQtyPerma = _delQtyPerma + 1;" \n
+ "" \n
+ " };" \n
+ "" \n
+ "} foreach _lootingrids;" \n
+ "" \n
+ "if ((_delQtySpawned > 0) or (_delQtyDroped > 0) or (_delQtyPerma > 0)) then {" \n
+ " //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
+ " diag_log format [""CLEANUP: (DELETED, DroppedLoot: %1, SpawnedLoot: %2), (KEPT, PermaLoot: %3)"", _delQtyDroped, _delQtySpawned, _delQtyPerma];" \n
+ "};" \n
+ ""/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ };
+ };
+ /*%FSM*/
+ };
+ initState="init";
+ finalStates[] =
+ {
+ };
+};
+/*%FSM*/
\ No newline at end of file