9 static int m_SystemsMask;
12 bool m_ModifiersEnabled =
true;
14 bool m_StaminaDisabled;
15 bool m_ClientInventoryDesync =
false;
19 bool m_LogPlayerStats;
20 Shape m_VehicleFreeAreaBox;
21 ref EnvDebugData m_EnvDebugData;
22 ref FallDamageDebugData m_FallDamageDebugData;
24 ref WeaponLiftDiag m_WeaponLiftDiag =
new WeaponLiftDiag();
26 ref UndergroundDiag m_UndergroundDiag =
new UndergroundDiag();
37 protected void BindCallbacks()
104 #ifdef ENABLE_LOGGING
105 DiagMenu.BindCallback(
DiagMenuIDs.MISC_ENVIRONMENT_LOGGING_DRYWET, CBMiscEnvironmentLoggingDryWet);
106 DiagMenu.BindCallback(
DiagMenuIDs.MISC_ENVIRONMENT_LOGGING_ITEMHEAT, CBMiscEnvironmentLoggingItemHeat);
116 DiagMenu.BindCallback(
DiagMenuIDs.MISC_UNIVERSAL_TEMPERATURE_SOURCES, CBMiscUniversalTemperatureSources);
119 DiagMenu.BindCallback(
DiagMenuIDs.MISC_GO_UNCONSCIOUS_DELAYED, CBMiscGoUnconsciousDelayed);
141 DiagMenu.BindCallback(
DiagMenuIDs.MISC_HIT_INDICATION_SPAWN_HIT, CBMiscHitIndicationSpawnHit);
181 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_DISABLE_BLOOD_LOSS, CBBleedingDisableBloodLoss);
183 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_ACTIVATE_ALL_SOURCES, CBBleedingActivateAllSources);
184 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDING_ACTIVATE_SOURCE_LEVEL, CBBleedingActivateSourceLevel);
191 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_USEVALUEOVERRIDES, CBBBleedingIndicators);
192 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RANDOMROTATION, CBBBleedingIndicators);
193 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_SEQUENCE_DURATION, CBBBleedingIndicators);
194 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_BASEDURATION, CBBBleedingIndicators);
195 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_MINDELAY, CBBBleedingIndicators);
196 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_MAXDELAY, CBBBleedingIndicators);
197 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_PROGRESSTHRESHOLD, CBBBleedingIndicators);
198 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_STARTSIZE, CBBBleedingIndicators);
200 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RNDSCALEMIN, CBBBleedingIndicators);
201 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_RNDSCALEMAX, CBBBleedingIndicators);
203 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_SLIDEDISTANCE, CBBBleedingIndicators);
208 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_ENABLEDESATURATION, CBBBleedingIndicators);
209 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_DESATURATIONEND, CBBBleedingIndicators);
213 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_A_START, CBBBleedingIndicators);
214 DiagMenu.BindCallback(
DiagMenuIDs.BLEEDINGINDICATORS_DROP_COLOR_A_END, CBBBleedingIndicators);
253 DiagMenu.BindCallback(
DiagMenuIDs.CAMERATOOLS_ENABLE_REMOTE_CAMERA, CBCameraToolsEnableRemoteCamera);
259 super.OnRPC(player, rpc_type, ctx);
263 case ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG_DATA:
266 m_EnvDebugData =
new EnvDebugData();
268 ctx.Read(m_EnvDebugData);
272 case ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG_DATA:
274 if (!m_FallDamageDebugData)
275 m_FallDamageDebugData =
new FallDamageDebugData();
277 ctx.Read(m_FallDamageDebugData);
281 case ERPCs.DIAG_VEHICLES_DUMP_CRASH_DATA_CONTENTS:
283 Param1<array<ref CrashDebugData>> par =
new Param1<array<ref CrashDebugData>>(null);
286 CrashDebugData.DumpDataArray(par.param1);
293 override void OnUpdate(
float delta_time)
295 super.OnUpdate(delta_time);
305 UpdateMiscVehicleGetOutBox();
306 UpdateEnvironmentDebug();
308 UpdateMaterialDebug();
309 UpdateWeaponLiftDiag(delta_time);
311 UpdateUndegroundDiag(delta_time);
316 void CheckTimeAccel()
318 if (!FeatureTimeAccel.m_CurrentTimeAccel)
325 TimeAccelParam param = GetTimeAccelMenuState();
327 if (!FeatureTimeAccel.AreTimeAccelParamsSame(param, FeatureTimeAccel.m_CurrentTimeAccel))
329 int timeAccelBig = param.param2;
330 float timeAccelSmall = param.param2 - timeAccelBig;
331 FeatureTimeAccel.CopyTimeAccelClipboard(param.param1, timeAccelBig, timeAccelSmall, param.param3 );
332 FeatureTimeAccel.SendTimeAccel(
g_Game.GetPlayer(), param);
333 FeatureTimeAccel.m_CurrentTimeAccel = param;
339 static void CBInventoryHandsAckMove(
bool enable,
int id)
341 PluginInventoryDebug pluginInventoryDebug = PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug));
342 DiagToggleRPCServer(enable, pluginInventoryDebug.m_IsHandAckEnable,
ERPCs.DIAG_INVENTORY_ACK_HANDS);
345 static void CBEnableDesyncRepair(
bool enable,
int id)
347 PluginInventoryDebug pluginInventoryDebug = PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug));
348 DiagToggleRPCServer(enable, pluginInventoryDebug.m_IsDesyncRepairEnable,
ERPCs.DIAG_INVENTORY_REPAIR_DESYNC);
351 static void CBClientDesync(
bool enable,
int id)
353 PluginInventoryDebug pluginInventoryDebug = PluginInventoryDebug.Cast(
GetPlugin(PluginInventoryDebug));
354 pluginInventoryDebug.SetLocalOnlyMoveEnable(enable);
358 static void CBCraftingGenerate(
bool enabled,
int id)
360 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
361 DiagButtonAction(enabled,
id,
ScriptCaller.Create(pluginRecipesManager.CallbackGenerateCache));
365 static void CBCraftingInstant(
bool enabled)
367 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
368 DiagToggleRPC(enabled, pluginRecipesManager.IsEnableDebugCrafting(),
ERPCs.DIAG_CRAFTING_INSTANT);
372 static void CBCraftingDump(
bool enabled,
int id)
374 PluginRecipesManager pluginRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
375 DiagButtonAction(enabled,
id,
ScriptCaller.Create(pluginRecipesManager.GenerateHumanReadableRecipeList));
379 static void CBCheatsModifiers(
bool enabled)
382 DiagToggleRPCServer(enabled, pluginDiag.m_ModifiersEnabled,
ERPCs.DIAG_CHEATS_MODIFIERS);
386 static void CBCheatsKillPlayer(
bool enabled,
int id)
388 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_KILL_PLAYER,
true);
392 static void CBCheatsInvincibility(
int value)
395 DiagToggleRPCServer(value, pluginDiag.m_IsInvincible,
ERPCs.DIAG_CHEATS_INVINCIBILITY);
399 static void CBCheatsStaminaDisable(
bool enabled)
403 player.SetStaminaDisabled(enabled);
406 DiagToggleRPCServer(enabled, pluginDiag.m_StaminaDisabled,
ERPCs.DIAG_CHEATS_DISABLE_STAMINA);
410 static void CBCheatsResetPlayer(
bool enabled,
int id)
414 player.ResetPlayer(
false);
415 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_RESET_PLAYER,
true);
419 static void CBCheatsResetPlayerMax(
bool enabled,
int id)
423 player.ResetPlayer(
true);
424 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_RESET_PLAYER_MAX,
true);
428 static void CBCheatsInventoryAccess(
bool enabled)
430 DiagToggleRPCServer(enabled,
PlayerBase.DEBUG_INVENTORY_ACCESS,
ERPCs.DIAG_CHEATS_INVENTORY_ACCESS);
434 static void CBCheatsFixItems(
bool enabled,
int id)
436 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_ITEMS_FIX,
true);
439 static void CBCreateHit(
bool enabled,
int id)
441 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_CREATE_HIT,
true);
444 static void CBCreateHitLight(
bool enabled,
int id)
446 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_CHEATS_CREATE_HIT_LIGHT,
true);
450 static void CBPlayerAgentsInjectActions(
bool enabled)
456 static void CBSoftSkillsShowDebug(
bool enabled)
463 static void CBSoftSkillsToggleState(
bool enabled)
470 static void CBSoftSkillsToggleModel(
bool enabled)
473 DiagToggleRPC(enabled, ssMngr.
IsLinear(),
ERPCs.DIAG_SOFT_SKILLS_TOGGLE_MODEL);
477 static void CBSoftSkillsSpecialtyValue(
float value)
484 static void CBLifespanBloodyHands(
bool enabled)
489 bool hasBloodyHands = player.HasBloodyHands();
490 DiagToggleRPCServer(enabled, hasBloodyHands,
ERPCs.DIAG_LIFESPAN_BLOODY_HANDS);
495 static void CBLifespanPlaytimeUpdate(
float value)
498 DiagToggleRPCServer(value * 60, pluginDiag.m_Playtime,
ERPCs.DIAG_LIFESPAN_PLAYTIME_UPDATE);
502 static void CBMiscPersonalLight(
bool enabled)
504 PlayerBaseClient.m_PersonalLightDisabledByDebug = enabled;
505 PlayerBaseClient.UpdatePersonalLight();
509 static void CBMiscItemDebugActions(
bool enabled)
515 static void CBMiscLogPlayerStats(
bool enabled)
518 DiagToggleRPC(enabled, pluginDiag.m_LogPlayerStats,
ERPCs.DIAG_MISC_LOG_PLAYER_STATS);
522 static void CBMiscForceHintIndex(
int index)
528 static void CBMiscPermanentCrossHair(
bool enabled)
530 PluginPermanentCrossHair crosshair = PluginPermanentCrossHair.Cast(
GetPlugin(PluginPermanentCrossHair));
531 crosshair.SwitchPermanentCrossHair(enabled);
535 void UpdateMiscVehicleGetOutBox()
539 if (m_VehicleFreeAreaBox)
541 m_VehicleFreeAreaBox.Destroy();
542 m_VehicleFreeAreaBox = null;
545 HumanCommandVehicle hcv =
g_Game.GetPlayer().GetCommand_Vehicle();
551 else if (m_VehicleFreeAreaBox)
553 m_VehicleFreeAreaBox.Destroy();
554 m_VehicleFreeAreaBox = null;
559 static void CBMiscToggleHud(
bool enabled)
562 mission.GetHud().Show(!enabled);
565 mission.HideCrosshairVisibility();
569 mission.RefreshCrosshairVisibility();
574 static void CBMiscEnvironmentDebug(
bool enabled)
576 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_ENVIRONMENT_DEBUG);
579 void UpdateEnvironmentDebug()
582 Environment.DisplayEnvDebugPlayerInfo(
true, m_EnvDebugData);
583 else if (m_EnvDebugData)
584 m_EnvDebugData = null;
588 void UpdateMaterialDebug()
597 void UpdateWeaponLiftDiag(
float delta_time)
603 GetWeaponLiftDiag().DrawDiag(weaponLiftDebug, delta_time);
610 static WeaponLiftDiag GetWeaponLiftDiag()
613 return pluginDiag.m_WeaponLiftDiag;
617 void UpdateUndegroundDiag(
float deltaTIme)
622 m_UndergroundDiag.DrawDiag(deltaTIme);
630 string materialPath =
"Graphics/Materials/postprocess/ghost";
638 DbgUI.Begin(
"GhostEffect Debug");
640 float channelWeights[] = { 0, 0, 0, 0 };
641 float noiseOffset[] = { 0, 0 };
642 float noiseScale[] = { 1, 1 };
643 float noiseLo[] = { 0, 0, 0, 0 };
644 float noiseHi[] = { 1, 1, 1, 1 };
645 float ghostOffset[] = { 0, 0 };
646 float ghostScale[] = { 1, 1 };
647 float colormod[] = { 1, 1, 1, 0.5 };
648 int spacer_height = 10;
650 float rw, gw, bw, aw;
651 DbgUI.Text(
"noise_channel_weight");
653 DbgUI.InputFloat(
"noise_weight_r", rw);
654 DbgUI.InputFloat(
"noise_weight_g", gw);
655 DbgUI.InputFloat(
"noise_weight_b", bw);
656 DbgUI.InputFloat(
"noise_weight_a", aw);
658 DbgUI.Spacer(spacer_height);
661 float nsx = 1, nsy = 1;
662 DbgUI.Text(
"noise_offset");
664 DbgUI.InputFloat(
"noise_offset_x", nox);
665 DbgUI.InputFloat(
"noise_offset_y", noy);
666 DbgUI.InputFloat(
"noise_scale_x", nsx);
667 DbgUI.InputFloat(
"noise_scale_y", nsy);
669 DbgUI.Spacer(spacer_height);
671 float rl = 0, rh = 1;
672 float gl = 0, gh = 1;
673 float bl = 0, bh = 1;
674 float al = 0, ah = 1;
675 DbgUI.Text(
"noise_remap");
677 DbgUI.InputFloat(
"lo_r", rl);
679 DbgUI.InputFloat(
"hi_r", rh);
681 DbgUI.InputFloat(
"lo_g", gl);
683 DbgUI.InputFloat(
"hi_g", gh);
685 DbgUI.InputFloat(
"lo_b", bl);
687 DbgUI.InputFloat(
"hi_b", bh);
689 DbgUI.InputFloat(
"lo_a", al);
691 DbgUI.InputFloat(
"hi_a", ah);
693 DbgUI.Spacer(spacer_height);
695 float gox = 50, goy = 25;
696 float gsx = 0.85, gsy = 0.85;
697 DbgUI.Text(
"ghost_offset");
699 DbgUI.InputFloat(
"ghost_offset_x", gox);
700 DbgUI.InputFloat(
"ghost_offset_y", goy);
701 DbgUI.InputFloat(
"ghost_scale_x", gsx);
702 DbgUI.InputFloat(
"ghost_scale_y", gsy);
704 DbgUI.Spacer(spacer_height);
706 float cmr = 1, cmg = 1, cmb = 1, cma = 1;
707 DbgUI.Text(
"color_mod");
709 DbgUI.InputFloat(
"color_mod_r", cmr);
710 DbgUI.InputFloat(
"color_mod_g", cmg);
711 DbgUI.InputFloat(
"color_mod_b", cmb);
712 DbgUI.InputFloat(
"color_curve", cma);
714 DbgUI.Spacer(spacer_height);
716 channelWeights = { rw, gw, bw, aw };
717 noiseOffset = { nox, noy };
718 noiseScale = { nsx, nsy };
719 noiseLo = { rl, gl, bl, al };
720 noiseHi = { rh, gh, bh, ah };
721 ghostOffset = { gox, goy };
722 ghostScale = { gsx, gsy };
723 colormod = { cmr, cmg, cmb, cma };
728 material.SetParamByIndex(1, channelWeights);
729 material.SetParamByIndex(2, noiseOffset[0]);
730 material.SetParamByIndex(3, noiseOffset[1]);
731 material.SetParamByIndex(4, noiseScale[0]);
732 material.SetParamByIndex(5, noiseScale[1]);
733 material.SetParamByIndex(6, noiseLo);
734 material.SetParamByIndex(7, noiseHi);
735 material.SetParamByIndex(8, ghostOffset[0]);
736 material.SetParamByIndex(9, ghostOffset[1]);
737 material.SetParamByIndex(10, ghostScale[0]);
738 material.SetParamByIndex(11, ghostScale[1]);
739 material.SetParamByIndex(12, colormod );
743 #ifdef ENABLE_LOGGING
744 static void CBMiscEnvironmentLoggingDryWet(
bool enabled)
746 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_ENVIRONMENT_LOGGING_DRYWET);
749 static void CBMiscEnvironmentLoggingItemHeat(
bool enabled)
751 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_ENVIRONMENT_LOGGING_ITEMHEAT);
755 static void CBMiscFallDamageDebug(
bool enabled)
757 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_FALLDAMAGE_DEBUG);
760 void UpdateFallDamageDebug()
763 DayZPlayerImplementFallDamage.DisplayFallDamageDebugInfo(
true, m_FallDamageDebugData);
764 else if (m_FallDamageDebugData)
765 m_FallDamageDebugData = null;
769 static void CBMiscDisplayPlayerInfo(
int value)
771 PluginRemotePlayerDebugClient prpdc = PluginRemotePlayerDebugClient.Cast(
GetPlugin(PluginRemotePlayerDebugClient));
776 static void CBMiscUniversalTemperatureSources(
bool enabled)
779 client.RequestUniversalTemperatureSources(
PlayerBase.Cast(
g_Game.GetPlayer()), enabled);
783 static void CBMiscBulletImpact(
bool enabled,
int id)
792 static void CBMiscGoUnconscious(
bool enabled,
int id)
794 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_MISC_GO_UNCONSCIOUS,
true);
798 static void CBMiscGoUnconsciousDelayed(
bool enabled,
int id)
800 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_MISC_GO_UNCONSCIOUS_DELAYED,
true);
804 static void CBMiscQuickRestrain(
bool enabled)
807 DiagToggleRPC(enabled, player.IsQuickRestrain(),
ERPCs.DIAG_MISC_QUICK_RESTRAIN);
811 static void CBMiscHairHide(
bool enabled,
int id)
814 DiagButtonRPCIntInt(enabled,
id, value, enabled,
ERPCs.DIAG_MISC_HAIR_LEVEL_HIDE,
true);
818 static void CBMiscHairHideAll(
bool enabled)
827 static void CBMiscCamShake(
bool enabled,
int id)
830 DiagButtonAction(enabled,
id,
ScriptCaller.Create(cam.SpawnDiagCameraShake));
834 static void CBMiscQuickFishing(
bool enabled)
837 DiagToggleRPC(enabled, player.IsQuickFishing(),
ERPCs.DIAG_MISC_QUICK_FISHING);
841 static void CBMiscShockImpact(
bool enabled,
int id)
843 DiagButtonAction(enabled,
id,
ScriptCaller.Create(ShockImpact));
846 static void ShockImpact()
848 static float intensity;
850 intensity =
Math.WrapFloat(intensity, 0.25, 1);
853 player.SpawnShockEffect(intensity);
857 static void CBMiscPlugArrows(
bool enabled)
859 g_Game.EnableEMPlugs(enabled);
863 static void CBMiscTargetableByAI(
bool enabled,
int id)
867 DiagToggleRPC(enabled, player.m_CanBeTargetedDebug,
ERPCs.DIAG_MISC_TARGETABLE_BY_AI);
871 static void CBMiscHitIndication()
901 static void CBMiscHitIndicationSpawnHit(
bool enabled,
int id)
903 DiagButtonAction(enabled,
id,
ScriptCaller.Create(SpawnHitDirEffect));
906 static void SpawnHitDirEffect()
909 g_Game.GetMission().GetHud().SpawnHitDirEffect(player,
DiagMenu.GetRangeValue(
DiagMenuIDs.MISC_HIT_INDICATION_SPAWN_HIT_DIRECTION), 1.0);
913 static void CBDebugMonitor(
bool enabled,
int id)
915 SendDiagRPC(enabled,
ERPCs.DIAG_MISC_DEBUG_MONITOR,
true);
918 g_Game.GetMission().CreateDebugMonitor();
920 g_Game.GetMission().HideDebugMonitor();
923 static void CBPRADrawAll(
bool enabled,
int id)
929 static void CBPRADetect(
bool enabled,
int id)
937 Print(
"player: " + player +
" | at position: " + player.GetPosition() +
" | intersects area: " + pra.areaName);
939 Print(
"player: " + player +
" | at position: " + player.GetPosition() +
" | is NOT in any PlayerRestrictedArea");
945 static void CBMiscFreezeEntity(
bool enabled,
int id)
947 DiagButtonAction(enabled,
id,
ScriptCaller.Create(FreezeEntity));
950 static void FreezeEntity()
953 if (PluginSceneManager.GetInstance() && PluginSceneManager.GetInstance().IsOpened())
956 SceneObject scene_obj = PluginSceneManager.GetInstance().GetSelectedSceneObject();
966 FreeDebugCamera camera = FreeDebugCamera.GetInstance();
967 entity =
EntityAI.Cast(camera.GetCrosshairObject());
971 entity.DisableSimulation(!entity.GetIsSimulationDisabled());
975 static void CBMiscFreezePlayer(
bool enabled,
int id)
977 DiagButtonAction(enabled,
id,
ScriptCaller.Create(FreezePlayer));
980 static void FreezePlayer()
984 player.DisableSimulation(!player.GetIsSimulationDisabled());
988 static void CBVehicleDebugOutput(
int value)
994 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED;
998 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED | EVehicleDebugOutputType.DAMAGE_CONSIDERED;
1000 else if (value == 3)
1002 bitValue = EVehicleDebugOutputType.CONTACT;
1004 else if (value == 4)
1006 bitValue = EVehicleDebugOutputType.DAMAGE_APPLIED | EVehicleDebugOutputType.CONTACT;
1008 SendDiagRPC(bitValue,
ERPCs.DIAG_VEHICLE_DEBUG_OUTPUT,
true);
1012 static void CBDumpCrashData(
bool value)
1016 SendDiagRPC(
true,
ERPCs.DIAG_VEHICLES_DUMP_CRASH_DATA_REQUEST,
true);
1024 static void SimulateMode(
bool enabled,
int id,
int rpc)
1032 DiagButtonRPC(enabled,
id, rpc,
true);
1037 DiagButtonRPCSelf(enabled,
id, rpc);
1042 DiagButtonRPC(enabled,
id, rpc,
true);
1043 DiagButtonRPCSelf(enabled,
id, rpc);
1050 static void CBSimulateInfiniteLoop(
bool enabled,
int id)
1052 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_INFINITE_LOOP);
1056 static void CBSimulateNullPointer(
bool enabled,
int id)
1058 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_NULL_POINTER);
1062 static void CBSimulateDivisionByZero(
bool enabled,
int id)
1064 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_DIVISION_BY_ZERO);
1068 static void CBSimulateErrorFunction(
bool enabled,
int id)
1070 SimulateMode(enabled,
id,
ERPCs.DIAG_SIMULATE_ERROR_FUNCTION);
1074 static void CBWeaponParticles(
bool enabled)
1076 DiagToggleRPCServer(enabled,
PrtTest.m_GunParticlesState,
ERPCs.DIAG_WEAPON_PARTICLES);
1080 static void CBWeaponDebug(
bool enabled)
1083 DiagToggleAction(enabled,
ScriptCaller.Create(player.ShowWeaponDebug), player.IsWeaponDebugEnabled());
1087 static void CBWeaponAimNoise(
bool enabled)
1098 static void CBWeaponRecoil(
bool enabled)
1109 static void CBWeaponUnlimitedAmmo(
bool enabled)
1115 static void CBWeaponBurstVersion(
int value)
1119 DiagToggleRPC(value, wpnMngr.GetBurstOption(),
ERPCs.DIAG_WEAPON_BURST_VERSION);
1123 static void CBBleedingSources(
bool enabled)
1126 player.GetBleedingManagerRemote().SetDiag(enabled);
1130 static void CBBleedingDisableBloodLoss(
bool enabled)
1132 SendDiagRPC(enabled,
ERPCs.DIAG_BLEEDING_DISABLE_BLOOD_LOSS,
true);
1136 static void CBBleedingActivateSource(
int value)
1138 SendDiagRPC(value,
ERPCs.DIAG_BLEEDING_ACTIVATE_SOURCE,
true);
1142 static void CBBleedingActivateAllSources(
bool enabled,
int id)
1144 DiagButtonRPC(enabled,
id,
ERPCs.DIAG_BLEEDING_ACTIVATE_ALL_SOURCES,
true);
1148 static void CBBleedingActivateSourceLevel(
int value)
1160 bone =
"lefttoebase";
1172 int count = mgr.m_BleedingSourceZone.Count();
1174 for (
int i = 0; i < count; ++i)
1176 if (mgr.m_BleedingSourceZone.GetKey(i) == bone)
1184 CBBleedingActivateSource(idx);
1188 static void CBBleedingReload(
bool enabled,
int id)
1191 BleedingSourcesManagerRemote bsMngrRem = player.GetBleedingManagerRemote();
1192 DiagButtonAction(enabled,
id,
ScriptCaller.Create(bsMngrRem.Reload));
1196 static void CBBBleedingIndicators()
1203 if (player && player.GetBleedingManagerRemote())
1205 player.GetBleedingManagerRemote().Reload();
1237 static void CBLogsActions(
bool enabled)
1239 DiagToggleRPC(enabled,
LogManager.IsActionLogEnable(),
ERPCs.DIAG_LOGS_ACTIONS);
1243 static void CBLogsWeapons(
bool enabled)
1245 DiagToggleRPC(enabled,
LogManager.IsWeaponLogEnable(),
ERPCs.DIAG_LOGS_WEAPONS);
1249 static void CBLogsSync(
bool enabled)
1251 DiagToggleRPC(enabled,
LogManager.IsSyncLogEnable(),
ERPCs.DIAG_LOGS_SYNC);
1255 static void CBLogsBaseBuilding(
bool enabled)
1257 DiagToggleRPC(enabled,
LogManager.IsBaseBuildingLogEnable(),
ERPCs.DIAG_LOGS_BASEBUILDING);
1261 static void CBLogsSymptoms(
bool enabled)
1263 DiagToggleRPC(enabled,
LogManager.IsSymptomLogEnable(),
ERPCs.DIAG_LOGS_SYMPTOMS);
1267 static void CBLogsInventoryMove(
bool enabled)
1269 DiagToggleRPC(enabled,
LogManager.IsInventoryMoveLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_MOVE);
1273 static void CBLogsInventoryReservation(
bool enabled)
1275 DiagToggleRPC(enabled,
LogManager.IsInventoryReservationLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_RESERVATION);
1279 static void CBLogsInventoryHFSM(
bool enabled)
1281 DiagToggleRPC(enabled,
LogManager.IsInventoryHFSMLogEnable(),
ERPCs.DIAG_LOGS_INVENTORY_HFSM);
1285 static void CBLogsQuickbar(
bool enabled)
1287 DiagToggleRPC(enabled,
LogManager.IsQuickbarLogEnable(),
ERPCs.DIAG_LOGS_QUICKBAR);
1291 static void CBLogsBleedingChances(
bool enabled)
1293 DiagToggleRPC(enabled,
LogManager.IsBleedingChancesLogEnable(),
ERPCs.DIAG_LOGS_BLEEDING_CHANCES);
1297 static void CBTriggerDebug(
bool enabled)
1299 EnableDebugSystemClient(ESubscriberSystems.TRIGGERS, enabled);
1303 static void CBBaseBuildingWood(
bool enabled)
1305 SendDiagRPC(enabled,
ERPCs.DIAG_BASEBUILDING_WOOD,
true);
1309 static void CBBaseBuildingGate(
bool enabled)
1311 SendDiagRPC(enabled,
ERPCs.DIAG_BASEBUILDING_GATE,
true);
1315 static void CBFinishersFinisherForced(
int value)
1318 DiagToggleRPC(value - 1, player.GetMeleeCombat().DebugGetForcedFinisherType(),
ERPCs.DIAG_FINISHERS_FORCE_FINISHER);
1322 static void CBCameraToolsEnableRemoteCamera(
bool enabled)
1329 if (!enabled && player.m_CameraToolsMenuClient)
1331 player.m_CameraToolsMenuClient.DelayedDestroy();
1335 g_Game.RPCSingleParam( null,
ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE, param,
true );
1352 vector end = start + (
g_Game.GetCurrentCameraDirection() * 5.0);
1354 vector hitPos, hitNormal;
1359 DayZPhysics.RayCastBullet(start, end, hitMask, null, hitObj, hitPos, hitNormal, hitFraction);
1360 Class.CastTo(player, hitObj);
1374 mask = (
ItemBase.GetDebugActionsMask() | type);
1378 mask = (
ItemBase.GetDebugActionsMask() & (~type));
1387 static void EnableDebugSystemClient(ESubscriberSystems system,
bool enable)
1392 mask = (m_SystemsMask | system);
1396 mask = (m_SystemsMask & (~system));
1399 if (mask != m_SystemsMask)
1403 m_SystemsMask = mask;
1411 static void DiagButtonActionParams(
bool enabled,
int id,
ScriptCaller action,
Param params)
1415 action.Invoke(params);
1421 static void DiagButtonAction(
bool enabled,
int id,
ScriptCaller action)
1423 DiagButtonActionParams(enabled,
id, action, null);
1427 static void DiagButtonRPC(
bool enabled,
int id,
int rpc,
bool serverOnly =
false)
1430 SendDiagRPCBasicParam params =
new SendDiagRPCBasicParam(rpc, serverOnly);
1432 DiagButtonActionParams(enabled,
id, action, params);
1436 static void DiagButtonRPCSelf(
bool enabled,
int id,
int rpc)
1439 SendDiagRPCSelfBasicParam params =
new SendDiagRPCSelfBasicParam(rpc);
1441 DiagButtonActionParams(enabled,
id, action, params);
1445 static void DiagButtonRPCIntInt(
bool enabled,
int id,
int value,
int value2,
int rpc,
bool serverOnly =
false)
1451 SendDiagRPCParamParam params =
new SendDiagRPCParamParam(rpc, serverOnly,
CachedObjectsParams.PARAM2_INT_INT);
1453 DiagButtonActionParams(enabled,
id, action, params);
1457 static void DiagToggleRPC(
bool value,
int current,
int rpc)
1459 if (value != current)
1461 SendDiagRPC(value, rpc,
false);
1466 static void DiagToggleRPC(
int value,
int current,
int rpc)
1468 if (value != current)
1470 SendDiagRPC(value, rpc,
false);
1475 static void DiagToggleRPC(
float value,
int current,
int rpc)
1477 if (value != current)
1479 SendDiagRPC(value, rpc,
false);
1484 static void DiagToggleRPCServer(
bool value, out
bool current,
int rpc)
1486 if (value != current)
1489 SendDiagRPC(value, rpc,
true);
1494 static void DiagToggleRPCServer(
int value, out
int current,
int rpc)
1496 if (value != current)
1499 SendDiagRPC(value, rpc,
true);
1504 static void DiagToggleRPCServer(
float value, out
float current,
int rpc)
1506 if (value != current)
1509 SendDiagRPC(value, rpc,
true);
1514 static void DiagToggleRPCAction(
int value,
ScriptCaller action,
int current,
int rpc)
1516 if (value != current)
1518 SendDiagRPC(value, rpc);
1519 action.Invoke(value);
1524 static void DiagToggleAction(
int value,
ScriptCaller action,
int current)
1526 if (value != current)
1528 action.Invoke(value);
1533 static void SendDiagRPCSelf(
Param value,
int rpc)
1538 g_Game.RPCSelfSingleParam(player, rpc, value);
1543 static void SendDiagRPCSelfBasic(SendDiagRPCSelfBasicParam param)
1545 SendDiagRPCSelf(null, param.param1);
1549 static void SendDiagRPCSelfParam(SendDiagRPCSelfParamParam param)
1551 SendDiagRPCSelf(param.param2, param.param1);
1555 static void SendDiagRPC(
Param value,
int rpc,
bool serverOnly =
false)
1561 if (
g_Game.IsMultiplayer() && playerIdentity)
1563 g_Game.RPCSingleParam(player, rpc, value,
true, playerIdentity);
1566 if (!
g_Game.IsMultiplayer() || !serverOnly)
1568 g_Game.RPCSelfSingleParam(player, rpc, value);
1574 static void SendDiagRPCBasic(SendDiagRPCBasicParam param)
1576 SendDiagRPC(null, param.param1, param.param2);
1580 static void SendDiagRPCParam(SendDiagRPCParamParam param)
1582 SendDiagRPC(param.param3, param.param1, param.param2);
1586 static void SendDiagRPC(
int rpc,
bool serverOnly =
false)
1588 SendDiagRPC(null, rpc, serverOnly);
1592 static void SendDiagRPC(
bool value,
int rpc,
bool serverOnly =
false)
1599 static void SendDiagRPC(
int value,
int rpc,
bool serverOnly =
false)
1606 static void SendDiagRPC(
float value,
int rpc,
bool serverOnly =
false)