39class TerrainCollisionInfo: CollisionInfoBase
48 static void RegisterSoundSet(
string sound_set)
50 m_Mappings.Set(sound_set.Hash(), sound_set);
53 static string GetSoundSetByHash(
int hash)
57 m_Mappings.Find(hash,sound_set);
69 override void Update(
float timeslice)
81 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
89 g_Game.SetGameState(DayZGameState.MAIN_MENU);
90 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
119 g_Game.SetKeyboardHandle(
this);
124 g_Game.SetKeyboardHandle(NULL);
129 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/dialog_queue_position.layout");
130 m_HintPanel =
new UiHintPanelLoading(layoutRoot.FindAnyWidget(
"hint_frame0"));
131 m_txtPosition = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtPosition"));
132 m_txtNote = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtNote"));
133 m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"btnLeave"));
135 layoutRoot.FindAnyWidget(
"notification_root").Show(
false);
137 #ifdef PLATFORM_CONSOLE
138 bool showToolbar = !
g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer() ||
g_Game.GetInput().GetCurrentInputDevice() ==
EInputDeviceType.CONTROLLER;
139 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(showToolbar);
143 #ifdef BUILD_EXPERIMENTAL
144 layoutRoot.FindAnyWidget(
"notification_root").Show(
true);
152 override bool OnClick(Widget w,
int x,
int y,
int button)
154 super.OnClick(w,
x,
y, button);
167 layoutRoot.Show(
true);
174 layoutRoot.Show(
false);
189 return timeAccu >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL;
197 void LoginQueueStatic()
217 g_Game.SetKeyboardHandle(
this);
226 g_Game.SetKeyboardHandle(null);
230 override Widget
Init()
232 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/dialog_login_time.layout");
234 m_txtDescription = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtDescription"));
235 m_txtLabel = TextWidget.Cast(layoutRoot.FindAnyWidget(
"txtLabel"));
236 m_btnLeave = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"btnLeave"));
237 m_txtDescription.Show(
true);
238 layoutRoot.FindAnyWidget(
"notification_root").Show(
false);
240 #ifdef PLATFORM_CONSOLE
241 bool showToolbar = !
g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer() ||
g_Game.GetInput().GetCurrentInputDevice() ==
EInputDeviceType.CONTROLLER;
242 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(showToolbar);
243 RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget(
"BackIcon"));
244 toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction(
"UAUIBack",
"", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
246 #ifdef BUILD_EXPERIMENTAL
247 layoutRoot.FindAnyWidget(
"notification_root").Show(
true);
255 override bool OnClick(Widget w,
int x,
int y,
int button)
257 super.OnClick(w,
x,
y, button);
270 layoutRoot.Show(
true);
271 m_HintPanel =
new UiHintPanelLoading(layoutRoot.FindAnyWidget(
"hint_frame0"));
278 layoutRoot.Show(
false);
285 TimeConversions.ConvertSecondsToFullTime(time, m_FullTime);
287 text =
"#menu_loading_in_";
289 text =
"#dayz_game_spawning_in_";
291 if (m_FullTime.m_Days > 0)
293 else if (m_FullTime.m_Hours > 0)
295 else if (m_FullTime.m_Minutes > 0)
300 text = Widget.TranslateString(text);
301 text =
string.Format(text, m_FullTime.m_Seconds, m_FullTime.m_Minutes, m_FullTime.m_Hours, m_FullTime.m_Days);
302 m_txtLabel.SetText(text);
304 if (m_IsRespawn && time <= 1)
305 g_Game.SetLoginTimerFinished();
310 m_txtDescription.SetText(status);
313 void SetRespawn(
bool value)
325 return timeAccu >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL && m_FullTime.m_Seconds >=
GameConstants.LOADING_SCREEN_HINT_INTERVAL_MIN;
332 void LoginTimeStatic()
339 void ~LoginTimeStatic()
348 private ref Widget m_WidgetRoot;
349 private TextWidget m_TextWidgetTitle;
350 private float m_duration;
352 void ConnectionLost(DayZGame game)
354 m_WidgetRoot = game.GetWorkspace().CreateWidgets(
"gui/layouts/day_z_connection_lost.layout");
355 m_WidgetRoot.Show(
false);
357 Class.CastTo(m_TextWidgetTitle, m_WidgetRoot.FindAnyWidget(
"TextWidget"));
363 if (!m_WidgetRoot.IsVisible())
365 if (
g_Game.GetUIManager().IsDialogVisible())
367 g_Game.GetUIManager().HideDialog();
370 m_WidgetRoot.Show(
true);
371 m_TextWidgetTitle.SetText(
"");
377 if (m_WidgetRoot.IsVisible())
379 m_WidgetRoot.Show(
false);
383 void SetText(
string text)
385 m_TextWidgetTitle.SetText(text);
393 void SetDuration(
float duration)
395 m_duration = duration;
404class DayZProfilesOptions
414 void DayZProfilesOptions()
421 void RegisterProfileOption(
EDayZProfilesOptions option,
string profileOptionName,
bool def =
true)
423 if (!m_DayZProfilesOptionsBool.Contains(option))
429 SetProfileOptionBool(option, profileVal);
433 void RegisterProfileOptionBool(
EDayZProfilesOptions option,
string profileOptionName,
bool defaultValue =
true)
435 RegisterProfileOption(option, profileOptionName, defaultValue);
438 void RegisterProfileOptionInt(
EDayZProfilesOptions option,
string profileOptionName,
int defaultValue = 0)
440 if (!m_DayZProfilesOptionsInt.Contains(option))
444 g_Game.GetProfileString(profileOptionName, outValue);
445 int value = outValue.ToInt();
447 m_DayZProfilesOptionsInt.Set(option,
new DayZProfilesOptionInt(profileOptionName, value, defaultValue));
448 SetProfileOptionInt(option, value);
452 void RegisterProfileOptionFloat(
EDayZProfilesOptions option,
string profileOptionName,
float defaultValue = 0.0)
454 if (!m_DayZProfilesOptionsFloat.Contains(option))
458 g_Game.GetProfileString(profileOptionName, outValue);
459 float value = outValue.ToFloat();
462 SetProfileOptionFloat(option, value);
466 void ResetOptionsBool()
468 if (!m_DayZProfilesOptionsBool)
476 SetProfileOptionBool(e_opt, profileVal);
485 void ResetOptionsInt()
487 if (!m_DayZProfilesOptionsInt)
495 g_Game.GetProfileString(r_opt.param1, outValue);
496 int value = outValue.ToInt();
497 SetProfileOptionInt(e_opt, value);
501 void ResetOptionsFloat()
503 if (!m_DayZProfilesOptionsFloat)
511 g_Game.GetProfileString(r_opt.param1, outValue);
512 float value = outValue.ToFloat();
513 SetProfileOptionFloat(e_opt, value);
519 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
524 g_Game.SetProfileString(po.param1, value.ToString());
527 m_OnBoolOptionChanged.Invoke(po.param1, value);
533 SetProfileOption(option, value);
538 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
543 g_Game.SetProfileString(po.param1, value.ToString());
546 m_OnIntOptionChanged.Invoke(option, value);
552 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
557 g_Game.SetProfileString(po.param1, value.ToString());
560 m_OnFloatOptionChanged.Invoke(po.param1, value);
566 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
577 return GetProfileOption(option);
582 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
593 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
604 return GetProfileOptionDefaultBool(option);
609 if (m_DayZProfilesOptionsBool && m_DayZProfilesOptionsBool.Contains(option))
621 if (m_DayZProfilesOptionsInt && m_DayZProfilesOptionsInt.Contains(option))
633 if (m_DayZProfilesOptionsFloat && m_DayZProfilesOptionsFloat.Contains(option))
645 if (m_DayZProfilesOptions)
646 return m_DayZProfilesOptions;
654 private DayZGame m_Game;
685 MISSION_CONTROLLER_SELECT
713 m_WidgetRoot = game.GetLoadingWorkspace().CreateWidgets(
"gui/layouts/loading.layout");
732 m_WidgetRoot.FindAnyWidget(
"notification_root").Show(
false);
734 #ifdef PLATFORM_CONSOLE
736 #ifdef BUILD_EXPERIMENTAL
737 Widget expNotification =
m_WidgetRoot.FindAnyWidget(
"notification_root");
740 expNotification.Show(
true);
754 game.GetBacklit().LoadingAnim();
841 if (
m_DayZGame.GetUIManager().IsDialogVisible())
846 if (
m_DayZGame.GetMissionState() == DayZGame.MISSION_STATE_MAINMENU)
866 ProgressAsync.SetProgressData(pText);
867 ProgressAsync.SetUserData(lIcon);
891class DayZGame
extends CGame
902 private EConnectivityStatLevel m_ConnectivityStatsStates[STATS_COUNT];
904 private int m_MissionState;
916 private int m_LoginTime;
923 private ref DragQueue m_dragQueue;
926 private bool m_early_access_dialog_accepted;
929 private string m_MissionPath;
930 private string m_MissionFolderPath;
931 private bool m_IsCtrlHolding;
932 private bool m_IsWinHolding;
933 private bool m_IsLeftAltHolding;
934 private bool m_IsRightAltHolding;
936 private bool m_IsWorldWetTempUpdateEnabled =
true;
937 private bool m_IsFoodDecayEnabled =
true;
938 private float m_FoodDecayModifier;
940 static bool m_ReportModded;
941 private bool m_IsStressTest;
942 private bool m_AimLoggingEnabled;
943 int m_OriginalCharactersCount;
944 private string m_PlayerName;
945 private bool m_IsNewCharacter;
946 private bool m_IsConnecting;
947 private bool m_ConnectFromJoin;
948 private bool m_ShouldShowControllerDisconnect;
949 private bool m_CursorDesiredVisibilityScript =
true;
950 private int m_PreviousGamepad;
951 private float m_UserFOV;
953 private float m_DeltaTime;
955 float m_volume_sound;
956 float m_volume_speechEX;
957 float m_volume_music;
959 float m_volume_radio;
961 float m_PreviousEVValue;
964 #ifdef DIAG_DEVELOPER
975 private ref
array<int> m_ConnectedInputDeviceList;
982 private const int MIN_ARTY_SOUND_RANGE = 300;
987 static bool m_IsPreviewSpawn;
989 #ifdef DIAG_DEVELOPER
990 ref CameraToolsMenuServer m_CameraToolsMenuServer;
998#ifdef PLATFORM_CONSOLE
1003 m_keyboard_handler = null;
1006 m_early_access_dialog_accepted =
true;
1013 m_timerQueue[i] =
new TimerQueue();
1018 m_dragQueue =
new DragQueue;
1023 if (CommandlineGetParam(
"stresstest", tmp))
1025 m_IsStressTest =
true;
1028 if (CommandlineGetParam(
"doAimLogs", tmp))
1030 m_AimLoggingEnabled =
true;
1034 m_Backlit =
new Backlit();
1035 m_Backlit.OnInit(
this);
1037 m_ReportModded = GetModToBeReported();
1040 if (m_loading == null)
1047 m_loading.ShowEx(
this);
1055 CachedObjectsParams.Init();
1056 CachedObjectsArrays.Init();
1057 BleedChanceData.InitBleedChanceData();
1060 m_DayZProfileOptions =
new DayZProfilesOptions();
1065 string path =
"cfgVehicles";
1066 string child_name =
"";
1067 int count = ConfigGetChildrenCount(
path);
1069 for (
int p = 0; p < count; ++p)
1071 ConfigGetChildName(
path, p, child_name);
1073 if (ConfigGetInt(
path +
" " + child_name +
" scope") != 2)
1076 if (!
IsKindOf(child_name,
"SurvivorBase"))
1080 if (child_name ==
"SurvivorF_Keiko")
1084 m_CharClassNames.Insert(child_name);
1087 m_IsConnecting =
false;
1088 m_ConnectFromJoin =
false;
1092 private void ~DayZGame()
1094 PPEManagerStatic.DestroyManagerStatic();
1095 BleedChanceData.Cleanup();
1096 NotificationSystem.CleanupInstance();
1099 Print(
"~DayZGame()");
1105 GameOptions opt =
new GameOptions();
1108 GetInput().UpdateConnectedInputDeviceList();
1112 m_volume_sound = GetSoundScene().GetSoundVolume();
1113 m_volume_speechEX = GetSoundScene().GetSpeechExVolume();
1114 m_volume_music = GetSoundScene().GetMusicVolume();
1115 m_volume_VOIP = GetSoundScene().GetVOIPVolume();
1116 m_volume_radio = GetSoundScene().GetRadioVolume();
1118 PPEManagerStatic.GetPPEManager().Init();
1127 m_IsWorldWetTempUpdateEnabled = (GetCEApi().GetCEGlobalInt(
"WorldWetTempUpdate") == 1);
1129 m_FoodDecayModifier = GetCEApi().GetCEGlobalFloat(
"FoodDecay");
1132 if (m_FoodDecayModifier ==
float.
MIN)
1134 m_FoodDecayModifier = GetCEApi().GetCEGlobalInt(
"FoodDecay");
1139 ObjectSpawnerHandler.OnGameplayDataHandlerLoad();
1143 void RegisterProfilesOptions()
1164 void ResetProfileOptions()
1166 m_DayZProfileOptions.ResetOptionsBool();
1167 m_DayZProfileOptions.ResetOptionsInt();
1168 m_DayZProfileOptions.ResetOptionsFloat();
1172 void SetMissionPath(
string path)
1174 m_MissionPath =
path;
1179 while (pos_cur != -1)
1182 pos_cur =
path.IndexOfFrom(pos_cur + 1 ,
"\\");
1185 m_MissionFolderPath =
path.Substring(0, pos_end);
1188 string GetMissionPath()
1190 return m_MissionPath;
1193 string GetMissionFolderPath()
1195 return m_MissionFolderPath;
1198 override ScriptCallQueue GetCallQueue(
int call_category)
1200 return m_callQueue[call_category];
1203 override ScriptInvoker GetUpdateQueue(
int call_category)
1205 return m_updateQueue[call_category];
1208 override ScriptInvoker GetPostUpdateQueue(
int call_category)
1210 return m_postUpdateQueue[call_category];
1213 ScriptInvoker GetYieldDataInitInvoker()
1215 if (!m_YieldDataInitInvoker)
1216 m_YieldDataInitInvoker =
new ScriptInvoker();
1218 return m_YieldDataInitInvoker;
1221 override TimerQueue GetTimerQueue(
int call_category)
1232 void OnGameplayDataHandlerLoad()
1239 int GetMissionState()
1241 return m_MissionState;
1245 void SetMissionState(
int state)
1247 m_MissionState = state;
1253 return m_DayZProfileOptions.GetProfileOption(option);
1258 return GetProfileOption(option);
1263 return m_DayZProfileOptions.GetProfileOptionInt(option);
1268 return m_DayZProfileOptions.GetProfileOptionFloat(option);
1273 return m_DayZProfileOptions.GetProfileOptionDefaultBool(option);
1278 return GetProfileOptionDefault(option);
1283 return m_DayZProfileOptions.GetProfileOptionDefaultInt(option);
1288 return m_DayZProfileOptions.GetProfileOptionDefaultFloat(option);
1293 m_DayZProfileOptions.SetProfileOptionBool(option, value);
1298 SetProfileOption(option, value);
1303 m_DayZProfileOptions.SetProfileOptionInt(option, value);
1308 m_DayZProfileOptions.SetProfileOptionFloat(option, value);
1313 return m_DayZProfileOptions.GetProfileOptionMap();
1318 return m_IsStressTest;
1321 bool IsAimLogEnabled()
1323 return m_AimLoggingEnabled;
1326 void SetGameState(DayZGameState state)
1328 m_GameState = state;
1331 DayZGameState GetGameState()
1336 void SetLoadState(DayZLoadState state)
1338 m_LoadState = state;
1341 DayZLoadState GetLoadState()
1346 static bool ReportModded()
1348 return m_ReportModded;
1351 Backlit GetBacklit()
1369 void EarlyAccessDialog(UIScriptedMenu parent)
1371 if (!m_early_access_dialog_accepted)
1374 m_early_access_dialog_accepted =
true;
1380 override UIScriptedMenu CreateScriptedMenu(
int id)
1383 Mission
mission = GetMission();
1386 return mission.CreateScriptedMenu(
id);
1393 void ReloadMission()
1395 #ifdef ENABLE_LOGGING
1396 Print(
"Reloading mission module!");
1402 void CancelLoginQueue()
1406 if (m_LoginQueue.IsStatic())
1408 m_LoginQueue.Hide();
1409 delete m_LoginQueue;
1413 m_LoginQueue.Close();
1418 void CancelLoginTimeCountdown()
1422 if (m_LoginTimeScreen)
1424 if (m_LoginTimeScreen.IsStatic())
1426 m_LoginTimeScreen.Hide();
1427 delete m_LoginTimeScreen;
1431 m_LoginTimeScreen.Close();
1436 private void ClearConnectivityStates()
1438 for (
int i = 0; i < STATS_COUNT; i++)
1439 m_ConnectivityStatsStates[i] = 0;
1450 switch (eventTypeId)
1463 ClearConnectivityStates();
1465 m_FirstConnect =
true;
1466 ClientData.ResetClientData();
1472 CancelLoginTimeCountdown();
1474 SetGameState(DayZGameState.MAIN_MENU);
1475 m_FirstConnect =
true;
1476 #ifdef PLATFORM_CONSOLE
1479 OnlineServices.LeaveGameplaySession();
1480 OnlineServices.ClearCurrentServerInfo();
1481 if (GetGameState() == DayZGameState.IN_GAME)
1483 SetLoadState(DayZLoadState.MAIN_MENU_START);
1486 m_Notifications.ClearVoiceNotifications();
1490 StatsEventDisconnectedData discData =
new StatsEventDisconnectedData();
1491 discData.m_CharacterId =
g_Game.GetDatabaseID();
1492 discData.m_Reason =
"quit";
1493 Analytics.PlayerDisconnected(discData);
1501 ProgressAsync.DestroyAllPendingProgresses();
1503 if (GetGameState() == DayZGameState.CONNECTING)
1505 SetGameState(DayZGameState.MAIN_MENU);
1513 ProgressAsync.DestroyAllPendingProgresses();
1515 SetGameState(DayZGameState.IN_GAME);
1519 StatsEventSpawnedData spawnData =
new StatsEventSpawnedData();
1520 spawnData.m_CharacterId =
g_Game.GetDatabaseID();
1521 spawnData.m_Lifetime = 0;
1522 spawnData.m_Position = vector.Zero;
1525 spawnData.m_Position =
GetPlayer().GetPosition();
1527 spawnData.m_DaytimeHour = 0;
1528 spawnData.m_Population = 0;
1529 Analytics.PlayerSpawned(spawnData);
1531 #ifdef PLATFORM_CONSOLE
1532 m_Notifications.ClearVoiceNotifications();
1533 OnlineServices.SetMultiplayState(
true);
1537 m_FirstConnect =
false;
1538 if (GetHostAddress(address, port))
1543 #ifdef PLATFORM_CONSOLE
1544 #ifndef PLATFORM_WINDOWS
1547 OnlineServices.EnterGameplaySession();
1548 OnlineServices.LoadVoicePrivilege();
1561 if (Class.CastTo(conLost_params, params))
1563 int duration = conLost_params.param1;
1581 if (Class.CastTo(chat_params, params))
1590 if (Class.CastTo(prog_params, params))
1597 if (Class.CastTo(loginTimeParams, params))
1606 if (Class.CastTo(respawnParams, params))
1615 if (Class.CastTo(preloadParams, params))
1624 if (Class.CastTo(logoutParams, params))
1626 GetCallQueue(
CALL_CATEGORY_GUI).Call(GetMission().StartLogoutMenu, logoutParams.param1);
1632 OnlineServices.Init();
1638 Class.CastTo(loginStatusParams, params);
1640 string msg1 = loginStatusParams.param1;
1641 string msg2 = loginStatusParams.param2;
1645 if (m_LoginTimeScreen)
1649 if (msg2.Length() > 0)
1650 finalMsg +=
"\n" + msg2;
1652 m_LoginTimeScreen.SetStatus(finalMsg);
1657 finalMsg = msg1 +
" " + msg2;
1658 m_loading.SetStatus(finalMsg);
1664 g_Game.SetGameState(DayZGameState.CONNECTING);
1670 g_Game.SetGameState(DayZGameState.MAIN_MENU);
1672 if (m_ConnectFromJoin)
1674 m_ConnectFromJoin =
false;
1682 if (Class.CastTo(dlcParams, params))
1684 Print(
"### DLC Ownership failed !!! Map: " + dlcParams.param1);
1691 if (Class.CastTo(connectivityStatsParams, params))
1693 PlayerIdentity playerIdentity = connectivityStatsParams.param1;
1695 int pingAvg = playerIdentity.GetPingAvg();
1696 if (pingAvg < GetWorld().GetPingWarningThreshold())
1700 else if (pingAvg < GetWorld().GetPingCriticalThreshold())
1714 if (Class.CastTo(serverFpsStatsParams, params))
1716 #ifdef DIAG_DEVELOPER
1717 m_ServerFpsStatsParams = serverFpsStatsParams;
1719 float fps = serverFpsStatsParams.param1;
1720 if (fps > GetWorld().GetServerFpsWarningThreshold())
1724 else if (fps > GetWorld().GetServerFpsCriticalThreshold())
1737 VONManager.GetInstance().OnEvent(eventTypeId, params);
1739 Mission
mission = GetMission();
1742 mission.OnEvent(eventTypeId, params);
1745 ErrorModuleHandler emh = ErrorModuleHandler.GetInstance();
1747 emh.OnEvent(eventTypeId, params);
1752 if (level != m_ConnectivityStatsStates[type])
1756 m_ConnectivityStatsStates[type] = level;
1769 hud.SetConnectivityStatIcon(type, newLevel);
1773 #ifdef DIAG_DEVELOPER
1774 private void DrawPerformanceStats(
float pingAct,
float pingAvg,
float throttleInput,
float throttleOutput)
1776 DbgUI.Begin(
"Performance Stats", 720, 10);
1777 DbgUI.Text(
"pingAct:" + pingAct );
1779 if ( pingAvg >= GetWorld().GetPingCriticalThreshold())
1781 else if ( pingAvg >= GetWorld().GetPingWarningThreshold())
1784 DbgUI.ColoredText(color,
"pingAvg:" + pingAvg);
1785 DbgUI.Text(
"Ping Warning Threshold:" + GetWorld().GetPingWarningThreshold());
1786 DbgUI.Text(
"Ping Critical Threshold:" + GetWorld().GetPingCriticalThreshold());
1787 DbgUI.PlotLive(
"pingAvg history:", 300, 125, pingAvg, 100, 100 );
1788 DbgUI.Text(
"Server Fps Warning Threshold:" + GetWorld().GetServerFpsWarningThreshold());
1789 DbgUI.Text(
"Server Fps Critical Threshold:" + GetWorld().GetServerFpsCriticalThreshold());
1790 if (m_ServerFpsStatsParams)
1793 if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsCriticalThreshold())
1795 else if ( m_ServerFpsStatsParams.param1 <= GetWorld().GetServerFpsWarningThreshold())
1798 DbgUI.ColoredText(color,
"serverFPS:" + m_ServerFpsStatsParams.param1.ToString() );
1799 DbgUI.PlotLive(
"serverFPS history:", 300, 125, m_ServerFpsStatsParams.param1, 100, 100 );
1802 DbgUI.ColoredText(
COLOR_WHITE,
"serverFrameTime:" + m_ServerFpsStatsParams.param2.ToString() );
1803 DbgUI.PlotLive(
"serverFrameTime history:", 300, 75, m_ServerFpsStatsParams.param2, 100, 100 );
1806 if (m_ServerFpsStatsParams.param3 > 0)
1809 DbgUI.ColoredText(color,
"physStepsSkippedServer:" + m_ServerFpsStatsParams.param3.ToString() );
1810 DbgUI.PlotLive(
"physStepsSkippedServer history:", 300, 75, m_ServerFpsStatsParams.param3, 100, 100 );
1813 if (m_ServerFpsStatsParams.param4 > 0)
1815 DbgUI.ColoredText(color,
"physStepsSkippedClient:" + m_ServerFpsStatsParams.param4.ToString() );
1816 DbgUI.PlotLive(
"physStepsSkippedClient history:", 300, 75, m_ServerFpsStatsParams.param4, 100, 100 );
1819 DbgUI.Text(
"throttleInput:" + throttleInput);
1820 DbgUI.PlotLive(
"throttleInput history:", 300, 75, throttleInput, 100, 50 );
1821 DbgUI.Text(
"throttleOutput:" + throttleOutput);
1822 DbgUI.PlotLive(
"throttleOutput history:", 300, 75, throttleOutput, 100, 50 );
1829 m_Notifications.AddVoiceNotification(vonStartParams.param2, vonStartParams.param1);
1840 int pos = GetUIManager().GetLoginQueuePosition();
1843 if (!m_LoginQueue && pos > 0)
1845 GetUIManager().CloseAll();
1854 m_LoginQueue =
new LoginQueueStatic();
1855 GetUIManager().ShowScriptedMenu(m_LoginQueue, null);
1860 m_LoginQueue.SetPosition(pos);
1863 LoginQueueStatic loginQueue;
1866 loginQueue.Update(timeslice);
1880 m_LoginTime = loginTime;
1883 if (m_LoginTime > 0)
1885 if (!m_LoginTimeScreen)
1887 GetUIManager().CloseAll();
1896 m_LoginTimeScreen =
new LoginTimeStatic();
1897 GetUIManager().ShowScriptedMenu(m_LoginTimeScreen, null);
1901 m_LoginTimeScreen.SetTime(m_LoginTime);
1902 m_LoginTimeScreen.Show();
1912 if (m_LoginTime > 0)
1914 if (m_LoginTimeScreen)
1915 m_LoginTimeScreen.SetTime(m_LoginTime);
1922 CancelLoginTimeCountdown();
1933 if (!m_LoginTimeScreen)
1935 GetUIManager().CloseAll();
1941 m_LoginTimeScreen.SetRespawn(
true);
1942 m_LoginTimeScreen.SetTime(m_LoginTime);
1943 m_LoginTimeScreen.Show();
1951 PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Start(
new Param1<float>(1.0));
1958 if (m_LoginTimeScreen && !m_LoginTimeScreen.IsRespawn())
1959 CancelLoginTimeCountdown();
1973 StoreLoginData(ctx.GetWriteContext());
1998 if (duration < 0 && GetGameState() == DayZGameState.IN_GAME)
2013 switch (progressState)
2019 GetUIManager().ScreenFadeOut(0);
2074 RegisterProfilesOptions();
2079 GetProfileStringList(
"SB_Visited",
m_Visited);
2081 if (GetLoadState() == DayZLoadState.UNDEFINED)
2088 #ifndef PLATFORM_PS4
2147 if (GetUIManager().GetMenu())
2149 GetUIManager().GetMenu().Refresh();
2156 m_IntroMenu = GetWorkspace().CreateWidgets(
"gui/layouts/xbox/day_z_title_screen.layout");
2158 m_IntroMenu.FindAnyWidget(
"notification_root").Show(
false);
2161 string text = Widget.TranslateString(
"#console_start_game");
2162 #ifdef PLATFORM_XBOX
2164 if (user_manager && user_manager.GetSelectedUser())
2165 text_widget.SetText(
string.Format(text,
"<image set=\"xbox_buttons\" name=\"A\" />"));
2167 text_widget.SetText(
string.Format(text,
"<image set=\"xbox_buttons\" name=\"A\" />"));
2171 string confirm =
"cross";
2180 text_widget.SetText(
string.Format(text,
"<image set=\"playstation_buttons\" name=\"" + confirm +
"\" />"));
2184 #ifdef PLATFORM_CONSOLE
2185 #ifdef PLATFORM_XBOX
2186 #ifdef BUILD_EXPERIMENTAL
2187 m_IntroMenu.FindAnyWidget(
"notification_root").Show(
true);
2203 return m_ShouldShowControllerDisconnect;
2208 #ifdef PLATFORM_CONSOLE
2212 m_ShouldShowControllerDisconnect = !GetInput().AreAllAllowedInputDevicesActive();
2213 if (m_ShouldShowControllerDisconnect)
2224 SetGameState(DayZGameState.JOIN);
2225 SetLoadState(DayZLoadState.JOIN_START);
2227 #ifdef PLATFORM_CONSOLE
2232 user_manager.ParseJoinAsync(join_param);
2240 if (user_manager.GetTitleInitiator())
2242 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2245 SetGameState(DayZGameState.CONNECT);
2246 SetLoadState(DayZLoadState.CONNECT_START);
2248 #ifndef PLATFORM_WINDOWS
2249 #ifdef PLATFORM_CONSOLE
2260 SetGameState(DayZGameState.PARTY);
2261 SetLoadState(DayZLoadState.PARTY_START);
2267 user_manager.ParsePartyAsync(param);
2274#ifdef PLATFORM_WINDOWS
2278 if (user_manager.GetTitleInitiator())
2280 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2285 SetGameState(DayZGameState.MAIN_MENU);
2286 SetLoadState(DayZLoadState.MAIN_MENU_START);
2296 if (user_manager.GetTitleInitiator())
2298 user_manager.SelectUserEx(user_manager.GetTitleInitiator());
2302 SetGameState(DayZGameState.IN_GAME);
2303 SetLoadState(DayZLoadState.MISSION_START);
2305 #ifndef PLATFORM_WINDOWS
2306 #ifdef PLATFORM_CONSOLE
2323 AutoTestFixture.LogRPT(
"Failed to load autotest configuration, continue with mission load.");
2346 GetInput().GetGamepadUser(gamepad, selected_user);
2351 if (user_manager.SelectUserEx(selected_user))
2354 GetInput().SelectActiveGamepad(gamepad);
2358 selected_user = user_manager.GetSelectedUser();
2362 if (!selected_user.IsOnline())
2364 user_manager.LogOnUserAsync(selected_user);
2372 GetInput().ResetActiveGamepad();
2379 selected_user = user_manager.GetSelectedUser();
2383 user_manager.PickUserAsync();
2387 user_manager.SelectUserEx(selected_user);
2389 switch (GetLoadState())
2391 case DayZLoadState.JOIN_START:
2393 SetLoadState(DayZLoadState.JOIN_USER_SELECT);
2396 case DayZLoadState.PARTY_START:
2398 SetLoadState(DayZLoadState.PARTY_USER_SELECT);
2401 case DayZLoadState.MAIN_MENU_START:
2403 SetLoadState(DayZLoadState.MAIN_MENU_USER_SELECT);
2406 case DayZLoadState.CONNECT_START:
2408 SetLoadState(DayZLoadState.CONNECT_USER_SELECT);
2411 case DayZLoadState.MISSION_START:
2413 SetLoadState(DayZLoadState.MISSION_USER_SELECT);
2421 g_Game.SetHudBrightness(
g_Game.GetHUDBrightnessSetting());
2427 m_PreviousGamepad = gamepad;
2432 return m_PreviousGamepad;
2437#ifdef PLATFORM_MSSTORE
2446 if (GetInput().IsActiveGamepadSelected())
2455 #ifdef PLATFORM_CONSOLE
2456 #ifndef PLATFORM_WINDOWS
2460 int gamepad = GetInput().GetUserGamepad(
GetUserManager().GetSelectedUser());
2469 g_Game.GetInput().IdentifyGamepad(
g_Game.GetInput().GetEnterButton());
2477 GetInput().IdentifyGamepad(GetInput().GetEnterButton());
2487 ResetProfileOptions();
2492 BiosUser selected_user = user_manager.GetSelectedUser();
2496 SetPlayerName(selected_user.GetName());
2498 #ifdef PLATFORM_CONSOLE
2500 user_manager.GetUserDatabaseIdAsync();
2504 if (GetUIManager().GetMenu())
2506 GetUIManager().GetMenu().Refresh();
2510 switch (GetLoadState())
2512 case DayZLoadState.JOIN_USER_SELECT:
2514 SetLoadState(DayZLoadState.JOIN_CONTROLLER_SELECT);
2518 case DayZLoadState.PARTY_USER_SELECT:
2520 SetLoadState(DayZLoadState.PARTY_CONTROLLER_SELECT);
2525 case DayZLoadState.CONNECT_USER_SELECT:
2527 SetLoadState(DayZLoadState.CONNECT_CONTROLLER_SELECT);
2531 case DayZLoadState.MAIN_MENU_USER_SELECT:
2533 SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2535 GetUIManager().EnterScriptedMenu(
MENU_MAIN, GetUIManager().GetMenu());
2538 case DayZLoadState.MISSION_USER_SELECT:
2540 SetLoadState(DayZLoadState.MISSION_CONTROLLER_SELECT);
2552 if (GetLoadState() == DayZLoadState.JOIN_CONTROLLER_SELECT)
2554 SetGameState(DayZGameState.CONNECTING);
2559 if (GetGameState() != DayZGameState.CONNECTING)
2561 switch (GetLoadState())
2563 case DayZLoadState.CONNECT_CONTROLLER_SELECT:
2565 SetGameState(DayZGameState.CONNECTING);
2569 case DayZLoadState.PARTY_CONTROLLER_SELECT:
2571 SetGameState(DayZGameState.CONNECTING);
2575 case DayZLoadState.MAIN_MENU_CONTROLLER_SELECT:
2577 SetGameState(DayZGameState.CONNECTING);
2587 if (GetHostAddress(address, port))
2596 DisconnectSessionForce();
2612 uid.Split(
":", output);
2614 port = output[1].ToInt();
2623 string uid = ip +
":" + port;
2643 SetProfileStringList(
"SB_Visited",
m_Visited);
2650 string uid = ip +
":" + port;
2652 return (index >= 0);
2659 if (GetHostAddress(addr, port))
2674 if (GetHostAddress(addr, port))
2692 if (displayJoinError)
2723 g_Game.GetUIManager().CloseAllSubmenus();
2725 if (
g_Game.GetUIManager().IsDialogVisible() )
2727 g_Game.GetUIManager().CloseDialog();
2733 DisconnectSessionForce();
2738 if (
g_Game.GetGameState() != DayZGameState.MAIN_MENU)
2745 g_Game.GetMission().AbortMission();
2747 SetGameState(DayZGameState.MAIN_MENU);
2748 SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
2765 m_ConnectFromJoin =
false;
2779 m_ConnectFromJoin =
true;
2793 m_ConnectFromJoin =
false;
2800 return m_IsCtrlHolding;
2806#ifdef DIAG_DEVELOPER
2850 if (key ==
KeyCode.KC_LCONTROL)
2852 m_IsCtrlHolding =
true;
2857 m_IsLeftAltHolding =
true;
2862 m_IsRightAltHolding =
true;
2865 if (m_keyboard_handler)
2867 m_keyboard_handler.OnKeyDown(NULL, 0, 0, key);
2877 if ((m_IsLeftAltHolding || m_IsLeftAltHolding) && key ==
KeyCode.KC_F4)
2888 if (key ==
KeyCode.KC_LCONTROL)
2890 m_IsCtrlHolding =
false;
2895 m_IsWinHolding =
false;
2900 m_IsLeftAltHolding =
false;
2905 m_IsRightAltHolding =
false;
2908 if (m_keyboard_handler)
2910 m_keyboard_handler.OnKeyUp(NULL, 0, 0, key);
2926 mission.OnMouseButtonPress(button);
2936 mission.OnMouseButtonRelease(button);
2943 m_IsCtrlHolding =
false;
2944 m_IsWinHolding =
false;
2945 m_IsLeftAltHolding =
false;
2946 m_IsRightAltHolding =
false;
2958 m_DeltaTime = timeslice;
2961 bool gameIsRunning =
false;
2966 gameIsRunning =
true;
2994 else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
2996 m_LoginTimeScreen.Update(timeslice);
3013 #ifdef DIAG_DEVELOPER
3020 int pingAct = playerIdentity.GetPingAct();
3021 int pingAvg = playerIdentity.GetPingAvg();
3023 float throttleInput = playerIdentity.GetInputThrottle();
3024 float throttleOutput = playerIdentity.GetOutputThrottle();
3026 DrawPerformanceStats(pingAct, pingAvg, throttleInput, throttleOutput);
3046 bool gameIsRunning =
false;
3050 gameIsRunning =
true;
3059 else if (m_LoginTimeScreen && m_LoginTimeScreen.IsStatic())
3079 hud.Update(timeslice);
3088 super.OnRPC(sender, target, rpc_type, ctx);
3089 Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
3096 target.OnRPC(sender, rpc_type, ctx);
3104 case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
3109 case ERPCs.RPC_UNDERGROUND_SYNC:
3114 case ERPCs.RPC_PLAYERRESTRICTEDAREAS_SYNC:
3119 case ERPCs.RPC_SEND_NOTIFICATION:
3126 ctx.Read(show_time);
3127 ctx.Read(detail_text);
3132 case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
3134 float show_time_ext;
3135 string title_text_ext;
3136 string detail_text_ext;
3139 ctx.Read(show_time_ext);
3140 ctx.Read(title_text_ext);
3141 ctx.Read(detail_text_ext);
3149 case ERPCs.RPC_SOUND_HELICRASH:
3157 if (ctx.Read(playCrashSound))
3159 playSound = playCrashSound.param1;
3160 pos = playCrashSound.param2;
3161 sound_set =
CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
3173 case ERPCs.RPC_SOUND_ARTILLERY:
3176 Param1<vector> playArtySound =
new Param1<vector>(
vector.Zero);
3177 if (ctx.Read(playArtySound))
3179 position = playArtySound.param1;
3180 if (position ==
vector.Zero)
3189 if (
vector.DistanceSq(
g_Game.GetPlayer().GetPosition(), position) <= (MIN_ARTY_SOUND_RANGE * MIN_ARTY_SOUND_RANGE))
3197 case ERPCs.RPC_SOUND_CONTAMINATION:
3201 Param1<vector> playContaminatedSound =
new Param1<vector>(
vector.Zero);
3202 if (ctx.Read(playContaminatedSound))
3204 soundPos = playContaminatedSound.param1;
3205 if (soundPos ==
vector.Zero)
3218 float distance_to_player =
vector.DistanceSq(soundPos,
g_Game.GetPlayer().GetPosition());
3219 if (distance_to_player <=
GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3221 float strength_factor =
Math.InverseLerp(
GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0,
Math.Sqrt(distance_to_player));
3224 camera.SpawnCameraShake(strength_factor * 4);
3231 case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3238 if (ctx.Read(playArtyShotSound))
3240 soundPosition = playArtyShotSound.param1;
3241 delayedSoundPos = playArtyShotSound.param2;
3242 soundDelay = playArtyShotSound.param3;
3243 if (soundPosition ==
vector.Zero)
3262 case ERPCs.RPC_SET_BILLBOARDS:
3267 Param1<int> indexP =
new Param1<int>(-1);
3268 if (ctx.Read(indexP))
3270 int index = indexP.param1;
3278 case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3281 if (ctx.Read(mute_list))
3283 for (
int i = 0; i < mute_list.Count(); i++)
3285 string uid = mute_list.GetKey(i);
3286 bool mute = mute_list.GetElement(i);
3287 MutePlayer(uid, sender.GetPlainId(), mute);
3305 case ERPCs.DEV_SET_WEATHER:
3307 Param1<DebugWeatherRPCData> p1data =
new Param1<DebugWeatherRPCData>(null);
3309 if ( ctx.Read(p1data) )
3313 if (data.m_FogValue >= 0)
3314 g_Game.GetWeather().GetFog().Set(data.m_FogValue, data.m_FogInterpolation, data.m_FogDuration);
3316 if (data.m_OvercastValue >= 0)
3317 g_Game.GetWeather().GetOvercast().Set(data.m_OvercastValue, data.m_OvercastInterpolation, data.m_OvercastDuration);
3319 if (data.m_RainValue >= 0)
3320 g_Game.GetWeather().GetRain().Set(data.m_RainValue, data.m_RainInterpolation, data.m_RainDuration);
3322 if (data.m_SnowfallValue >= 0)
3323 g_Game.GetWeather().GetSnowfall().Set(data.m_SnowfallValue, data.m_SnowfallInterpolation, data.m_SnowfallDuration);
3325 if (data.m_VolFogDistanceDensity >= 0)
3326 g_Game.GetWeather().SetDynVolFogDistanceDensity(data.m_VolFogDistanceDensity, data.m_VolFogDistanceDensityTime);
3328 if (data.m_VolFogHeightDensity >= 0)
3329 g_Game.GetWeather().SetDynVolFogHeightDensity(data.m_VolFogHeightDensity, data.m_VolFogHeightDensityTime);
3331 if (data.m_VolFogHeightBias >= -500)
3332 g_Game.GetWeather().SetDynVolFogHeightBias(data.m_VolFogHeightBias, data.m_VolFogHeightBiasTime);
3334 if (data.m_WindMagnitudeValue >= 0)
3335 g_Game.GetWeather().GetWindMagnitude().Set(data.m_WindMagnitudeValue, data.m_WindDInterpolation, data.m_WindDDuration);
3337 if (data.m_WindDirectionValue >= -3.14)
3338 g_Game.GetWeather().GetWindDirection().Set(data.m_WindDirectionValue, data.m_WindDInterpolation, data.m_WindDDuration);
3342 ErrorEx(
"Failed to read weather debug data");
3349 #ifdef DIAG_DEVELOPER
3351 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3353 if (!m_CameraToolsMenuServer)
3355 m_CameraToolsMenuServer =
new CameraToolsMenuServer;
3357 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3361 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3363 if (!m_CameraToolsMenuServer)
3365 m_CameraToolsMenuServer =
new CameraToolsMenuServer;
3367 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3393 GetUIManager().ShowQueuedDialog();
3401 m_IsConnecting = value;
3406 return m_IsConnecting;
3418 m_keyboard_handler = handler;
3436 #ifdef PLATFORM_CONSOLE
3451 if (m_CharClassNames.Count() > 0)
3452 return m_CharClassNames[0];
3460 return m_CharClassNames.GetRandomElement();
3466 return m_CharClassNames;
3472 vector pos = hitInfo.GetPosition();
3473 string ammoType = hitInfo.GetAmmoType();
3476 ExplosionEffects(source, directHit, componentIndex, hitInfo.GetSurface(), pos, hitInfo.GetSurfaceNormal(), energyFactor, explosionFactor, hitInfo.IsWater(), ammoType);
3482 m_NoiseParams.LoadFromPath(
string.Format(
"cfgAmmo %1 NoiseExplosion", ammoType));
3484 float multiplier = hitInfo.GetSurfaceNoiseMultiplier();
3485 if (multiplier == 0)
3488 GetNoiseSystem().AddNoiseTarget(pos, 21, m_NoiseParams, multiplier *
g_Game.GetWeather().GetNoiseReductionByWeather());
3494 float energyFactor,
float explosionFactor,
bool isWater,
string ammoType)
3499 if (
g_Game.GetPlayer() == null)
3501 source.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
3503 if (source.ShootsExplosiveAmmo() )
3505 int particleID =
AmmoTypesAPI.GetExplosionParticleID(ammoType, surface);
3506 if (particleID > -1)
3513 float distance_to_player =
vector.Distance(pos,
g_Game.GetPlayer().GetPosition());
3514 m_AmmoShakeParams.Load(ammoType);
3516 if (distance_to_player < m_AmmoShakeParams.m_Radius)
3518 float dist01 =
Math.InverseLerp(0, m_AmmoShakeParams.m_Radius, distance_to_player);
3519 float modifier =
Math.Lerp(m_AmmoShakeParams.m_ModifierClose, m_AmmoShakeParams.m_ModifierFar,dist01);
3521 g_Game.GetPlayer().GetCurrentCamera().SpawnCameraShake(modifier * m_AmmoShakeParams.m_Strength);
3532 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3534 if (simulation ==
"shotArrow")
3538 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3541 arrow.PlaceOnSurface();
3542 arrow.SetFromProjectile(info);
3553 if (info.GetIsWater())
3556 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3557 if (simulation ==
"shotArrow")
3560 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3561 vector pos = info.GetPos();
3562 vector dir = -info.GetInVelocity();
3568 arrow.SetDirection(dir);
3569 arrow.SetFromProjectile(info);
3578 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" simulation", simulation);
3579 if (simulation ==
"shotArrow")
3582 g_Game.ConfigGetText(
"cfgAmmo " + info.GetAmmoType() +
" spawnPileType", pile);
3588 EntityAI parent = ent.GetHierarchyParent();
3589 if (parent && parent.IsPlayer())
3592 arrow.PlaceOnSurface();
3593 arrow.SetFromProjectile(info);
3599 vector pos = info.GetPos();
3600 vector dir = -info.GetInVelocity();
3606 arrow.SetDirection(dir);
3607 arrow.SetFromProjectile(info);
3609 info.GetHitObj().AddArrow(arrow, info.GetComponentIndex(), info.GetHitObjPos(), info.GetHitObjRot());
3615 vector exitPos,
vector inSpeed,
vector outSpeed,
bool isWater,
bool deflected,
string ammoType)
3618 ImpactEffectsData impactEffectsData =
new ImpactEffectsData();
3619 impactEffectsData.m_DirectHit = directHit;
3620 impactEffectsData.m_ComponentIndex = componentIndex;
3621 impactEffectsData.m_Surface = surface;
3622 impactEffectsData.m_Position = pos;
3623 impactEffectsData.m_ImpactType =
ImpactTypes.UNKNOWN;
3624 impactEffectsData.m_SurfaceNormal = surfNormal;
3625 impactEffectsData.m_ExitPosition = exitPos;
3626 impactEffectsData.m_InSpeed = inSpeed;
3627 impactEffectsData.m_OutSpeed = outSpeed;
3628 impactEffectsData.m_IsDeflected = deflected;
3629 impactEffectsData.m_AmmoType = ammoType;
3630 impactEffectsData.m_IsWater = isWater;
3634 directHit.OnReceivedHit(impactEffectsData);
3643 if (source && source.ShootsExplosiveAmmo() && !deflected && outSpeed ==
vector.Zero)
3645 if (ammoType ==
"Bullet_40mm_ChemGas")
3647 g_Game.CreateObject(
"ContaminatedArea_Local", pos);
3649 else if (ammoType ==
"Bullet_40mm_Explosive")
3651 DamageSystem.ExplosionDamage(
EntityAI.Cast(source), null,
"Explosion_40mm_Ammo", pos,
DamageType.EXPLOSION);
3656 m_NoiseParams.LoadFromPath(
"cfgAmmo " + ammoType +
" NoiseHit");
3659 float coefAdjusted = surfaceCoef * inSpeed.Length() / ConfigGetFloat(
"cfgAmmo " + ammoType +
" initSpeed");
3660 if (coefAdjusted == 0)
3663 GetNoiseSystem().AddNoiseTarget(pos, 10, m_NoiseParams, coefAdjusted *
g_Game.GetWeather().GetNoiseReductionByWeather());
3669 bool isWater,
string ammoType)
3672 ImpactEffectsData impactEffectsData =
new ImpactEffectsData();
3673 impactEffectsData.m_DirectHit = directHit;
3674 impactEffectsData.m_ComponentIndex = componentIndex;
3675 impactEffectsData.m_Surface = surface;
3676 impactEffectsData.m_Position = pos;
3677 impactEffectsData.m_ImpactType =
ImpactTypes.MELEE;
3678 impactEffectsData.m_SurfaceNormal =
Vector(
Math.RandomFloat(-1,1),
Math.RandomFloat(-1,1),
Math.RandomFloat(-1,1));
3679 impactEffectsData.m_ExitPosition =
"0 0 0";
3680 impactEffectsData.m_InSpeed =
"0 0 0";
3681 impactEffectsData.m_OutSpeed =
"0 0 0";
3682 impactEffectsData.m_IsDeflected =
false;
3683 impactEffectsData.m_AmmoType = ammoType;
3684 impactEffectsData.m_IsWater = isWater;
3687 directHit.OnReceivedHit(impactEffectsData);
3695 m_NoiseParams.LoadFromPath(
"cfgAmmo " + ammoType +
" NoiseHit");
3698 if (surfaceCoef == 0)
3701 GetNoiseSystem().AddNoisePos(
EntityAI.Cast(source), pos, m_NoiseParams, surfaceCoef *
g_Game.GetWeather().GetNoiseReductionByWeather());
3707 GetMission().UpdateVoiceLevelWidgets(level);
3712 m_OriginalCharactersCount = menudata_count;
3717 m_PlayerName =
name;
3722 return m_PlayerName;
3727 m_IsNewCharacter = state;
3732 return m_IsNewCharacter;
3737 if (pFov < OPTIONS_FIELD_OF_VIEW_MIN)
3738 pFov = OPTIONS_FIELD_OF_VIEW_MIN;
3740 if (pFov > OPTIONS_FIELD_OF_VIEW_MAX)
3741 pFov = OPTIONS_FIELD_OF_VIEW_MAX;
3754 NumericOptionsAccess noa;
3755 if (gameOptions &&
Class.CastTo(noa,gameOptions.GetOptionByType(
OptionAccessType.AT_OPTIONS_FIELD_OF_VIEW)))
3757 return noa.ReadValue();
3780 Widget.SetLV(value);
3781 Widget.SetTextLV(value);
3794 string cfg_path =
"CfgWeapons " + weaponInHand.GetType() +
" chamberableFrom";
3795 g_Game.ConfigGetTextArray(cfg_path, ammo_names);
3797 foreach (
string ammo_name : ammo_names)
3799 if (ammo.GetType() == ammo_name)
3811 m_PreviousEVValue = m_EVValue;
3823 return m_PreviousEVValue;
3828 ListOptionsAccess language_option;
3830 language_option = ListOptionsAccess.Cast(options.GetOptionByType(
OptionAccessType.AT_OPTIONS_LANGUAGE));
3832 if (language_option)
3834 idx = language_option.GetIndex();
3842 return m_IsWorldWetTempUpdateEnabled;
3852 #ifdef DIAG_DEVELOPER
3854 if (FeatureTimeAccel.GetFeatureTimeAccelEnabled(ETimeAccelCategories.FOOD_DECAY))
3856 return m_FoodDecayModifier * FeatureTimeAccel.GetFeatureTimeAccelValue();
3859 return m_FoodDecayModifier;
3864 if (!m_ConnectedInputDeviceList)
3868 return m_ConnectedInputDeviceList;
3873 m_CursorDesiredVisibilityScript = visible;
3880 return m_CursorDesiredVisibilityScript;
3887#ifdef PLATFORM_CONSOLE
3890 return GetInput().IsMouseConnected();
3895#ifdef PLATFORM_CONSOLE
3905#ifdef FEATURE_CURSOR
3908 ShowCursorWidget(
true);
3919 ui.ShowCursor(showCursor);
3924 ShowCursorWidget(showCursor);
const int ECE_DYNAMIC_PERSISTENCY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void SetConnecting(bool value)
Returns true when connecting to server.
void DisconnectSessionScript(bool displayJoinError=false)
override TStringArray ListAvailableCharacters()
override void OnUpdate(bool doSim, float timeslice)
void UpdateVoiceLevel(int level)
override void OnActivateMessage()
void AddVisitedServer(string ip, int port)
override void OnDeactivateMessage()
void UpdateLoginQueue(float timeslice)
override string CreateRandomPlayer()
void OnProjectileStoppedInTerrain(TerrainCollisionInfo info)
DayZGameState m_GameState
void SetPreviousGamepad(int gamepad)
float GetFoodDecayModifier()
void ConnectFromServerBrowserEx(string ip, int port, int steamQueryPort, string password="")
void StoreLoginDataPrepare()
void DelayedMidAirDetonation(float x, float y, float z)
override void OnPostUpdate(bool doSim, float timeslice)
int GetCurrentDisplayLanguageIdx()
array< int > GetConnectedInputDeviceList()
override void OnDeviceReset()
override void OnAfterCreate()
proto native bool IsMultiplayer()
void SetPlayerGameName(string name)
string GetPlayerGameName()
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
void OnProjectileStopped(ProjectileStoppedInfo info)
void ExplosionEffectsEx(Object source, Object directHit, int componentIndex, float energyFactor, float explosionFactor, HitInfo hitInfo)
bool OnConnectivityStatChange(EConnectivityStatType type, EConnectivityStatLevel newLevel, EConnectivityStatLevel oldLevel)
void SetMouseCursorDesiredVisibility(bool visible)
void LoadingHide(bool force=false)
bool GetMouseCursorDesiredVisibility()
proto native BiosUserManager GetUserManager()
void OnLoginTimeEvent(int loginTime)
override void OnKeyPress(int key)
void OnMPConnectionLostEvent(int duration)
void CreateGamepadDisconnectMenu()
bool CanDisplayMouseCursor()
extend as needed, only game focus and M&K setting (consoles only!) are checked natively
void SetKeyboardHandle(UIScriptedMenu handler)
void OnRespawnEvent(int time)
float GetPreviousEVValue()
void LoginTimeCountdown()
proto native void SetMainMenuWorld(string world)
void AutoTestLaunch(string param)
ref BillboardSetHandler m_BillboardSetHandler
void OnPreloadEvent(vector pos)
proto native bool IsServer()
void EnterLoginTime(UIMenuPanel parent)
void RemoveVoiceNotification(VONStopSpeakingEventParams vonStopParams)
const int MISSION_STATE_GAME
ref TStringArray m_Visited
float GetCurrentEVValue()
static float GetUserFOVFromConfig()
override string CreateDefaultPlayer()
void EnterLoginQueue(UIMenuPanel parent)
void SetNewCharacter(bool state)
void RefreshCurrentServerInfo()
override void OnKeyRelease(int key)
static bool CheckAmmoCompability(EntityAI weaponInHand, EntityAI ammo)
bool ShouldShowControllerDisconnect()
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)
float GetFOVByZoomType(ECameraZoomType type)
void OnProjectileStoppedInObject(ObjectCollisionInfo info)
proto native owned string GetMainMenuWorld()
void ConnectFromServerBrowser(string ip, int port, string password="")
override void OnMouseButtonRelease(int button)
bool GetLastVisitedServer(out string ip, out int port)
override void OnMouseButtonPress(int button)
void SetDatabaseID(string id)
void InitCharacterMenuDataInfo(int menudata_count)
bool IsVisited(string ip, int port)
proto native Weather GetWeather()
Returns weather controller object.
void SelectUser(int gamepad=-1)
ref NotificationUI m_Notifications
void RefreshMouseCursorVisibility()
DayZLoadState m_LoadState
proto native bool IsClient()
int m_ConnectSteamQueryPort
bool IsFoodDecayEnabled()
float GetHUDBrightnessSetting()
const int MISSION_STATE_MAINMENU
native void CreateMission(string path)
Create only enforce script mission, used for mission script reloading.
override bool OnInitialize()
proto native float SurfaceGetNoiseMultiplier(Object directHit, vector pos, int componentIndex)
void SetUserFOV(float pFov)
void SetEVValue(float value)
const float ARROW_PIERCE_DEPTH
override void OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
void CloseCombatEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, bool isWater, string ammoType)
proto native void SetEVUser(float value)
Sets custom camera camera EV. range: -50.0..50.0? //TODO.
void SetHudBrightness(float value)
void DeleteGamepadDisconnectMenu()
proto native void AbortMission()
Returns to main menu, leave world empty for using last mission world.
const int MISSION_STATE_FINNISH
BillboardSetHandler GetBillboardHandler()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
void ExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
void UpdateInputDeviceDisconnectWarning()
void ConnectFromJoin(string ip, int port)
ref Widget m_GamepadDisconnectMenu
void DisconnectSessionEx(DisconnectSessionFlags flags)
void AddVoiceNotification(VONStopSpeakingEventParams vonStartParams)
void LoadProgressUpdate(int progressState, float progress, string title)
ref LoadingScreen m_loading
bool IsWorldWetTempUpdateEnabled()
Super root of all classes in Enforce script.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
struct that keeps Time relevant information for future formatting
LoginQueue position when using -connect since mission is not created yet.
TextWidget m_txtDescription
bool CanChangeHintPage(float timeAccu)
LoginTime when using -connect since mission is not created yet.
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 AddNotification(NotificationType type, float show_time, string detail_text="")
Send notification from default types to local player.
static void Update(float timeslice)
static BiosUser GetBiosUser()
static void GetCurrentServerInfo(string ip, int port)
static void SetBiosUser(BiosUser user)
static void SetMultiplayState(bool state)
static void LoadMPPrivilege()
Static component of PPE manager, used to hold the instance.
The class that will be instanced (moddable).
Manager class for managing Effect (EffectParticle, EffectSound).
static void OnUpdate(float timeslice)
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...
ScriptInvoker Class provide list of callbacks usage:
Module containing compiled scripts.
Keeps information about currently loaded world, like temperature.
void UpdateWeatherEffects(Weather weather, float timeslice)
Updates local weather effects.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override void OnEvent(EventType eventTypeId, Param params)
Handles VON-related events.
override void DeferredInit()
DamageType
exposed from C++ (do not change)
class DayZProfilesOptions PARTY_CONTROLLER_SELECT
class DayZProfilesOptions MISSION_USER_SELECT
ImageWidget m_ImageLogoCorner
ImageWidget m_ImageLoadingIcon
ImageWidget m_ImageWidgetBackground
enum DisconnectSessionFlags DISCONNECT_SESSION_FLAGS_FORCE
class DayZProfilesOptions PARTY_USER_SELECT
class DayZProfilesOptions JOIN_START
class DayZProfilesOptions MAIN_MENU_USER_SELECT
Param3< string, int, int > DayZProfilesOptionInt
class DayZProfilesOptions CONNECT_START
void SetProgress(float val)
TextWidget m_TextWidgetTitle
float m_LastProgressUpdate
class DayZProfilesOptions MISSION_START
const int DISCONNECT_SESSION_FLAGS_ALL
class DayZProfilesOptions PARTY
class DayZProfilesOptions MAIN_MENU_CONTROLLER_SELECT
ref UiHintPanelLoading m_HintPanel
@ DISCONNECT_ERROR_ENABLED
class DayZProfilesOptions UNDEFINED
TextWidget m_ModdedWarning
void ShowEx(DayZGame game)
proto native vector GetPos()
proto native vector GetInVelocity()
Param3< string, float, float > DayZProfilesOptionFloat
ProgressBarWidget m_ProgressLoading
class DayZProfilesOptions JOIN_USER_SELECT
const int DISCONNECT_SESSION_FLAGS_JOIN
proto native vector GetHitObjRot()
ImageWidget m_ImageLogoMid
DayZProfilesOption DayZProfilesOptionBool
class DayZProfilesOptions JOIN_CONTROLLER_SELECT
void SetTitle(string title)
class DayZProfilesOptions CONNECTING
class DayZProfilesOptions CONNECT_USER_SELECT
class DayZProfilesOptions MAIN_MENU_START
void LoadingScreen(DayZGame game)
proto native float GetProjectileDamage()
TextWidget m_TextWidgetStatus
proto native int GetComponentIndex()
void SetStatus(string status)
class DayZProfilesOptions PARTY_START
float m_ImageLoadingIconRotation
ImageWidget m_ImageBackground
proto native string GetAmmoType()
proto native Object GetHitObj()
proto native Object GetSource()
bool CanChangeHintPage(float timeAccu)
class LoginScreenBase extends UIScriptedMenu m_txtPosition
class DayZProfilesOptions m_WidgetRoot
class DayZProfilesOptions CONNECT
TextWidget m_ProgressText
class DayZProfilesOptions JOIN
class CrashSoundSets GetIsWater
proto native vector GetHitObjPos()
Param3< string, bool, bool > DayZProfilesOption
void SetPosition(int position)
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
ProjectileStoppedInfo Managed GetSurfNormal()
class DayZProfilesOptions MAIN_MENU
class DayZProfilesOptions CONNECT_CONTROLLER_SELECT
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)
void SetDispatcher(Dispatcher dispatcher)
int GetID()
Get the ID registered in SEffectManager.
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
const int PROGRESS_UPDATE
Param1< int > RespawnEventParams
RespawnTime.
Param1< int > MPConnectionLostEventParams
Duration.
Param1< int > LoginTimeEventParams
LoginTime.
const EventType MPSessionEndEventTypeID
no params
const EventType ConnectingStartEventTypeID
no params
PlayerIdentity PROGRESS_START
const EventType LoginStatusEventTypeID
params: LoginStatusEventParams
Param1< vector > PreloadEventParams
Position.
Serializer ParamsReadContext
Param4< float, float, int, int > ServerFpsStatsUpdatedEventParams
average server fps, highest frame time, skipped physics simulation steps server/client
const EventType WorldCleaupEventTypeID
no params
Param1< string > DLCOwnerShipFailedParams
world name
Param1< int > LogoutEventParams
logoutTime
Param2< string, string > VONStopSpeakingEventParams
player name, player id
const EventType SelectedUserChangedEventTypeID
no params
const EventType RespawnEventTypeID
params: RespawnEventParams
const EventType MPSessionFailEventTypeID
no params
const int PROGRESS_PROGRESS
const EventType StartupEventTypeID
no params
const EventType DialogQueuedEventTypeID
no params
Param4< int, string, string, string > ChatMessageEventParams
channel, from, text, color config class
Param2< string, string > LoginStatusEventParams
text message for line 1, text message for line 2
const EventType MPSessionStartEventTypeID
no params
const EventType PreloadEventTypeID
params: PreloadEventParams
const EventType LoginTimeEventTypeID
params: LoginTimeEventParams
Param1< PlayerIdentity > ConnectivityStatsUpdatedEventParams
PlayerIdentity.
const EventType ServerFpsStatsUpdatedEventTypeID
params: ServerFpsStatsUpdatedEventParams
const EventType ConnectivityStatsUpdatedEventTypeID
params: ConnectivityStatsUpdatedEventParams
const EventType MPConnectionLostEventTypeID
params: MPConnectionLostEventParams
const EventType LogoutEventTypeID
params: LogoutEventParams
const EventType MPSessionPlayerReadyEventTypeID
no params
const EventType DLCOwnerShipFailedEventTypeID
params: DLCOwnerShipFailedParams
Param3< int, float, string > ProgressEventParams
state, progress, title
const int PROGRESS_FINISH
const EventType ProgressEventTypeID
params: ProgressEventParams
OptionAccessType
C++ OptionAccessType.
const EventType ChatMessageEventTypeID
params: ChatMessageEventParams
const EventType ConnectingAbortEventTypeID
no params
proto GizmoApi GetGizmoApi()
const string GAME_CHAT_MSG
const string SYSTEM_CHAT_MSG
const string RADIO_CHAT_MSG
const string PLAYER_CHAT_MSG
const string DIRECT_CHAT_MSG
const string ADMIN_CHAT_MSG
proto void Print(void var)
Prints content of variable to console/log.
const string OPTIONS_SOUND_AMBIENT_SOUND_MODE
array< string > TStringArray
const string SHOW_QUICKBAR
const string SHOW_SERVERINFO
const string SHOW_HUD_VEHICLE
const string SHOW_CONNECTIVITYINFO
const string HUD_BRIGHTNESS
const string ENABLE_BLEEDINGINDICATION
const string SHOW_CROSSHAIR
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
@ NONE
body is not in simulation, nor in collision world
proto bool GetCLIParam(string param, out string val)
Returns command line argument.
class NoiseSystem NoiseParams()
NotificationType
DEPRECATED (moved into NotificationSystem).
void SetTime(float time)
DEPRECATED.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor).