Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Server-Side Cleanup">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-62.908096,-391.651611,27.091887,-341.651672,0.000000,"init"};
  5. item1[] = {"true",8,218,-62.976639,-315.185364,27.023363,-265.185364,0.000000,"true"};
  6. item2[] = {"Share__Work_load",2,250,-64.183350,-224.681931,25.816656,-174.681931,0.000000,"Share " \n "Work-load"};
  7. item3[] = {"Continue__",4,218,-220.591476,74.216980,-130.591476,124.216980,0.000000,"" \n "" \n "Continue" \n "" \n ""};
  8. item4[] = {"Time_Check",4,218,-219.425827,-133.310532,-129.425964,-83.310455,0.000000,"Time Check"};
  9. item5[] = {"Delete_Dead_Cars",2,4346,-220.186951,-29.248400,-130.187195,20.751413,0.000000,"Delete" \n "Dead" \n "Cars"};
  10. item6[] = {"",7,210,-312.538239,95.295059,-304.538239,103.295059,0.000000,""};
  11. item7[] = {"",7,210,-312.798218,-204.081940,-304.798218,-196.081940,0.000000,""};
  12. item8[] = {"End_Cleanup_",1,250,-64.828239,87.581070,25.171984,137.581238,0.000000,"" \n "End Cleanup" \n ""};
  13. item9[] = {"Check_for_HC_",4,218,-65.059021,-30.047342,24.941008,19.952658,0.000000,"" \n "Check for HC" \n ""};
  14. link0[] = {0,1};
  15. link1[] = {1,2};
  16. link2[] = {2,4};
  17. link3[] = {3,6};
  18. link4[] = {4,5};
  19. link5[] = {5,3};
  20. link6[] = {5,9};
  21. link7[] = {6,7};
  22. link8[] = {7,2};
  23. link9[] = {9,8};
  24. globals[] = {0.000000,0,0,0,0,640,480,1,53,6316128,1,-481.887177,425.726196,554.522583,-436.926575,170,901,1};
  25. window[] = {0,-1,-1,-32000,-32000,1065,104,1468,104,1,188};
  26. *//*%FSM</HEAD>*/
  27. class FSM
  28. {
  29. fsmName = "Server-Side Cleanup";
  30. class States
  31. {
  32. /*%FSM<STATE "init">*/
  33. class init
  34. {
  35. name = "init";
  36. init = /*%FSM<STATEINIT""">*/"private [""_impound"",""_cars"",""_objs"",""_totCars"",""_thread""];" \n
  37. "_impound = time;" \n
  38. "_cars = time;" \n
  39. "_objs = time;" \n
  40. "cleanupFSM setFSMVariable [""stopfsm"",false];"/*%FSM</STATEINIT""">*/;
  41. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  42. class Links
  43. {
  44. /*%FSM<LINK "true">*/
  45. class true
  46. {
  47. priority = 0.000000;
  48. to="Share__Work_load";
  49. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  50. condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
  51. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  52. };
  53. /*%FSM</LINK>*/
  54. };
  55. };
  56. /*%FSM</STATE>*/
  57. /*%FSM<STATE "Share__Work_load">*/
  58. class Share__Work_load
  59. {
  60. name = "Share__Work_load";
  61. init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  62. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  63. class Links
  64. {
  65. /*%FSM<LINK "Time_Check">*/
  66. class Time_Check
  67. {
  68. priority = 0.000000;
  69. to="Delete_Dead_Cars";
  70. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  71. condition=/*%FSM<CONDITION""">*/"((time - _cars) > (3 * 60))"/*%FSM</CONDITION""">*/;
  72. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  73. };
  74. /*%FSM</LINK>*/
  75. };
  76. };
  77. /*%FSM</STATE>*/
  78. /*%FSM<STATE "Delete_Dead_Cars">*/
  79. class Delete_Dead_Cars
  80. {
  81. name = "Delete_Dead_Cars";
  82. init = /*%FSM<STATEINIT""">*/"{" \n
  83. " if (!alive _x) then {" \n
  84. " _dbInfo = _x getVariable [""dbInfo"",[]];" \n
  85. " if (count _dbInfo > 0) then {" \n
  86. " _uid = _dbInfo select 0;" \n
  87. " _plate = _dbInfo select 1;" \n
  88. " _insureSystem = _dbInfo select 2;" \n
  89. " diag_log "" destroy vehicle !"";" \n
  90. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  91. " if(_insureSystem isEqualTo 1) then " \n
  92. " { diag_log "" Insured !"";" \n
  93. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  94. "" \n
  95. " _query_0 = format [""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate];" \n
  96. " _query_0 spawn {" \n
  97. " " \n
  98. " _thread = [_this,1] call DB_fnc_asyncCall;" \n
  99. " };" \n
  100. " } else {" \n
  101. " diag_log "" Not insured !"";" \n
  102. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  103. " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n
  104. " _query spawn {" \n
  105. " _thread = [_this,1] call DB_fnc_asyncCall;" \n
  106. " };" \n
  107. " };" \n
  108. " if (!isNil ""_x"" && {!isNull _x}) then {" \n
  109. " deleteVehicle _x;" \n
  110. " };" \n
  111. " };" \n
  112. "};" \n
  113. "} forEach allMissionObjects ""LandVehicle"";" \n
  114. "" \n
  115. "{" \n
  116. " if (!alive _x) then {" \n
  117. " _dbInfo = _x getVariable [""dbInfo"",[]];" \n
  118. " if (count _dbInfo > 0) then {" \n
  119. " _uid = _dbInfo select 0;" \n
  120. " _plate = _dbInfo select 1;" \n
  121. " _insureSystem = _dbInfo select 2;" \n
  122. " diag_log "" destroy vehicle !"";" \n
  123. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  124. " if(_insureSystem isEqualTo 1) then" \n
  125. " { diag_log "" Insured !"";" \n
  126. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  127. " _query_0 = format [""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate];" \n
  128. " _query_0 spawn {" \n
  129. " " \n
  130. " _thread = [_this,1] call DB_fnc_asyncCall;" \n
  131. " };} else { " \n
  132. " diag_log "" Not Insured !"";" \n
  133. " diag_log format[""insureSystem = %1 "", _insureSystem];" \n
  134. " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n
  135. " _query spawn {" \n
  136. " _thread = [_this,1] call DB_fnc_asyncCall;" \n
  137. " };" \n
  138. " };" \n
  139. " };" \n
  140. " if (!isNil ""_x"" && {!isNull _x}) then {" \n
  141. " deleteVehicle _x;" \n
  142. " };" \n
  143. " };" \n
  144. "} forEach allMissionObjects ""Air"";" \n
  145. "_cars = time;" \n
  146. "" \n
  147. "//Group cleanup." \n
  148. "{" \n
  149. " if (units _x isEqualTo [] && local _x) then {" \n
  150. " deleteGroup _x;" \n
  151. " };" \n
  152. "} forEach allGroups;"/*%FSMFSM</STATEINIT""">*/;
  153. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  154. class Links
  155. {
  156. /*%FSM<LINK "Check_for_HC_">*/
  157. class Check_for_HC_
  158. {
  159. priority = 0.000000;
  160. to="End_Cleanup_";
  161. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  162. condition=/*%FSM<CONDITION""">*/"cleanupFSM getFSMVariable ""stopfsm"""/*%FSM</CONDITION""">*/;
  163. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  164. };
  165. /*%FSM</LINK>*/
  166. /*%FSM<LINK "Continue__">*/
  167. class Continue__
  168. {
  169. priority = 0.000000;
  170. to="Share__Work_load";
  171. precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
  172. condition=/*%FSM<CONDITION""">*/"!(cleanupFSM getFSMVariable ""stopfsm"")"/*%FSM</CONDITION""">*/;
  173. action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
  174. };
  175. /*%FSM</LINK>*/
  176. };
  177. };
  178. /*%FSM</STATE>*/
  179. /*%FSM<STATE "End_Cleanup_">*/
  180. class End_Cleanup_
  181. {
  182. name = "End_Cleanup_";
  183. init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
  184. precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
  185. class Links
  186. {
  187. };
  188. };
  189. /*%FSM</STATE>*/
  190. };
  191. initState="init";
  192. finalStates[] =
  193. {
  194. "End_Cleanup_",
  195. };
  196. };
  197. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement