Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Server Cleanup">*/
- /*%FSM<HEAD>*/
- /*
- item0[] = {"init",0,250,-75.000000,-400.000000,25.000000,-350.000000,0.000000,"init"};
- 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,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,""};
- item8[] = {"",7,210,-304.000000,-154.000000,-296.000000,-146.000000,0.000000,""};
- item9[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
- item10[] = {"",7,210,221.000000,146.000000,229.000000,154.000000,0.000000,""};
- item11[] = {"initialized",4,218,-75.000000,-325.000000,25.000000,-275.000000,0.000000,"initialized"};
- item12[] = {"prepare",2,250,-75.000000,-250.000000,25.000000,-200.000000,0.000000,"prepare"};
- item13[] = {"update_objects",2,250,100.000000,50.000000,200.000000,100.000000,0.000000,"update objects"};
- 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,4346,-25.000000,50.000000,75.000000,100.000000,0.000000,"vehicle" \n "cleanup"};
- link0[] = {0,11};
- link1[] = {1,2};
- link2[] = {2,3};
- link3[] = {2,9};
- link4[] = {2,14};
- link5[] = {2,16};
- link6[] = {2,18};
- link7[] = {3,4};
- link8[] = {4,5};
- link9[] = {5,6};
- link10[] = {6,7};
- link11[] = {7,8};
- link12[] = {8,1};
- link13[] = {9,10};
- link14[] = {9,15};
- link15[] = {10,5};
- link16[] = {11,12};
- link17[] = {12,1};
- link18[] = {13,5};
- link19[] = {14,13};
- 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,810,52,1330,52,1,693};
- *//*%FSM</HEAD>*/
- class FSM
- {
- fsmName = "DayZ Server Cleanup";
- class States
- {
- /*%FSM<STATE "init">*/
- class init
- {
- name = "init";
- init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "initialized">*/
- class initialized
- {
- priority = 0.000000;
- to="prepare";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "waiting">*/
- class waiting
- {
- name = "waiting";
- init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "need_update">*/
- class need_update
- {
- priority = 1.000000;
- to="update_objects";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"( (count needUpdate_objects) > 0 && (diag_tickTime -_lastNeedUpdate>40) )"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "cleanup_groups">*/
- class cleanup_groups
- {
- priority = 1.000000;
- to="group_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupGroups) > 10)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastCleanupGroups = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "cleanup_vehicles">*/
- class cleanup_vehicles
- {
- priority = 1.000000;
- to="vehicle_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastCleanupVehicles) > 5)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastCleanupVehicles = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "time_sync">*/
- class time_sync
- {
- priority = 1.000000;
- to="sync_the_time";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%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 "sync_the_time">*/
- class sync_the_time
- {
- name = "sync_the_time";
- init = /*%FSM<STATEINIT""">*/"//Send request" \n
- "_key = ""CHILD:307:"";" \n
- "_result = _key call server_hiveReadWrite;" \n
- "_outcome = _result select 0;" \n
- "if(_outcome == ""PASS"") then {" \n
- " _date = _result select 1; " \n
- " " \n
- " if(dayz_fullMoonNights) then {" \n
- " //date setup" \n
- " _year = _date select 0;" \n
- " _month = _date select 1;" \n
- " _day = _date select 2;" \n
- " _hour = _date select 3;" \n
- " _minute = _date select 4;" \n
- " " \n
- " //Force full moon nights" \n
- " _date = [2012,6,6,_hour,_minute];" \n
- " };" \n
- "" \n
- " setDate _date;" \n
- " dayzSetDate = _date;" \n
- " publicVariable ""dayzSetDate"";" \n
- " diag_log (""TIME SYNC: Local Time set to "" + str(_date)); " \n
- "};" \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 "general_cleanup">*/
- class general_cleanup
- {
- name = "general_cleanup";
- init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Starting loop for next task"";"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "prepare">*/
- class prepare
- {
- name = "prepare";
- init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
- "" \n
- "_safety = dayz_serverObjectMonitor;" \n
- "//_dateNow = (DateToNumber date);" \n
- "" \n
- "_lastUpdate = diag_tickTime;" \n
- "_lastNeedUpdate = diag_tickTime;" \n
- "_lastCleanupVehicles = diag_tickTime;" \n
- "_lastCleanupGroups = diag_tickTime;" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "update_objects">*/
- class update_objects
- {
- name = "update_objects";
- 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
- "" \n
- "} forEach needUpdate_objects;"/*%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 "group_cleanup">*/
- class group_cleanup
- {
- name = "group_cleanup";
- init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
- "{" \n
- " // diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
- " if (count units _x==0) then {" \n
- " deleteGroup _x;" \n
- " // 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 = dayz_serverObjectMonitor;" \n
- "" \n
- "//Check for hackers" \n
- " {" \n
- " if(vehicle _x != _x && (vehicle _x getVariable [""Mission"",0] != 1) && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
- " diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
- " (vehicle _x) setDamage 1;" \n
- " _x setDamage 1;" \n
- " };" \n
- " } forEach allUnits;" \n
- "" \n
- "dayz_serverObjectMonitor = _safety;"/*%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[] =
- {
- };
- };
- /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment