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