From dee52083d359434fc3ac51a871c1b836d092d2ac Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Jun 2026 19:55:41 +0300 Subject: init --- Server/FSM/updateserver.fsm | 424 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 424 insertions(+) create mode 100644 Server/FSM/updateserver.fsm (limited to 'Server/FSM/updateserver.fsm') diff --git a/Server/FSM/updateserver.fsm b/Server/FSM/updateserver.fsm new file mode 100644 index 0000000..1a7cd75 --- /dev/null +++ b/Server/FSM/updateserver.fsm @@ -0,0 +1,424 @@ +/*%FSM*/ +/*%FSM*/ +/* +item0[] = {"Init",0,250,68.844200,-235.317032,158.844086,-185.317093,0.000000,"Init"}; +item1[] = {"Loop",4,218,69.950378,-54.529591,159.950424,-4.529562,0.000000,"Loop"}; +item2[] = {"End",1,250,71.371758,179.546143,161.371826,229.546112,0.000000,"End"}; +item3[] = {"Loop",4,218,-30.854136,-55.398598,59.145935,-5.398569,0.000000,"Loop"}; +item4[] = {"Gameover",4,218,71.840584,101.891243,161.840546,151.891220,0.000000,"Gameover"}; +item5[] = {"_",8,218,96.687485,-169.297226,128.493500,-146.721985,0.000000,""}; +item6[] = {"Wait",2,250,67.782181,-122.639091,157.782181,-72.639091,0.000000,"Wait"}; +item7[] = {"Annihilation",2,250,-30.415300,33.022167,59.584702,83.022156,0.000000,"Annihilation"}; +item8[] = {"Assassination",2,250,70.389214,33.891174,160.389175,83.891144,0.000000,"Assassination"}; +item9[] = {"Loop",4,218,171.623901,-54.529591,261.623230,-4.529560,0.000000,"Loop"}; +item10[] = {"Supremacy",2,250,172.062729,33.891171,262.062012,83.891174,0.000000,"Supremacy"}; +item11[] = {"_",2,250,-61.980644,102.236549,28.019346,152.236542,0.000000,""}; +item12[] = {"_",4,218,-61.980686,179.758133,28.019318,229.758133,0.000000,""}; +item13[] = {"Town",2,250,275.342438,33.587734,365.342438,83.587723,0.000000,"Town"}; +item14[] = {"Loop",4,4314,275.618805,-53.185108,365.618805,-3.185127,0.000000,"Loop"}; +link0[] = {0,5}; +link1[] = {1,8}; +link2[] = {3,7}; +link3[] = {4,11}; +link4[] = {5,6}; +link5[] = {6,1}; +link6[] = {6,3}; +link7[] = {6,9}; +link8[] = {6,14}; +link9[] = {7,3}; +link10[] = {7,4}; +link11[] = {8,1}; +link12[] = {8,4}; +link13[] = {9,10}; +link14[] = {10,4}; +link15[] = {10,9}; +link16[] = {11,12}; +link17[] = {12,2}; +link18[] = {13,4}; +link19[] = {13,14}; +link20[] = {14,13}; +globals[] = {0.000000,0,0,0,0,640,480,1,24,6316128,1,-124.082573,468.916992,194.838867,-216.614029,595,514,1}; +window[] = {0,-1,-1,-1,-1,834,200,1460,200,1,613}; +*//*%FSM*/ +class FSM +{ + fsmName = "updateserver"; + class States + { + /*%FSM*/ + class Init + { + name = "Init"; + init = /*%FSM*/"_lastUpdate = time;" \n + "_winTime = time;" \n + "" \n + "_vc = 'WFBE_VICTORYCONDITION' Call GetNamespace;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class _ + { + priority = 0.000000; + to="Wait"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class End + { + name = "End"; + init = /*%FSM*/"diag_log Format[""[WFBE (OUTRO)][frameno:%1 | ticktime:%2] updateserver.fsm: Mission end - [Done]"",diag_frameno,diag_tickTime];" \n + "failMission ""END1"";"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Wait + { + name = "Wait"; + init = /*%FSM*/"_total = totalTowns;" \n + "_westTowns = 0;" \n + "_eastTowns = 0;" \n + "{_sideID = _x getVariable ""sideID"";if (_sideID == WESTID) then {_westTowns = _westTowns + 1};if (_sideID == EASTID) then {_eastTowns = _eastTowns + 1}} ForEach towns;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Annihilation"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 0"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop_1 + { + priority = 0.000000; + to="Supremacy"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 2"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop_2 + { + priority = 0.000000; + to="Town"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 3"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop_3 + { + priority = 0.000000; + to="Assassination"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Annihilation + { + name = "Annihilation"; + init = /*%FSM*/"_westMHQ = WestMHQ;" \n + "_eastMHQ = EastMHQ;" \n + "_westBuildings = WestBaseStructures;" \n + "_eastBuildings = EastBaseStructures;" \n + "" \n + "_westMHQAlive = true;" \n + "_eastMHQAlive = true;" \n + "if (isNull _westMHQ || getDammage _westMHQ >= 1) then {_westMHQAlive = false};" \n + "if (isNull _eastMHQ || getDammage _eastMHQ >= 1) then {_eastMHQAlive = false};" \n + "" \n + "//--- East Win." \n + "if ((count _westBuildings == 0)&&(!_westMHQAlive) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",east];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "//--- West Win." \n + "if ((count _eastBuildings == 0)&&(!_eastMHQAlive) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[WESTID,_westBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[WESTID,_westBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",west];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "_lastUpdate = time;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Gameover + { + priority = 0.000000; + to="_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"gameOver"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Annihilation"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 0"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Assassination + { + name = "Assassination"; + init = /*%FSM*/"_westMHQ = WestMHQ;" \n + "_eastMHQ = EastMHQ;" \n + "_westBuildings = WestBaseStructures;" \n + "_eastBuildings = EastBaseStructures;" \n + "" \n + "_westMHQAlive = true;" \n + "_eastMHQAlive = true;" \n + "if (isNull _westMHQ || getDammage _westMHQ >= 1) then {_westMHQAlive = false};" \n + "if (isNull _eastMHQ || getDammage _eastMHQ >= 1) then {_eastMHQAlive = false};" \n + "" \n + "_westTowns = 0;" \n + "_eastTowns = 0;" \n + "{_sideID = _x getVariable ""sideID"";if (_sideID == WESTID) then {_westTowns = _westTowns + 1};if (_sideID == EASTID) then {_eastTowns = _eastTowns + 1}} ForEach towns;" \n + "" \n + "//--- East Win." \n + "if (!_westMHQAlive || (_eastTowns == _total) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",east];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "//--- West Win." \n + "if (!_eastMHQAlive || (_westTowns == _total) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[WESTID,_westBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[WESTID,_westBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",west];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "_lastUpdate = time;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Gameover + { + priority = 0.000000; + to="_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"gameOver"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Assassination"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 1"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Supremacy + { + name = "Supremacy"; + init = /*%FSM*/"_westMHQ = WestMHQ;" \n + "_eastMHQ = EastMHQ;" \n + "_westBuildings = WestBaseStructures;" \n + "_eastBuildings = EastBaseStructures;" \n + "" \n + "_westMHQAlive = true;" \n + "_eastMHQAlive = true;" \n + "if (isNull _westMHQ || getDammage _westMHQ >= 1) then {_westMHQAlive = false};" \n + "if (isNull _eastMHQ || getDammage _eastMHQ >= 1) then {_eastMHQAlive = false};" \n + "" \n + "_westTowns = 0;" \n + "_eastTowns = 0;" \n + "{_sideID = _x getVariable ""sideID"";if (_sideID == WESTID) then {_westTowns = _westTowns + 1};if (_sideID == EASTID) then {_eastTowns = _eastTowns + 1}} ForEach towns;" \n + "" \n + "_westFactories = 0;" \n + "_eastFactories = 0;" \n + "{" \n + " _tmp = count([west,Format [""WFBE_WEST%1TYPE"",_x] Call GetNamespace,_westBuildings] Call GetFactories);" \n + " _westFactories = _westFactories + _tmp;" \n + " _tmp = count([east,Format [""WFBE_EAST%1TYPE"",_x] Call GetNamespace,_eastBuildings] Call GetFactories);" \n + " _eastFactories = _eastFactories + _tmp;" \n + "} forEach [""BARRACKS"",""LIGHT"",""HEAVY"",""AIRCRAFT""];" \n + "" \n + "//--- East Win." \n + "if (!_westMHQAlive && _westFactories == 0 || (_eastTowns == _total) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",east];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "//--- West Win." \n + "if (!_eastMHQAlive && _eastFactories == 0 || (_westTowns == _total) && !gameOver) then {" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[WESTID,_westBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[WESTID,_westBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",west];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "_lastUpdate = time;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Supremacy"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 2"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Gameover + { + priority = 0.000000; + to="_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"gameOver"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class _ + { + name = "_"; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class _ + { + priority = 0.000000; + to="End"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _winTime > 20"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Town + { + name = "Town"; + init = /*%FSM*/"_westTowns = 0;" \n + "_eastTowns = 0;" \n + "{_sideID = _x getVariable ""sideID"";if (_sideID == WESTID) then {_westTowns = _westTowns + 1};if (_sideID == EASTID) then {_eastTowns = _eastTowns + 1}} ForEach towns;" \n + "" \n + "//--- East Win." \n + "if (_eastTowns == _total && !gameOver) then {" \n + " _eastBuildings = EastBaseStructures;" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[EASTID,_eastBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",east];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "//--- West Win." \n + "if (_westTowns == _total && !gameOver) then {" \n + " _westBuildings = WestBaseStructures;" \n + " WFBE_EndGame = [nil,'CLTFNCENDGAME',[WESTID,_westBuildings]];" \n + " publicVariable 'WFBE_EndGame';" \n + " if (isHostedServer) then {[nil,'CLTFNCENDGAME',[WESTID,_westBuildings]] Spawn HandlePVF};" \n + " WF_Logic setVariable [""WF_Winner"",west];" \n + " gameOver = true;" \n + " _winTime = time;" \n + "};" \n + "" \n + "_lastUpdate = time;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Loop + { + priority = 0.000000; + to="Town"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"time - _lastUpdate > 20 && !gameOver && _vc == 3"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Gameover + { + priority = 0.000000; + to="_"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"gameOver"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + }; + initState="Init"; + finalStates[] = + { + "End" + }; +}; +/*%FSM*/ -- cgit v1.3.1