DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CfgBunkerBroadcastJsonData.c
См. документацию.
2{
3 bool IsValid()
4 {
5 return true;
6 }
7
8 protected void OutOfRangeException(string name, float value, float rangeMin, float rangeMax)
9 {
10 ErrorEx(string.Format("%1=%2 is out of range (<%3; %4>)", name, value, rangeMin, rangeMax));
11 }
12
13 protected void OutOfRangeException(string name, string value, float rangeMin, float rangeMax)
14 {
15 ErrorEx(string.Format("%1=%2 is out of range (<%3; %4>)", name, value, rangeMin, rangeMax));
16 }
17}
18
19class BunkerBroadcastConfigInstance: BunkerBroadcastJsonDataBase
20{
22 ref BunkerBroadcastSettings bunkerSettings = new BunkerBroadcastSettings();
25
26 override bool IsValid()
27 {
28 if (!super.IsValid())
29 return false;
30
31 bool hasErrors;
32 foreach (BunkerBroadcastProxySpawn proxyData : proxies)
33 {
34 if (!proxyData.IsValid())
35 {
36 hasErrors = true;
37 break;
38 }
39 }
40
41 if (!bunkerSettings.IsValid())
42 hasErrors = true;
43
44 if (!schedulerSettings.IsValid())
45 hasErrors = true;
46
47 if (!playbackSettings.IsValid())
48 hasErrors = true;
49
50 return !hasErrors;
51 }
52}
53
58
59class BunkerBroadcastSettings : BunkerBroadcastJsonDataBase
60{
61 private const int MIN_ACTIVE = 1;
62 private const int MAX_ACTIVE = 30;
63
64 private const int MIN_LOCKCODE_LENGTH = 3;
65 private const int MAX_LOCKCODE_LENGTH = 6;
66
70 int lockCodeMode = 0;
71
72 override bool IsValid()
73 {
74 if (!super.IsValid())
75 return false;
76
77 bool hasErrors;
79 {
81 hasErrors = true;
82 }
83
85 {
87 hasErrors = true;
88 }
89
91 {
92 OutOfRangeException("lockCodeMode", lockCodeMode, 0, 1);
93 hasErrors = true;
94 }
95
96 return !hasErrors;
97 }
98}
99
101{
102 private const int BATCH_LIFETIME_MIN = 1; // [minute]
103 private const int BATCH_LIFETIME_MAX = 1000; // [minute]
104
105 private const int REPORT_INTERVAL_MIN = 1; // [minute]
106 private const int REPORT_INTERVAL_MAX = 120; // [minute]
107
111
113
114 override bool IsValid()
115 {
116 if (!super.IsValid())
117 return false;
118
119 bool hasErrors;
121 {
123 hasErrors = true;
124 }
125
127 {
129 hasErrors = true;
130 }
131
132 foreach (BunkerBroadcastPeriod period : periods)
133 {
134 if (!period.IsValid())
135 hasErrors = true;
136 }
137
138 return !hasErrors;
139 }
140}
141
142class BunkerBroadcastPeriod : BunkerBroadcastJsonDataBase
143{
144 private const int TIME_RANGE_MIN = 0;
145 private const int TIME_RANGE_MAX = 2359;
146
148 string startTime = "0000";
149 string endTime = "2359";
150
151 override bool IsValid()
152 {
153 if (!super.IsValid())
154 return false;
155
156 bool hasErrors;
157 if (startTime.Length() != 4)
158 {
159 ErrorEx(string.Format("startTime=%1 is not 4 character long string (formated as '0700', '1310', etc.)", startTime, TIME_RANGE_MIN, TIME_RANGE_MAX));
160 hasErrors = true;
161 }
162
163 if (endTime.Length() != 4)
164 {
165 ErrorEx(string.Format("endTime=%1 is not 4 character long string (formated as '0700', '1310', etc.)", endTime, TIME_RANGE_MIN, TIME_RANGE_MAX));
166 hasErrors = true;
167 }
168
169 if (startTime.ToInt() < 0 || startTime.ToInt() > 2359)
170 {
172 hasErrors = true;
173 }
174
175 if (endTime.ToInt() < 0 || endTime.ToInt() > 2359)
176 {
178 hasErrors = true;
179 }
180
181 return !hasErrors;
182 }
183
185 {
186 return startTime.ToInt() / 100;
187 }
188
190 {
191 return endTime.ToInt() / 100;
192 }
193
195 {
196 return startTime.ToInt() % 100;
197 }
198
200 {
201 return endTime.ToInt() % 100;
202 }
203
204 override protected void OutOfRangeException(string name, string value, float rangeMin, float rangeMax)
205 {
206 ErrorEx(string.Format("%1=%2 is out of range (<%2; %3>, formated as '0700', '1310', etc.)", name, value, rangeMin, rangeMax));
207 }
208}
209
211{
212 private const float DURATION_MIN = 0.1;
213 private const float DURATION_MAX = 5.0;
214
215 private const float PAUSE_MIN = 0.5;
216 private const float PAUSE_MAX = 10.0;
217
218 private const int BUNKER_REPETITIONS_MIN = 0;
219 private const int BUNKER_REPETITIONS_MAX = 3;
220
221 private const int MESSAGE_REPETITIONS_MIN = 0;
222 private const int MESSAGE_REPETITIONS_MAX = 5;
223
225 float dotDuration = 0.3;
226 float dashDuration = 0.4;
227 float symbolGapDuration = 0.1;
228 float wordGapDuration = 0.3;
232
233 override bool IsValid()
234 {
235 if (!super.IsValid())
236 return false;
237
238 bool hasErrors;
240 {
242 hasErrors = true;
243 }
244
246 {
248 hasErrors = true;
249 }
250
252 {
254 hasErrors = true;
255 }
256
258 {
260 hasErrors = true;
261 }
262
264 {
266 hasErrors = true;
267 }
268
270 {
272 hasErrors = true;
273 }
274
276 {
278 hasErrors = true;
279 }
280
281 return !hasErrors;
282 }
283}
const int MAX_ACTIVE
Определения CfgBunkerBroadcastJsonData.c:62
int GetStartHour()
Определения CfgBunkerBroadcastJsonData.c:184
int lockCodeLength
Определения CfgBunkerBroadcastJsonData.c:69
int GetEndHour()
Определения CfgBunkerBroadcastJsonData.c:189
BunkerBroadcastProxySpawn MIN_ACTIVE
class BunkerBroadcastJsonDataBase proxies
BunkerBroadcastSchedulerSettings TIME_RANGE_MIN
int GetStartMinute()
Определения CfgBunkerBroadcastJsonData.c:194
string startTime
default values
Определения CfgBunkerBroadcastJsonData.c:148
ref BunkerBroadcastSettings bunkerSettings
Определения CfgBunkerBroadcastJsonData.c:22
const int TIME_RANGE_MAX
Определения CfgBunkerBroadcastJsonData.c:145
int GetEndMinute()
Определения CfgBunkerBroadcastJsonData.c:199
const int MIN_LOCKCODE_LENGTH
Определения CfgBunkerBroadcastJsonData.c:64
int lockCodeMode
Определения CfgBunkerBroadcastJsonData.c:70
ref BunkerBroadcastSchedulerSettings schedulerSettings
Определения CfgBunkerBroadcastJsonData.c:23
int numberOfActive
default values
Определения CfgBunkerBroadcastJsonData.c:68
const int MAX_LOCKCODE_LENGTH
Определения CfgBunkerBroadcastJsonData.c:65
string endTime
Определения CfgBunkerBroadcastJsonData.c:149
ref BunkerBroadcastPlaybackSettings playbackSettings
Определения CfgBunkerBroadcastJsonData.c:24
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void OutOfRangeException(string name, string value, float rangeMin, float rangeMax)
Определения CfgBunkerBroadcastJsonData.c:13
void OutOfRangeException(string name, float value, float rangeMin, float rangeMax)
Определения CfgBunkerBroadcastJsonData.c:8
float dotDuration
default values
Определения CfgBunkerBroadcastJsonData.c:225
int batchLifetimeLength
default values
Определения CfgBunkerBroadcastJsonData.c:109
ref array< ref BunkerBroadcastPeriod > periods
Определения CfgBunkerBroadcastJsonData.c:112
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
enum ShapeType ErrorEx