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