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