This repository has been archived by the owner on Sep 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote_call.fsm
125 lines (125 loc) · 4.46 KB
/
remote_call.fsm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Remote Call">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,250,-36.768673,533.704102,53.231323,583.704102,0.000000,"init"};
item1[] = {"true",8,218,-37.364014,606.966980,52.635986,656.966980,0.000000,"true"};
item2[] = {"Loadbalancer",2,250,-37.366936,680.859558,52.633080,730.859558,0.000000,"Loadbalancer"};
item3[] = {"Time_Check_5sek",4,218,-36.925579,763.796814,53.074421,813.796814,0.000000,"Time Check" \n "5sek"};
item4[] = {"Extension_call",2,4346,-37.303535,841.277954,52.696480,891.277954,0.000000,"Extension call"};
item5[] = {"true",8,218,-37.688129,933.801575,52.311871,983.801575,0.000000,"true"};
item6[] = {"",7,210,-300.321777,955.025696,-292.321747,963.025696,0.000000,""};
item7[] = {"",7,210,-300.057068,701.597839,-292.057068,709.597839,0.000000,""};
link0[] = {0,1};
link1[] = {1,2};
link2[] = {2,3};
link3[] = {3,4};
link4[] = {4,5};
link5[] = {5,6};
link6[] = {6,7};
link7[] = {7,2};
globals[] = {0.000000,0,0,0,0,640,480,1,11,6316128,1,-417.548584,399.303040,1112.951538,473.334656,933,615,1};
window[] = {0,-1,-1,-1,-1,785,25,1668,25,1,951};
*//*%FSM</HEAD>*/
class FSM
{
fsmName = "Remote Call";
class States
{
/*%FSM<STATE "init">*/
class init
{
name = "init";
init = /*%FSM<STATEINIT""">*/"private [""_rcWorkerTimer""];" \n
"" \n
"call compile (""remote_call"" callExtension ""Init"");" \n
"" \n
"_rcWorkerTimer = time;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Loadbalancer";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Loadbalancer">*/
class Loadbalancer
{
name = "Loadbalancer";
init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Time_Check_5sek">*/
class Time_Check_5sek
{
priority = 0.000000;
to="Extension_call";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((time - _rcWorkerTimer) >= 5)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Extension_call">*/
class Extension_call
{
name = "Extension_call";
init = /*%FSM<STATEINIT""">*/"private [""_queryStack"",""_continue"",""_query"",""_queryId"",""_queryComplete""];" \n
"_continue = true;" \n
"_queryComplete = false;" \n
"_queryId = 0;" \n
"_query = """";" \n
"" \n
"while {_continue} do {" \n
" _queryStack = call compile (""remote_call"" callExtension ""WorkerStack"");" \n
" if ((count _queryStack) > 0) then {" \n
" _queryId = _queryStack select 0;" \n
" _queryComplete = if ((_queryStack select 1) == 1) then {true} else {false};" \n
" _query = _query + (_queryStack select 2);" \n
" }" \n
" else {" \n
" _continue = false;" \n
" };" \n
" " \n
" if (_queryComplete) then {" \n
" [] spawn compile _query;" \n
" _queryId = 0;" \n
" _query = """";" \n
" };" \n
"};" \n
"" \n
"_rcWorkerTimer = time;"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
priority = 0.000000;
to="Loadbalancer";
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>*/