Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
dayzgame.c
Go to the documentation of this file.
2 {
3  NONE = 0,
8  CLOSE_MENUS = 16,
11 }
12 
13 const int DISCONNECT_SESSION_FLAGS_FORCE = int.MAX & ~DisconnectSessionFlags.IGNORE_WHEN_IN_GAME;
14 const int DISCONNECT_SESSION_FLAGS_JOIN = int.MAX & ~DisconnectSessionFlags.JOIN_ERROR_CHECK;
15 const int DISCONNECT_SESSION_FLAGS_ALL = int.MAX;
16 
18 {
19  proto native Object GetSource();
20  proto native vector GetPos();
21  proto native vector GetInVelocity();
22  proto native string GetAmmoType();
23  proto native float GetProjectileDamage();
24 }
25 
26 class CollisionInfoBase: ProjectileStoppedInfo
27 {
28  proto native vector GetSurfNormal();
29 }
30 
31 class ObjectCollisionInfo: CollisionInfoBase
32 {
33  proto native Object GetHitObj();
34  proto native vector GetHitObjPos();
35  proto native vector GetHitObjRot();
36  proto native int GetComponentIndex();
37 }
38 
39 class TerrainCollisionInfo: CollisionInfoBase
40 {
41  proto native bool GetIsWater();
42 }
43 
45 {
46  static ref map<int, string> m_Mappings = new map<int, string>;
47 
48  static void RegisterSoundSet(string sound_set)
49  {
50  m_Mappings.Set(sound_set.Hash(), sound_set);
51  }
52 
53  static string GetSoundSetByHash(int hash)
54  {
55  string sound_set;
56  if (m_Mappings)
57  m_Mappings.Find(hash,sound_set);
58  return sound_set;
59  }
60 };
61 
62 
64 {
65  protected ref UiHintPanelLoading m_HintPanel;
66  protected bool m_IsStatic;
67  protected float m_HintTimeAccu;
68 
69  override void Update(float timeslice)
70  {
71  if (m_HintPanel)
72  {
73  m_HintTimeAccu += timeslice;
74  if (CanChangeHintPage(m_HintTimeAccu))
75  {
76  m_HintPanel.ShowRandomPage();
77  m_HintTimeAccu = 0;
78  }
79  }
80 
81  if (GetUApi().GetInputByID(UAUIBack).LocalPress())
82  {
83  Leave();
84  }
85  }
86 
87  protected void Leave()
88  {
89  g_Game.SetGameState(DayZGameState.MAIN_MENU);
90  g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
91 
92  g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().DisconnectSessionForce);
93 
94  Close();
95  }
96 
97  protected bool CanChangeHintPage(float timeAccu);
98 
99  bool IsStatic()
100  {
101  return m_IsStatic;
102  }
103 }
104 
105 class LoginQueueBase extends LoginScreenBase
106 {
107  protected TextWidget m_txtPosition;
109  protected ButtonWidget m_btnLeave;
110  protected int m_iPosition = -1;
111 
113  {
114  g_Game.SetKeyboardHandle(this);
115  }
116 
118  {
119  g_Game.SetKeyboardHandle(NULL);
120  }
121 
122  override Widget Init()
123  {
124  layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/dialog_queue_position.layout");
125  m_HintPanel = new UiHintPanelLoading(layoutRoot.FindAnyWidget("hint_frame0"));
126  m_txtPosition = TextWidget.Cast(layoutRoot.FindAnyWidget("txtPosition"));
127  m_txtNote = TextWidget.Cast(layoutRoot.FindAnyWidget("txtNote"));
128  m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget("btnLeave"));
129  m_txtNote.Show(true);
130  layoutRoot.FindAnyWidget("notification_root").Show(false);
131 
132  #ifdef PLATFORM_CONSOLE
133  layoutRoot.FindAnyWidget("toolbar_bg").Show(true);
134  RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
135  toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
136  #ifdef PLATFORM_XBOX
137  #ifdef BUILD_EXPERIMENTAL
138  layoutRoot.FindAnyWidget("notification_root").Show(true);
139  #endif
140  #endif
141  #endif
142 
143  return layoutRoot;
144  }
145 
146  override bool OnClick(Widget w, int x, int y, int button)
147  {
148  super.OnClick(w, x, y, button);
149  if (w == m_btnLeave)
150  {
151  Leave();
152  return true;
153  }
154  return false;
155  }
156 
157  void Show()
158  {
159  if (layoutRoot)
160  {
161  layoutRoot.Show(true);
162  }
163  }
164 
165  void Hide()
166  {
167  if (layoutRoot)
168  layoutRoot.Show(false);
169  m_HintPanel = null;
170  }
171 
172  void SetPosition(int position)
173  {
174  if (position != m_iPosition)
175  {
176  m_iPosition = position;
177  m_txtPosition.SetText(position.ToString());
178  }
179  }
180 
181  override protected bool CanChangeHintPage(float timeAccu)
182  {
183  return timeAccu >= GameConstants.LOADING_SCREEN_HINT_INTERVAL;
184  }
185 };
186 
187 
189 class LoginQueueStatic extends LoginQueueBase
190 {
191  void LoginQueueStatic()
192  {
193  Init();
194 
195  m_IsStatic = true;
196  }
197 };
198 
200 {
201  protected TextWidget m_txtDescription;
202  protected TextWidget m_txtLabel;
203  protected ButtonWidget m_btnLeave;
204 
205  protected bool m_IsRespawn;
206 
207  private ref FullTimeData m_FullTime;
208 
209  void LoginTimeBase()
210  {
211  g_Game.SetKeyboardHandle(this);
212  m_IsRespawn = false;
213 
214  m_FullTime = new FullTimeData();
215  }
216 
217  void ~LoginTimeBase()
218  {
219  if (g_Game)
220  g_Game.SetKeyboardHandle(null);
221  m_FullTime = null;
222  }
223 
224  override Widget Init()
225  {
226  layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/dialog_login_time.layout");
227 
228  m_txtDescription = TextWidget.Cast(layoutRoot.FindAnyWidget("txtDescription"));
229  m_txtLabel = TextWidget.Cast(layoutRoot.FindAnyWidget("txtLabel"));
230  m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget("btnLeave"));
231  m_txtDescription.Show(true);
232  layoutRoot.FindAnyWidget("notification_root").Show(false);
233 
234  #ifdef PLATFORM_CONSOLE
235  layoutRoot.FindAnyWidget("toolbar_bg").Show(true);
236  RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
237  toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
238  #ifdef PLATFORM_XBOX
239  #ifdef BUILD_EXPERIMENTAL
240  layoutRoot.FindAnyWidget("notification_root").Show(true);
241  #endif
242  #endif
243  #endif
244 
245  return layoutRoot;
246  }
247 
248  override bool OnClick(Widget w, int x, int y, int button)
249  {
250  super.OnClick(w, x, y, button);
251  if (w == m_btnLeave)
252  {
253  Leave();
254  return true;
255  }
256  return false;
257  }
258 
259  void Show()
260  {
261  if (layoutRoot)
262  {
263  layoutRoot.Show(true);
264  m_HintPanel = new UiHintPanelLoading(layoutRoot.FindAnyWidget("hint_frame0"));
265  }
266  }
267 
268  void Hide()
269  {
270  if (layoutRoot)
271  layoutRoot.Show(false);
272  m_HintPanel = null;
273  }
274 
275  void SetTime(int time)
276  {
277  string text = "";
278  TimeConversions.ConvertSecondsToFullTime(time, m_FullTime);
279  if (!m_IsRespawn)
280  text = "#menu_loading_in_";
281  else
282  text = "#dayz_game_spawning_in_";
283 
284  if (m_FullTime.m_Days > 0)
285  text += "dhms";
286  else if (m_FullTime.m_Hours > 0)
287  text += "hms";
288  else if (m_FullTime.m_Minutes > 0)
289  text += "ms";
290  else
291  text += "s";
292 
293  text = Widget.TranslateString(text);
294  text = string.Format(text, m_FullTime.m_Seconds, m_FullTime.m_Minutes, m_FullTime.m_Hours, m_FullTime.m_Days);
295  m_txtLabel.SetText(text);
296 
297  if (m_IsRespawn && time <= 1)
298  GetGame().SetLoginTimerFinished();
299  }
300 
301  void SetStatus(string status)
302  {
303  m_txtDescription.SetText(status);
304  }
305 
306  void SetRespawn(bool value)
307  {
308  m_IsRespawn = value;
309  }
310 
311  bool IsRespawn()
312  {
313  return m_IsRespawn;
314  }
315 
316  override protected bool CanChangeHintPage(float timeAccu)
317  {
318  return timeAccu >= GameConstants.LOADING_SCREEN_HINT_INTERVAL && m_FullTime.m_Seconds >= GameConstants.LOADING_SCREEN_HINT_INTERVAL_MIN;
319  }
320 };
321 
323 class LoginTimeStatic extends LoginTimeBase
324 {
325  void LoginTimeStatic()
326  {
327  Init();
328 
329  m_IsStatic = true;
330  }
331 
332  void ~LoginTimeStatic()
333  {
334  }
335 };
336 
337 
338 
340 {
341  private ref Widget m_WidgetRoot;
342  private TextWidget m_TextWidgetTitle;
343  private float m_duration;
344 
345  void ConnectionLost(DayZGame game)
346  {
347  m_WidgetRoot = game.GetWorkspace().CreateWidgets("gui/layouts/day_z_connection_lost.layout");
348  m_WidgetRoot.Show(false);
349 
350  Class.CastTo(m_TextWidgetTitle, m_WidgetRoot.FindAnyWidget("TextWidget"));
351  m_duration = 0.0;
352  }
353 
354  void Show()
355  {
356  if (!m_WidgetRoot.IsVisible())
357  {
358  if (g_Game.GetUIManager().IsDialogVisible())
359  {
360  g_Game.GetUIManager().HideDialog();
361  }
362 
363  m_WidgetRoot.Show(true);
364  m_TextWidgetTitle.SetText("");
365  }
366  }
367 
368  void Hide()
369  {
370  if (m_WidgetRoot.IsVisible())
371  {
372  m_WidgetRoot.Show(false);
373  }
374  }
375 
376  void SetText(string text)
377  {
378  m_TextWidgetTitle.SetText(text);
379  }
380 
381  float GetDuration()
382  {
383  return m_duration;
384  }
385 
386  void SetDuration(float duration)
387  {
388  m_duration = duration;
389  }
390 };
391 
396 
398 {
399  private ref map<EDayZProfilesOptions, ref DayZProfilesOptionBool> m_DayZProfilesOptionsBool;
400  private ref map<EDayZProfilesOptions, ref DayZProfilesOptionInt> m_DayZProfilesOptionsInt;
401  private ref map<EDayZProfilesOptions, ref DayZProfilesOptionFloat> m_DayZProfilesOptionsFloat;
402  private DayZGame m_Game
403 
404  void DayZProfilesOptions()
405  {
406  m_DayZProfilesOptionsBool = new map<EDayZProfilesOptions, ref DayZProfilesOptionBool>();
407  m_DayZProfilesOptionsInt = new map<EDayZProfilesOptions, ref DayZProfilesOptionInt>();
408  m_DayZProfilesOptionsFloat = new map<EDayZProfilesOptions, ref DayZProfilesOptionFloat>();
409  }
410 
411  void RegisterProfileOption(EDayZProfilesOptions option, string profileOptionName, bool def = true)
412  {
413  if (!m_DayZProfilesOptionsBool.Contains(option))
414  {
416  bool profileVal = GetProfileValueBool(profileOptionName, def);
417 
418  m_DayZProfilesOptionsBool.Set(option, new DayZProfilesOptionBool(profileOptionName, profileVal, def));
419  SetProfileOptionBool(option, profileVal);
420  }
421  }
422 
423  void RegisterProfileOptionBool(EDayZProfilesOptions option, string profileOptionName, bool defaultValue = true)
424  {
425  RegisterProfileOption(option, profileOptionName, defaultValue);
426  }
427 
428  void RegisterProfileOptionInt(EDayZProfilesOptions option, string profileOptionName, int defaultValue = 0)
429  {
430  if (!m_DayZProfilesOptionsInt.Contains(option))
431  {
433  string outValue;
434  GetGame().GetProfileString(profileOptionName, outValue);
435  int value = outValue.ToInt();
436 
437  m_DayZProfilesOptionsInt.Set(option, new DayZProfilesOptionInt(profileOptionName, value, defaultValue));
438  SetProfileOptionInt(option, value);
439  }
440  }
441 
442  void RegisterProfileOptionFloat(EDayZProfilesOptions option, string profileOptionName, float defaultValue = 0.0)
443  {
444  if (!m_DayZProfilesOptionsFloat.Contains(option))
445  {
447  string outValue;
448  GetGame().GetProfileString(profileOptionName, outValue);
449  float value = outValue.ToFloat();
450 
451  m_DayZProfilesOptionsFloat.Set(option, new DayZProfilesOptionFloat(profileOptionName, value, defaultValue));
452  SetProfileOptionFloat(option, value);
453  }
454  }
455 
456  void ResetOptionsBool()
457  {
458  if (!m_DayZProfilesOptionsBool)
459  {
460  m_DayZProfilesOptionsBool = new map<EDayZProfilesOptions, ref DayZProfilesOptionBool>();
461  }
462 
463  foreach (EDayZProfilesOptions e_opt, DayZProfilesOptionBool r_opt : m_DayZProfilesOptionsBool)
464  {
465  bool profileVal = GetProfileValueBool(r_opt.param1, r_opt.param3);
466  SetProfileOptionBool(e_opt, profileVal);
467  }
468  }
469 
470  void ResetOptions()
471  {
472  ResetOptionsBool();
473  }
474 
475  void ResetOptionsInt()
476  {
477  if (!m_DayZProfilesOptionsInt)
478  {
479  m_DayZProfilesOptionsInt = new map<EDayZProfilesOptions, ref DayZProfilesOptionInt>();
480  }
481 
482  foreach (EDayZProfilesOptions e_opt, DayZProfilesOptionInt r_opt : m_DayZProfilesOptionsInt)
483  {
484  string outValue;
485  GetGame().GetProfileString(r_opt.param1, outValue);
486  int value = outValue.ToInt();
487  SetProfileOptionInt(e_opt, value);
488  }
489  }
490 
491  void ResetOptionsFloat()
492  {
493  if (!m_DayZProfilesOptionsFloat)
494  {
495  m_DayZProfilesOptionsFloat = new map<EDayZProfilesOptions, ref DayZProfilesOptionFloat>();
496  }
497 
498  foreach (EDayZProfilesOptions e_opt, DayZProfilesOptionFloat r_opt : m_DayZProfilesOptionsFloat)
499  {
500  string outValue;
501  GetGame().GetProfileString(r_opt.param1, outValue);
502  float value = outValue.ToFloat();
503  SetProfileOptionFloat(e_opt, value);
504  }
505  }
506 
507  void SetProfileOption(EDayZProfilesOptions option, bool value)
508  {
509  if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
510  {
511  DayZProfilesOptionBool po = m_DayZProfilesOptionsBool.Get(option);
512 
513  po.param2 = value;
514  GetGame().SetProfileString(po.param1, value.ToString());
515  GetGame().SaveProfile();
516  }
517  }
518 
519  void SetProfileOptionBool(EDayZProfilesOptions option, bool value)
520  {
521  SetProfileOption(option, value);
522  }
523 
524  void SetProfileOptionInt(EDayZProfilesOptions option, int value)
525  {
526  if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
527  {
528  DayZProfilesOptionInt po = m_DayZProfilesOptionsInt.Get(option);
529 
530  po.param2 = value;
531  GetGame().SetProfileString(po.param1, value.ToString());
532  GetGame().SaveProfile();
533  }
534  }
535 
536  void SetProfileOptionFloat(EDayZProfilesOptions option, float value)
537  {
538  if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
539  {
540  DayZProfilesOptionFloat po = m_DayZProfilesOptionsFloat.Get(option);
541 
542  po.param2 = value;
543  GetGame().SetProfileString(po.param1, value.ToString());
544  GetGame().SaveProfile();
545  }
546  }
547 
548  bool GetProfileOption(EDayZProfilesOptions option)
549  {
550  if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
551  {
552  DayZProfilesOptionBool po = m_DayZProfilesOptionsBool.Get(option);
553  return po.param2;
554  }
555 
556  return true;
557  }
558 
559  bool GetProfileOptionBool(EDayZProfilesOptions option)
560  {
561  return GetProfileOption(option);
562  }
563 
564  int GetProfileOptionInt(EDayZProfilesOptions option)
565  {
566  if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
567  {
568  DayZProfilesOptionInt po = m_DayZProfilesOptionsInt.Get(option);
569  return po.param2;
570  }
571 
572  return 0;
573  }
574 
575  float GetProfileOptionFloat(EDayZProfilesOptions option)
576  {
577  if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
578  {
579  DayZProfilesOptionFloat po = m_DayZProfilesOptionsFloat.Get(option);
580  return po.param2;
581  }
582 
583  return 0.0;
584  }
585 
586  bool GetProfileOptionDefault(EDayZProfilesOptions option)
587  {
588  return GetProfileOptionDefaultBool(option);
589  }
590 
591  bool GetProfileOptionDefaultBool(EDayZProfilesOptions option)
592  {
593  if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
594  {
595  DayZProfilesOptionBool po = m_DayZProfilesOptionsBool.Get(option);
596  return po.param3;
597  }
598 
599  ErrorEx("Invalid profile option id! Returning 'true'.", ErrorExSeverity.WARNING);
600  return true;
601  }
602 
603  int GetProfileOptionDefaultInt(EDayZProfilesOptions option)
604  {
605  if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
606  {
607  DayZProfilesOptionInt po = m_DayZProfilesOptionsInt.Get(option);
608  return po.param3;
609  }
610 
611  ErrorEx("Invalid profile option id! Returning '0'.", ErrorExSeverity.WARNING);
612  return 0;
613  }
614 
615  float GetProfileOptionDefaultFloat(EDayZProfilesOptions option)
616  {
617  if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
618  {
619  DayZProfilesOptionFloat po = m_DayZProfilesOptionsFloat.Get(option);
620  return po.param3;
621  }
622 
623  ErrorEx("Invalid profile option id! Returning '0.0'.", ErrorExSeverity.WARNING);
624  return 0.0;
625  }
626 
628  {
629  if (m_DayZProfilesOptions)
630  return m_DayZProfilesOptions;
631 
632  return null;
633  }
634 
637  private ref map<EDayZProfilesOptions, ref DayZProfilesOption> m_DayZProfilesOptions;
638 }
639 
640 enum DayZGameState
641 {
642  UNDEFINED,
643  MAIN_MENU,
644  JOIN,
645  PARTY,
646  CONNECT,
647  CONNECTING,
648  IN_GAME
649 }
650 
651 enum DayZLoadState
652 {
653  UNDEFINED,
657  JOIN_START,
660  PARTY_START,
668  MISSION_CONTROLLER_SELECT
669 }
670 
671 class LoadingScreen
672 {
673  ref Widget m_WidgetRoot;
678  DayZGame m_DayZGame;
680 
681  ImageWidget m_ImageLogoMid;
682  ImageWidget m_ImageLogoCorner;
683  ImageWidget m_ImageLoadingIcon;
684  ImageWidget m_ImageBackground;
685  ProgressBarWidget m_ProgressLoading;
688 
691  ref UiHintPanelLoading m_HintPanel;
692  void LoadingScreen(DayZGame game)
693  {
694  m_DayZGame = game;
695 
696  m_WidgetRoot = game.GetLoadingWorkspace().CreateWidgets("gui/layouts/loading.layout");
697  Class.CastTo(m_ImageLogoMid, m_WidgetRoot.FindAnyWidget("ImageLogoMid"));
698  Class.CastTo(m_ImageLogoCorner, m_WidgetRoot.FindAnyWidget("ImageLogoCorner"));
699 
700  Class.CastTo(m_TextWidgetTitle, m_WidgetRoot.FindAnyWidget("TextWidget"));
701  Class.CastTo(m_TextWidgetStatus, m_WidgetRoot.FindAnyWidget("StatusText"));
702  Class.CastTo(m_ImageWidgetBackground, m_WidgetRoot.FindAnyWidget("ImageBackground"));
703  Class.CastTo(m_ImageLoadingIcon, m_WidgetRoot.FindAnyWidget("ImageLoadingIcon"));
704  Class.CastTo(m_ModdedWarning, m_WidgetRoot.FindAnyWidget("ModdedWarning"));
705 
706  m_ImageBackground = ImageWidget.Cast(m_WidgetRoot.FindAnyWidget("ImageBackground"));
707  m_ProgressLoading = ProgressBarWidget.Cast(m_WidgetRoot.FindAnyWidget("LoadingBar"));
708 
709  string tmp;
710  m_ProgressText = TextWidget.Cast(m_WidgetRoot.FindAnyWidget("ProgressText"));
711  if (GetGame())
712  {
713  m_ProgressText.Show(GetGame().CommandlineGetParam("loadingTest", tmp));
714  }
715  m_WidgetRoot.FindAnyWidget("notification_root").Show(false);
716 
717  #ifdef PLATFORM_CONSOLE
718  #ifdef PLATFORM_XBOX
719  #ifdef BUILD_EXPERIMENTAL
720  Widget expNotification = m_WidgetRoot.FindAnyWidget("notification_root");
721  if (expNotification)
722  {
723  expNotification.Show(true);
724  }
725  #endif
726  #endif
727  #endif
728 
729  m_ModdedWarning.Show(g_Game.ReportModded());
730  m_ImageLogoMid.Show(true);
731  m_ImageLogoCorner.Show(false);
732 
733  m_ImageWidgetBackground.Show(true);
734  m_Counter = 0;
735 
736  // lighten up your desktop
737  game.GetBacklit().LoadingAnim();
738 
739  ProgressAsync.SetProgressData(m_ProgressLoading);
740  ProgressAsync.SetUserData(m_ImageBackground);
741  }
742 
744  void OnTimer();
745 
746  void Inc()
747  {
748  m_LastProgressUpdate = m_DayZGame.GetTickTime();
749  m_Counter++;
750  if (m_Counter == 1)
751  {
752  Show();
753  }
754  }
755 
756  void Dec()
757  {
758  m_Counter = m_Counter - 1;
759 
760  if (m_Counter <= 0)
761  {
762  m_Counter = 0;
763  EndLoading();
764  m_HintPanel = null;
765  }
766  }
767 
768  void EndLoading()
769  {
770  ProgressAsync.SetProgressData(null);
771  ProgressAsync.SetUserData(null);
772  m_WidgetRoot.Show(false);
773  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(g_Game.CheckDialogs);
774  }
775 
776  bool IsLoading()
777  {
778  return m_WidgetRoot.IsVisible();
779  }
780 
781  void SetTitle(string title)
782  {
783  m_TextWidgetTitle.SetText(title);
784  }
785 
786  void SetStatus(string status)
787  {
788  m_TextWidgetStatus.SetText(status);
789  }
790 
791  void SetProgress(float val)
792  {
793  float time_delta = m_DayZGame.GetTickTime() - m_LastProgressUpdate;
794 
795  m_LastProgressUpdate = m_DayZGame.GetTickTime();
796  }
797 
798  void OnUpdate(float timeslice)
799  {
800 
801  }
802 
803  void ShowEx(DayZGame game)
804  {
805  if (!m_HintPanel)
806  {
807  m_HintPanel = new UiHintPanelLoading(m_WidgetRoot.FindAnyWidget("hint_frame"));
808  m_HintPanel.Init(game);
809  }
810 
811  Show();
812  }
813 
814  void Show()
815  {
816  Widget lIcon = m_ImageBackground;
817  Widget pText = m_ProgressLoading;
818  m_ProgressText.SetText("");
819  m_ProgressLoading.SetCurrent(0.0);
820  m_ImageBackground.SetMaskProgress(0.0);
821 
822  if (!m_WidgetRoot.IsVisible())
823  {
824  if (m_DayZGame.GetUIManager().IsDialogVisible())
825  {
826  m_DayZGame.GetUIManager().HideDialog();
827  }
828 
829  if (m_DayZGame.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU)
830  {
831  m_ImageLogoMid.Show(false);
832  m_ImageLogoCorner.Show(false);
833  m_ImageWidgetBackground.Show(true);
834  m_TextWidgetStatus.Show(true);
835  }
836  else
837  {
838  m_ImageLogoMid.Show(true);
839  m_ImageLogoCorner.Show(false);
840  m_ImageWidgetBackground.Show(true);
841  m_TextWidgetStatus.Show(false);
842  }
843 
844  m_WidgetRoot.Show(true);
845  m_TextWidgetTitle.SetText("");
846  m_TextWidgetStatus.SetText("");
847  }
848 
849  ProgressAsync.SetProgressData(pText);
850  ProgressAsync.SetUserData(lIcon);
851  }
852 
853  void Hide(bool force)
854  {
855  if (force)
856  {
857  while (m_Counter > 0)
858  {
859  Dec();
860  }
861  }
862 
863  if (m_Counter <= 0)
864  {
865  m_WidgetRoot.Show(false);
866  ProgressAsync.SetUserData(null);
867  ProgressAsync.SetProgressData(null);
868  m_HintPanel = null;
869  }
870  }
871 };
872 
873 
874 class DayZGame extends CGame
875 {
876  protected ref BillboardSetHandler m_BillboardSetHandler;
877 
878  const int MISSION_STATE_MAINMENU = 0;
879  const int MISSION_STATE_GAME = 1;
880  const int MISSION_STATE_FINNISH = 2;
881 
882  private const int STATS_COUNT = EConnectivityStatType.COUNT;
883  private EConnectivityStatLevel m_ConnectivityStatsStates[STATS_COUNT];
884 
885  private int m_MissionState;
886 
887  //HK stuff
888  protected DayZGameState m_GameState;
889  protected DayZLoadState m_LoadState;
890  protected ref NotificationUI m_Notifications;
891  protected bool m_FirstConnect = true;
892  //End HK stuff
893 
894  ref LoadingScreen m_loading;
895  private ref LoginTimeBase m_LoginTimeScreen;
896  private ref LoginQueueBase m_LoginQueue;
897  private int m_LoginTime;
898 
899  private ref ConnectionLost m_connectionLost;
900  private ref TimerQueue m_timerQueue[CALL_CATEGORY_COUNT];
901  private ref ScriptCallQueue m_callQueue[CALL_CATEGORY_COUNT];
902  private ref ScriptInvoker m_updateQueue[CALL_CATEGORY_COUNT];
903  private ref ScriptInvoker m_postUpdateQueue[CALL_CATEGORY_COUNT];
904  private ref DragQueue m_dragQueue;
905  private ref DayZProfilesOptions m_DayZProfileOptions;
906  private bool m_early_access_dialog_accepted;
907  private UIScriptedMenu m_keyboard_handler;
908  private ScriptModule m_mission_module;
909  private string m_MissionPath;
910  private string m_MissionFolderPath;
911  private bool m_IsCtrlHolding;
912  private bool m_IsWinHolding;
913  private bool m_IsLeftAltHolding;
914  private bool m_IsRightAltHolding;
915 
916  private bool m_IsWorldWetTempUpdateEnabled = true;
917  private bool m_IsFoodDecayEnabled = true;
918  private float m_FoodDecayModifier;
919 
920  static bool m_ReportModded;
921  private bool m_IsStressTest;
922  private bool m_AimLoggingEnabled;
923  int m_OriginalCharactersCount;
924  private string m_PlayerName;
925  private bool m_IsNewCharacter;
926  private bool m_IsConnecting;
927  private bool m_ConnectFromJoin;
928  private bool m_ShouldShowControllerDisconnect;
929  private bool m_CursorDesiredVisibilityScript = true;
930  private int m_PreviousGamepad;
931  private float m_UserFOV;
932 
933  private float m_DeltaTime;
934 
935  float m_volume_sound;
936  float m_volume_speechEX;
937  float m_volume_music;
938  float m_volume_VOIP;
939  float m_volume_radio;
940 
941  float m_PreviousEVValue;
942  float m_EVValue = 0;
943 
944  #ifdef DIAG_DEVELOPER
945  private static ref ServerFpsStatsUpdatedEventParams m_ServerFpsStatsParams;
946  #endif
947 
948  static ref AmmoCamParams m_AmmoShakeParams = new AmmoCamParams();//TODO: make static, reuse
949 
950  static ref ScriptInvoker Event_OnRPC = new ScriptInvoker();
951 
952  private ref Backlit m_Backlit;
953 
954  private ref array<string> m_CharClassNames = new array<string>();
955  private ref array<int> m_ConnectedInputDeviceList; //has to be owned here, 'Input' is a native class
956 
957  //Used for helicrash sound
958  private ref EffectSound m_CrashSound;
959 
960  //Used for Artillery sound
961  private ref EffectSound m_ArtySound;
962  private const int MIN_ARTY_SOUND_RANGE = 300; // The distance under which sound is no longer heard
963 
964  static ref NoiseParams m_NoiseParams = new NoiseParams();
965  #ifdef DEVELOPER
966  static bool m_IsPreviewSpawn;
967  #endif
968  #ifdef DIAG_DEVELOPER
969  ref CameraToolsMenuServer m_CameraToolsMenuServer;
970  #endif
971  // CGame override functions
972  void DayZGame()
973  {
974  PPEManagerStatic.CreateManagerStatic();
975 
976 #ifdef PLATFORM_CONSOLE
977  SetMainMenuWorld("MainMenuSceneXbox");
978 #endif
979  m_MissionState = MISSION_STATE_GAME;
980 
981  m_keyboard_handler = null;
982 
983  #ifdef DEVELOPER
984  m_early_access_dialog_accepted = true;
985  #endif
986 
987  for (int i = 0; i < CALL_CATEGORY_COUNT; i++)
988  {
989  m_callQueue[i] = new ScriptCallQueue();
990  m_updateQueue[i] = new ScriptInvoker();
991  m_timerQueue[i] = new TimerQueue();
992 
993  m_postUpdateQueue[i] = new ScriptInvoker();
994  }
995 
996  m_dragQueue = new DragQueue;
997 
998  m_LoginTime = 0;
999 
1000  string tmp;
1001  if (CommandlineGetParam("stresstest", tmp))
1002  {
1003  m_IsStressTest = true;
1004  }
1005 
1006  if (CommandlineGetParam("doAimLogs", tmp))
1007  {
1008  m_AimLoggingEnabled = true;
1009  }
1010 
1011  // initialize backlit effects
1012  m_Backlit = new Backlit();
1013  m_Backlit.OnInit(this);
1014 
1015  m_ReportModded = GetModToBeReported();
1016 
1017  #ifndef NO_GUI
1018  if (m_loading == null)
1019  {
1020  m_loading = new LoadingScreen(this);
1021  }
1022 
1023  if (m_loading)
1024  {
1025  m_loading.ShowEx(this);
1026  }
1027 
1028  RefreshMouseCursorVisibility();
1029  #endif
1030 
1031  Debug.Init();
1032  Component.Init();
1033  CachedObjectsParams.Init();
1034  CachedObjectsArrays.Init();
1035  BleedChanceData.InitBleedChanceData();
1036  GetUApi().PresetSelect(GetUApi().PresetCurrent());
1037 
1038  m_DayZProfileOptions = new DayZProfilesOptions();
1039 
1040  GetCallQueue(CALL_CATEGORY_GUI).Call(DeferredInit);
1041  GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(GlobalsInit);
1042 
1043  string path = "cfgVehicles";
1044  string child_name = "";
1045  int count = ConfigGetChildrenCount(path);
1046 
1047  for (int p = 0; p < count; ++p)
1048  {
1049  ConfigGetChildName(path, p, child_name);
1050 
1051  if (ConfigGetInt(path + " " + child_name + " scope") == 2 && IsKindOf(child_name, "SurvivorBase"))
1052  m_CharClassNames.Insert(child_name);
1053  }
1054 
1055  m_IsConnecting = false;
1056  m_ConnectFromJoin = false;
1057  }
1058 
1059  // ------------------------------------------------------------
1060  private void ~DayZGame()
1061  {
1062  PPEManagerStatic.DestroyManagerStatic();
1063  BleedChanceData.Cleanup();
1064  NotificationSystem.CleanupInstance();
1065 
1066  g_Game = null;
1067  SetDispatcher(null);
1068  Print("~DayZGame()");
1069  }
1070 
1071  // ------------------------------------------------------------
1072  void DeferredInit()
1073  {
1074  GameOptions opt = new GameOptions();
1075  opt.Initialize();
1076 
1077  GetInput().UpdateConnectedInputDeviceList();
1078 
1079  m_UserFOV = GetUserFOVFromConfig();
1080 
1081  m_volume_sound = GetSoundScene().GetSoundVolume();
1082  m_volume_speechEX = GetSoundScene().GetSpeechExVolume();
1083  m_volume_music = GetSoundScene().GetMusicVolume();
1084  m_volume_VOIP = GetSoundScene().GetVOIPVolume();
1085  m_volume_radio = GetSoundScene().GetRadioVolume();
1086 
1087  PPEManagerStatic.GetPPEManager().Init();
1088  GetMenuDefaultCharacterData();
1089  }
1090 
1091  // ------------------------------------------------------------
1092  void GlobalsInit()
1093  {
1094  if (GetCEApi())
1095  {
1096  m_IsWorldWetTempUpdateEnabled = (GetCEApi().GetCEGlobalInt("WorldWetTempUpdate") == 1);
1097 
1098  m_FoodDecayModifier = GetCEApi().GetCEGlobalFloat("FoodDecay");
1099 
1100  //check for legacy INT format, if value == float.MIN when read as FLOAT, it is of type INT, so we read it as such below
1101  if (m_FoodDecayModifier == float.MIN)
1102  {
1103  m_FoodDecayModifier = GetCEApi().GetCEGlobalInt("FoodDecay");
1104  }
1105  }
1106 
1107  //we need to perform the load here as some objects behaving correctly after spawn is dependent on CE being initialized before spawning them
1108  ObjectSpawnerHandler.OnGameplayDataHandlerLoad();
1109  }
1110 
1111  // ------------------------------------------------------------
1112  void RegisterProfilesOptions()
1113  {
1114  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.CROSSHAIR, SHOW_CROSSHAIR);
1115  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.HUD, SHOW_HUD);
1116  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.QUICKBAR, SHOW_QUICKBAR);
1117  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.SERVER_MESSAGES, SYSTEM_CHAT_MSG);
1118  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.USERS_CHAT, DIRECT_CHAT_MSG);
1119  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.RADIO_CHAT, RADIO_CHAT_MSG);
1120  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.GAME_MESSAGES, GAME_CHAT_MSG, false);
1121  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.ADMIN_MESSAGES, ADMIN_CHAT_MSG, false);
1122  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.PLAYER_MESSAGES, PLAYER_CHAT_MSG, false);
1123  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.SERVERINFO_DISPLAY, SHOW_SERVERINFO, true);
1124  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.BLEEDINGINDICATION, ENABLE_BLEEDINGINDICATION, true);
1125  m_DayZProfileOptions.RegisterProfileOptionBool(EDayZProfilesOptions.CONNECTIVITY_INFO, SHOW_CONNECTIVITYINFO, true);
1126 
1127  m_DayZProfileOptions.RegisterProfileOptionFloat(EDayZProfilesOptions.HUD_BRIGHTNESS, HUD_BRIGHTNESS, 0.0);
1128  }
1129 
1130  void ResetProfileOptions()
1131  {
1132  m_DayZProfileOptions.ResetOptionsBool();
1133  m_DayZProfileOptions.ResetOptionsInt();
1134  m_DayZProfileOptions.ResetOptionsFloat();
1135  }
1136 
1138  void SetMissionPath(string path)
1139  {
1140  m_MissionPath = path;
1141 
1142  int pos_end = 0;
1143  int pos_cur = 0;
1144 
1145  while (pos_cur != -1)
1146  {
1147  pos_end = pos_cur;
1148  pos_cur = path.IndexOfFrom(pos_cur + 1 , "\\");
1149  }
1150 
1151  m_MissionFolderPath = path.Substring(0, pos_end);
1152  }
1153 
1154  string GetMissionPath()
1155  {
1156  return m_MissionPath;
1157  }
1158 
1159  string GetMissionFolderPath()
1160  {
1161  return m_MissionFolderPath;
1162  }
1163 
1164  override ScriptCallQueue GetCallQueue(int call_category)
1165  {
1166  return m_callQueue[call_category];
1167  }
1168 
1169  override ScriptInvoker GetUpdateQueue(int call_category)
1170  {
1171  return m_updateQueue[call_category];
1172  }
1173 
1174  override ScriptInvoker GetPostUpdateQueue(int call_category)
1175  {
1176  return m_postUpdateQueue[call_category];
1177  }
1178 
1179  override TimerQueue GetTimerQueue(int call_category)
1180  {
1181  return m_timerQueue[call_category];
1182  }
1183 
1184  override DragQueue GetDragQueue()
1185  {
1186  return m_dragQueue;
1187  }
1188 
1189  // ------------------------------------------------------------
1190  void OnGameplayDataHandlerLoad()
1191  {
1192 
1193  }
1194 
1195 
1196  // ------------------------------------------------------------
1197  int GetMissionState()
1198  {
1199  return m_MissionState;
1200  }
1201 
1202  // ------------------------------------------------------------
1203  void SetMissionState(int state)
1204  {
1205  m_MissionState = state;
1206  }
1207 
1208  // ------------------------------------------------------------
1209  bool GetProfileOption(EDayZProfilesOptions option)
1210  {
1211  return m_DayZProfileOptions.GetProfileOption(option);
1212  }
1213 
1214  bool GetProfileOptionBool(EDayZProfilesOptions option)
1215  {
1216  return GetProfileOption(option);
1217  }
1218 
1219  int GetProfileOptionInt(EDayZProfilesOptions option)
1220  {
1221  return m_DayZProfileOptions.GetProfileOptionInt(option);
1222  }
1223 
1224  float GetProfileOptionFloat(EDayZProfilesOptions option)
1225  {
1226  return m_DayZProfileOptions.GetProfileOptionFloat(option);
1227  }
1228 
1229  bool GetProfileOptionDefault(EDayZProfilesOptions option)
1230  {
1231  return m_DayZProfileOptions.GetProfileOptionDefaultBool(option);
1232  }
1233 
1234  bool GetProfileOptionDefaultBool(EDayZProfilesOptions option)
1235  {
1236  return GetProfileOptionDefault(option);
1237  }
1238 
1239  int GetProfileOptionDefaultInt(EDayZProfilesOptions option)
1240  {
1241  return m_DayZProfileOptions.GetProfileOptionDefaultInt(option);
1242  }
1243 
1244  float GetProfileOptionDefaultFloat(EDayZProfilesOptions option)
1245  {
1246  return m_DayZProfileOptions.GetProfileOptionDefaultFloat(option);
1247  }
1248 
1249  void SetProfileOption(EDayZProfilesOptions option, bool value)
1250  {
1251  m_DayZProfileOptions.SetProfileOptionBool(option, value);
1252  }
1253 
1254  void SetProfileOptionBool(EDayZProfilesOptions option, bool value)
1255  {
1256  SetProfileOption(option, value);
1257  }
1258 
1259  void SetProfileOptionInt(EDayZProfilesOptions option, int value)
1260  {
1261  m_DayZProfileOptions.SetProfileOptionInt(option, value);
1262  }
1263 
1264  void SetProfileOptionFloat(EDayZProfilesOptions option, float value)
1265  {
1266  m_DayZProfileOptions.SetProfileOptionFloat(option, value);
1267  }
1268 
1270  {
1271  return m_DayZProfileOptions.GetProfileOptionMap();
1272  }
1273 
1274  bool IsStressTest()
1275  {
1276  return m_IsStressTest;
1277  }
1278 
1279  bool IsAimLogEnabled()
1280  {
1281  return m_AimLoggingEnabled;
1282  }
1283 
1284  void SetGameState(DayZGameState state)
1285  {
1286  m_GameState = state;
1287  }
1288 
1289  DayZGameState GetGameState()
1290  {
1291  return m_GameState;
1292  }
1293 
1294  void SetLoadState(DayZLoadState state)
1295  {
1296  m_LoadState = state;
1297  }
1298 
1299  DayZLoadState GetLoadState()
1300  {
1301  return m_LoadState;
1302  }
1303 
1304  static bool ReportModded()
1305  {
1306  return m_ReportModded;
1307  }
1308 
1309  Backlit GetBacklit()
1310  {
1311  return m_Backlit;
1312  }
1313 
1314  // ------------------------------------------------------------
1315  override bool IsInventoryOpen()
1316  {
1317 #ifndef NO_GUI
1318  if (GetUIManager().FindMenu(MENU_INVENTORY) != NULL)
1319  {
1320  return true;
1321  }
1322 #endif
1323  return false;
1324  }
1325 
1326  // ------------------------------------------------------------
1327  void EarlyAccessDialog(UIScriptedMenu parent)
1328  {
1329  if (!m_early_access_dialog_accepted)
1330  {
1331  g_Game.GetUIManager().EnterScriptedMenu(MENU_EARLYACCESS, parent);
1332  m_early_access_dialog_accepted = true;
1333  }
1334  }
1335 
1336  // ------------------------------------------------------------
1338  override UIScriptedMenu CreateScriptedMenu(int id)
1339  {
1340  #ifndef NO_GUI
1341  Mission mission = GetMission();
1342  if (mission)
1343  {
1344  return mission.CreateScriptedMenu(id);
1345  }
1346  #endif
1347  return NULL;
1348  }
1349 
1350  // ------------------------------------------------------------
1351  void ReloadMission()
1352  {
1353  #ifdef DEVELOPER
1354  Print("Reloading mission module!");
1355  CreateMission(m_MissionPath);
1356  #endif
1357  }
1358 
1359  // ------------------------------------------------------------
1360  void CancelLoginQueue()
1361  {
1362  if (m_LoginQueue)
1363  {
1364  if (m_LoginQueue.IsStatic())
1365  {
1366  m_LoginQueue.Hide();
1367  delete m_LoginQueue;
1368  }
1369  else
1370  {
1371  m_LoginQueue.Close();
1372  }
1373  }
1374  }
1375  // ------------------------------------------------------------
1376  void CancelLoginTimeCountdown()
1377  {
1378  GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(this.LoginTimeCountdown);
1379 
1380  if (m_LoginTimeScreen)
1381  {
1382  if (m_LoginTimeScreen.IsStatic())
1383  {
1384  m_LoginTimeScreen.Hide();
1385  delete m_LoginTimeScreen;
1386  }
1387  else
1388  {
1389  m_LoginTimeScreen.Close();
1390  }
1391  }
1392  }
1393  // ------------------------------------------------------------
1394  private void ClearConnectivityStates()
1395  {
1396  for (int i = 0; i < STATS_COUNT; i++)
1397  m_ConnectivityStatsStates[i] = 0;
1398  }
1399 
1400 
1401  // ------------------------------------------------------------
1402  override void OnEvent(EventType eventTypeId, Param params)
1403  {
1404  string address;
1405  int port;
1406  int high, low;
1407 
1408  switch (eventTypeId)
1409  {
1410  case StartupEventTypeID:
1411  {
1412  #ifndef SERVER
1413  // Just call it, to create the global instance if it doesn't exist yet
1414  ParticleManager.GetInstance();
1415  #endif
1416  break;
1417  }
1419  {
1420  #ifndef SERVER
1421  ClearConnectivityStates();
1422  #endif
1423  m_FirstConnect = true;
1424  ClientData.ResetClientData();
1425  break;
1426  }
1428  {
1429  LoadingHide();
1430  CancelLoginTimeCountdown();
1431  SetConnecting(false);
1432  SetGameState(DayZGameState.MAIN_MENU);
1433  m_FirstConnect = true;
1434  #ifdef PLATFORM_CONSOLE
1435  if (GetUserManager().GetSelectedUser())
1436  {
1437  OnlineServices.LeaveGameplaySession();
1438  OnlineServices.ClearCurrentServerInfo();
1439  if (GetGameState() == DayZGameState.IN_GAME)
1440  {
1441  SetLoadState(DayZLoadState.MAIN_MENU_START);
1442  }
1443  }
1444  m_Notifications.ClearVoiceNotifications();
1445  #endif
1446 
1447  // analytics - disconnected player
1449  discData.m_CharacterId = g_Game.GetDatabaseID();
1450  discData.m_Reason = "quit";
1451  Analytics.PlayerDisconnected(discData);
1452  break;
1453  }
1455  {
1456  CancelLoginQueue();
1457  LoadingHide(true);
1458  SetConnecting(false);
1459  ProgressAsync.DestroyAllPendingProgresses();
1460 
1461  if (GetGameState() == DayZGameState.CONNECTING)
1462  {
1463  SetGameState(DayZGameState.MAIN_MENU);
1464  }
1465 
1466  break;
1467  }
1469  {
1470  LoadingHide(true);
1471  ProgressAsync.DestroyAllPendingProgresses();
1472 
1473  SetGameState(DayZGameState.IN_GAME);
1474 
1475  // analytics - spawned
1476  StatsEventSpawnedData spawnData = new StatsEventSpawnedData();
1477  spawnData.m_CharacterId = g_Game.GetDatabaseID();
1478  spawnData.m_Lifetime = 0;
1479  spawnData.m_Position = vector.Zero;
1480  if (GetPlayer())
1481  {
1482  spawnData.m_Position = GetPlayer().GetPosition();
1483  }
1484  spawnData.m_DaytimeHour = 0;
1485  spawnData.m_Population = 0;
1486  Analytics.PlayerSpawned(spawnData);
1487 
1488  #ifdef PLATFORM_CONSOLE
1489  m_Notifications.ClearVoiceNotifications();
1490  OnlineServices.SetMultiplayState(true);
1491  #endif
1492  if (m_FirstConnect)
1493  {
1494  m_FirstConnect = false;
1495  if (GetHostAddress(address, port))
1496  {
1497  AddVisitedServer(address, port);
1498  }
1499 
1500  #ifdef PLATFORM_CONSOLE
1501  #ifndef PLATFORM_WINDOWS // if app is not on Windows with -XBOX parameter
1502  if (null != GetUserManager().GetSelectedUser())
1503  {
1504  OnlineServices.EnterGameplaySession();
1505  OnlineServices.LoadVoicePrivilege();
1506  }
1507  #endif
1508  #endif
1509  }
1510 
1511  UpdateInputDeviceDisconnectWarning();
1512 
1513  break;
1514  }
1516  {
1517  MPConnectionLostEventParams conLost_params;
1518  if (Class.CastTo(conLost_params, params))
1519  {
1520  int duration = conLost_params.param1;
1521  OnMPConnectionLostEvent(duration);
1522  }
1523  break;
1524  }
1526  {
1527  LoadingShow();
1528  break;
1529  }
1531  {
1532  GetCallQueue(CALL_CATEGORY_SYSTEM).Call(g_Game.CheckDialogs);
1533  break;
1534  }
1536  {
1537  ChatMessageEventParams chat_params;
1538  if (Class.CastTo(chat_params, params))
1539  {
1540 
1541  }
1542  break;
1543  }
1544  case ProgressEventTypeID:
1545  {
1546  ProgressEventParams prog_params;
1547  if (Class.CastTo(prog_params, params))
1548  LoadProgressUpdate(prog_params.param1, prog_params.param2, prog_params.param3);
1549  break;
1550  }
1551  case LoginTimeEventTypeID:
1552  {
1553  LoginTimeEventParams loginTimeParams;
1554  if (Class.CastTo(loginTimeParams, params))
1555  {
1556  OnLoginTimeEvent(loginTimeParams.param1);
1557  }
1558  break;
1559  }
1560  case RespawnEventTypeID:
1561  {
1562  RespawnEventParams respawnParams;
1563  if (Class.CastTo(respawnParams, params))
1564  {
1565  OnRespawnEvent(respawnParams.param1);
1566  }
1567  break;
1568  }
1569  case PreloadEventTypeID:
1570  {
1571  PreloadEventParams preloadParams;
1572  if (Class.CastTo(preloadParams, params))
1573  {
1574  OnPreloadEvent(preloadParams.param1);
1575  }
1576  break;
1577  }
1578  case LogoutEventTypeID:
1579  {
1580  LogoutEventParams logoutParams;
1581  if (Class.CastTo(logoutParams, params))
1582  {
1583  GetCallQueue(CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1584  }
1585  break;
1586  }
1588  {
1589  OnlineServices.Init();
1590  break;
1591  }
1593  {
1594  LoginStatusEventParams loginStatusParams;
1595  Class.CastTo(loginStatusParams, params);
1596 
1597  string msg1 = loginStatusParams.param1;
1598  string msg2 = loginStatusParams.param2;
1599  string finalMsg;
1600 
1601  // write either to login time screen or loading screen
1602  if (m_LoginTimeScreen)
1603  {
1604  finalMsg = msg1;
1605  // login time screen supports two lines
1606  if (msg2.Length() > 0)
1607  finalMsg += "\n" + msg2;
1608 
1609  m_LoginTimeScreen.SetStatus(finalMsg);
1610  }
1611  else if (m_loading)
1612  {
1613  // loading only one line, but it's a long one
1614  finalMsg = msg1 + " " + msg2;
1615  m_loading.SetStatus(finalMsg);
1616  }
1617  break;
1618  }
1620  {
1621  g_Game.SetGameState(DayZGameState.CONNECTING);
1622  SetConnecting(true);
1623  break;
1624  }
1626  {
1627  g_Game.SetGameState(DayZGameState.MAIN_MENU);
1628  SetConnecting(false);
1629  if (m_ConnectFromJoin)
1630  {
1631  m_ConnectFromJoin = false;
1632  AbortMission();
1633  }
1634  break;
1635  }
1637  {
1638  DLCOwnerShipFailedParams dlcParams;
1639  if (Class.CastTo(dlcParams, params))
1640  {
1641  Print("### DLC Ownership failed !!! Map: " + dlcParams.param1);
1642  }
1643  break;
1644  }
1646  {
1647  ConnectivityStatsUpdatedEventParams connectivityStatsParams;
1648  if (Class.CastTo(connectivityStatsParams, params))
1649  {
1650  PlayerIdentity playerIdentity = connectivityStatsParams.param1;
1651 
1652  int pingAvg = playerIdentity.GetPingAvg();
1653  if (pingAvg < GetWorld().GetPingWarningThreshold())
1654  {
1655  SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.OFF);
1656  }
1657  else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1658  {
1659  SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL1);
1660  }
1661  else
1662  {
1663  SetConnectivityStatState(EConnectivityStatType.PING, EConnectivityStatLevel.LEVEL2);
1664  }
1665  }
1666  break;
1667  }
1669  {
1670  ServerFpsStatsUpdatedEventParams serverFpsStatsParams;
1671  if (Class.CastTo(serverFpsStatsParams, params))
1672  {
1673  #ifdef DIAG_DEVELOPER
1674  m_ServerFpsStatsParams = serverFpsStatsParams;
1675  #endif
1676  float fps = serverFpsStatsParams.param1;
1677  if (fps > GetWorld().GetServerFpsWarningThreshold())
1678  {
1679  SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.OFF);
1680  }
1681  else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1682  {
1683  SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL1);
1684  }
1685  else
1686  {
1687  SetConnectivityStatState(EConnectivityStatType.SERVER_PERF, EConnectivityStatLevel.LEVEL2);
1688  }
1689  }
1690  break;
1691  }
1692  }
1693 
1694  VONManager.GetInstance().OnEvent(eventTypeId, params);
1695 
1696  Mission mission = GetMission();
1697  if (mission)
1698  {
1699  mission.OnEvent(eventTypeId, params);
1700  }
1701 
1702  ErrorModuleHandler emh = ErrorModuleHandler.GetInstance();
1703  if (emh)
1704  emh.OnEvent(eventTypeId, params);
1705  }
1706 
1707  protected void SetConnectivityStatState(EConnectivityStatType type, EConnectivityStatLevel level)
1708  {
1709  if (level != m_ConnectivityStatsStates[type])
1710  {
1711  if (OnConnectivityStatChange(type, level, m_ConnectivityStatsStates[type]))//before setting the prev. level to be the current level, we need to make sure we successfully set the icon
1712  {
1713  m_ConnectivityStatsStates[type] = level;
1714  }
1715  }
1716  }
1717 
1718  protected bool OnConnectivityStatChange(EConnectivityStatType type, EConnectivityStatLevel newLevel, EConnectivityStatLevel oldLevel)
1719  {
1720  if (!GetGame() || !GetGame().GetMission())
1721  return false;
1722  Hud hud = GetGame().GetMission().GetHud();
1723  if (!hud)
1724  return false;
1725 
1726  hud.SetConnectivityStatIcon(type, newLevel);
1727  return true;
1728  }
1729 
1730  #ifdef DIAG_DEVELOPER
1731  private void DrawPerformaceStats(float pingAct, float pingAvg)
1732  {
1733  DbgUI.Begin("Performance Stats", 10, 520);
1734  DbgUI.Text("pingAct:" + pingAct );
1735  int color = COLOR_WHITE;
1736  if ( pingAvg >= GetWorld().GetPingCriticalThreshold())
1737  color = COLOR_RED;
1738  else if ( pingAvg >= GetWorld().GetPingWarningThreshold())
1739  color = COLOR_YELLOW;
1740 
1741  DbgUI.ColoredText(color, "pingAvg:" + pingAvg);
1742  DbgUI.Text("Ping Warning Threshold:" + GetWorld().GetPingWarningThreshold());
1743  DbgUI.Text("Ping Critical Threshold:" + GetWorld().GetPingCriticalThreshold());
1744  DbgUI.PlotLive("pingAvg history:", 300,150, pingAvg, 2000, 100 );
1745  DbgUI.Text("Server Fps Warning Threshold:" + GetWorld().GetServerFpsWarningThreshold());
1746  DbgUI.Text("Server Fps Critical Threshold:" + GetWorld().GetServerFpsCriticalThreshold());
1747  if (m_ServerFpsStatsParams)// SERVER FPS
1748  {
1749  color = COLOR_WHITE;
1750  if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsCriticalThreshold())
1751  color = COLOR_RED;
1752  else if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsWarningThreshold())
1753  color = COLOR_YELLOW;
1754  DbgUI.ColoredText(color, "serverFPS:" + m_ServerFpsStatsParams.param1.ToString() );
1755  DbgUI.PlotLive("serverFPS history:", 300,150, m_ServerFpsStatsParams.param1, 6000, 100 );
1756  }
1757  DbgUI.End();
1758  }
1759  #endif
1760 
1761  void AddVoiceNotification(VONStopSpeakingEventParams vonStartParams)
1762  {
1763  m_Notifications.AddVoiceNotification(vonStartParams.param2, vonStartParams.param1);
1764  }
1765 
1766  void RemoveVoiceNotification(VONStopSpeakingEventParams vonStopParams)
1767  {
1768  m_Notifications.RemoveVoiceNotification(vonStopParams.param2);
1769  }
1770 
1771  // ------------------------------------------------------------
1772  void UpdateLoginQueue(float timeslice)
1773  {
1774  int pos = GetUIManager().GetLoginQueuePosition();
1775 
1777  if (!m_LoginQueue && pos > 0)
1778  {
1779  GetUIManager().CloseAll();
1780 
1781  if (GetMission())
1782  {
1783  UIScriptedMenu parent = GetUIManager().GetMenu();
1784  EnterLoginQueue(parent);
1785  }
1786  else
1787  {
1788  m_LoginQueue = new LoginQueueStatic();
1789  GetUIManager().ShowScriptedMenu(m_LoginQueue, null);
1790  }
1791  }
1792  if (m_LoginQueue)
1793  {
1794  m_LoginQueue.SetPosition(pos);
1795 
1797  LoginQueueStatic loginQueue;
1798  if (LoginQueueBase.CastTo(loginQueue, m_LoginQueue))
1799  {
1800  loginQueue.Update(timeslice);
1801  }
1802  }
1803  }
1804 
1805  // ------------------------------------------------------------
1806  void OnLoginTimeEvent(int loginTime)
1807  {
1808 #ifndef NO_GUI
1809  // remove login queue if exits
1810  CancelLoginQueue();
1811 
1812  GetUserManager().GetUserDatabaseIdAsync();
1813 
1814  m_LoginTime = loginTime;
1815 
1816  // timer for login
1817  if (m_LoginTime > 0)
1818  {
1819  if (!m_LoginTimeScreen)
1820  {
1821  GetUIManager().CloseAll();
1822 
1823  if (GetMission())
1824  {
1825  UIScriptedMenu parent = GetUIManager().GetMenu();
1826  EnterLoginTime(parent);
1827  }
1828  else
1829  {
1830  m_LoginTimeScreen = new LoginTimeStatic();
1831  GetUIManager().ShowScriptedMenu(m_LoginTimeScreen, null);
1832  }
1833  }
1834 
1835  m_LoginTimeScreen.SetTime(m_LoginTime);
1836  m_LoginTimeScreen.Show();
1837 
1838  GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(this.LoginTimeCountdown, 1000, true);
1839  }
1840 #endif
1841  }
1842 
1843  // ------------------------------------------------------------
1844  void LoginTimeCountdown()
1845  {
1846  if (m_LoginTime > 0)
1847  {
1848  if (m_LoginTimeScreen)
1849  m_LoginTimeScreen.SetTime(m_LoginTime);
1850 
1851  m_LoginTime--;
1852  }
1853  else
1854  {
1855  // stop the call loop
1856  CancelLoginTimeCountdown();
1857  }
1858  }
1859 
1860  // ------------------------------------------------------------
1861  void OnRespawnEvent(int time)
1862  {
1863  // use login time screen for respawn timer
1864  if (time >= 0)
1865  {
1866  m_LoginTime = time;
1867  if (!m_LoginTimeScreen)
1868  {
1869  GetUIManager().CloseAll();
1870 
1871  UIScriptedMenu parent = GetUIManager().GetMenu();
1872  EnterLoginTime(parent);
1873  }
1874 
1875  m_LoginTimeScreen.SetRespawn(true);
1876  m_LoginTimeScreen.SetTime(m_LoginTime);
1877  m_LoginTimeScreen.Show();
1878 
1879  GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(this.LoginTimeCountdown, 1000, true);
1880  }
1881 
1882  if (GetPlayer())
1883  GetPlayer().StopDeathDarkeningEffect();
1884 
1885  PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Start(new Param1<float>(1.0));
1886  }
1887 
1888  // ------------------------------------------------------------
1889  void OnPreloadEvent(vector pos)
1890  {
1891  // cancel only login time (respawn time is parallel with preload, but login time is not)
1892  if (m_LoginTimeScreen && !m_LoginTimeScreen.IsRespawn())
1893  CancelLoginTimeCountdown();
1894 
1895  // tell game to continue
1896  StoreLoginDataPrepare();
1897  }
1898 
1899  // ------------------------------------------------------------
1900  // Serialize and send default character information to server (must be called)
1901  void StoreLoginDataPrepare()
1902  {
1904 
1905  //GetMenuData().RequestGetDefaultCharacterData();
1906  GetMenuDefaultCharacterData().SerializeCharacterData(ctx.GetWriteContext());
1907  StoreLoginData(ctx.GetWriteContext());
1908  }
1909 
1910  // ------------------------------------------------------------
1911  void EnterLoginQueue(UIMenuPanel parent)
1912  {
1913  m_LoginQueue = LoginQueueBase.Cast(GetUIManager().EnterScriptedMenu(MENU_LOGIN_QUEUE, parent));
1914  }
1915 
1916  // ------------------------------------------------------------
1917  void EnterLoginTime(UIMenuPanel parent)
1918  {
1919  m_LoginTimeScreen = LoginTimeBase.Cast(GetUIManager().EnterScriptedMenu(MENU_LOGIN_TIME, parent));
1920  }
1921 
1922  // ------------------------------------------------------------
1923  void OnMPConnectionLostEvent(int duration)
1924  {
1925  if (duration >= 0)//(-1 means conn. reestablished)
1926  SetConnectivityStatState(EConnectivityStatType.CONN_LOST, EConnectivityStatLevel.LEVEL1);
1927  else
1928  SetConnectivityStatState(EConnectivityStatType.CONN_LOST, EConnectivityStatLevel.OFF);
1929 
1930  #ifdef PLATFORM_PS4
1931  //PSN Set multiplay state
1932  if (duration < 0 && GetGameState() == DayZGameState.IN_GAME)
1933  {
1934  OnlineServices.SetMultiplayState(true);
1935  }
1936  else
1937  {
1938  OnlineServices.SetMultiplayState(false);
1939  }
1940  #endif
1941  }
1942 
1943  // ------------------------------------------------------------
1944  void LoadProgressUpdate(int progressState, float progress, string title)
1945  {
1946  #ifndef NO_GUI
1947  switch (progressState)
1948  {
1949  case PROGRESS_START:
1950  {
1951  #ifndef NO_GUI
1952  // get out of the black screen immediately
1953  GetUIManager().ScreenFadeOut(0);
1954  #endif
1955  m_loading.Inc();
1956  m_loading.SetTitle(title);
1957  if (m_loading.m_HintPanel)
1958  m_loading.m_HintPanel.ShowRandomPage();
1959 
1960  }
1961  break;
1962 
1963  case PROGRESS_FINISH:
1964  {
1965  m_loading.Dec();
1966  }
1967  break;
1968 
1969  case PROGRESS_PROGRESS:
1970  {
1971  m_loading.SetProgress(progress);
1972 
1973  }
1974  break;
1975 
1976  case PROGRESS_UPDATE:
1977  {
1978  m_loading.SetProgress(0);
1979  }
1980  break;
1981  }
1982  #endif
1983  }
1984 
1985  // ------------------------------------------------------------
1986  override void OnAfterCreate()
1987  {
1988  Math.Randomize(-1);
1989  }
1990 
1991  // ------------------------------------------------------------
1992  override void OnActivateMessage()
1993  {
1994  RefreshMouseCursorVisibility();
1995  }
1996 
1997  // ------------------------------------------------------------
1998  override void OnDeactivateMessage()
1999  {
2000  RefreshMouseCursorVisibility();
2001  }
2002 
2003  // ------------------------------------------------------------
2004  override bool OnInitialize()
2005  {
2006  ParticleList.PreloadParticles();
2007 
2008  RegisterProfilesOptions();
2009  SetHudBrightness(GetHUDBrightnessSetting());
2010 
2011  InitNotifications();
2012  m_Visited = new TStringArray;
2013  GetProfileStringList("SB_Visited", m_Visited);
2014 
2015  if (GetLoadState() == DayZLoadState.UNDEFINED)
2016  {
2017  string param;
2018 
2019  if (GetCLIParam("join", param))
2020  {
2021  JoinLaunch();
2022  #ifndef PLATFORM_PS4
2023  CreateTitleScreen();
2024  #endif
2025  }
2026  else if (GetCLIParam("connect", param))
2027  {
2028  ConnectLaunch();
2029  }
2030  else if (GetCLIParam("mission", param))
2031  {
2032  MissionLaunch();
2033  }
2034  else if (GetCLIParam("party", param))
2035  {
2036  PartyLaunch();
2037  }
2038  else
2039  {
2040  MainMenuLaunch();
2041  }
2042 
2043  return true;
2044  }
2045 
2046  return false;
2047  }
2048 
2049  void InitNotifications()
2050  {
2051  NotificationSystem.InitInstance();
2052  m_Notifications = new NotificationUI();
2053  }
2054 
2055  protected ref Widget m_IntroMenu;
2056  protected ref Widget m_GamepadDisconnectMenu; //DEPRECATED
2057  protected int m_PrevBlur;
2058 
2059  protected string m_DatabaseID;
2060 
2061  protected string m_ConnectAddress;
2062  protected int m_ConnectPort;
2063  protected string m_ConnectPassword;
2064 
2065  protected const int MAX_VISITED = 50;
2066  protected ref TStringArray m_Visited;
2067 
2068  string GetDatabaseID()
2069  {
2070  return m_DatabaseID;
2071  }
2072 
2073  void SetDatabaseID(string id)
2074  {
2075  m_DatabaseID = id;
2076  if (GetUIManager().GetMenu())
2077  {
2078  GetUIManager().GetMenu().Refresh();
2079  }
2080  }
2081 
2082  void CreateTitleScreen()
2083  {
2084  DeleteTitleScreen();
2085  m_IntroMenu = GetWorkspace().CreateWidgets("gui/layouts/xbox/day_z_title_screen.layout");
2086  RichTextWidget text_widget = RichTextWidget.Cast(m_IntroMenu.FindAnyWidget("InputPromptText"));
2087  m_IntroMenu.FindAnyWidget("notification_root").Show(false);
2088  if (text_widget)
2089  {
2090  string text = Widget.TranslateString("#console_start_game");
2091  #ifdef PLATFORM_XBOX
2092  BiosUserManager user_manager = GetGame().GetUserManager();
2093  if (user_manager && user_manager.GetSelectedUser())
2094  text_widget.SetText(string.Format(text, "<image set=\"xbox_buttons\" name=\"A\" />"));
2095  else
2096  text_widget.SetText(string.Format(text, "<image set=\"xbox_buttons\" name=\"A\" />"));
2097  #endif
2098 
2099  #ifdef PLATFORM_PS4
2100  string confirm = "cross";
2101  if (GetGame().GetInput().GetEnterButton() == GamepadButton.A)
2102  {
2103  confirm = "cross";
2104  }
2105  else
2106  {
2107  confirm = "circle";
2108  }
2109  text_widget.SetText(string.Format(text, "<image set=\"playstation_buttons\" name=\"" + confirm + "\" />"));
2110  #endif
2111  }
2112 
2113  #ifdef PLATFORM_CONSOLE
2114  #ifdef PLATFORM_XBOX
2115  #ifdef BUILD_EXPERIMENTAL
2116  m_IntroMenu.FindAnyWidget("notification_root").Show(true);
2117  #endif
2118  #endif
2119  #endif
2120  }
2121 
2122  void DeleteTitleScreen()
2123  {
2124  if (m_IntroMenu)
2125  {
2126  delete m_IntroMenu;
2127  }
2128  }
2129 
2130  bool ShouldShowControllerDisconnect()
2131  {
2132  return m_ShouldShowControllerDisconnect;
2133  }
2134 
2135  void UpdateInputDeviceDisconnectWarning()
2136  {
2137  #ifdef PLATFORM_CONSOLE
2138  if (!GetUIManager().IsMenuOpen(MENU_WARNING_INPUTDEVICE_DISCONNECT))
2139  {
2140  m_ShouldShowControllerDisconnect = !GetInput().AreAllAllowedInputDevicesActive();
2141  if (m_ShouldShowControllerDisconnect)
2142  {
2143  GetCallQueue(CALL_CATEGORY_GUI).Call(GetUIManager().EnterScriptedMenu,MENU_WARNING_INPUTDEVICE_DISCONNECT,GetUIManager().GetMenu());
2144  }
2145  }
2146  #endif
2147  }
2148 
2149  void JoinLaunch()
2150  {
2151  SetGameState(DayZGameState.JOIN);
2152  SetLoadState(DayZLoadState.JOIN_START);
2153 
2154  #ifdef PLATFORM_CONSOLE
2155  string join_param;
2156  if (GetCLIParam("join", join_param))
2157  {
2158  BiosUserManager user_manager = GetUserManager();
2159  user_manager.ParseJoinAsync(join_param);
2160  }
2161  #endif
2162  }
2163 
2164  void ConnectLaunch()
2165  {
2166  BiosUserManager user_manager = GetUserManager();
2167  if (user_manager.GetTitleInitiator())
2168  {
2169  user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2170  }
2171 
2172  SetGameState(DayZGameState.CONNECT);
2173  SetLoadState(DayZLoadState.CONNECT_START);
2174 
2175  #ifndef PLATFORM_WINDOWS
2176  #ifdef PLATFORM_CONSOLE
2177  CreateTitleScreen();
2178  GamepadCheck();
2179  #endif
2180  #else
2181  ConnectFromCLI();
2182  #endif
2183  }
2184 
2185  void PartyLaunch()
2186  {
2187  SetGameState(DayZGameState.PARTY);
2188  SetLoadState(DayZLoadState.PARTY_START);
2189  BiosUserManager user_manager = GetGame().GetUserManager();
2190 
2191  string param;
2192  if (GetCLIParam("party", param))
2193  {
2194  user_manager.ParsePartyAsync(param);
2195  StartRandomCutscene(GetMainMenuWorld());
2196  }
2197  }
2198 
2199  void MainMenuLaunch()
2200  {
2201 #ifdef PLATFORM_WINDOWS
2202  BiosUserManager user_manager = GetUserManager();
2203  if (user_manager)
2204  {
2205  if (user_manager.GetTitleInitiator())
2206  {
2207  user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2208  }
2209  }
2210 #endif
2211 
2212  SetGameState(DayZGameState.MAIN_MENU);
2213  SetLoadState(DayZLoadState.MAIN_MENU_START);
2214  StartRandomCutscene(GetMainMenuWorld());
2215  DeleteTitleScreen();
2216  }
2217 
2218  void MissionLaunch()
2219  {
2220  BiosUserManager user_manager = GetUserManager();
2221  if (user_manager)
2222  {
2223  if (user_manager.GetTitleInitiator())
2224  {
2225  user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2226  }
2227  }
2228 
2229  SetGameState(DayZGameState.IN_GAME);
2230  SetLoadState(DayZLoadState.MISSION_START);
2231 
2232 
2233  #ifndef PLATFORM_WINDOWS
2234  #ifdef PLATFORM_CONSOLE
2235  #ifndef DEVELOPER
2236  CreateTitleScreen();
2237  GamepadCheck();
2238  return;
2239  #endif
2240  #endif
2241  #endif
2242 
2243  string mission;
2244  GetCLIParam("mission", mission);
2245  PlayMission(mission);
2246  }
2247 
2248  void SelectUser(int gamepad = -1)
2249  {
2250  BiosUserManager user_manager = GetUserManager();
2251  if (user_manager)
2252  {
2253  BiosUser selected_user;
2254  if (gamepad > -1)
2255  {
2256  GetInput().GetGamepadUser(gamepad, selected_user);
2257  #ifdef PLATFORM_PS4
2258  if (selected_user)
2259  #endif
2260  {
2261  if (user_manager.SelectUserEx(selected_user))
2262  {
2263  GetGame().GetInput().IdentifyGamepad(GamepadButton.BUTTON_NONE);
2264  GetInput().SelectActiveGamepad(gamepad);
2265  }
2266  else
2267  {
2268  selected_user = user_manager.GetSelectedUser();
2269  }
2270 
2271  #ifdef PLATFORM_PS4
2272  if (!selected_user.IsOnline())
2273  {
2274  user_manager.LogOnUserAsync(selected_user);
2275  return;
2276  }
2277  #endif
2278  }
2279  #ifdef PLATFORM_PS4
2280  else
2281  {
2282  GetInput().ResetActiveGamepad();
2283  GamepadCheck();
2284  }
2285  #endif
2286  }
2287 
2288  if (!selected_user)
2289  selected_user = user_manager.GetSelectedUser();
2290 
2291  if (!selected_user)
2292  {
2293  user_manager.PickUserAsync();
2294  return;
2295  }
2296 
2297  user_manager.SelectUserEx(selected_user);
2298 
2299  switch (GetLoadState())
2300  {
2301  case DayZLoadState.JOIN_START:
2302  {
2303  SetLoadState(DayZLoadState.JOIN_USER_SELECT);
2304  break;
2305  }
2306  case DayZLoadState.PARTY_START:
2307  {
2308  SetLoadState(DayZLoadState.PARTY_USER_SELECT);
2309  break;
2310  }
2311  case DayZLoadState.MAIN_MENU_START:
2312  {
2313  SetLoadState(DayZLoadState.MAIN_MENU_USER_SELECT);
2314  break;
2315  }
2316  case DayZLoadState.CONNECT_START:
2317  {
2318  SetLoadState(DayZLoadState.CONNECT_USER_SELECT);
2319  break;
2320  }
2321  case DayZLoadState.MISSION_START:
2322  {
2323  SetLoadState(DayZLoadState.MISSION_USER_SELECT);
2324  break;
2325  }
2326  default:
2327  break;
2328  }
2329 
2330  SelectGamepad();
2331  g_Game.SetHudBrightness(g_Game.GetHUDBrightnessSetting());
2332  }
2333  }
2334 
2335  void SetPreviousGamepad(int gamepad)
2336  {
2337  m_PreviousGamepad = gamepad;
2338  }
2339 
2340  int GetPreviousGamepad()
2341  {
2342  return m_PreviousGamepad;
2343  }
2344 
2345  void GamepadCheck()
2346  {
2347 #ifndef AUTOTEST
2348  if (GetInput().IsActiveGamepadSelected())
2349  {
2350 #endif
2351  DeleteTitleScreen();
2352  SelectUser();
2353 #ifndef AUTOTEST
2354  }
2355  else
2356  {
2357  #ifdef PLATFORM_CONSOLE
2358  #ifndef PLATFORM_WINDOWS
2359  #ifdef PLATFORM_PS4
2360  if (GetUserManager().GetSelectedUser())
2361  {
2362  int gamepad = GetInput().GetUserGamepad(GetUserManager().GetSelectedUser());
2363  if (gamepad > -1)
2364  {
2365  SelectUser(gamepad);
2366  }
2367  else
2368  {
2369  if (!m_IntroMenu && !(GetGame().GetUIManager().GetMenu() && GetGame().GetUIManager().GetMenu().GetID() == MENU_TITLE_SCREEN))
2370  CreateTitleScreen();
2371  GetGame().GetInput().IdentifyGamepad(GetGame().GetInput().GetEnterButton());
2372  }
2373  }
2374  else
2375  #endif
2376  {
2377  if (!m_IntroMenu && !(GetUIManager().GetMenu() && GetUIManager().GetMenu().GetID() == MENU_TITLE_SCREEN))
2378  CreateTitleScreen();
2379  GetInput().IdentifyGamepad(GetInput().GetEnterButton());
2380  }
2381  #endif
2382  #endif
2383  }
2384 #endif
2385  }
2386 
2387  void SelectGamepad()
2388  {
2389  ResetProfileOptions();
2390  BiosUserManager user_manager = GetUserManager();
2391 
2392  if (user_manager)
2393  {
2394  BiosUser selected_user = user_manager.GetSelectedUser();
2395  if (selected_user)
2396  {
2397  OnlineServices.SetBiosUser(selected_user);
2398  SetPlayerName(selected_user.GetName());
2399  SetUserFOV(GetUserFOVFromConfig());
2400  #ifdef PLATFORM_CONSOLE
2401  SetPlayerGameName(selected_user.GetName());
2402  user_manager.GetUserDatabaseIdAsync();
2403  #endif
2404  }
2405 
2406  if (GetUIManager().GetMenu())
2407  {
2408  GetUIManager().GetMenu().Refresh();
2409  }
2410  }
2411 
2412  switch (GetLoadState())
2413  {
2414  case DayZLoadState.JOIN_USER_SELECT:
2415  {
2416  SetLoadState(DayZLoadState.JOIN_CONTROLLER_SELECT);
2417  OnlineServices.LoadMPPrivilege();
2418  break;
2419  }
2420  case DayZLoadState.PARTY_USER_SELECT:
2421  {
2422  SetLoadState(DayZLoadState.PARTY_CONTROLLER_SELECT);
2423  DeleteTitleScreen();
2424  GetUIManager().EnterScriptedMenu(MENU_SERVER_BROWSER, GetUIManager().GetMenu());
2425  break;
2426  }
2427  case DayZLoadState.CONNECT_USER_SELECT:
2428  {
2429  SetLoadState(DayZLoadState.CONNECT_CONTROLLER_SELECT);
2430  OnlineServices.LoadMPPrivilege();
2431  break;
2432  }
2433  case DayZLoadState.MAIN_MENU_USER_SELECT:
2434  {
2435  SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2436  DeleteTitleScreen();
2437  GetUIManager().EnterScriptedMenu(MENU_MAIN, GetUIManager().GetMenu());
2438  break;
2439  }
2440  case DayZLoadState.MISSION_USER_SELECT:
2441  {
2442  SetLoadState(DayZLoadState.MISSION_CONTROLLER_SELECT);
2443  DeleteTitleScreen();
2444  string mission;
2445  GetCLIParam("mission", mission);
2446  PlayMission(mission);
2447  break;
2448  }
2449  }
2450  }
2451 
2452  void TryConnect()
2453  {
2454  if (GetLoadState() == DayZLoadState.JOIN_CONTROLLER_SELECT)
2455  {
2456  SetGameState(DayZGameState.CONNECTING);
2457  OnlineServices.GetSession();
2458  }
2459  else
2460  {
2461  if (GetGameState() != DayZGameState.CONNECTING)
2462  {
2463  switch (GetLoadState())
2464  {
2465  case DayZLoadState.CONNECT_CONTROLLER_SELECT:
2466  {
2467  SetGameState(DayZGameState.CONNECTING);
2468  ConnectFromCLI();
2469  break;
2470  }
2471  case DayZLoadState.PARTY_CONTROLLER_SELECT:
2472  {
2473  SetGameState(DayZGameState.CONNECTING);
2474  Connect();
2475  break;
2476  }
2477  case DayZLoadState.MAIN_MENU_CONTROLLER_SELECT:
2478  {
2479  SetGameState(DayZGameState.CONNECTING);
2480  Connect();
2481  break;
2482  }
2483  }
2484  }
2485  else
2486  {
2487  string address;
2488  int port;
2489  if (GetHostAddress(address, port))
2490  {
2491  if (m_ConnectAddress == address && m_ConnectPort == port)
2492  ErrorModuleHandler.ThrowError(ErrorCategory.ConnectErrorScript, EConnectErrorScript.ALREADY_CONNECTING_THIS);
2493  else
2494  ErrorModuleHandler.ThrowError(ErrorCategory.ConnectErrorScript, EConnectErrorScript.ALREADY_CONNECTING, string.Format("%1:%2", address, port));
2495  }
2496  else
2497  {
2498  DisconnectSessionForce();
2499  DisconnectSessionScript();
2500  TryConnect();
2501  }
2502  }
2503  }
2504  }
2505 
2506  bool GetLastVisitedServer(out string ip, out int port)
2507  {
2508  if (m_Visited)
2509  {
2510  if (m_Visited.Count() > 0)
2511  {
2512  string uid = m_Visited.Get(m_Visited.Count() - 1);
2513  TStringArray output = new TStringArray;
2514  uid.Split(":", output);
2515  ip = output[0];
2516  port = output[1].ToInt();
2517  return true;
2518  }
2519  }
2520  return false;
2521  }
2522 
2523  void AddVisitedServer(string ip, int port)
2524  {
2525  string uid = ip + ":" + port;
2526  if (m_Visited)
2527  {
2528  int pos = m_Visited.Find(uid);
2529 
2530  if (pos < 0)
2531  {
2532  if (m_Visited.Count() == MAX_VISITED)
2533  m_Visited.Remove(0);
2534  m_Visited.Insert(uid);
2535  }
2536  else
2537  {
2538  // if item is not saved as last server, move it
2539  if (pos != (m_Visited.Count() - 1))
2540  {
2541  m_Visited.Remove(pos);
2542  m_Visited.Insert(uid);
2543  }
2544  }
2545  SetProfileStringList("SB_Visited", m_Visited);
2546  SaveProfile();
2547  }
2548  }
2549 
2550  bool IsVisited(string ip, int port)
2551  {
2552  string uid = ip + ":" + port;
2553  int index = m_Visited.Find(uid);
2554  return (index >= 0);
2555  }
2556 
2557  void RefreshCurrentServerInfo()
2558  {
2559  string addr;
2560  int port;
2561  if (GetHostAddress(addr, port))
2562  {
2563  m_ConnectAddress = addr;
2564  m_ConnectPort = port;
2565  }
2566  OnlineServices.GetCurrentServerInfo(m_ConnectAddress, m_ConnectPort);
2567  }
2568 
2569  void Connect()
2570  {
2571  SetConnecting(true);
2572 
2573  DeleteTitleScreen();
2574  string addr;
2575  int port;
2576  if (GetHostAddress(addr, port))
2577  {
2578  if (m_ConnectAddress == addr && m_ConnectPort == port)
2579  return;
2580  }
2581 
2582  if (Connect(GetUIManager().GetMenu(), m_ConnectAddress, m_ConnectPort, m_ConnectPassword) != 0)
2583  DisconnectSessionScript(true);
2584  }
2585 
2586  void DisconnectSessionScript(bool displayJoinError = false)
2587  {
2588  DisconnectSessionFlags flags = DisconnectSessionFlags.SELECT_USER | DisconnectSessionFlags.IGNORE_WHEN_IN_GAME;
2589  if (displayJoinError)
2590  {
2591  flags |= DisconnectSessionFlags.JOIN_ERROR_ENABLED;
2592  flags |= DisconnectSessionFlags.JOIN_ERROR_CHECK;
2593  }
2594 
2595  DisconnectSessionEx(flags);
2596  }
2597 
2598  void DisconnectSessionEx(DisconnectSessionFlags flags)
2599  {
2600  if (flags & DisconnectSessionFlags.SELECT_USER && OnlineServices.GetBiosUser())
2601  {
2602  GetGame().GetUserManager().SelectUserEx(OnlineServices.GetBiosUser());
2603  }
2604 
2605  if (flags & DisconnectSessionFlags.JOIN_ERROR_ENABLED)
2606  {
2607  if (!(flags & DisconnectSessionFlags.JOIN_ERROR_CHECK) || GetGameState() == DayZGameState.JOIN)
2608  {
2609  NotificationSystem.AddNotification(NotificationType.JOIN_FAIL_GET_SESSION, NotificationSystem.DEFAULT_TIME_DISPLAYED);
2610  }
2611  }
2612 
2613  if (flags & DisconnectSessionFlags.IGNORE_WHEN_IN_GAME && GetGameState() == DayZGameState.IN_GAME)
2614  {
2615  return;
2616  }
2617 
2618  if (flags & DisconnectSessionFlags.CLOSE_MENUS && GetGame().GetUIManager())
2619  {
2620  GetGame().GetUIManager().CloseAllSubmenus();
2621 
2622  if ( GetGame().GetUIManager().IsDialogVisible() )
2623  {
2624  GetGame().GetUIManager().CloseDialog();
2625  }
2626  }
2627 
2628  if (flags & DisconnectSessionFlags.ALWAYS_FORCE)
2629  {
2630  DisconnectSessionForce();
2631  }
2632 
2633  if (GetGame().GetMission())
2634  {
2635  if (g_Game.GetGameState() != DayZGameState.MAIN_MENU)
2636  {
2637  if (flags & DisconnectSessionFlags.DISCONNECT_ERROR_ENABLED)
2638  {
2639  NotificationSystem.AddNotification(NotificationType.DISCONNECTED, NotificationSystem.DEFAULT_TIME_DISPLAYED);
2640  }
2641 
2642  GetGame().GetMission().AbortMission();
2643 
2644  SetGameState(DayZGameState.MAIN_MENU);
2645  SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2646 
2647  GamepadCheck();
2648  }
2649  }
2650 
2651  else
2652  {
2653  MainMenuLaunch();
2654  }
2655  }
2656 
2657  void ConnectFromServerBrowser(string ip, int port, string password = "")
2658  {
2659  m_ConnectAddress = ip;
2660  m_ConnectPort = port;
2661  m_ConnectPassword = password;
2662  m_ConnectFromJoin = false;
2663  OnlineServices.LoadMPPrivilege();
2664  }
2665 
2666  void ConnectFromJoin(string ip, int port)
2667  {
2668  m_ConnectAddress = ip;
2669  m_ConnectPort = port;
2670  m_ConnectFromJoin = true;
2671  Connect();
2672  }
2673 
2674  void ConnectFromCLI()
2675  {
2676  string port;
2677  if (GetCLIParam("connect", m_ConnectAddress))
2678  {
2679  GetCLIParam("port", port);
2680  m_ConnectPort = port.ToInt();
2681 
2682  GetCLIParam("password", m_ConnectPassword);
2683 
2684  m_ConnectFromJoin = false;
2685  Connect();
2686  }
2687  }
2688 
2689  bool IsLeftCtrlDown()
2690  {
2691  return m_IsCtrlHolding;
2692  }
2693 
2694  // ------------------------------------------------------------
2695  override void OnKeyPress(int key)
2696  {
2697 
2698  if (key == KeyCode.KC_LCONTROL)
2699  {
2700  m_IsCtrlHolding = true;
2701  }
2702 
2703  if (key == KeyCode.KC_LMENU)
2704  {
2705  m_IsLeftAltHolding = true;
2706  }
2707 
2708  if (key == KeyCode.KC_RMENU)
2709  {
2710  m_IsRightAltHolding = true;
2711  }
2712 
2713  if (m_keyboard_handler)
2714  {
2715  m_keyboard_handler.OnKeyDown(NULL, 0, 0, key);
2716  }
2717 
2718  Mission mission = GetMission();
2719  if (mission)
2720  {
2721  mission.OnKeyPress(key);
2722  }
2723 
2724 #ifdef DEVELOPER
2725  if ((m_IsLeftAltHolding || m_IsLeftAltHolding) && key == KeyCode.KC_F4)
2726  {
2727  RequestExit(0);
2728  }
2729 #endif
2730 
2731  }
2732 
2733  // ------------------------------------------------------------
2734  override void OnKeyRelease(int key)
2735  {
2736  if (key == KeyCode.KC_LCONTROL)
2737  {
2738  m_IsCtrlHolding = false;
2739  }
2740 
2741  if (key == KeyCode.KC_LWIN)
2742  {
2743  m_IsWinHolding = false;
2744  }
2745 
2746  if (key == KeyCode.KC_LMENU || key == KeyCode.KC_RMENU)
2747  {
2748  m_IsLeftAltHolding = false;
2749  }
2750 
2751  if (key == KeyCode.KC_RMENU)
2752  {
2753  m_IsRightAltHolding = false;
2754  }
2755 
2756  if (m_keyboard_handler)
2757  {
2758  m_keyboard_handler.OnKeyUp(NULL, 0, 0, key);
2759  }
2760 
2761  Mission mission = GetMission();
2762  if (mission)
2763  {
2764  mission.OnKeyRelease(key);
2765  }
2766  }
2767 
2768  // ------------------------------------------------------------
2769  override void OnMouseButtonPress(int button)
2770  {
2771  Mission mission = GetMission();
2772  if (mission)
2773  {
2774  mission.OnMouseButtonPress(button);
2775  }
2776  }
2777 
2778  // ------------------------------------------------------------
2779  override void OnMouseButtonRelease(int button)
2780  {
2781  Mission mission = GetMission();
2782  if (mission)
2783  {
2784  mission.OnMouseButtonRelease(button);
2785  }
2786  }
2787 
2788  // ------------------------------------------------------------
2789  override void OnDeviceReset()
2790  {
2791  m_IsCtrlHolding = false;
2792  m_IsWinHolding = false;
2793  m_IsLeftAltHolding = false;
2794  m_IsRightAltHolding = false;
2795  }
2796 
2797  // ------------------------------------------------------------
2798  float GetDeltaT()
2799  {
2800  return m_DeltaTime;
2801  }
2802 
2803  // ------------------------------------------------------------
2804  override void OnUpdate(bool doSim, float timeslice)
2805  {
2806  m_DeltaTime = timeslice;
2807 
2808  Mission mission = GetMission();
2809  bool gameIsRunning = false;
2810 
2811  if (doSim && mission && !mission.IsPaused())
2812  {
2813  gameIsRunning = true;
2814  }
2815 
2816  if (doSim && mission)
2817  {
2818  mission.OnUpdate(timeslice);
2819  }
2820 
2821  // queues and timers update
2822  GetCallQueue(CALL_CATEGORY_SYSTEM).Tick(timeslice);
2823  GetUpdateQueue(CALL_CATEGORY_SYSTEM).Invoke(timeslice);
2824  GetTimerQueue(CALL_CATEGORY_SYSTEM).Tick(timeslice);
2825 
2826  #ifndef NO_GUI
2827  if (m_IsConnecting)
2828  UpdateLoginQueue(timeslice);
2829 
2830  if (m_loading && m_loading.IsLoading())
2831  {
2832  m_loading.OnUpdate(timeslice);
2833  }
2834  else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
2835  {
2836  m_LoginTimeScreen.Update(timeslice);
2837  }
2838  else
2839  {
2840  GetCallQueue(CALL_CATEGORY_GUI).Tick(timeslice);
2841  GetUpdateQueue(CALL_CATEGORY_GUI).Invoke(timeslice);
2842  GetTimerQueue(CALL_CATEGORY_GUI).Tick(timeslice);
2843  GetDragQueue().Tick();
2844  }
2845 
2846  NotificationSystem.Update(timeslice);
2847  if (m_Notifications)
2848  {
2849  m_Notifications.Update(timeslice);
2850  }
2851 
2852  #ifndef SERVER
2853  #ifdef DIAG_DEVELOPER
2854  if (GetGame().IsMultiplayer() && GetPlayer() && DiagMenu.GetBool(DiagMenuIDs.MISC_CONNECTION_STATS))
2855  {
2856  PlayerIdentity playerIdentity = GetPlayer().GetIdentity();
2857 
2858  if (playerIdentity)
2859  {
2860  int pingAct = playerIdentity.GetPingAct();
2861  int pingAvg = playerIdentity.GetPingAvg();
2862  }
2863 
2864  DrawPerformaceStats(pingAct, pingAvg);
2865  }
2866  #endif
2867  #endif
2868 
2869  #endif
2870 
2871  if (gameIsRunning)
2872  {
2873  GetCallQueue(CALL_CATEGORY_GAMEPLAY).Tick(timeslice);
2874  GetUpdateQueue(CALL_CATEGORY_GAMEPLAY).Invoke(timeslice);
2875  GetTimerQueue(CALL_CATEGORY_GAMEPLAY).Tick(timeslice);
2876  }
2877  }
2878 
2879  // ------------------------------------------------------------
2880  override void OnPostUpdate(bool doSim, float timeslice)
2881  {
2882  Mission mission = GetMission();
2883  bool gameIsRunning = false;
2884 
2885  if (doSim && mission && !mission.IsPaused())
2886  {
2887  gameIsRunning = true;
2888  }
2889 
2890  GetPostUpdateQueue(CALL_CATEGORY_SYSTEM).Invoke(timeslice);
2891 
2892  #ifndef NO_GUI
2893  if (m_loading && m_loading.IsLoading())
2894  {
2895  }
2896  else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
2897  {
2898  }
2899  else
2900  {
2901  GetPostUpdateQueue(CALL_CATEGORY_GUI).Invoke(timeslice);
2902  }
2903  #endif
2904 
2905  if (gameIsRunning)
2906  {
2907  GetPostUpdateQueue(CALL_CATEGORY_GAMEPLAY).Invoke(timeslice);
2908  }
2909  }
2910 
2911  // ------------------------------------------------------------
2912  override void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
2913  {
2914  super.OnRPC(sender, target, rpc_type, ctx);
2915  Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
2916 
2917  //Print("["+ GetGame().GetTime().ToString() +"] => DayZGame::OnRPC = "+ EnumTools.EnumToString(ERPCs,rpc_type));
2918 
2919  if (target)
2920  {
2921  // call rpc on target
2922  target.OnRPC(sender, rpc_type, ctx);
2923  }
2924  else
2925  {
2926  switch (rpc_type)
2927  {
2928  #ifndef SERVER
2929  #ifndef NO_GUI
2930  case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
2931  {
2932  CfgGameplayHandler.OnRPC(null, ctx);
2933  break;
2934  }
2935  case ERPCs.RPC_UNDERGROUND_SYNC:
2936  {
2937  UndergroundAreaLoader.OnRPC(ctx);
2938  break;
2939  }
2940  case ERPCs.RPC_SEND_NOTIFICATION:
2941  {
2942  NotificationType type;
2943  float show_time;
2944  string detail_text;
2945 
2946  ctx.Read(type);
2947  ctx.Read(show_time);
2948  ctx.Read(detail_text);
2949 
2950  NotificationSystem.AddNotification(type, show_time, detail_text);
2951  break;
2952  }
2953  case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
2954  {
2955  float show_time_ext;
2956  string title_text_ext;
2957  string detail_text_ext;
2958  string icon_ext;
2959 
2960  ctx.Read(show_time_ext);
2961  ctx.Read(title_text_ext);
2962  ctx.Read(detail_text_ext);
2963  ctx.Read(icon_ext);
2964 
2965  NotificationSystem.AddNotificationExtended(show_time_ext, title_text_ext, detail_text_ext, icon_ext);
2966  break;
2967  }
2968 
2969 
2970  case ERPCs.RPC_SOUND_HELICRASH:
2971  {
2972  bool playSound;
2973  vector pos;
2974  string sound_set;
2975 
2976  //Helicrash is a world event, we want anyone to be able to hear it
2977  Param3<bool, vector, int> playCrashSound = new Param3<bool, vector, int>(false, "0 0 0",0);
2978  if (ctx.Read(playCrashSound))
2979  {
2980  playSound = playCrashSound.param1;
2981  pos = playCrashSound.param2;
2982  sound_set = CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
2983  }
2984 
2985  if (playSound)
2986  {
2987  m_CrashSound = SEffectManager.PlaySound(sound_set, pos, 0.1, 0.1);
2988  m_CrashSound.SetAutodestroy(true);
2989  }
2990 
2991  break;
2992  }
2993  //Random off map artillery barrage
2994  case ERPCs.RPC_SOUND_ARTILLERY:
2995  {
2996  vector position;
2997  Param1<vector> playArtySound = new Param1<vector>(vector.Zero);
2998  if (ctx.Read(playArtySound))
2999  {
3000  position = playArtySound.param1;
3001  if (position == vector.Zero)
3002  break;
3003  }
3004  else
3005  break;
3006 
3007  if (!GetGame().GetPlayer())
3008  break;
3009 
3010  if (vector.DistanceSq(GetGame().GetPlayer().GetPosition(), position) <= (MIN_ARTY_SOUND_RANGE * MIN_ARTY_SOUND_RANGE))
3011  break;
3012 
3013  m_ArtySound = SEffectManager.PlaySound("Artillery_Distant_Barrage_SoundSet", position, 0.1, 0.1);
3014  m_ArtySound.SetAutodestroy(true);
3015 
3016  break;
3017  }
3018  case ERPCs.RPC_SOUND_CONTAMINATION:
3019  {
3020  vector soundPos;
3021 
3022  Param1<vector> playContaminatedSound = new Param1<vector>(vector.Zero);
3023  if (ctx.Read(playContaminatedSound))
3024  {
3025  soundPos = playContaminatedSound.param1;
3026  if (soundPos == vector.Zero)
3027  break;
3028  }
3029  else
3030  break;
3031 
3032  if (!GetGame().GetPlayer())
3033  break;
3034 
3035  EffectSound closeArtySound = SEffectManager.PlaySound("Artillery_Close_SoundSet", soundPos);
3036  closeArtySound.SetAutodestroy(true);
3037 
3038  // We add camera shake upon shell detonation
3039  float distance_to_player = vector.DistanceSq(soundPos, GetGame().GetPlayer().GetPosition());
3040  if (distance_to_player <= GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3041  {
3042  float strength_factor = Math.InverseLerp(GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0, Math.Sqrt(distance_to_player));
3043  DayZPlayerCamera camera = GetGame().GetPlayer().GetCurrentCamera();
3044  if (camera)
3045  camera.SpawnCameraShake(strength_factor * 4);
3046  }
3047 
3048  ParticleManager.GetInstance().PlayInWorld(ParticleList.CONTAMINATED_AREA_GAS_SHELL, soundPos);
3049  break;
3050  }
3051  // Single artillery shot to announce dynamic contaminated area
3052  case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3053  {
3054  vector soundPosition;
3055  vector delayedSoundPos;
3056  float soundDelay;
3057 
3058  Param3<vector, vector, float> playArtyShotSound = new Param3<vector, vector, float>(vector.Zero, vector.Zero, 0);
3059  if (ctx.Read(playArtyShotSound))
3060  {
3061  soundPosition = playArtyShotSound.param1;
3062  delayedSoundPos = playArtyShotSound.param2;
3063  soundDelay = playArtyShotSound.param3;
3064  if (soundPosition == vector.Zero)
3065  break;
3066  }
3067  else
3068  break;
3069 
3070  if (!GetGame().GetPlayer())
3071  break;
3072 
3073  m_ArtySound = SEffectManager.PlaySound("Artillery_Distant_SoundSet", soundPosition, 0.1, 0.1);
3074  m_ArtySound.SetAutodestroy(true);
3075 
3076  // We remove the amount of time the incoming sound lasts
3077  soundDelay -= 5;
3078  // We convert to milliseconds
3079  soundDelay *= 1000;
3080  GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(DelayedMidAirDetonation, soundDelay, false, delayedSoundPos[0], delayedSoundPos[1], delayedSoundPos[2]);
3081  break;
3082  }
3083  case ERPCs.RPC_SET_BILLBOARDS:
3084  {
3085  if (!m_BillboardSetHandler)
3086  m_BillboardSetHandler = new BillboardSetHandler();
3087 
3088  Param1<int> indexP = new Param1<int>(-1);
3089  if (ctx.Read(indexP))
3090  {
3091  int index = indexP.param1;
3092  m_BillboardSetHandler.OnRPCIndex(index);
3093  }
3094  break;
3095  }
3096  #endif
3097  #endif
3098 
3099  case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3100  {
3101  map<string, bool> mute_list;
3102  if (ctx.Read(mute_list))
3103  {
3104  for (int i = 0; i < mute_list.Count(); i++)
3105  {
3106  string uid = mute_list.GetKey(i);
3107  bool mute = mute_list.GetElement(i);
3108  MutePlayer(uid, sender.GetPlainId(), mute);
3109  }
3110  }
3111  break;
3112  }
3113 
3114  /*
3115  case ERPCs.RPC_SERVER_RESPAWN_MODE:
3116  {
3117  int mode;
3118  if (ctx.Read(mode) && !IsServer())
3119  {
3120  GetMission().SetRespawnModeClient(mode);
3121  }
3122  }
3123  */
3124 
3125  #ifdef DEVELOPER
3126  case ERPCs.DEV_SET_WEATHER:
3127  {
3128  Param1<DebugWeatherRPCData> p1data = new Param1<DebugWeatherRPCData>(null);
3129 
3130  if ( ctx.Read(p1data) )
3131  {
3132  DebugWeatherRPCData data = p1data.param1;
3133 
3134  if (data.m_FogValue >= 0)
3135  GetGame().GetWeather().GetFog().Set(data.m_FogValue, data.m_FogInterpolation, data.m_FogDuration);
3136 
3137  if (data.m_OvercastValue >= 0)
3138  GetGame().GetWeather().GetOvercast().Set(data.m_OvercastValue, data.m_OvercastInterpolation, data.m_OvercastDuration);
3139 
3140  if (data.m_RainValue >= 0)
3141  GetGame().GetWeather().GetRain().Set(data.m_RainValue, data.m_RainInterpolation, data.m_RainDuration);
3142 
3143  }
3144  else
3145  {
3146  ErrorEx("Failed to read weather debug data");
3147  }
3148  break;
3149  }
3150  #endif
3151 
3152 
3153  #ifdef DIAG_DEVELOPER
3154  #ifdef SERVER
3155  case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3156  {
3157  if (!m_CameraToolsMenuServer)
3158  {
3159  m_CameraToolsMenuServer = new CameraToolsMenuServer;
3160  }
3161  m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3162  break;
3163  }
3164 
3165  case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3166  {
3167  if (!m_CameraToolsMenuServer)
3168  {
3169  m_CameraToolsMenuServer = new CameraToolsMenuServer;
3170  }
3171  m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3172  break;
3173  }
3174 
3175  #endif
3176  #endif
3177 
3178  }
3179  // global rpc's handling
3180  }
3181  }
3182 
3183  void DelayedMidAirDetonation(float x, float y, float z)
3184  {
3185  EffectSound artilleryFallSound = SEffectManager.PlaySound("Artillery_Fall_SoundSet", Vector(x, y, z));
3186  artilleryFallSound.SetAutodestroy(true);
3187  }
3188 
3189  // ------------------------------------------------------------
3190  void CheckDialogs()
3191  {
3192  #ifndef NO_GUI
3193  Mission mission = GetMission();
3194  if (mission && !m_loading.IsLoading() && GetUIManager().IsDialogQueued())
3195  {
3196  mission.Pause();
3197  GetUIManager().ShowQueuedDialog();
3198  }
3199  #endif
3200  }
3201 
3203  void SetConnecting(bool value)
3204  {
3205  m_IsConnecting = value;
3206  }
3207 
3208  bool IsConnecting()
3209  {
3210  return m_IsConnecting;
3211  }
3212 
3213  // ------------------------------------------------------------
3214  bool IsLoading()
3215  {
3216  return m_loading && m_loading.IsLoading();
3217  }
3218 
3219  // ------------------------------------------------------------
3220  void SetKeyboardHandle(UIScriptedMenu handler)
3221  {
3222  m_keyboard_handler = handler;
3223  }
3224 
3225  // ------------------------------------------------------------
3226  void LoadingShow()
3227  {
3228  #ifndef NO_GUI
3229  m_loading.ShowEx(this);
3230  #endif
3231  }
3232 
3233  // ------------------------------------------------------------
3234  void LoadingHide(bool force = false)
3235  {
3236  #ifndef NO_GUI
3237  m_loading.Hide(force);
3238  // turn the lights back on
3239  PPEManagerStatic.GetPPEManager().StopAllEffects();
3240  #ifdef PLATFORM_CONSOLE
3241  if (!IsLoading())
3242  {
3243  if (m_LoadState != DayZLoadState.MAIN_MENU_START && m_LoadState != DayZLoadState.MAIN_MENU_USER_SELECT)
3244  {
3245  UpdateInputDeviceDisconnectWarning();
3246  }
3247  }
3248  #endif
3249  #endif
3250  }
3251 
3252  // ------------------------------------------------------------
3253  override string CreateDefaultPlayer()
3254  {
3255  if (m_CharClassNames.Count() > 0)
3256  return m_CharClassNames[0];
3257 
3258  return "";
3259  }
3260 
3261  // ------------------------------------------------------------
3262  override string CreateRandomPlayer()
3263  {
3264  return m_CharClassNames.GetRandomElement();
3265  }
3266 
3267  // ------------------------------------------------------------
3268  override TStringArray ListAvailableCharacters()
3269  {
3270  return m_CharClassNames;
3271  }
3272 
3273  // ------------------------------------------------------------
3274  void ExplosionEffectsEx(Object source, Object directHit, int componentIndex, float energyFactor, float explosionFactor, HitInfo hitInfo)
3275  {
3276  vector pos = hitInfo.GetPosition();
3277  string ammoType = hitInfo.GetAmmoType();
3278 
3279  // Call legacy method
3280  ExplosionEffects(source, directHit, componentIndex, hitInfo.GetSurface(), pos, hitInfo.GetSurfaceNormal(), energyFactor, explosionFactor, hitInfo.IsWater(), ammoType);
3281 
3282  // add explosion noise
3283  if (IsServer())
3284  {
3285  //NoiseParams npar = new NoiseParams();
3286  m_NoiseParams.LoadFromPath(string.Format("cfgAmmo %1 NoiseExplosion", ammoType));
3287 
3288  GetNoiseSystem().AddNoiseTarget(pos, 21, m_NoiseParams, hitInfo.GetSurfaceNoiseMultiplier());
3289  }
3290  }
3291 
3292  // ------------------------------------------------------------
3293  void ExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal,
3294  float energyFactor, float explosionFactor, bool isWater, string ammoType)
3295  {
3296  #ifndef SERVER
3297  if (source)
3298  {
3299  source.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
3300 
3301  if (source.ShootsExplosiveAmmo() && ammoType == "Explosion_40mm_Ammo")
3302  ParticleManager.GetInstance().PlayInWorld(ParticleList.EXPLOSION_LANDMINE, pos);
3303 
3304  float distance_to_player = vector.Distance(pos, GetGame().GetPlayer().GetPosition());
3305  m_AmmoShakeParams.Load(ammoType);
3306 
3307  if (distance_to_player < m_AmmoShakeParams.m_Radius)
3308  {
3309  float dist01 = Math.InverseLerp(0, m_AmmoShakeParams.m_Radius, distance_to_player);
3310  float modifier = Math.Lerp(m_AmmoShakeParams.m_ModifierClose, m_AmmoShakeParams.m_ModifierFar,dist01);
3311 
3312  GetGame().GetPlayer().GetCurrentCamera().SpawnCameraShake(modifier * m_AmmoShakeParams.m_Strength);
3313  }
3314  }
3315  #endif
3316  }
3317 
3318  // ------------------------------------------------------------
3319  void OnProjectileStopped(ProjectileStoppedInfo info)
3320  {
3321  string simulation;
3322 
3323  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3324 
3325  if (simulation == "shotArrow")
3326  {
3327  string pile;
3328 
3329  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3330 
3331  EntityAI arrow = EntityAI.Cast(GetGame().CreateObjectEx(pile, info.GetPos(), ECE_DYNAMIC_PERSISTENCY));
3332  arrow.PlaceOnSurface();
3333  arrow.SetFromProjectile(info);
3334  }
3335  }
3336 
3337  const float ARROW_PIERCE_DEPTH = 0.05;
3338 
3339  // ------------------------------------------------------------
3340  void OnProjectileStoppedInTerrain(TerrainCollisionInfo info)
3341  {
3342  string simulation;
3343 
3344  if (info.GetIsWater())
3345  return;
3346 
3347  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3348  if (simulation == "shotArrow")
3349  {
3350  string pile;
3351  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3352  vector pos = info.GetPos();
3353  vector dir = -info.GetInVelocity();
3354 
3355  dir.Normalize();
3356  pos -= dir * ARROW_PIERCE_DEPTH;
3357 
3358  EntityAI arrow = EntityAI.Cast(GetGame().CreateObjectEx(pile, pos, ECE_KEEPHEIGHT|ECE_DYNAMIC_PERSISTENCY));
3359  arrow.SetDirection(dir);
3360  arrow.SetFromProjectile(info);
3361  }
3362  }
3363 
3364  // ------------------------------------------------------------
3365  void OnProjectileStoppedInObject(ObjectCollisionInfo info)
3366  {
3367  string simulation;
3368 
3369  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " simulation", simulation);
3370  if (simulation == "shotArrow")
3371  {
3372  string pile;
3373  GetGame().ConfigGetText("cfgAmmo " + info.GetAmmoType() + " spawnPileType", pile);
3374 
3375  EntityAI arrow = null;
3376  EntityAI ent = EntityAI.Cast(info.GetHitObj());
3377  if (ent)
3378  {
3379  EntityAI parent = ent.GetHierarchyParent();
3380  if (parent && parent.IsPlayer())
3381  {
3382  arrow = EntityAI.Cast(GetGame().CreateObjectEx(pile, parent.GetPosition(), ECE_DYNAMIC_PERSISTENCY));
3383  arrow.PlaceOnSurface();
3384  arrow.SetFromProjectile(info);
3385 
3386  return;
3387  }
3388  }
3389 
3390  vector pos = info.GetPos();
3391  vector dir = -info.GetInVelocity();
3392 
3393  dir.Normalize();
3394  pos -= dir * ARROW_PIERCE_DEPTH;
3395 
3396  arrow = EntityAI.Cast(GetGame().CreateObjectEx(pile, pos, ECE_KEEPHEIGHT|ECE_DYNAMIC_PERSISTENCY));
3397  arrow.SetDirection(dir);
3398  arrow.SetFromProjectile(info);
3399 
3400  info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3401  }
3402  }
3403 
3404  // ------------------------------------------------------------
3405  void FirearmEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal,
3406  vector exitPos, vector inSpeed, vector outSpeed, bool isWater, bool deflected, string ammoType)
3407  {
3408  #ifndef SERVER
3409  ImpactEffectsData impactEffectsData = new ImpactEffectsData();
3410  impactEffectsData.m_DirectHit = directHit;
3411  impactEffectsData.m_ComponentIndex = componentIndex;
3412  impactEffectsData.m_Surface = surface;
3413  impactEffectsData.m_Position = pos;
3414  impactEffectsData.m_ImpactType = ImpactTypes.UNKNOWN;
3415  impactEffectsData.m_SurfaceNormal = surfNormal;
3416  impactEffectsData.m_ExitPosition = exitPos;
3417  impactEffectsData.m_InSpeed = inSpeed;
3418  impactEffectsData.m_OutSpeed = outSpeed;
3419  impactEffectsData.m_IsDeflected = deflected;
3420  impactEffectsData.m_AmmoType = ammoType;
3421  impactEffectsData.m_IsWater = isWater;
3422 
3423  if (directHit)
3424  {
3425  directHit.OnReceivedHit(impactEffectsData);
3426  }
3427 
3428  ImpactMaterials.EvaluateImpactEffectEx(impactEffectsData);
3429  #endif
3430 
3431 
3432  if (IsServer())
3433  {
3434  if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed == vector.Zero)
3435  {
3436  if (ammoType == "Bullet_40mm_ChemGas")
3437  {
3438  GetGame().CreateObject("ContaminatedArea_Local", pos);
3439  }
3440  else if (ammoType == "Bullet_40mm_Explosive")
3441  {
3442  DamageSystem.ExplosionDamage(EntityAI.Cast(source), null, "Explosion_40mm_Ammo", pos, DamageType.EXPLOSION);
3443  }
3444  }
3445 
3446  // add hit noise
3447  m_NoiseParams.LoadFromPath("cfgAmmo " + ammoType + " NoiseHit");
3448 
3449  float surfaceCoef = SurfaceGetNoiseMultiplier(directHit, pos, componentIndex);
3450  float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat("cfgAmmo " + ammoType + " initSpeed");
3451  GetNoiseSystem().AddNoiseTarget(pos, 10, m_NoiseParams, coefAdjusted); // Leave a ping for 5 seconds
3452  }
3453  }
3454 
3455  // ------------------------------------------------------------
3456  void CloseCombatEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal,
3457  bool isWater, string ammoType)
3458  {
3459  #ifndef SERVER
3460  ImpactEffectsData impactEffectsData = new ImpactEffectsData();
3461  impactEffectsData.m_DirectHit = directHit;
3462  impactEffectsData.m_ComponentIndex = componentIndex;
3463  impactEffectsData.m_Surface = surface;
3464  impactEffectsData.m_Position = pos;
3465  impactEffectsData.m_ImpactType = ImpactTypes.MELEE;
3466  impactEffectsData.m_SurfaceNormal = Vector(Math.RandomFloat(-1,1), Math.RandomFloat(-1,1), Math.RandomFloat(-1,1));
3467  impactEffectsData.m_ExitPosition = "0 0 0";
3468  impactEffectsData.m_InSpeed = "0 0 0";
3469  impactEffectsData.m_OutSpeed = "0 0 0";
3470  impactEffectsData.m_IsDeflected = false;
3471  impactEffectsData.m_AmmoType = ammoType;
3472  impactEffectsData.m_IsWater = isWater;
3473 
3474  if (directHit)
3475  directHit.OnReceivedHit(impactEffectsData);
3476 
3477  ImpactMaterials.EvaluateImpactEffectEx(impactEffectsData);
3478  #endif
3479 
3480  // add hit noise
3481  if (IsServer())
3482  {
3483  m_NoiseParams.LoadFromPath("cfgAmmo " + ammoType + " NoiseHit");
3484 
3485  float surfaceCoef = SurfaceGetNoiseMultiplier(directHit, pos, componentIndex);
3486  GetNoiseSystem().AddNoisePos(EntityAI.Cast(source), pos, m_NoiseParams, surfaceCoef);
3487  }
3488  }
3489 
3490  void UpdateVoiceLevel(int level)
3491  {
3492  GetMission().UpdateVoiceLevelWidgets(level);
3493  }
3494 
3495  void InitCharacterMenuDataInfo(int menudata_count)
3496  {
3497  m_OriginalCharactersCount = menudata_count;
3498  }
3499 
3500  void SetPlayerGameName(string name)
3501  {
3502  m_PlayerName = name;
3503  }
3504 
3505  string GetPlayerGameName()
3506  {
3507  return m_PlayerName;
3508  }
3509 
3510  void SetNewCharacter(bool state)
3511  {
3512  m_IsNewCharacter = state;
3513  }
3514 
3515  bool IsNewCharacter()
3516  {
3517  return m_IsNewCharacter;
3518  }
3519 
3520  void SetUserFOV(float pFov)
3521  {
3522  if (pFov < OPTIONS_FIELD_OF_VIEW_MIN)
3523  pFov = OPTIONS_FIELD_OF_VIEW_MIN;
3524 
3525  if (pFov > OPTIONS_FIELD_OF_VIEW_MAX)
3526  pFov = OPTIONS_FIELD_OF_VIEW_MAX;
3527 
3528  m_UserFOV = pFov;
3529  }
3530 
3531  float GetUserFOV()
3532  {
3533  return m_UserFOV;
3534  }
3535 
3536  static float GetUserFOVFromConfig()
3537  {
3538  GameOptions gameOptions = new GameOptions;
3539  NumericOptionsAccess noa;
3540  if (gameOptions && Class.CastTo(noa,gameOptions.GetOptionByType(OptionAccessType.AT_OPTIONS_FIELD_OF_VIEW)))
3541  {
3542  return noa.ReadValue();
3543  }
3544  return 1.0;
3545  }
3546 
3547  float GetFOVByZoomType(ECameraZoomType type)
3548  {
3549  switch (type)
3550  {
3551  case ECameraZoomType.NONE:
3552  return GetUserFOV();
3553  case ECameraZoomType.NORMAL:
3554  return Math.Min(GetUserFOV(), GameConstants.DZPLAYER_CAMERA_FOV_EYEZOOM);
3555  case ECameraZoomType.SHALLOW:
3556  return Math.Min(GetUserFOV(),GameConstants.DZPLAYER_CAMERA_FOV_EYEZOOM_SHALLOW);
3557  default:
3558  return GetUserFOV();
3559  }
3560  return GetUserFOV();
3561  }
3562 
3563  void SetHudBrightness(float value)
3564  {
3565  Widget.SetLV(value);
3566  Widget.SetTextLV(value);
3567  }
3568 
3569  float GetHUDBrightnessSetting()
3570  {
3571  return g_Game.GetProfileOptionFloat(EDayZProfilesOptions.HUD_BRIGHTNESS);
3572  }
3573 
3574  // Check if ammo is compatible with a weapon in hands
3575  static bool CheckAmmoCompability(EntityAI weaponInHand, EntityAI ammo)
3576  {
3577  TStringArray ammo_names = new TStringArray; // Array of ammo types (their name) that can be used with weapon in hand
3578 
3579  string cfg_path = "CfgWeapons " + weaponInHand.GetType() + " chamberableFrom"; // Create config path
3580  GetGame().ConfigGetTextArray(cfg_path, ammo_names); // Get ammo types
3581 
3582  foreach (string ammo_name : ammo_names) // for every ammo in ammo string compare passed ammo
3583  {
3584  if (ammo.GetType() == ammo_name)
3585  {
3586  return true;
3587  }
3588  }
3589 
3590  // if no ammo from the array matches with ammo passed, return false
3591  return false;
3592  }
3593 
3594  void SetEVValue(float value)
3595  {
3596  m_PreviousEVValue = m_EVValue;
3597  SetEVUser(value);
3598  m_EVValue = value;
3599  }
3600 
3601  float GetCurrentEVValue()
3602  {
3603  return m_EVValue;
3604  }
3605 
3606  float GetPreviousEVValue()
3607  {
3608  return m_PreviousEVValue;
3609  }
3610 
3611  int GetCurrentDisplayLanguageIdx()
3612  {
3613  ListOptionsAccess language_option;
3614  GameOptions options = new GameOptions();
3615  language_option = ListOptionsAccess.Cast(options.GetOptionByType(OptionAccessType.AT_OPTIONS_LANGUAGE));
3616  int idx = -1;
3617  if (language_option)
3618  {
3619  idx = language_option.GetIndex();
3620  }
3621 
3622  return idx;
3623  }
3624 
3625  bool IsWorldWetTempUpdateEnabled()
3626  {
3627  return m_IsWorldWetTempUpdateEnabled;
3628  }
3629 
3630  bool IsFoodDecayEnabled()
3631  {
3632  return (GetFoodDecayModifier() != 0);
3633  }
3634 
3635  float GetFoodDecayModifier()
3636  {
3637  #ifdef DIAG_DEVELOPER
3638 
3639  if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.FOOD_DECAY))
3640  {
3641  return m_FoodDecayModifier * FeatureTimeAccel.GetFeatureTimeAccelValue();
3642  }
3643  #endif
3644  return m_FoodDecayModifier;
3645  }
3646 
3647  array<int> GetConnectedInputDeviceList()
3648  {
3649  if (!m_ConnectedInputDeviceList)
3650  {
3651  m_ConnectedInputDeviceList = new array<int>;
3652  }
3653  return m_ConnectedInputDeviceList;
3654  }
3655 
3656  void SetMouseCursorDesiredVisibility(bool visible)
3657  {
3658  m_CursorDesiredVisibilityScript = visible;
3659 
3660  RefreshMouseCursorVisibility();
3661  }
3662 
3663  bool GetMouseCursorDesiredVisibility()
3664  {
3665  return m_CursorDesiredVisibilityScript;
3666  }
3667 
3669  bool CanDisplayMouseCursor()
3670  {
3672 #ifdef PLATFORM_CONSOLE
3673  if (GetInput())
3674  {
3675  return GetInput().IsMouseConnected();
3676  }
3677 #endif
3678 
3680 #ifdef PLATFORM_CONSOLE
3681  return false;
3682 #else
3683  return true;
3684 #endif
3685  }
3686 
3687  void RefreshMouseCursorVisibility()
3688  {
3689 #ifndef NO_GUI
3690 #ifdef FEATURE_CURSOR
3691  if (!IsAppActive())
3692  {
3693  ShowCursorWidget(true);
3694  }
3695  else
3696 #endif
3697  {
3698  bool showCursor = m_CursorDesiredVisibilityScript && CanDisplayMouseCursor();
3699 
3700  UIManager ui = GetUIManager();
3701  if (ui)
3702  {
3704  ui.ShowCursor(showCursor);
3705  }
3706  else
3707  {
3709  ShowCursorWidget(showCursor);
3710  }
3711  }
3712 #endif
3713  }
3714 
3715  BillboardSetHandler GetBillboardHandler()
3716  {
3717  return m_BillboardSetHandler;
3718  }
3719 
3721  //DEPRECATED//
3723  void CreateGamepadDisconnectMenu();
3724  void DeleteGamepadDisconnectMenu();
3725 };
3726 
3727 DayZGame g_Game;
3728 
3729 DayZGame GetDayZGame()
3730 {
3731  return g_Game;
3732 }
Param2< string, string >
ProjectileStoppedInfo
Definition: dayzgame.c:17
GetGame
proto native CGame GetGame()
MAIN_MENU_USER_SELECT
class DayZProfilesOptions MAIN_MENU_USER_SELECT
UIScriptedMenu
Definition: dayzgame.c:63
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
DLCOwnerShipFailedEventTypeID
const EventType DLCOwnerShipFailedEventTypeID
params: DLCOwnerShipFailedParams
Definition: gameplay.c:550
ShowEx
void ShowEx(DayZGame game)
Definition: dayzgame.c:803
Backlit
Backlit effect class.
Definition: backlit.c:104
mission
Mission mission
Definition: displaystatus.c:28
SHOW_CROSSHAIR
const string SHOW_CROSSHAIR
Definition: constants.c:561
RespawnEventTypeID
const EventType RespawnEventTypeID
params: RespawnEventParams
Definition: gameplay.c:520
GetCLIParam
proto bool GetCLIParam(string param, out string val)
Returns command line argument.
EDayZProfilesOptions
EDayZProfilesOptions
Definition: edayzprofilesoptions.c:1
m_ImageBackground
ImageWidget m_ImageBackground
Definition: dayzgame.c:684
JOIN_START
class DayZProfilesOptions JOIN_START
Init
override Widget Init()
Definition: dayzgame.c:122
m_DayZGame
DayZGame m_DayZGame
Definition: dayzgame.c:678
CALL_CATEGORY_GAMEPLAY
const int CALL_CATEGORY_GAMEPLAY
Definition: tools.c:10
InputUtils
Definition: inpututils.c:1
Dec
void Dec()
Definition: dayzgame.c:756
MAIN_MENU
class DayZProfilesOptions MAIN_MENU
GetProfileValueBool
bool GetProfileValueBool(string name, bool def=false)
Return value from profile variable, if variable with given name is not present, default value is retu...
Definition: tools.c:1021
Mission
Mission class.
Definition: gameplay.c:670
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
DbgUI
Definition: dbgui.c:59
DayZProfilesOptionInt
Param3< string, int, int > DayZProfilesOptionInt
Definition: dayzgame.c:394
DayZProfilesOptionFloat
Param3< string, float, float > DayZProfilesOptionFloat
Definition: dayzgame.c:395
PROGRESS_START
PlayerIdentity PROGRESS_START
MENU_SERVER_BROWSER
const int MENU_SERVER_BROWSER
Definition: constants.c:190
HitInfo
Definition: hitinfo.c:1
GetDayZGame
DayZGame GetDayZGame()
Definition: dayzgame.c:3729
MAIN_MENU_START
class DayZProfilesOptions MAIN_MENU_START
DiagMenu
Definition: endebug.c:232
DayZPlayerCamera
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
Definition: dayzplayer.c:56
TStringArray
array< string > TStringArray
Definition: enscript.c:685
CanChangeHintPage
override protected bool CanChangeHintPage(float timeAccu)
Definition: dayzgame.c:181
m_NoiseParams
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
ECE_KEEPHEIGHT
const int ECE_KEEPHEIGHT
Definition: centraleconomy.c:27
NotificationSystem
Definition: notificationsystem.c:69
SetDispatcher
void SetDispatcher(Dispatcher dispatcher)
Definition: dispatcher.c:31
Show
void Show()
Definition: dayzgame.c:157
OnTimer
void OnTimer()
DEPRECATED.
Definition: tools.c:350
m_Counter
int m_Counter
Definition: dayzgame.c:689
KeyCode
KeyCode
Definition: ensystem.c:156
ServerFpsStatsUpdatedEventTypeID
const EventType ServerFpsStatsUpdatedEventTypeID
params: ServerFpsStatsUpdatedEventParams
Definition: gameplay.c:514
m_Timer
ref Timer m_Timer
Definition: dayzgame.c:690
Component
Definition: componententitydebug.c:1
MENU_WARNING_INPUTDEVICE_DISCONNECT
const int MENU_WARNING_INPUTDEVICE_DISCONNECT
Definition: constants.c:202
m_duration
protected float m_duration
Definition: tools.c:223
Close
void Close()
m_ImageLogoCorner
ImageWidget m_ImageLogoCorner
Definition: dayzgame.c:682
m_TextWidgetStatus
TextWidget m_TextWidgetStatus
Definition: dayzgame.c:675
y
Icon y
Managed
TODO doc.
Definition: enscript.c:117
ConnectingAbortEventTypeID
const EventType ConnectingAbortEventTypeID
no params
Definition: gameplay.c:556
DISCONNECT_SESSION_FLAGS_FORCE
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
ChatMessageEventParams
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Definition: gameplay.c:396
Print
proto void Print(void var)
Prints content of variable to console/log.
GameOptions
Definition: gameplay.c:1420
EConnectivityStatType
EConnectivityStatType
Definition: egamestateicons.c:1
LogoutEventTypeID
const EventType LogoutEventTypeID
params: LogoutEventParams
Definition: gameplay.c:524
AmmoCamParams
Definition: ammocamparams.c:1
MPConnectionLostEventParams
Param1< int > MPConnectionLostEventParams
Duration.
Definition: gameplay.c:446
CONNECT
class DayZProfilesOptions CONNECT
IsLoading
bool IsLoading()
Definition: dayzgame.c:776
SetTitle
void SetTitle(string title)
Definition: dayzgame.c:781
MPSessionPlayerReadyEventTypeID
const EventType MPSessionPlayerReadyEventTypeID
no params
Definition: gameplay.c:468
m_txtPosition
class LoginScreenBase extends UIScriptedMenu m_txtPosition
ClientData
Definition: clientdata.c:1
JOIN_ERROR_ENABLED
@ JOIN_ERROR_ENABLED
Definition: dayzgame.c:4
DISCONNECT_SESSION_FLAGS_ALL
const int DISCONNECT_SESSION_FLAGS_ALL
Definition: dayzgame.c:15
ConnectionLost
Definition: dayzgame.c:339
DialogQueuedEventTypeID
const EventType DialogQueuedEventTypeID
no params
Definition: gameplay.c:482
StartupEventTypeID
const EventType StartupEventTypeID
no params
Definition: gameplay.c:456
CachedObjectsParams
Definition: utilityclasses.c:9
ECameraZoomType
ECameraZoomType
Definition: ecamerazoomtype.c:1
PLAYER_CHAT_MSG
const string PLAYER_CHAT_MSG
Definition: constants.c:547
SHOW_QUICKBAR
const string SHOW_QUICKBAR
Definition: constants.c:555
COLOR_YELLOW
const int COLOR_YELLOW
Definition: constants.c:67
m_ImageWidgetBackground
ImageWidget m_ImageWidgetBackground
Definition: dayzgame.c:677
RespawnEventParams
Param1< int > RespawnEventParams
RespawnTime.
Definition: gameplay.c:420
SHOW_SERVERINFO
const string SHOW_SERVERINFO
Definition: constants.c:562
Param3
Definition: entityai.c:95
IGNORE_WHEN_IN_GAME
@ IGNORE_WHEN_IN_GAME
Definition: dayzgame.c:9
PARTY_USER_SELECT
class DayZProfilesOptions PARTY_USER_SELECT
m_timerQueue
protected array< TimerBase > m_timerQueue
Definition: tools.c:225
LoginStatusEventTypeID
const EventType LoginStatusEventTypeID
params: LoginStatusEventParams
Definition: gameplay.c:526
MIN
const int MIN
Definition: enconvert.c:28
CALL_CATEGORY_GUI
const int CALL_CATEGORY_GUI
Definition: tools.c:9
DayZProfilesOptionBool
DayZProfilesOption DayZProfilesOptionBool
Definition: dayzgame.c:393
LoginQueueBase
void LoginQueueBase()
Definition: dayzgame.c:112
PROGRESS_PROGRESS
const int PROGRESS_PROGRESS
Definition: gameplay.c:385
MENU_LOGIN_TIME
const int MENU_LOGIN_TIME
Definition: constants.c:197
DLCOwnerShipFailedParams
Param1< string > DLCOwnerShipFailedParams
world name
Definition: gameplay.c:442
NotificationUI
Definition: notificationui.c:1
ErrorEx
enum ShapeType ErrorEx
SHOW_HUD
const string SHOW_HUD
Definition: constants.c:556
MENU_INVENTORY
const int MENU_INVENTORY
Definition: constants.c:170
CONNECT_USER_SELECT
class DayZProfilesOptions CONNECT_USER_SELECT
ProgressAsync
Definition: progressasync.c:1
ErrorCategory
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
Definition: errormodulehandler.c:4
BillboardSetHandler
Definition: billboardset.c:1
MISSION_USER_SELECT
class DayZProfilesOptions MISSION_USER_SELECT
UNDEFINED
class DayZProfilesOptions UNDEFINED
ChatMessageEventTypeID
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
Definition: gameplay.c:486
m_HintPanel
ref UiHintPanelLoading m_HintPanel
Definition: dayzgame.c:691
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
OnRPC
void OnRPC(ParamsReadContext ctx)
Definition: displaystatus.c:216
OnEvent
override void OnEvent(EventType eventTypeId, Param params)
Handles VON-related events.
Definition: connecterrorscriptmodule.c:35
ImpactMaterials
Definition: impacteffects.c:28
ALWAYS_FORCE
@ ALWAYS_FORCE
Definition: dayzgame.c:10
ShowCursorWidget
proto native void ShowCursorWidget(bool show)
direct mouse cursor visibility control
ServerFpsStatsUpdatedEventParams
Param1< float > ServerFpsStatsUpdatedEventParams
float
Definition: gameplay.c:428
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
PreloadEventParams
Param1< vector > PreloadEventParams
Position.
Definition: gameplay.c:422
SelectedUserChangedEventTypeID
const EventType SelectedUserChangedEventTypeID
no params
Definition: gameplay.c:530
PPEManagerStatic
Static component of PPE manager, used to hold the instance.
Definition: ppemanager.c:2
DiagMenuIDs
DiagMenuIDs
Definition: ediagmenuids.c:1
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
EventType
TypeID EventType
Definition: enwidgets.c:55
ParticleList
Definition: particlelist.c:11
RichTextWidget
Definition: gameplay.c:315
UIManager
Definition: uimanager.c:1
m_ImageLoadingIcon
ImageWidget m_ImageLoadingIcon
Definition: dayzgame.c:683
map
map
Definition: controlsxboxnew.c:3
PARTY_CONTROLLER_SELECT
class DayZProfilesOptions PARTY_CONTROLLER_SELECT
UIMenuPanel
Part of main menu hierarchy to create custom menus from script.
Definition: uiscriptedmenu.c:2
vector
Definition: enconvert.c:105
PARTY_START
class DayZProfilesOptions PARTY_START
NoiseParams
class ObjectSpawnerHandler NoiseParams
JOIN_USER_SELECT
class DayZProfilesOptions JOIN_USER_SELECT
Analytics
Definition: scriptanalytics.c:145
GetID
int GetID()
Get the ID registered in SEffectManager.
Definition: effect.c:534
TextWidget
Definition: enwidgets.c:219
SetPosition
void SetPosition(int position)
Definition: dayzgame.c:172
CALL_CATEGORY_COUNT
const int CALL_CATEGORY_COUNT
Definition: tools.c:12
ObjectCollisionInfo
Definition: dayzgame.c:31
JOIN_CONTROLLER_SELECT
class DayZProfilesOptions JOIN_CONTROLLER_SELECT
SYSTEM_CHAT_MSG
const string SYSTEM_CHAT_MSG
Definition: constants.c:540
ConnectivityStatsUpdatedEventParams
Param1< PlayerIdentity > ConnectivityStatsUpdatedEventParams
PlayerIdentity.
Definition: gameplay.c:426
LoadingScreen
void LoadingScreen(DayZGame game)
Definition: dayzgame.c:692
DamageType
DamageType
exposed from C++ (do not change)
Definition: damagesystem.c:10
m_TextWidgetTitle
TextWidget m_TextWidgetTitle
Definition: dayzgame.c:674
SetStatus
void SetStatus(string status)
Definition: dayzgame.c:786
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
UndergroundAreaLoader
Definition: undergroundarealoader.c:47
MISSION_START
class DayZProfilesOptions MISSION_START
ErrorExSeverity
ErrorExSeverity
Definition: endebug.c:61
PreloadEventTypeID
const EventType PreloadEventTypeID
params: PreloadEventParams
Definition: gameplay.c:522
Object
Definition: objecttyped.c:1
DebugWeatherRPCData
Definition: debugweatherrpcdata.c:1
DISCONNECT_ERROR_ENABLED
@ DISCONNECT_ERROR_ENABLED
Definition: dayzgame.c:6
ConnectingStartEventTypeID
const EventType ConnectingStartEventTypeID
no params
Definition: gameplay.c:554
OnUpdate
void OnUpdate(float timeslice)
Definition: dayzgame.c:798
DISCONNECT_SESSION_FLAGS_JOIN
const int DISCONNECT_SESSION_FLAGS_JOIN
Definition: dayzgame.c:14
OptionAccessType
OptionAccessType
C++ OptionAccessType.
Definition: gameplay.c:1200
ObjectSpawnerHandler
Definition: objectspawner.c:1
CGame
Definition: dayzgame.c:874
m_ImageLogoMid
ImageWidget m_ImageLogoMid
Definition: dayzgame.c:681
CrashSoundSets
Definition: dayzgame.c:44
m_WidgetRoot
class DayZProfilesOptions m_WidgetRoot
COLOR_RED
const int COLOR_RED
Definition: constants.c:64
BiosUserManager
Definition: biosusermanager.c:16
DisconnectSessionFlags
DisconnectSessionFlags
Definition: dayzgame.c:1
LoginQueueBase
LoginQueue position when using -connect since mission is not created yet.
Definition: dayzgame.c:189
CfgGameplayHandler
Definition: cfggameplayhandler.c:1
LoginTimeBase
LoginTime when using -connect since mission is not created yet.
Definition: dayzgame.c:323
CreateMission
Mission CreateMission(string path)
Definition: somemission.c:1
CONNECT_START
class DayZProfilesOptions CONNECT_START
DIRECT_CHAT_MSG
const string DIRECT_CHAT_MSG
Definition: constants.c:542
MENU_LOGIN_QUEUE
const int MENU_LOGIN_QUEUE
Definition: constants.c:189
DayZProfilesOptions
Definition: dayzgame.c:397
array< string >
Update
proto native volatile void Update()
Definition: playersoundmanager.c:125
LoginTimeEventParams
Param1< int > LoginTimeEventParams
LoginTime.
Definition: gameplay.c:418
HUD_BRIGHTNESS
const string HUD_BRIGHTNESS
Definition: constants.c:557
MENU_TITLE_SCREEN
const int MENU_TITLE_SCREEN
Definition: constants.c:186
BleedChanceData
Static data of bleeding chance probabilities; currently used for melee only.
Definition: bleedchancedata.c:4
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ImpactTypes
ImpactTypes
Definition: impacteffects.c:1
x
Icon x
m_iPosition
protected int m_iPosition
Definition: dayzgame.c:110
FullTimeData
struct that keeps Time relevant information for future formatting
Definition: timeconversions.c:4
GAME_CHAT_MSG
const string GAME_CHAT_MSG
Definition: constants.c:545
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
JOIN
class DayZProfilesOptions JOIN
SELECT_USER
@ SELECT_USER
Definition: dayzgame.c:7
ScriptModule
Module containing compiled scripts.
Definition: enscript.c:130
GameConstants
Definition: constants.c:612
Debug
Definition: debug.c:13
NotificationType
NotificationType
DEPRECATED (moved into NotificationSystem)
Definition: notificationsystem.c:3
m_ProgressLoading
ProgressBarWidget m_ProgressLoading
Definition: dayzgame.c:685
PARTY
class DayZProfilesOptions PARTY
LoginScreenBase
Definition: dayzgame.c:199
EndLoading
void EndLoading()
Definition: dayzgame.c:768
ConnectivityStatsUpdatedEventTypeID
const EventType ConnectivityStatsUpdatedEventTypeID
params: ConnectivityStatsUpdatedEventParams
Definition: gameplay.c:512
MPSessionFailEventTypeID
const EventType MPSessionFailEventTypeID
no params
Definition: gameplay.c:466
VONManager
Manager class which handles Voice-over-network functionality while player is connected to a server.
Definition: vonmanager.c:275
ADMIN_CHAT_MSG
const string ADMIN_CHAT_MSG
Definition: constants.c:546
LogoutEventParams
Param1< int > LogoutEventParams
logoutTime
Definition: gameplay.c:432
ECE_DYNAMIC_PERSISTENCY
const int ECE_DYNAMIC_PERSISTENCY
Definition: centraleconomy.c:32
EConnectErrorScript
EConnectErrorScript
Definition: connecterrorscriptmodule.c:1
MAIN_MENU_CONTROLLER_SELECT
class DayZProfilesOptions MAIN_MENU_CONTROLLER_SELECT
m_ModdedWarning
TextWidget m_ModdedWarning
Definition: dayzgame.c:676
GetSurfNormal
ProjectileStoppedInfo Managed GetSurfNormal()
ENABLE_BLEEDINGINDICATION
const string ENABLE_BLEEDINGINDICATION
Definition: constants.c:558
ScriptCallQueue
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition: tools.c:52
ERPCs
ERPCs
Definition: erpcs.c:1
PROGRESS_UPDATE
const int PROGRESS_UPDATE
Definition: gameplay.c:386
Timer
Definition: dayzplayerimplement.c:62
BiosUser
Definition: biosusermanager.c:8
CONNECTING
class DayZProfilesOptions CONNECTING
LoginTimeEventTypeID
const EventType LoginTimeEventTypeID
params: LoginTimeEventParams
Definition: gameplay.c:518
Widget
Definition: enwidgets.c:189
GamepadButton
GamepadButton
Definition: ensystem.c:340
WorldCleaupEventTypeID
const EventType WorldCleaupEventTypeID
no params
Definition: gameplay.c:458
GetUApi
proto native UAInputAPI GetUApi()
PROGRESS_FINISH
const int PROGRESS_FINISH
Definition: gameplay.c:384
StatsEventDisconnectedData
Definition: scriptanalytics.c:59
SetProgress
void SetProgress(float val)
Definition: dayzgame.c:791
GetInput
ActionInput GetInput()
Definition: actionbase.c:1066
OnClick
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition: dayzgame.c:146
Math
Definition: enmath.c:6
GetIsWater
class CrashSoundSets GetIsWater
MENU_EARLYACCESS
const int MENU_EARLYACCESS
Definition: constants.c:166
SetTime
void SetTime(float time)
DEPRECATED.
CONNECT_CONTROLLER_SELECT
class DayZProfilesOptions CONNECT_CONTROLLER_SELECT
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition: particlemanager.c:84
m_btnLeave
protected ButtonWidget m_btnLeave
Definition: dayzgame.c:109
Hide
void Hide()
Definition: dayzgame.c:165
DayZProfilesOption
Param3< string, bool, bool > DayZProfilesOption
Definition: dayzgame.c:392
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
MPConnectionLostEventTypeID
const EventType MPConnectionLostEventTypeID
params: MPConnectionLostEventParams
Definition: gameplay.c:470
m_ImageLoadingIconRotation
float m_ImageLoadingIconRotation
Definition: dayzgame.c:686
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
JOIN_ERROR_CHECK
@ JOIN_ERROR_CHECK
Definition: dayzgame.c:5
StatsEventSpawnedData
Definition: scriptanalytics.c:66
SHOW_CONNECTIVITYINFO
const string SHOW_CONNECTIVITYINFO
Definition: constants.c:559
OnlineServices
Definition: onlineservices.c:1
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
MPSessionStartEventTypeID
const EventType MPSessionStartEventTypeID
no params
Definition: gameplay.c:462
EntityAI
Definition: building.c:5
~LoginQueueBase
void ~LoginQueueBase()
Definition: dayzgame.c:117
COLOR_WHITE
const int COLOR_WHITE
Definition: constants.c:63
NONE
@ NONE
Definition: dayzgame.c:3
Inc
void Inc()
Definition: dayzgame.c:746
m_txtNote
protected TextWidget m_txtNote
Definition: dayzgame.c:108
m_Game
protected DayZGame m_Game
Definition: uihintpanel.c:22
CLOSE_MENUS
@ CLOSE_MENUS
Definition: dayzgame.c:8
m_ProgressText
TextWidget m_ProgressText
Definition: dayzgame.c:687
MENU_MAIN
const int MENU_MAIN
Definition: constants.c:172
RADIO_CHAT_MSG
const string RADIO_CHAT_MSG
Definition: constants.c:544
ProgressEventTypeID
const EventType ProgressEventTypeID
params: ProgressEventParams
Definition: gameplay.c:476
m_LastProgressUpdate
float m_LastProgressUpdate
Definition: dayzgame.c:679
MPSessionEndEventTypeID
const EventType MPSessionEndEventTypeID
no params
Definition: gameplay.c:464
Connect
void Connect(ServerBrowserEntry server)
Definition: serverbrowsertab.c:547
CachedObjectsArrays
Definition: utilityclasses.c:40
ScriptReadWriteContext
Definition: gameplay.c:133
Hud
Definition: gameplay.c:623
GetCEApi
proto native CEApi GetCEApi()
Get the CE API.
path
string path
Definition: optionselectormultistate.c:135
ErrorModuleHandler
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Definition: errormodulehandler.c:28
ScriptInvoker
ScriptInvoker Class provide list of callbacks usage:
Definition: tools.c:115