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