Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. /*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Server-Side Cleanup">*/
  2. /*%FSM<HEAD>*/
  3. /*
  4. item0[] = {"init",0,250,-65.004578,-391.651611,24.995417,-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[] = {"true",8,218,-54.709698,75.189262,35.290302,125.189262,0.000000,"true"};
  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,-311.750000,-203.033707,-303.750000,-195.033707,0.000000,""};
  12. link0[] = {0,1};
  13. link1[] = {1,2};
  14. link2[] = {2,4};
  15. link3[] = {3,6};
  16. link4[] = {4,5};
  17. link5[] = {5,3};
  18. link6[] = {6,7};
  19. link7[] = {7,2};
  20. globals[] = {0.000000,0,0,0,0,640,480,1,46,6316128,1,-629.444153,611.207214,293.309357,-434.050568,1243,911,1};
  21. window[] = {2,-1,-1,-32000,-32000,910,150,1793,150,3,1261};
  22. *//*%FSM</HEAD>*/
  23. class FSM
  24. {
  25. fsmName = "Server-Side Cleanup";
  26. class States
  27. {
  28.  
  29. class init
  30. {
  31. name = "init";
  32. init = "private[""_impound"",""_cars"",""_objs"",""_totCars"",""_thread""];" \n
  33. "_impound = time;" \n
  34. "_cars = time;" \n
  35. "_objs = time;";
  36. precondition = "";
  37. class Links
  38. {
  39.  
  40. class true
  41. {
  42. priority = 0.000000;
  43. to="Share__Work_load";
  44. precondition = "";
  45. condition="true";
  46. action="";
  47. };
  48.  
  49. };
  50. };
  51.  
  52.  
  53. class Share__Work_load
  54. {
  55. name = "Share__Work_load";
  56. init = "";
  57. precondition = "";
  58. class Links
  59. {
  60.  
  61. class Time_Check
  62. {
  63. priority = 0.000000;
  64. to="Delete_Dead_Cars";
  65. precondition = "";
  66. condition="((time - _cars) > (3 * 60))";
  67. action="";
  68. };
  69.  
  70. };
  71. };
  72.  
  73.  
  74. class Delete_Dead_Cars
  75. {
  76. name = "Delete_Dead_Cars";
  77. init = "{" \n
  78. " if(!alive _x) then" \n
  79. " {" \n
  80. " _dbInfo = _x getVariable[""dbInfo"",[]];" \n
  81. " if(count _dbInfo > 0) then" \n
  82. " {" \n
  83. " _uid = _dbInfo select 0;" \n
  84. " _plate = _dbInfo select 1;" \n
  85. "" \n
  86. " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate];" \n
  87. " _query spawn {" \n
  88. " " \n
  89. " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n
  90. " };" \n
  91. " };" \n
  92. " if(!isNil ""_x"" && {!isNull _x}) then {" \n
  93. " deleteVehicle _x;" \n
  94. " };" \n
  95. " };" \n
  96. "} foreach allMissionObjects ""LandVehicle"";" \n
  97. "" \n
  98. "{" \n
  99. " if(!alive _x) then" \n
  100. " {" \n
  101. " _dbInfo = _x getVariable[""dbInfo"",[]];" \n
  102. " if(count _dbInfo > 0) then" \n
  103. " {" \n
  104. " _uid = _dbInfo select 0;" \n
  105. " _plate = _dbInfo select 1;" \n
  106. "" \n
  107. " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate];" \n
  108. " _query spawn {" \n
  109. " " \n
  110. " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n
  111. " };" \n
  112. " };" \n
  113. " if(!isNil ""_x"" && {!isNull _x}) then {" \n
  114. " deleteVehicle _x;" \n
  115. " };" \n
  116. " };" \n
  117. "} foreach allMissionObjects ""Air"";" \n
  118. "" \n
  119. "_cars = time;";
  120. precondition = "";
  121. class Links
  122. {
  123.  
  124. class true
  125. {
  126. priority = 0.000000;
  127. to="Share__Work_load";
  128. precondition = "";
  129. condition="true";
  130. action="";
  131. };
  132.  
  133. };
  134. };
  135.  
  136. };
  137. initState="init";
  138. finalStates[] =
  139. {
  140. };
  141. };
  142. /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement