Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
plugindiagmenu.c
Go to the documentation of this file.
2 {
6 };
7 
8 #ifdef DEVELOPER
9 enum ESubscriberSystems
10 {
11  TRIGGERS = 0x00000001,
12  //SYSTEM2 = 0x00000002,
13  //SYSTEM3 = 0x00000004,
14  //SYSTEM4 = 0x00000008,
15 }
16 #endif
17 
18 class PluginDiagMenu extends PluginBase
19 {
20 #ifdef DEVELOPER
21  static ref map<Man, int> m_Subscribers = new map<Man, int>;
22  static int m_SystemsMaks;
23  static bool DIAGS_REGISTERED;
24  ref Timer m_Timer;
25  bool m_EnableModifiers = true;
26  bool m_EnableUnlimitedAmmo;
27  bool m_DisableBloodLoss = false;
28  int m_IsInvincible = false;
29  bool m_ShowCraftingDebugActions = false;
30  bool m_BuildWood = false;
31  bool m_BuildGate = false;
32  bool m_LogPlayerStats = false;
33  bool m_SoftSkillsState = false;
34  bool m_SoftSkillsDebug = false;
35  bool m_GunParticlesState = false;
36  bool m_SoftSkillsModel = false;
37  bool m_BloodyHands = false;
38  bool m_PermanentCrossHair = false;
39  bool m_ToggleHud = false;
40  bool m_ShowingWeaponDebug = false;
41  bool m_AimNoiseEnabled = true;
42  int m_DisplayPlayerInfo = false;
43  bool m_ProceduralRecoilEnabled = true;
44  bool m_EnableQuickRestrain = false;
45  bool m_EnableQuickFishing = false;
46  bool m_StaminaDisabled = false;
47  bool m_EnvironmentStats = false;
48  bool m_EnableUniversalTemperatureSources = false;
49  bool m_DrawCheckerboard = false;
50  bool m_PresenceNotifierDebug = false;
51  bool m_ShowBleedingSources = false;
52  bool m_DoActionLogs = false;
53  bool m_DoWeaponLogs = false;
54  bool m_DoInventoryMoveLogs = false;
55  bool m_DoInventoryReservationLogs = false;
56  bool m_DoInventoryHFSMLogs = false;
57  bool m_DoSymptomLogs = false;
58  bool m_AllowInventoryAccess = false;
59  bool m_EnableRemoteCamera;
60  bool m_FixItems = false;
61  bool m_HitIndicationDebugEnabled = false;
62 
63  float m_SpecialtyLevel = 0;
64  float m_LifespanLevel = 0;
65  int m_DayzPlayerDebugMenu = -1;
66  int m_BleedingSourceRequested;
67  int m_BleedingSourceLevelRequested;
68  int m_HairLevelSelected = 0;
69  int m_TotalHairLevelsAdjusted;
70  int m_Burst = 0;
71  static bool ENABLE_BREATH_VAPOR;
72 
73  //string m_HairSelections = "Clipping_GhillieHood, Clipping_grathelm, Clipping_ConstructionHelmet, Clipping_Hockey_hekmet, Clipping_Maska, Clipping_ProtecSkateHelmet2, Clipping_BandanaFace, Clipping_NioshFaceMask, Clipping_NBC_Hood, Clipping_MotoHelmet, Clipping_FireHelmet, Clipping_ushanka, Clipping_TankerHelmet, Clipping_SantasBeard, Clipping_Surgical_mask, Clipping_PumpkinHelmet, Clipping_Balaclava_3holes, Clipping_Balaclava, Clipping_GP5GasMask, Clipping_BoonieHat, Clipping_prison_cap, Clipping_MilitaryBeret_xx, Clipping_Policecap, Clipping_OfficerHat, Clipping_Hat_leather, Clipping_CowboyHat, Clipping_BandanaHead, Clipping_SantasHat, Clipping_FlatCap, Clipping_MxHelmet, Clipping_baseballcap, Clipping_BeanieHat, Clipping_MedicalScrubs_Hat, Clipping_RadarCap, Clipping_ZmijovkaCap, Clipping_HeadTorch, Clipping_pilotka, Clipping_MxHelmet, Clipping_HelmetMich, Clipping_Ssh68Helmet, Clipping_Mich2001, Clipping_Welding_Mask, Clipping_VintageHockeyMask, Clipping_mouth_rags, Clipping_Gasmask";
74  ref map<int,bool> m_HairHidingStateMap;
75  ref TStringArray m_HairSelectionArray;
76  Shape m_VehicleFreeAreaBox;
77 
78  override void OnInit()
79  {
80  if ( GetGame().IsMultiplayer() && GetGame().IsServer() ) return; //(only client/local)
81 
82  m_DoActionLogs = IsCLIParam("doActionLog");
83  m_DoActionLogs = IsCLIParam("doInventoryLog");
84  m_DoActionLogs = IsCLIParam("doActionLog");
85  m_DoWeaponLogs = IsCLIParam("doWeaponLog");
86 
87  //----------------------
88  m_HairHidingStateMap = new map<int,bool>;
89  m_HairSelectionArray = new TStringArray;
90  m_VehicleFreeAreaBox = Debug.DrawBox(vector.Zero, vector.Zero, 0xffffffff);
91 
92  g_Game.ConfigGetTextArray("cfgVehicles Head_Default simpleHiddenSelections", m_HairSelectionArray);
93  m_TotalHairLevelsAdjusted = m_HairSelectionArray.Count() - 1;
94  for (int i = 0; i < m_HairSelectionArray.Count(); ++i)
95  {
96  m_HairHidingStateMap.Insert(i, 1); //all considered "shown" on init
97  }
98 
99  //----------------------
100  m_Timer = new Timer();
101 
102  m_Timer.Run(0.5, this, "Update", null, true);
103 
104  if (DIAGS_REGISTERED)
105  return;
106 
107  //---------------------------------------------------------------
108  // LEVEL 0
109  //---------------------------------------------------------------
110  DiagMenu.RegisterMenu(DiagMenuIDs.DM_SCRIPTS_MENU, "Script", "");
111  {
112  //---------------------------------------------------------------
113  // LEVEL 1 - Script
114  //---------------------------------------------------------------
115  DiagMenu.RegisterMenu(DiagMenuIDs.DM_PLAYER_STATES_MENU, "Player States", "Script");
116  {
117  //---------------------------------------------------------------
118  // LEVEL 2 - Script > Player States
119  //---------------------------------------------------------------
120  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_SYMPTOMS_SHOW, "lalt+6", "Show States", "Player States");
121  }
122 
123  //---------------------------------------------------------------
124  // LEVEL 1 - Script
125  //---------------------------------------------------------------
126  DiagMenu.RegisterMenu(DiagMenuIDs.DM_TRANSFER_VALUES_MENU, "TransferValues", "Script");
127  {
128  //---------------------------------------------------------------
129  // LEVEL 2 - Script > TransferValues
130  //---------------------------------------------------------------
131  DiagMenu.RegisterBool(DiagMenuIDs.DM_TRANSFER_VALUES_SHOW, "", "ShowValues", "TransferValues");
132  }
133 
134  //---------------------------------------------------------------
135  // LEVEL 1 - Script
136  //---------------------------------------------------------------
137  DiagMenu.RegisterMenu(DiagMenuIDs.DM_PLAYER_CRAFTING_MENU, "Crafting", "Script");
138  {
139  //---------------------------------------------------------------
140  // LEVEL 2 - Script > Crafting
141  //---------------------------------------------------------------
142  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_CRAFTING_GENERATE, "", "Generate Cache", "Crafting");
143  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_CRAFTING_DEBUG_ACTIONS_ENABLE, "", "Debug Insta Crafting", "Crafting");
144  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_CRAFTING_DUMP, "", "Dump recipes to file", "Crafting");
145  }
146 
147  //---------------------------------------------------------------
148  // LEVEL 1 - Script
149  //---------------------------------------------------------------
150  DiagMenu.RegisterMenu(DiagMenuIDs.DM_CHEATS_MENU, "Cheats", "Script");
151  {
152  //---------------------------------------------------------------
153  // LEVEL 2 - Script > Cheats
154  //---------------------------------------------------------------
155  DiagMenu.RegisterBool(DiagMenuIDs.DM_CHEATS_MODIFIERS_ENABLE, "lalt+2", "Tick Modifiers", "Cheats");
156  DiagMenu.SetValue(DiagMenuIDs.DM_CHEATS_MODIFIERS_ENABLE, true);
157  DiagMenu.RegisterBool(DiagMenuIDs.DM_CHEATS_PLAYER_INSTAKILL, "", "Kill Player", "Cheats");
158  DiagMenu.RegisterItem( DiagMenuIDs.DM_CHEATS_INVINCIBILITY, "lalt+1", "Invincibility (IDDQD)", "Cheats", "Disabled,Partial,Full" );
159  DiagMenu.RegisterBool(DiagMenuIDs.DM_CHEATS_STAMINA_DISABLE, "", "Disable stamina", "Cheats");
160  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_RESET, "", "Reset Player", "Cheats");
161  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_RESET_MAX, "lalt+3", "Reset Player Max", "Cheats");
162  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_INVENTORY_ACCESS, "", "Inventory Access", "Cheats");
163  DiagMenu.RegisterBool(DiagMenuIDs.DM_FIX_ITEMS, "", "Fix Inventory Items", "Cheats");
164  }
165 
166  //---------------------------------------------------------------
167  // LEVEL 1 - Script
168  //---------------------------------------------------------------
169  DiagMenu.RegisterMenu(DiagMenuIDs.DM_PLAYER_AGENTS_MENU, "Player Agents", "Script");
170  {
171  //---------------------------------------------------------------
172  // LEVEL 2 - Script > Player Agents
173  //---------------------------------------------------------------
174  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_AGENTS_INJECTS_SHOW, "lalt+5", "Allow Inject Actions", "Player Agents");
175  }
176 
177  //---------------------------------------------------------------
178  // LEVEL 1 - Script
179  //---------------------------------------------------------------
180  DiagMenu.RegisterMenu(DiagMenuIDs.DM_SOFT_SKILLS_MENU, "Soft Skills", "Script");
181  {
182  //---------------------------------------------------------------
183  // LEVEL 2 - Script > Soft Skills
184  //---------------------------------------------------------------
185  DiagMenu.RegisterBool( DiagMenuIDs.DM_SOFT_SKILLS_SHOW_DEBUG, "", "Show Debug", "Soft Skills" );
186  DiagMenu.RegisterBool( DiagMenuIDs.DM_SOFT_SKILLS_TOGGLE_STATE, "", "Enable SoftSkills", "Soft Skills" );
187  DiagMenu.RegisterBool( DiagMenuIDs.DM_SOFT_SKILLS_TOGGLE_MODEL, "", "Enable linear model", "Soft Skills" );
188  DiagMenu.RegisterRange( DiagMenuIDs.DM_SOFT_SKILLS_SPECIALTY_VALUE, "", "Set specialty value", "Soft Skills", "-1, 1, 0, 0.01" );
189  }
190 
191  //---------------------------------------------------------------
192  // LEVEL 1 - Script
193  //---------------------------------------------------------------
194  DiagMenu.RegisterMenu(DiagMenuIDs.DM_LIFESPAN_MENU, "Lifespan", "Script");
195  {
196  //---------------------------------------------------------------
197  // LEVEL 2 - Script > Lifespan
198  //---------------------------------------------------------------
199  DiagMenu.RegisterBool( DiagMenuIDs.DM_BLOODY_HANDS, "", "Bloody hands", "Lifespan" );
200  DiagMenu.RegisterRange( DiagMenuIDs.DM_LIFESPAN_PLAYTIME_UPDATE, "", "Playtime in minutes", "Lifespan", "0, 600, 0, 10" );
201  }
202 
203  //---------------------------------------------------------------
204  // LEVEL 1 - Script
205  //---------------------------------------------------------------
206  DiagMenu.RegisterMenu(DiagMenuIDs.DM_MISC_MENU, "Misc", "Script");
207  {
208  //---------------------------------------------------------------
209  // LEVEL 2 - Script > Misc
210  //---------------------------------------------------------------
211  DiagMenu.RegisterBool(DiagMenuIDs.DM_DISABLE_PERSONAL_LIGHT, "", "Disable Personal Light", "Misc");
212  DiagMenu.RegisterBool(DiagMenuIDs.DM_ITEM_DEBUG_ACTIONS_SHOW, "lalt+4", "Item Debug Actions", "Misc");
213  DiagMenu.RegisterBool(DiagMenuIDs.DM_PLAYER_STATS_LOG_ENABLE, "", "Log Player Stats", "Misc");
214  DiagMenu.RegisterMenu(DiagMenuIDs.DM_ACTION_TARGETS_MENU, "Action Targets", "Misc");
215  {
216  //---------------------------------------------------------------
217  // LEVEL 3 - Script > Misc > Action Targets
218  //---------------------------------------------------------------
219  DiagMenu.RegisterBool(DiagMenuIDs.DM_ACTION_TARGETS_NEW, "", "New AT Selection", "Action Targets", true);
220  DiagMenu.RegisterBool(DiagMenuIDs.DM_ACTION_TARGETS_DEBUG, "", "Show Debug", "Action Targets");
221  DiagMenu.RegisterBool(DiagMenuIDs.DM_ACTION_TARGETS_SELPOS_DEBUG, "", "Show selection pos debug", "Action Targets");
222  }
223  //---------------------------------------------------------------
224  // LEVEL 2 - Script > Misc
225  //---------------------------------------------------------------
226  DiagMenu.RegisterBool(DiagMenuIDs.DM_PERMANENT_CROSSHAIR, "", "Enable permanent crosshair", "Misc");
227  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOW_VEHICLE_GETOUT_BOX, "", "Debug transport freespace", "Misc");
228  DiagMenu.RegisterBool(DiagMenuIDs.DM_TOGGLE_HUD, "", "Toggle HUD on/off", "Misc", true);
229  DiagMenu.RegisterBool(DiagMenuIDs.DM_ENVIRONMENT_DEBUG_ENABLE, "", "Show Environment stats", "Misc");
230  DiagMenu.RegisterRange(DiagMenuIDs.DM_DISPLAY_PLAYER_INFO, "", "Display Player Info", "Misc", "0,2,0,1");
231  DiagMenu.RegisterBool(DiagMenuIDs.DM_UNIVERSAL_TEMPERATURE_SOURCES, "lalt+u", "Universal Temp Sources", "Misc");
232  DiagMenu.RegisterBool(DiagMenuIDs.DM_DRAW_CHECKERBOARD, "", "Draw Checkerboard on screen", "Misc");
233  DiagMenu.RegisterBool(DiagMenuIDs.DM_BULLET_IMPACT, "lalt+7", "BulletImpact", "Misc");
234  DiagMenu.RegisterBool(DiagMenuIDs.DM_PRESENCE_NOTIFIER_DBG, "", "Show Presence to AI dbg", "Misc");
235  DiagMenu.RegisterBool(DiagMenuIDs.DM_GO_UNCONSCIOUS, "", "Go Unconscious", "Misc");
236  DiagMenu.RegisterBool(DiagMenuIDs.DM_GO_UNCONSCIOUS_DELAYED, "", "Uncons. in 10sec", "Misc");
237  DiagMenu.RegisterBool(DiagMenuIDs.DM_QUICK_RESTRAIN, "", "Quick Restrain", "Misc");
238  DiagMenu.RegisterMenu(DiagMenuIDs.DM_HAIR_MENU, "Hair Hiding", "Misc");
239  {
240  //---------------------------------------------------------------
241  // LEVEL 3 - Script > Misc > Hair Hiding
242  //---------------------------------------------------------------
243  DiagMenu.RegisterBool(DiagMenuIDs.DM_HAIR_DISPLAY_DEBUG, "", "Display Debug", "Hair Hiding");
244  DiagMenu.RegisterRange(DiagMenuIDs.DM_HAIR_LEVEL, "", "Hair Level#", "Hair Hiding", string.Format("0,%1,0,1", m_TotalHairLevelsAdjusted));
245  DiagMenu.RegisterBool(DiagMenuIDs.DM_HAIR_LEVEL_HIDE, "", "Toggle Hair Level", "Hair Hiding");
246  DiagMenu.RegisterBool(DiagMenuIDs.DM_HAIR_HIDE_ALL, "", "Hide/Show All", "Hair Hiding");
247  }
248  //---------------------------------------------------------------
249  // LEVEL 2 - Script > Misc
250  //---------------------------------------------------------------
251  DiagMenu.RegisterBool(DiagMenuIDs.DM_CAM_SHAKE, "", "Simulate Cam Shake", "Misc");
252  DiagMenu.RegisterBool(DiagMenuIDs.DM_QUICK_FISHING, "", "Quick Fishing", "Misc");
253  DiagMenu.RegisterBool(DiagMenuIDs.DM_HOLOGRAM, "lctrl+h", "Hologram placing debug", "Misc");
254  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOCK_IMPACT, "lalt+8", "ShockHitEffect", "Misc");
255  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOW_PLUG_ARROWS, "", "Show Energy Manager Plug Arrows", "Misc");
256  DiagMenu.RegisterBool(DiagMenuIDs.DM_BREATH_VAPOR_LVL, "", "Breath Vapor", "Misc");
257  DiagMenu.SetValue(DiagMenuIDs.DM_BREATH_VAPOR_LVL, true);
258  DiagMenu.RegisterBool(DiagMenuIDs.DM_TARGETABLE_BY_AI, "", "Toggle Targetable By AI", "Misc");
259  DiagMenu.SetValue(DiagMenuIDs.DM_TARGETABLE_BY_AI, true);
260  DiagMenu.RegisterMenu(DiagMenuIDs.DM_HIT_INDICATION_MENU, "Hit Indication", "Misc");
261  {
262  //---------------------------------------------------------------
263  // LEVEL 3 - Script > Misc > Hit Indication
264  //---------------------------------------------------------------
265  DiagMenu.RegisterBool(DiagMenuIDs.DM_HIT_INDICATION_ENABLE_DEBUG, "", "Enable Debug", "Hit Indication");
266  DiagMenu.RegisterBool(DiagMenuIDs.DM_HIT_INDICATION_SPAWN_HIT, "", "Spawn Hit", "Hit Indication");
267  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_SPAWN_HIT_DIRECTION, "", "Spawn Hit Direction", "Hit Indication", "0, 359, 0, 1");
268  DiagMenu.RegisterItem(DiagMenuIDs.DM_HIT_INDICATION_MODE, "", "Mode", "Hit Indication", "Disabled,Static,Dynamic");
269  DiagMenu.SetValue(DiagMenuIDs.DM_HIT_INDICATION_MODE, 1);
270  DiagMenu.RegisterItem(DiagMenuIDs.DM_HIT_INDICATION_TYPE, "", "Type", "Hit Indication", "Splash,Spike,Arrow");
271  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_DURATION, "", "Hit Duration Max", "Hit Indication", "0.1, 5.0, 1.0, 0.1");
272  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_BREAKPOINT, "", "Hit Breakpoint", "Hit Indication", "0.0, 1.0, 0.8, 0.05");
273  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_DISTANCE, "", "Distance Adjust", "Hit Indication", "0.0, 1.0, 0.0, 0.01");
274  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_ROTATION, "", "Rotation Override", "Hit Indication", "0, 360, 0, 15");
275  DiagMenu.RegisterRange(DiagMenuIDs.DM_HIT_INDICATION_SCATTER, "", "Direction Scatter", "Hit Indication", "0, 90, 0, 1");
276  DiagMenu.RegisterBool(DiagMenuIDs.DM_HIT_INDICATION_DISABLE_PPE, "", "Disable Hit PPE", "Hit Indication");
277  }
278  //---------------------------------------------------------------
279  // LEVEL 2 - Script > Misc
280  //---------------------------------------------------------------
281  DiagMenu.RegisterBool(DiagMenuIDs.DM_SUPPRESSNEXTFRAMEINPUTS, "", "Suppress Next Frame Inputs", "Misc");
282  DiagMenu.RegisterBool(DiagMenuIDs.DM_FREEZE_ENTITY, "lalt+x", "Freeze entity", "Misc");
283  }
284 
285  //---------------------------------------------------------------
286  // LEVEL 1 - Script
287  //---------------------------------------------------------------
288  DiagMenu.RegisterMenu(DiagMenuIDs.DM_MISC_SIMULATE, "Simulate script", "Script");
289  {
290  //---------------------------------------------------------------
291  // LEVEL 2 - Script > Simulate script
292  //---------------------------------------------------------------
293  DiagMenu.RegisterBool(DiagMenuIDs.DM_SIMULATE_INFINITE_LOOP, "", "Simulate infinite loop", "Simulate script");
294  DiagMenu.RegisterBool(DiagMenuIDs.DM_SIMULATE_NULL_POINTER, "", "Simulate null pointer", "Simulate script");
295  DiagMenu.RegisterBool(DiagMenuIDs.DM_SIMULATE_DIVISION_BY_ZERO, "", "Simulate division by 0", "Simulate script");
296  DiagMenu.RegisterBool(DiagMenuIDs.DM_SIMULATE_ERROR_FUNCTION, "", "Simulate Error() function", "Simulate script");
297  }
298 
299  //---------------------------------------------------------------
300  // LEVEL 1 - Script
301  //---------------------------------------------------------------
302  DiagMenu.RegisterMenu(DiagMenuIDs.DM_MELEE_MENU, "Melee", "Script");
303  {
304  //---------------------------------------------------------------
305  // LEVEL 2 - Script > Melee
306  //---------------------------------------------------------------
307  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_DEBUG_ENABLE, "", "Enable Melee Debug", "Melee");
308  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_CONTINUOUS, "", "Continuous update", "Melee");
309  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_SHOW_TARGETS, "", "Show targets", "Melee");
310  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_DRAW_TARGETS, "", "Draw targets", "Melee");
311  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_DRAW_RANGE, "", "Draw range", "Melee");
312  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_DRAW_BLOCK_RANGE_AI, "", "Draw block range PVE", "Melee");
313  DiagMenu.RegisterBool(DiagMenuIDs.DM_MELEE_DRAW_BLOCK_RANGE_PVP, "", "Draw block range PVP", "Melee");
314  }
315 
316  //---------------------------------------------------------------
317  // LEVEL 1 - Script
318  //---------------------------------------------------------------
319  DiagMenu.RegisterMenu(DiagMenuIDs.DM_WEAPON_DEBUG_MENU, "Weapon", "Script");
320  {
321  //---------------------------------------------------------------
322  // LEVEL 2 - Script > Weapon
323  //---------------------------------------------------------------
324  DiagMenu.RegisterBool(DiagMenuIDs.DM_GUN_PARTICLES, "", "Enable gun particles", "Weapon", true);
325  DiagMenu.RegisterBool(DiagMenuIDs.DM_WEAPON_DEBUG_ENABLE, "", "Show Debug", "Weapon");
326  DiagMenu.RegisterBool(DiagMenuIDs.DM_WEAPON_AIM_NOISE, "", "Weapon Sway", "Weapon");
327  DiagMenu.SetValue(DiagMenuIDs.DM_WEAPON_AIM_NOISE, true);
328  DiagMenu.RegisterBool(DiagMenuIDs.DM_WEAPON_ALLOW_RECOIL, "", "Procedural Recoil", "Weapon");
329  DiagMenu.SetValue(DiagMenuIDs.DM_WEAPON_ALLOW_RECOIL, true);
330  DiagMenu.RegisterBool(DiagMenuIDs.DM_WEAPON_UNLIMITED, "lalt+9", "Unlimited Ammo", "Weapon");
331  DiagMenu.RegisterItem(DiagMenuIDs.DM_WEAPON_BURST, "lctrl+0", "Burst Version", "Weapon", "Hold, Press");
332  DiagMenu.RegisterBool(DiagMenuIDs.DM_WEAPON_CLAYMORE_DEBUG, "", "Claymore debugs", "Weapon");
333  }
334 
335  //---------------------------------------------------------------
336  // LEVEL 1 - Script
337  //---------------------------------------------------------------
338  DiagMenu.RegisterMenu(DiagMenuIDs.DM_BLEEDING_MENU, "Bleeding", "Script");
339  {
340  //---------------------------------------------------------------
341  // LEVEL 2 - Script > Bleeding
342  //---------------------------------------------------------------
343  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOW_BLEEDING_SOURCES, "", "Show Bleeding Sources", "Bleeding");
344  DiagMenu.RegisterBool(DiagMenuIDs.DM_DISABLE_BLOOD_LOSS, "", "Disable Blood Loss", "Bleeding");
345  DiagMenu.RegisterRange(DiagMenuIDs.DM_ACTIVATE_SOURCE, "", "Activate Source #", "Bleeding", "1, 32, 0, 1");
346  DiagMenu.RegisterBool(DiagMenuIDs.DM_ACTIVATE_ALL_BS, "", "Activate All Sources", "Bleeding");
347  DiagMenu.RegisterItem(DiagMenuIDs.DM_ACTIVATE_BS_LEVEL, "", "Activate Blsource Level", "Bleeding", "None, Low, Medium, High");
348  DiagMenu.SetValue(DiagMenuIDs.DM_ACTIVATE_BS_LEVEL, 0);
349  DiagMenu.RegisterBool(DiagMenuIDs.DM_BS_RELOAD, "", "Client Reload", "Bleeding");
350  DiagMenu.RegisterMenu(DiagMenuIDs.DM_BLEEDINGINDICATORS_MENU, "Bleeding Indication", "Bleeding");
351  {
352  //---------------------------------------------------------------
353  // LEVEL 3 - Script > Bleeding > Bleeding Indication
354  //---------------------------------------------------------------
355  DiagMenu.RegisterBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_ENABLE, "", "Enable BleedingIndicators", "Bleeding Indication");
356  DiagMenu.SetValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_ENABLE, true);
357  DiagMenu.RegisterBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_USEVALUEOVERRIDES, "", "Enable Debug Overrides", "Bleeding Indication");
358  DiagMenu.SetValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_USEVALUEOVERRIDES, false);
359  DiagMenu.RegisterBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RANDOMROTATION, "", "Enable Random Rotation", "Bleeding Indication");
360  DiagMenu.SetValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RANDOMROTATION, true);
361  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_SEQUENCE_DURATION, "", "Sequence Duration", "Bleeding Indication", "0.2, 5.0, " + BleedingIndicationConstants.SEQUENCE_DURATION_DEFAULT.ToString() + ", 0.01");
362  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_BASEDURATION, "", "Drop Anim Duration", "Bleeding Indication", "0.1, 5.0, " + BleedingIndicationConstants.DROP_DURATION_LOW.ToString() + ", 0.05");
363  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_MINDELAY, "", "Drop Min Delay", "Bleeding Indication", "0.0, 5.0, " + BleedingIndicationConstants.SEQUENCE_DROP_DELAY_MIN_LOW.ToString() + ", 0.05");
364  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_MAXDELAY, "", "Drop Max Delay", "Bleeding Indication", "0.0, 5.0, " + BleedingIndicationConstants.SEQUENCE_DROP_DELAY_MAX_LOW.ToString() + ", 0.05");
365  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_PROGRESSTHRESHOLD, "", "Drop Progress Threshold", "Bleeding Indication", "0.1, 1.0, " + BleedingIndicationConstants.DROP_PROGRESS_THRESHOLD.ToString() + ", 0.05");
366  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_STARTSIZE, "", "Drop Start Size", "Bleeding Indication", "0.1, 1.0, " + BleedingIndicationConstants.DROP_SIZE_START_LOW.ToString() + ", 0.01");
367  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_ENDSIZE, "", "Drop End Size", "Bleeding Indication", "0.1, 1.0, " + BleedingIndicationConstants.DROP_SIZE_END_LOW.ToString() + ", 0.01");
368  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RNDSCALEMIN, "", "Drop Size Random Min", "Bleeding Indication", "0.0, 2.0, " + BleedingIndicationConstants.DROP_SIZE_VARIATION_MIN_LOW.ToString() + ", 0.01");
369  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RNDSCALEMAX, "", "Drop Size Random Max", "Bleeding Indication", "0.0, 2.0, " + BleedingIndicationConstants.DROP_SIZE_VARIATION_MAX_LOW.ToString() + ", 0.01");
370  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_SCATTER, "", "Drop Scatter px", "Bleeding Indication", "0.0, 500.0, " + BleedingIndicationConstants.DROP_SCATTER_LOW.ToString() + ", 1.0");
371  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_SLIDEDISTANCE, "", "Drop Slide Distance", "Bleeding Indication", "0.0, 500.0, 0, 0.1");
372  DiagMenu.RegisterMenu(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLORMENU, "Color Debug", "Bleeding Indication");
373  {
374  //---------------------------------------------------------------
375  // LEVEL 4 - Script > Bleeding > Bleeding Indication > Color Debug
376  //---------------------------------------------------------------
377  DiagMenu.RegisterBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_ENABLEDESATURATION, "", "Desaturate", "Color Debug");
378  DiagMenu.SetValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_ENABLEDESATURATION, true);
379  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_DESATURATIONEND, "", "Saturation End Value", "Color Debug", "0.0, 1.0, " + BleedingIndicationConstants.DROP_COLOR_DESATURATIONEND.ToString() + ", 0.05");
380  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_R, "", "Red", "Color Debug", "0.0, 255.0, " + BleedingIndicationConstants.DROP_COLOR_RED.ToString() + ", 1.0");
381  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_G, "", "Green", "Color Debug", "0.0, 255.0, " + BleedingIndicationConstants.DROP_COLOR_GREEN.ToString() + ", 1.0");
382  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_B, "", "Blue", "Color Debug", "0.0, 255.0, " + BleedingIndicationConstants.DROP_COLOR_BLUE.ToString() + ", 1.0");
383  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_A_START, "", "Alpha - Start", "Color Debug", "0.0, 255.0, " + BleedingIndicationConstants.DROP_COLOR_ALPHA_START.ToString() + ", 1.0");
384  DiagMenu.RegisterRange(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_A_END, "", "Alpha - End", "Color Debug", "0.0, 255.0, " + BleedingIndicationConstants.DROP_COLOR_ALPHA_END.ToString() + ", 1.0");
385  }
386  }
387  }
388 
389  //---------------------------------------------------------------
390  // LEVEL 1 - Script
391  //---------------------------------------------------------------
392  DiagMenu.RegisterMenu(DiagMenuIDs.DM_LOGS_MENU, "Logs", "Script");
393  {
394  //---------------------------------------------------------------
395  // LEVEL 2 - Script > Logs
396  //---------------------------------------------------------------
397  DiagMenu.RegisterBool(DiagMenuIDs.DM_LOG_ACTIONS, "", "Log Actions", "Logs");
398  DiagMenu.RegisterBool(DiagMenuIDs.DM_LOG_SYMPTOM, "", "Log Symptoms", "Logs");
399  DiagMenu.RegisterMenu(DiagMenuIDs.DM_LOGS_MENU_INVENTORY, "InventoryLog", "Logs");
400  {
401  //---------------------------------------------------------------
402  // LEVEL 3 - Script > Logs > InventoryLogs
403  //---------------------------------------------------------------
404  DiagMenu.RegisterBool(DiagMenuIDs.DM_LOG_INVENTORY_MOVE, "", "Log Items move", "InventoryLog");
405  DiagMenu.RegisterBool(DiagMenuIDs.DM_LOG_INVENTORY_RESERVATION, "", "Log Reservations", "InventoryLog");
406  DiagMenu.RegisterBool(DiagMenuIDs.DM_LOG_INVENTORY_HFSM, "", "Log HandFSM", "InventoryLog");
407  }
408  }
409 
410  //---------------------------------------------------------------
411  // LEVEL 1 - Script
412  //---------------------------------------------------------------
413  DiagMenu.RegisterMenu(DiagMenuIDs.DM_TRIGGER_MENU, "Triggers", "Script");
414  {
415  //---------------------------------------------------------------
416  // LEVEL 2 - Script > Triggers
417  //---------------------------------------------------------------
418  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOW_AREADMG_TRIGGER, "", "Show Triggers", "Triggers");
419  DiagMenu.RegisterBool(DiagMenuIDs.DM_SHOW_PLAYER_TOUCHTRIGGER, "", "Show Player Touch", "Triggers");
420  #ifdef TRIGGER_DEBUG_BASIC
421  DiagMenu.SetValue(DiagMenuIDs.DM_SHOW_AREADMG_TRIGGER, true);
422  DiagMenu.SetValue(DiagMenuIDs.DM_SHOW_PLAYER_TOUCHTRIGGER, true);
423  #endif
424  }
425 
426  //---------------------------------------------------------------
427  // LEVEL 1 - Script
428  //---------------------------------------------------------------
429  DiagMenu.RegisterMenu(DiagMenuIDs.DM_BASEBUILDING_MENU, "Base Building", "Script");
430  {
431  //---------------------------------------------------------------
432  // LEVEL 2 - Script > Base Building
433  //---------------------------------------------------------------
434  DiagMenu.RegisterBool(DiagMenuIDs.DM_BUILD_WOOD, "", "Spawn uses wood/metal", "Base Building");
435  DiagMenu.RegisterBool(DiagMenuIDs.DM_BUILD_GATE, "", "Spawn Fence makes gate", "Base Building");
436  }
437 
438  //---------------------------------------------------------------
439  // LEVEL 1 - Script
440  //---------------------------------------------------------------
441  DiagMenu.RegisterMenu(DiagMenuIDs.DM_UNDERGROUNDS, "Underground Areas", "Script");
442  {
443  //---------------------------------------------------------------
444  // LEVEL 2 - Script > Underground Areas
445  //---------------------------------------------------------------
446  DiagMenu.RegisterBool(DiagMenuIDs.DM_UNDERGROUND_SHOW_BREADCRUMB, "", "Show Breadcrumbs", "Underground Areas");
447  DiagMenu.RegisterBool(DiagMenuIDs.DM_UNDERGROUND_DISABLE_DARKENING, "lctrl+f", "Disable Darkening", "Underground Areas");
448  }
449 
450  //---------------------------------------------------------------
451  // LEVEL 1 - Script
452  //---------------------------------------------------------------
453  DiagMenu.RegisterMenu(DiagMenuIDs.DM_FINISHERS_MENU, "Finishers", "Script");
454  {
455  //---------------------------------------------------------------
456  // LEVEL 2 - Script > Finishers
457  //---------------------------------------------------------------
458  DiagMenu.RegisterItem(DiagMenuIDs.DM_FINISHERS_FINISHER_FORCED, "", "Forced Finisher: ", "Finishers", "None,Liver,Neck");
459  }
460 
461  //---------------------------------------------------------------
462  // LEVEL 1 - Script
463  //---------------------------------------------------------------
464  DiagMenu.RegisterMenu(DiagMenuIDs.DM_SOUNDS_MENU, "Script Sounds", "Script");
465  {
466  //---------------------------------------------------------------
467  // LEVEL 2 - Script > Script Sounds
468  //---------------------------------------------------------------
469  DiagMenu.RegisterBool(DiagMenuIDs.DM_SOUNDS_ITEM_IMPACT_SOUNDS, "", "Item impact sounds", "Script Sounds");
470  }
471 
472  //---------------------------------------------------------------
473  // LEVEL 1 - Script
474  //---------------------------------------------------------------
475  DiagMenu.RegisterMenu(DiagMenuIDs.DM_CAMERA_TOOLS_MENU, "Cinematic Camera Tools", "Script");
476  {
477  //---------------------------------------------------------------
478  // LEVEL 2 - Script > Cinematic Camera Tools
479  //---------------------------------------------------------------
480  DiagMenu.RegisterBool(DiagMenuIDs.DM_ENABLE_REMOTE_CAMERA, "", "Show remote camera", "Cinematic Camera Tools");
481  DiagMenu.RegisterBool(DiagMenuIDs.DM_ENABLE_REMOTE_CAMERA_BROADCAST, "", "Broadcast camera", "Cinematic Camera Tools");
482  }
483  //---------------------------------------------------------------
484  // LEVEL 1 - Script
485  //---------------------------------------------------------------
486  DiagMenu.RegisterMenu(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_MENU, "Time Accel", "Script");
487  {
488  //---------------------------------------------------------------
489  // LEVEL 2 - Script > Cinematic Camera Tools
490  //---------------------------------------------------------------
491  DiagMenu.RegisterBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENABLE, "", "Apply Time Accel", "Time Accel");
492  DiagMenu.RegisterRange(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_VALUE1, "", "Accel Factor Big", "Time Accel","0,100,1,1");
493  DiagMenu.RegisterRange(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_VALUE2, "", "Accel Factor Small", "Time Accel","0,0.95 ,0,0.05");
494  DiagMenu.RegisterBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_UG_ENTRANCES, "", "Underground Entrances", "Time Accel");
495  DiagMenu.RegisterBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_UG_RESERVOIR, "", "Underground Reservoir", "Time Accel");
496  DiagMenu.RegisterBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENERGY_CONSUME, "", "Energy Consumption", "Time Accel");
497  DiagMenu.RegisterBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENERGY_RECHARGE, "", "Energy Recharging", "Time Accel");
498  }
499  }
500 
501  DIAGS_REGISTERED = true;
502  }
503 
504  void Update(float deltaT)
505  {
506  //---------------------------------------------
507  // every system can handle their own actions locally(within the system itself),
508  // this section is for systems which don't have client side representation,
509  // or don't have their own tick, or for whatever other reason you prefer to put the logic here
510  // PUT ONLY METHOD CALLS HERE, NO CODE !!
511  // PUT ONLY METHOD CALLS HERE, NO CODE !!
512  //---------------------------------------------
513 
514  CheckModifiers();//should modifiers be ticking
515  CheckKillPlayer();//should i kill myself ?
516  CheckCraftingDebugActions();
517  CheckItemDebugActions();
518  CheckAgentInjectActions();
519  CheckGenerateRecipeCache();
520  CheckDayzPlayerMenu();
521  CheckSoftSkillsDebug();
522  CheckSoftSkillsState();
523  CheckSoftSkillsModel();
524  CheckGunParticles();
525  CheckSpecialtyLevel();
526  CheckBloodyHands();
527  CheckLifeSpanPlaytimeUpdate();
528  CheckPermanentCrossHairUpdate();
529  CheckToggleHud();
530  CheckShowWeaponDebug();
531  CheckInvincibility();
532  CheckStamina();
533  CheckAimNoise();
534  CheckProceduralRecoil();
535  CheckUnlimitedAmmo();
536  CheckCraftingDump();
537  CheckEnvironmentStats();
538  CheckUniversalTemperatureSources();
539  CheckDisplayMenu();
540  CheckDrawCheckerboard();
541  CheckBulletImpact();
542  CheckShockImpact();
543  CheckTargetableByAI();
544  CheckPresenceNotifierDebug();
545  CheckGoUnconscious();
546  CheckGoUnconsciousDelayed();
547  CheckSimulateNULLPointer();
548  CheckSimulateDivisionByZero();
549  CheckSimulateInfiniteLoop();
550  CheckSimulateErrorFunction();
551  CheckShowBleedingSources();
552  CheckDisableBloodLoss();
553  CheckActivateAllBS();
554  CheckReloadBS();
555  CheckActivateBleedingSource();
556  CheckActivateBleedingSourceLevel();
557  CheckQuickRestrain();
558  CheckQuickFishing();
559  CheckHairLevel();
560  CheckHairHide();
561  CheckPersonalLight();
562  CheckCamShake();
563  CheckVehicleGetOutBox();
564  CheckDoActionLogs();
565  CheckDoWeaponLogs();
566  CheckDoInventoryLogs();
567  CheckDoSymptomLogs();
568  CheckPlayerReset();
569  CheckInventoryAccess();
570  CheckFixItems();
571  CheckPlugArrows();
572  CheckBurst();
573  CheckBreathVapor();
574  CheckHitDirection();
575  CheckBleedingIndicators();
576  CheckFinisherOverride();
577  CheckInputSuppression();
578  CheckFreezeEntity();
579  CheckBuildWood();
580  CheckBuildGate();
581  CheckClientCameraObserver();
582  CheckTriggerDebug();
583  CheckTimeAccel();
584 
585  }
586  //---------------------------------------------
587  void CheckTimeAccel()
588  {
589  bool enable = DiagMenu.GetBool(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENABLE);
590  float timeAccel = DiagMenu.GetRangeValue(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_VALUE1) + DiagMenu.GetRangeValue(DiagMenuIDs.DM_FEATURE_TIME_ACCEL_VALUE2);
591  int bitMask = GetTimeAccelBitmask();
592 
593 
594 
595  TimeAccelParam param = new TimeAccelParam(enable, timeAccel, bitMask);
596 
597  if (!AreTimeAccelParamsSame(param, FeatureTimeAccel.m_CurrentTimeAccel))
598  {
599  SendTimeAccel(param);
600  FeatureTimeAccel.m_CurrentTimeAccel = param;
601  }
602 
603  }
604  //---------------------------------------------
605  void CheckTriggerDebug()
606  {
607  EnableDebugSystemClient(ESubscriberSystems.TRIGGERS,DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_AREADMG_TRIGGER));
608  }
609 
610  //---------------------------------------------
611  void CheckBreathVapor()
612  {
613  ENABLE_BREATH_VAPOR = DiagMenu.GetBool(DiagMenuIDs.DM_BREATH_VAPOR_LVL);
614  }
615  //---------------------------------------------
616 
617  void CheckClientCameraObserver()
618  {
619  if ( DiagMenu.GetBool(DiagMenuIDs.DM_ENABLE_REMOTE_CAMERA))
620  {
621  if (!m_EnableRemoteCamera)
622  {
623 
624  if (GetGame() && GetGame().GetPlayer())
625  GetGame().RPCSingleParam( null, ERPCs.DEV_CAMERA_TOOLS_CAM_SUBSCRIBE, new Param2<bool, EntityAI>(true, GetGame().GetPlayer()), true );
626  m_EnableRemoteCamera = true;
627  }
628  }
629  else
630  {
631  if (m_EnableRemoteCamera)
632  {
633  if (GetGame() && GetGame().GetPlayer())
634  {
635  GetGame().RPCSingleParam( null, ERPCs.DEV_CAMERA_TOOLS_CAM_SUBSCRIBE, new Param2<bool, EntityAI>(false, GetGame().GetPlayer()), true );
636  if (PlayerBase.Cast(GetGame().GetPlayer()).m_CameraToolsMenuClient)
637  PlayerBase.Cast(GetGame().GetPlayer()).m_CameraToolsMenuClient.DelayedDestroy();
638  }
639  m_EnableRemoteCamera = false;
640 
641 
642  }
643  }
644  }
645 
646  void CheckPlayerReset()
647  {
648  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_RESET) || DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_RESET_MAX))
649  {
650 
651  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_RESET) )
652  {
653  CachedObjectsParams.PARAM1_BOOL.param1 = false;
654 
655  }
656 
657  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_RESET_MAX) )
658  {
659  CachedObjectsParams.PARAM1_BOOL.param1 = true;
660 
661  }
662 
663 
664  if (GetGame() && GetGame().GetPlayer())
665  {
666  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_PLAYER_RESET, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
667  DiagMenu.SetValue(DiagMenuIDs.DM_PLAYER_RESET, false);
668  DiagMenu.SetValue(DiagMenuIDs.DM_PLAYER_RESET_MAX, false);
669  }
670  }
671  }
672  void CheckInventoryAccess()
673  {
674  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_INVENTORY_ACCESS) )
675  {
676  if (!m_AllowInventoryAccess)
677  {
678  SendInventoryAccessRPC(true);
679  PlayerBase.DEBUG_INVENTORY_ACCESS = true;
680  m_AllowInventoryAccess = true;
681  }
682  }
683  else
684  {
685  if (m_AllowInventoryAccess)
686  {
687  PlayerBase.DEBUG_INVENTORY_ACCESS = false;
688  m_AllowInventoryAccess = false;
689  }
690  }
691  }
692  void CheckFixItems()
693  {
694  if ( DiagMenu.GetBool(DiagMenuIDs.DM_FIX_ITEMS) )
695  {
696  if (GetGame() && GetGame().GetPlayer())
697  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_ITEMS_FIX, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
698  DiagMenu.SetValue(DiagMenuIDs.DM_FIX_ITEMS, false);
699  }
700  }
701 
702  //---------------------------------------------
703  void CheckModifiers()
704  {
705  if ( DiagMenu.GetBool(DiagMenuIDs.DM_CHEATS_MODIFIERS_ENABLE) )
706  {
707  if (!m_EnableModifiers)
708  {
709  SendModifiersRPC(true);
710  m_EnableModifiers = true;
711  }
712  }
713  else
714  {
715  if (m_EnableModifiers)
716  {
717  SendModifiersRPC(false);
718  m_EnableModifiers = false;
719  }
720  }
721  }
722  //---------------------------------------------
723  void CheckUnlimitedAmmo()
724  {
725  if ( DiagMenu.GetBool(DiagMenuIDs.DM_WEAPON_UNLIMITED) )
726  {
727  if (!m_EnableUnlimitedAmmo)
728  {
729  SendUnlimitedRPC(true);
730  m_EnableUnlimitedAmmo = true;
731  ItemBase.SetDebugActionsMask( ItemBase.GetDebugActionsMask() | DebugActionType.UNLIMITED_AMMO );
732  }
733  }
734  else
735  {
736  if (m_EnableUnlimitedAmmo)
737  {
738  SendUnlimitedRPC(false);
739  m_EnableUnlimitedAmmo = false;
740  ItemBase.SetDebugActionsMask( ItemBase.GetDebugActionsMask() & (~DebugActionType.UNLIMITED_AMMO) );
741  }
742  }
743  }
744  //---------------------------------------------
745  void CheckDisableBloodLoss()
746  {
747  if ( DiagMenu.GetBool(DiagMenuIDs.DM_DISABLE_BLOOD_LOSS) )
748  {
749  if (!m_DisableBloodLoss)
750  {
751  SendDisableBloodLossRPC(true);
752  m_DisableBloodLoss = true;
753  }
754  }
755  else
756  {
757  if (m_DisableBloodLoss)
758  {
759  SendDisableBloodLossRPC(false);
760  m_DisableBloodLoss = false;
761  }
762  }
763  }
764  //---------------------------------------------
765  void CheckActivateAllBS()
766  {
767  if ( DiagMenu.GetBool(DiagMenuIDs.DM_ACTIVATE_ALL_BS) )
768  {
769  SendActivateAllBSRPC();
770  DiagMenu.SetValue(DiagMenuIDs.DM_ACTIVATE_ALL_BS, false);//to prevent constant RPC calls, switch back to false
771  }
772  }
773  //---------------------------------------------
774  void CheckReloadBS()
775  {
776  if ( DiagMenu.GetBool(DiagMenuIDs.DM_BS_RELOAD) )
777  {
778  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
779  if (player && player.GetBleedingManagerRemote())
780  {
781  player.GetBleedingManagerRemote().Reload();
782  }
783  DiagMenu.SetValue(DiagMenuIDs.DM_BS_RELOAD, false);//to prevent constant RPC calls, switch back to false
784  }
785  }
786  //---------------------------------------------
787  void CheckGenerateRecipeCache()
788  {
789  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_CRAFTING_GENERATE) )
790  {
791  PluginRecipesManager plugin_recipes_manager;
792  Class.CastTo(plugin_recipes_manager, GetPlugin(PluginRecipesManager));
793  plugin_recipes_manager.CallbackGenerateCache();
794  DiagMenu.SetValue(DiagMenuIDs.DM_PLAYER_CRAFTING_GENERATE, false);
795  }
796  }
797  //---------------------------------------------
798  void CheckShowBleedingSources()
799  {
800  PlayerBase player;
801  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_BLEEDING_SOURCES) )
802  {
803  if ( !m_ShowBleedingSources )
804  {
805  player = PlayerBase.Cast(GetGame().GetPlayer());
806  player.GetBleedingManagerRemote().SetDiag(true);
807  m_ShowBleedingSources = true;
808  }
809  }
810  else
811  {
812  if ( m_ShowBleedingSources )
813  {
814  player = PlayerBase.Cast(GetGame().GetPlayer());
815  player.GetBleedingManagerRemote().SetDiag(false);
816  m_ShowBleedingSources = false;
817  }
818  }
819  }
820  //---------------------------------------------
821  void CheckKillPlayer()
822  {
823  if ( DiagMenu.GetBool(DiagMenuIDs.DM_CHEATS_PLAYER_INSTAKILL) )
824  {
825  SendKillPlayerRPC();
826  DiagMenu.SetValue(DiagMenuIDs.DM_CHEATS_PLAYER_INSTAKILL, false);//to prevent constant RPC calls, switch back to false
827  }
828  }
829  //---------------------------------------------
830  void CheckGoUnconscious()
831  {
832  if ( DiagMenu.GetBool(DiagMenuIDs.DM_GO_UNCONSCIOUS) )
833  {
834  SendGoUnconsciousRPC(false);
835  DiagMenu.SetValue(DiagMenuIDs.DM_GO_UNCONSCIOUS, false);//to prevent constant RPC calls, switch back to false
836  }
837  }
838  //---------------------------------------------
839  void CheckGoUnconsciousDelayed()
840  {
841  if ( DiagMenu.GetBool(DiagMenuIDs.DM_GO_UNCONSCIOUS_DELAYED) )
842  {
843  SendGoUnconsciousRPC(true);
844  DiagMenu.SetValue(DiagMenuIDs.DM_GO_UNCONSCIOUS_DELAYED, false);//to prevent constant RPC calls, switch back to false
845  }
846  }
847 
848  void CheckHairLevel()
849  {
850  int value = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HAIR_LEVEL);
851  if (value != m_HairLevelSelected)
852  {
853  m_HairLevelSelected = value;
854  //SendSetHairLevelRPC();
855  DiagMenu.SetRangeValue(DiagMenuIDs.DM_HAIR_LEVEL, value);//to prevent constant RPC calls, switch back to false
856  }
857  }
858 
859  void CheckHairHide()
860  {
861  int value = DiagMenu.GetBool(DiagMenuIDs.DM_HAIR_LEVEL_HIDE);
862  bool hide_all = DiagMenu.GetBool(DiagMenuIDs.DM_HAIR_HIDE_ALL);
863  if (hide_all)
864  {
865  SendSetHairLevelHideRPC(-1,value);
866  DiagMenu.SetValue(DiagMenuIDs.DM_HAIR_HIDE_ALL, false);//to prevent constant RPC calls, switch back to false
867  }
868  else if (value)
869  {
870  SendSetHairLevelHideRPC(m_HairLevelSelected,value);
871  DiagMenu.SetValue(DiagMenuIDs.DM_HAIR_LEVEL_HIDE, false);//to prevent constant RPC calls, switch back to false
872  }
873  }
874 
875  void CheckPersonalLight()
876  {
877  int value = DiagMenu.GetBool(DiagMenuIDs.DM_DISABLE_PERSONAL_LIGHT);
878  PlayerBaseClient.m_PersonalLightDisabledByDebug = value;
879  PlayerBaseClient.UpdatePersonalLight();
880  }
881 
882  //---------------------------------------------
883  void CheckItemDebugActions()
884  {
885  if ( DiagMenu.GetBool(DiagMenuIDs.DM_ITEM_DEBUG_ACTIONS_SHOW) )
886  {
887  if ( (ItemBase.GetDebugActionsMask() & DebugActionType.GENERIC_ACTIONS) == 0 )
888  {
889  int mask = (ItemBase.GetDebugActionsMask() | DebugActionType.GENERIC_ACTIONS);
890  ItemBase.SetDebugActionsMask(mask);
891  SendDebugActionsRPC();
892  }
893  }
894  else
895  {
896  if ( (ItemBase.GetDebugActionsMask() & DebugActionType.GENERIC_ACTIONS) )
897  {
898  int mask2 = (ItemBase.GetDebugActionsMask() & (~DebugActionType.GENERIC_ACTIONS));
899  ItemBase.SetDebugActionsMask(mask2);
900  SendDebugActionsRPC();
901  }
902  }
903  }
904 
905  void CheckBulletImpact()
906  {
907  if ( DiagMenu.GetBool(DiagMenuIDs.DM_BULLET_IMPACT) )
908  {
909  PlayerBase pl_player = PlayerBase.Cast(GetGame().GetPlayer() );
910  CachedObjectsParams.PARAM2_FLOAT_FLOAT.param1 = 32;
911  CachedObjectsParams.PARAM2_FLOAT_FLOAT.param2 = 0.3;
912  pl_player.SpawnDamageDealtEffect2(CachedObjectsParams.PARAM2_FLOAT_FLOAT);
913  DiagMenu.SetValue(DiagMenuIDs.DM_BULLET_IMPACT, false);
914  }
915  else
916  {
917 
918  }
919  }
920 
921  float tmp = 0.25;
922  void CheckShockImpact()
923  {
924  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SHOCK_IMPACT) )
925  {
926  PlayerBase pl_player = PlayerBase.Cast(GetGame().GetPlayer() );
927  if (tmp >= 1.0) tmp = 0.25;
928  pl_player.SpawnShockEffect(tmp);
929  tmp += 0.25;
930  DiagMenu.SetValue(DiagMenuIDs.DM_SHOCK_IMPACT, false);
931  }
932  }
933 
934  void CheckHitDirection()
935  {
936  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
937  bool enabled = DiagMenu.GetBool(DiagMenuIDs.DM_HIT_INDICATION_ENABLE_DEBUG);
938  if (enabled != m_HitIndicationDebugEnabled)
939  {
940  if (!enabled)
941  {
942  HitDirectionEffectBase.CheckValues();
943  if (player)
944  {
945  player.SetHitPPEEnabled(CfgGameplayHandler.GetHitIndicationPPEEnabled());
946  }
947  }
948  //Print("DbgHitDirection | PluginDiagMenu | CheckHitDirection | enabled: " + enabled);
949  m_HitIndicationDebugEnabled = enabled;
950  }
951 
952  if ( m_HitIndicationDebugEnabled )
953  {
954  HitDirectionEffectBase.m_Mode = DiagMenu.GetValue(DiagMenuIDs.DM_HIT_INDICATION_MODE);
955  HitDirectionEffectBase.m_ID = DiagMenu.GetValue(DiagMenuIDs.DM_HIT_INDICATION_TYPE);
956  HitDirectionEffectBase.m_DurationMax = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_DURATION);
957  HitDirectionEffectBase.m_BreakPointBase = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_BREAKPOINT);
958  HitDirectionEffectBase.m_DistanceAdjust = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_DISTANCE);
959  HitDirectionEffectBase.m_RotationOverride = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_ROTATION);
960  HitDirectionEffectBase.m_Scatter = DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_SCATTER);
961  }
962 
963  if (player)
964  {
965  if ( DiagMenu.GetBool(DiagMenuIDs.DM_HIT_INDICATION_SPAWN_HIT) )
966  {
967  if ( m_HitIndicationDebugEnabled )
968  {
969  GetGame().GetMission().GetHud().SpawnHitDirEffect(player,DiagMenu.GetRangeValue(DiagMenuIDs.DM_HIT_INDICATION_SPAWN_HIT_DIRECTION),1.0);
970  }
971  DiagMenu.SetValue(DiagMenuIDs.DM_HIT_INDICATION_SPAWN_HIT,false);
972  }
973 
974  if ( m_HitIndicationDebugEnabled )
975  {
976  player.SetHitPPEEnabled(!DiagMenu.GetBool(DiagMenuIDs.DM_HIT_INDICATION_DISABLE_PPE));
977  }
978  }
979  }
980 
981  void CheckBleedingIndicators()
982  {
983  bool diagEnable = DiagMenu.GetBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_ENABLE);
984  if (diagEnable != DbgBleedingIndicationStaticInfo.m_DbgEnableBleedingIndication)
985  {
986  DbgBleedingIndicationStaticInfo.m_DbgEnableBleedingIndication = diagEnable;
987  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
988  if (player && player.GetBleedingManagerRemote())
989  {
990  player.GetBleedingManagerRemote().Reload();
991  }
992  }
993  DbgBleedingIndicationStaticInfo.m_DbgUseOverrideValues = DiagMenu.GetBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_USEVALUEOVERRIDES);
994 
995  if (DbgBleedingIndicationStaticInfo.m_DbgUseOverrideValues)
996  {
997  DbgBleedingIndicationStaticInfo.m_DbgSequenceDuration = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_SEQUENCE_DURATION);
998  DbgBleedingIndicationStaticInfo.m_DbgDropRotationRandom = DiagMenu.GetBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RANDOMROTATION);
999  DbgBleedingIndicationStaticInfo.m_DbgDropDurationBase = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_BASEDURATION);
1000  DbgBleedingIndicationStaticInfo.m_DbgDropMinDelay = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_MINDELAY);
1001  DbgBleedingIndicationStaticInfo.m_DbgDropMaxDelay = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_MAXDELAY);
1002  DbgBleedingIndicationStaticInfo.m_DbgDropProgressTreshold = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_PROGRESSTHRESHOLD);
1003  DbgBleedingIndicationStaticInfo.m_DbgDropStartSize = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_STARTSIZE);
1004  DbgBleedingIndicationStaticInfo.m_DbgDropEndSize = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_ENDSIZE);
1005  DbgBleedingIndicationStaticInfo.m_DbgDropSizeVariationMin = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RNDSCALEMIN);
1006  DbgBleedingIndicationStaticInfo.m_DbgDropSizeVariationMax = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_RNDSCALEMAX);
1007  DbgBleedingIndicationStaticInfo.m_DbgDropScatter = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_SCATTER);
1008  DbgBleedingIndicationStaticInfo.m_DbgDropSlideDistance = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_SLIDEDISTANCE);
1009 
1010  DbgBleedingIndicationStaticInfo.m_DbgDropDesaturate = DiagMenu.GetBool(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_ENABLEDESATURATION);
1011  DbgBleedingIndicationStaticInfo.m_DbgDesaturationEnd = DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_DESATURATIONEND);
1012  DbgBleedingIndicationStaticInfo.m_DbgDropColorRed = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_R);
1013  DbgBleedingIndicationStaticInfo.m_DbgDropColorGreen = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_G);
1014  DbgBleedingIndicationStaticInfo.m_DbgDropColorBlue = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_B);
1015  DbgBleedingIndicationStaticInfo.m_DbgDropColorAlphaStart = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_A_START);
1016  DbgBleedingIndicationStaticInfo.m_DbgDropColorAlphaEnd = (int)DiagMenu.GetRangeValue(DiagMenuIDs.DM_BLEEDINGINDICATORS_DROP_COLOR_A_END);
1017  }
1018  }
1019 
1020  void CheckFinisherOverride()
1021  {
1022  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1023  int value = DiagMenu.GetValue(DiagMenuIDs.DM_FINISHERS_FINISHER_FORCED) - 1;
1024  if ( player && player.GetMeleeCombat() && player.GetMeleeCombat().DebugGetForcedFinisherType() != value )
1025  {
1026  player.GetMeleeCombat().DebugSetForcedFinisherType(value);
1027  SendForceFinisherType(value);
1028  }
1029  }
1030 
1031  void CheckTargetableByAI()
1032  {
1033  PlayerBase pl_player = PlayerBase.Cast(GetGame().GetPlayer());
1034  if (pl_player)
1035  {
1036  bool value = DiagMenu.GetBool(DiagMenuIDs.DM_TARGETABLE_BY_AI);
1037  if ( value != pl_player.m_CanBeTargetedDebug )
1038  {
1039  pl_player.m_CanBeTargetedDebug = value;
1040  SendTargetabilityRPC(value);
1041  }
1042  }
1043  }
1044 
1045  void CheckInputSuppression()
1046  {
1047  /*Mission mission = GetGame().GetMission();
1048  if (mission)
1049  {
1050  bool value = DiagMenu.GetBool(DiagMenuIDs.DM_SUPPRESSNEXTFRAMEINPUTS);
1051  if ( value != mission.GetInputSuppression() )
1052  {
1053  mission.SetInputSuppression(value);
1054  }
1055  }*/
1056  }
1057 
1058  void CheckFreezeEntity()
1059  {
1060  if ( DiagMenu.GetBool(DiagMenuIDs.DM_FREEZE_ENTITY) )
1061  {
1062  EntityAI entity;
1063  if (PluginSceneManager.GetInstance() && PluginSceneManager.GetInstance().IsOpened())
1064  {
1065  // Scene Editor
1066  SceneObject scene_obj = PluginSceneManager.GetInstance().GetSelectedSceneObject();
1067 
1068  if (scene_obj)
1069  {
1070  entity = scene_obj.GetObject();
1071  }
1072  }
1073  else
1074  {
1075  // FreeDebugCamera
1076  FreeDebugCamera camera = FreeDebugCamera.GetInstance();
1077  entity = EntityAI.Cast(camera.GetCrosshairObject());
1078  }
1079 
1080  if (entity)
1081  entity.DisableSimulation(!entity.GetIsSimulationDisabled());
1082 
1083  DiagMenu.SetValue(DiagMenuIDs.DM_FREEZE_ENTITY, false);
1084  }
1085  }
1086 
1087  //---------------------------------------------
1088  void CheckAgentInjectActions()
1089  {
1090  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_AGENTS_INJECTS_SHOW) )
1091  {
1092  if ( (ItemBase.GetDebugActionsMask() & DebugActionType.PLAYER_AGENTS) == 0 )
1093  {
1094  int mask = (ItemBase.GetDebugActionsMask() | DebugActionType.PLAYER_AGENTS);
1095  ItemBase.SetDebugActionsMask(mask);
1096  SendDebugActionsRPC();
1097  }
1098  }
1099  else
1100  {
1101  if ( ItemBase.GetDebugActionsMask() & DebugActionType.PLAYER_AGENTS )
1102  {
1103  int mask2 = (ItemBase.GetDebugActionsMask() & (~DebugActionType.PLAYER_AGENTS));
1104  ItemBase.SetDebugActionsMask(mask2);
1105  SendDebugActionsRPC();
1106  }
1107  }
1108  }
1109  //---------------------------------------------
1110  /*
1111  void CheckAgentInjectActions()
1112  {
1113  if ( DiagMenu.GetBool(DM_PLAYER_AGENTS_INJECTS_SHOW) )
1114  {
1115  if ( !ItemBase.IsShowInjectActions() )
1116  {
1117  ItemBase.SetShowInjectActions(true);
1118  }
1119  }
1120  else
1121  {
1122  if ( ItemBase.IsShowInjectActions() )
1123  {
1124  ItemBase.SetShowInjectActions(false);
1125  }
1126  }
1127  }
1128  */
1129 
1130  //---------------------------------------------
1131  void CheckCraftingDump()
1132  {
1133  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_CRAFTING_DUMP) )
1134  {
1135  PluginRecipesManager plugin_recipes_manager;
1136  Class.CastTo(plugin_recipes_manager, GetPlugin(PluginRecipesManager));
1137  plugin_recipes_manager.GenerateHumanReadableRecipeList();
1138  DiagMenu.SetValue(DiagMenuIDs.DM_PLAYER_CRAFTING_DUMP, false);
1139  }
1140  }
1141  //---------------------------------------------
1142 
1143 
1144  //---------------------------------------------
1145  void CheckCraftingDebugActions()
1146  {
1147  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_CRAFTING_DEBUG_ACTIONS_ENABLE) )
1148  {
1149  if (!m_ShowCraftingDebugActions)
1150  {
1151  SendDebugCraftingRPC(true);
1152  PluginRecipesManager plugin_recipes_manager;
1153  Class.CastTo(plugin_recipes_manager, GetPlugin(PluginRecipesManager));
1154  plugin_recipes_manager.SetEnableDebugCrafting(true);
1155  m_ShowCraftingDebugActions = true;
1156  }
1157  }
1158  else
1159  {
1160  if (m_ShowCraftingDebugActions)
1161  {
1162  SendDebugCraftingRPC(false);
1163  PluginRecipesManager plugin_recipes_manager2;
1164  Class.CastTo(plugin_recipes_manager2, GetPlugin(PluginRecipesManager));
1165  plugin_recipes_manager2.SetEnableDebugCrafting(false);
1166  m_ShowCraftingDebugActions = false;
1167  }
1168  }
1169  }
1170  //---------------------------------------------
1171  void CheckBuildWood()
1172  {
1173  if ( DiagMenu.GetBool(DiagMenuIDs.DM_BUILD_WOOD) )
1174  {
1175  if (!m_BuildWood)
1176  {
1177  SendBuildWoodRPC(true);
1178  m_BuildWood = true;
1179  }
1180  }
1181  else
1182  {
1183  if (m_BuildWood)
1184  {
1185  SendBuildWoodRPC(false);
1186  m_BuildWood = false;
1187  }
1188  }
1189  }
1190  //---------------------------------------------
1191  void CheckBuildGate()
1192  {
1193  if ( DiagMenu.GetBool(DiagMenuIDs.DM_BUILD_GATE) )
1194  {
1195  if (!m_BuildGate)
1196  {
1197  SendBuildGateRPC(true);
1198  m_BuildGate = true;
1199  }
1200  }
1201  else
1202  {
1203  if (m_BuildGate)
1204  {
1205  SendBuildGateRPC(false);
1206  m_BuildGate = false;
1207  }
1208  }
1209  }
1210  //---------------------------------------------
1211  void CheckInvincibility()
1212  {
1213  if (DiagMenu.GetValue(DiagMenuIDs.DM_CHEATS_INVINCIBILITY) == 1)
1214  {
1215  if (m_IsInvincible != 1)
1216  {
1217  SendInvincibilityRPC(1);
1218  m_IsInvincible = 1;
1219  }
1220  }
1221  else if (DiagMenu.GetValue(DiagMenuIDs.DM_CHEATS_INVINCIBILITY) == 2)
1222  {
1223  if (m_IsInvincible != 2)
1224  {
1225  SendInvincibilityRPC(2);
1226  m_IsInvincible = 2;
1227  }
1228  }
1229  else
1230  {
1231  if (m_IsInvincible != 0)
1232  {
1233  SendInvincibilityRPC(0);
1234  m_IsInvincible = 0;
1235  }
1236  }
1237 
1238  }
1239  //---------------------------------------------
1240  void CheckBurst()
1241  {
1242  int value = DiagMenu.GetValue(DiagMenuIDs.DM_WEAPON_BURST);
1243  if ( m_Burst != value )
1244  {
1245  m_Burst = value;
1246  SendBurstRPC(value);
1247  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1248  player.GetWeaponManager().SetBurstOption(m_Burst);
1249  }
1250  }
1251 
1252  //---------------------------------------------
1253  void CheckStamina()
1254  {
1255  if (DiagMenu.GetBool(DiagMenuIDs.DM_CHEATS_STAMINA_DISABLE))
1256  {
1257  if (!m_StaminaDisabled)
1258  {
1259  SendStaminaRPC(m_StaminaDisabled);
1260  m_StaminaDisabled = true;
1261  }
1262  }
1263  else
1264  {
1265  if (m_StaminaDisabled)
1266  {
1267  SendStaminaRPC(m_StaminaDisabled);
1268  m_StaminaDisabled = false;
1269  }
1270  }
1271  }
1272 
1273  //---------------------------------------------
1274  void CheckLogPlayerStats()
1275  {
1276  if ( DiagMenu.GetBool(DiagMenuIDs.DM_PLAYER_STATS_LOG_ENABLE) )
1277  {
1278  if (!m_LogPlayerStats)
1279  {
1280  SendLogPlayerStatsRPC(true);
1281  m_LogPlayerStats = true;
1282  }
1283  }
1284  else
1285  {
1286  if (m_LogPlayerStats)
1287  {
1288  SendLogPlayerStatsRPC(false);
1289  m_LogPlayerStats = false;
1290  }
1291  }
1292  }
1293 
1294  //---------------------------------------------
1295  void CheckSoftSkillsDebug()
1296  {
1297  PlayerBase player;
1298  SoftSkillManagerDebug m_DebugWindow;
1299 
1300  if ( DiagMenu.GetBool( DiagMenuIDs.DM_SOFT_SKILLS_SHOW_DEBUG ) )
1301  {
1302  if (!m_SoftSkillsDebug)
1303  {
1304  Class.CastTo(player, GetGame().GetPlayer());
1305  player.GetSoftSkillsManager().CreateDebugWindow( true );
1306  SoftSkillsShowDebugRPC(true);
1307  m_SoftSkillsDebug = true;
1308  }
1309  }
1310  else
1311  {
1312  if (m_SoftSkillsDebug)
1313  {
1314  Class.CastTo(player, GetGame().GetPlayer());
1315  player.GetSoftSkillsManager().CreateDebugWindow( false );
1316  SoftSkillsShowDebugRPC(false);
1317  m_SoftSkillsDebug = false;
1318  }
1319  }
1320  }
1321 
1322  //---------------------------------------------
1323  void CheckSoftSkillsState()
1324  {
1325  if ( DiagMenu.GetBool( DiagMenuIDs.DM_SOFT_SKILLS_TOGGLE_STATE ) )
1326  {
1327  if (!m_SoftSkillsState)
1328  {
1329  SoftSkillsToggleStateRPC(true);
1330  m_SoftSkillsState = true;
1331  }
1332  }
1333  else
1334  {
1335  if (m_SoftSkillsState)
1336  {
1337  SoftSkillsToggleStateRPC(false);
1338  m_SoftSkillsState = false;
1339  }
1340  }
1341  }
1342 
1343  //---------------------------------------------
1344  void CheckGunParticles()
1345  {
1346  if ( DiagMenu.GetBool( DiagMenuIDs.DM_GUN_PARTICLES ) )
1347  {
1348  if (!m_GunParticlesState)
1349  {
1350  GunParticlesToggleStateRPC(false);
1351  m_GunParticlesState = true;
1352  }
1353  }
1354  else
1355  {
1356  if (m_GunParticlesState)
1357  {
1358  GunParticlesToggleStateRPC(true);
1359  m_GunParticlesState = false;
1360  }
1361  }
1362  }
1363 
1364  //---------------------------------------------
1365  void CheckSoftSkillsModel()
1366  {
1367  if ( DiagMenu.GetBool( DiagMenuIDs.DM_SOFT_SKILLS_TOGGLE_MODEL ) )
1368  {
1369  if (!m_SoftSkillsModel)
1370  {
1371  SoftSkillsToggleModelRPC(true);
1372  m_SoftSkillsModel = true;
1373  }
1374  }
1375  else
1376  {
1377  if (m_SoftSkillsModel)
1378  {
1379  SoftSkillsToggleModelRPC(false);
1380  m_SoftSkillsModel = false;
1381  }
1382  }
1383  }
1384 
1385  //---------------------------------------------
1386  void CheckSpecialtyLevel()
1387  {
1388  float specialty_value = DiagMenu.GetRangeValue( DiagMenuIDs.DM_SOFT_SKILLS_SPECIALTY_VALUE );
1389 
1390  if ( m_SpecialtyLevel != specialty_value )
1391  {
1392  SoftSkillsSetSpecialtyRPC( specialty_value );
1393  m_SpecialtyLevel = specialty_value;
1394  }
1395  }
1396 
1397  //---------------------------------------------
1398  void CheckActivateBleedingSource()
1399  {
1400  int bleeding_source = DiagMenu.GetRangeValue( DiagMenuIDs.DM_ACTIVATE_SOURCE );
1401 
1402  if ( bleeding_source != m_BleedingSourceRequested )
1403  {
1404  SendActivateBleedingSource(bleeding_source);
1405  m_BleedingSourceRequested = bleeding_source;
1406  }
1407  }
1408 
1409  //---------------------------------------------
1410  void CheckActivateBleedingSourceLevel()
1411  {
1412  int source_level = DiagMenu.GetValue( DiagMenuIDs.DM_ACTIVATE_BS_LEVEL );
1413 
1414  if (source_level != m_BleedingSourceLevelRequested)
1415  {
1416  PlayerBase player;
1417  if (Class.CastTo(player, GetGame().GetPlayer()))
1418  {
1419  BleedingSourcesManagerBase mgr = player.GetBleedingManagerRemote();
1420 
1421  int idx = 100; //invalid index, just deletes all
1422  if (source_level != 0)
1423  {
1424  string bone = ""; //lower-case!
1425  switch (source_level)
1426  {
1427  case 1: //PlayerConstants.BLEEDING_SOURCE_FLOW_MODIFIER_LOW
1428  bone = "lefttoebase";
1429  break;
1430 
1431  case 2: //PlayerConstants.BLEEDING_SOURCE_FLOW_MODIFIER_MEDIUM
1432  bone = "leftarm";
1433  break;
1434 
1435  case 3: //PlayerConstants.BLEEDING_SOURCE_FLOW_MODIFIER_HIGH
1436  bone = "neck";
1437  break;
1438  }
1439 
1440  for (int i = 0; i < mgr.m_BleedingSourceZone.Count(); i++)
1441  {
1442  if (mgr.m_BleedingSourceZone.GetKey(i) == bone)
1443  {
1444  idx = i;
1445  break;
1446  }
1447  }
1448  }
1449  SendActivateBleedingSource(idx);
1450  }
1451  m_BleedingSourceLevelRequested = source_level;
1452  }
1453  }
1454 
1455  //---------------------------------------------
1456  void CheckBloodyHands()
1457  {
1458  if ( DiagMenu.GetBool( DiagMenuIDs.DM_BLOODY_HANDS ) )
1459  {
1460  if (!m_BloodyHands)
1461  {
1462  LifespanBloodyHandsRPC(true);
1463  m_BloodyHands = true;
1464  }
1465  }
1466  else
1467  {
1468  if (m_BloodyHands)
1469  {
1470  LifespanBloodyHandsRPC(false);
1471  m_BloodyHands = false;
1472  }
1473  }
1474  }
1475 
1476  //---------------------------------------------
1477  void CheckLifeSpanPlaytimeUpdate()
1478  {
1479  float lifespan_level = DiagMenu.GetRangeValue( DiagMenuIDs.DM_LIFESPAN_PLAYTIME_UPDATE ) * 60;
1480 
1481  if ( m_LifespanLevel != lifespan_level )
1482  {
1483  LifespanPlaytimeUpdateRPC( lifespan_level );
1484  m_LifespanLevel = lifespan_level;
1485  }
1486  }
1487  //---------------------------------------------
1488  void CheckPermanentCrossHairUpdate()
1489  {
1490  PluginPermanentCrossHair crosshair;
1491  if ( DiagMenu.GetBool( DiagMenuIDs.DM_PERMANENT_CROSSHAIR ) )
1492  {
1493  if (!m_PermanentCrossHair)
1494  {
1495  Class.CastTo(crosshair, GetPlugin( PluginPermanentCrossHair ));
1496  crosshair.SwitchPermanentCrossHair(true);
1497  m_PermanentCrossHair = true;
1498  }
1499  }
1500  else
1501  {
1502  if (m_PermanentCrossHair)
1503  {
1504  Class.CastTo(crosshair, GetPlugin( PluginPermanentCrossHair ));
1505  crosshair.SwitchPermanentCrossHair(false);
1506  m_PermanentCrossHair = false;
1507  }
1508  }
1509  }
1510 
1511  //---------------------------------------------
1512  void CheckVehicleGetOutBox()
1513  {
1514  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_VEHICLE_GETOUT_BOX ) )
1515  {
1516  if (m_VehicleFreeAreaBox)
1517  {
1518  m_VehicleFreeAreaBox.Destroy();
1519  m_VehicleFreeAreaBox = null;
1520  }
1521 
1522  HumanCommandVehicle hcv = GetGame().GetPlayer().GetCommand_Vehicle();
1523  if (!hcv)
1524  return;
1525  m_VehicleFreeAreaBox = hcv.GetTransport().DebugFreeAreaAtDoor( hcv.GetVehicleSeat() );
1526  }
1527  else if (m_VehicleFreeAreaBox)
1528  {
1529  m_VehicleFreeAreaBox.Destroy();
1530  m_VehicleFreeAreaBox = null;
1531  }
1532  }
1533 
1534  //---------------------------------------------
1535  void CheckToggleHud()
1536  {
1537  Hud hud;
1538 
1539  if ( DiagMenu.GetBool( DiagMenuIDs.DM_TOGGLE_HUD ) )
1540  {
1541  if (!m_ToggleHud)
1542  {
1543  hud = GetGame().GetMission().GetHud();
1544  hud.Show( m_ToggleHud );
1545  GetGame().GetMission().HideCrosshairVisibility();
1546  m_ToggleHud = true;
1547  }
1548  }
1549  else
1550  {
1551  if (m_ToggleHud)
1552  {
1553  hud = GetGame().GetMission().GetHud();
1554  hud.Show( m_ToggleHud );
1555  GetGame().GetMission().RefreshCrosshairVisibility();
1556  m_ToggleHud = false;
1557  }
1558  }
1559  }
1560 
1561  //---------------------------------------------
1562  void CheckShowWeaponDebug()
1563  {
1564  PlayerBase player;
1565  if ( DiagMenu.GetBool( DiagMenuIDs.DM_WEAPON_DEBUG_ENABLE ) )
1566  {
1567  if (!m_ShowingWeaponDebug)
1568  {
1569 
1570  Class.CastTo(player, GetGame().GetPlayer());
1571  player.ShowWeaponDebug(true);
1572  m_ShowingWeaponDebug = true;
1573  }
1574  }
1575  else
1576  {
1577  if (m_ShowingWeaponDebug)
1578  {
1579  Class.CastTo(player, GetGame().GetPlayer());
1580  player.ShowWeaponDebug(false);
1581  m_ShowingWeaponDebug = false;
1582  }
1583  }
1584  }
1585  //---------------------------------------------
1586  void CheckProceduralRecoil()
1587  {
1588  DayZPlayerImplement player;
1589  if ( DiagMenu.GetBool( DiagMenuIDs.DM_WEAPON_ALLOW_RECOIL ) )
1590  {
1591  if (!m_ProceduralRecoilEnabled)
1592  {
1593  //Class.CastTo(player, GetGame().GetPlayer());
1594  //player.GetAimingModel().SetProceduralRecoilEnabled(true);
1595  SendProceduralRecoilRPC(true);
1596  m_ProceduralRecoilEnabled = true;
1597  }
1598  }
1599  else
1600  {
1601  if (m_ProceduralRecoilEnabled)
1602  {
1603  //Class.CastTo(player, GetGame().GetPlayer());
1604  //player.GetAimingModel().SetProceduralRecoilEnabled(false);
1605  SendProceduralRecoilRPC(false);
1606  m_ProceduralRecoilEnabled = false;
1607  }
1608  }
1609  }
1610  //---------------------------------------------
1611  void CheckQuickRestrain()
1612  {
1613 
1614  if ( DiagMenu.GetBool( DiagMenuIDs.DM_QUICK_RESTRAIN ) )
1615  {
1616  if (!m_EnableQuickRestrain)
1617  {
1618  SendEnableQuickRestrainRPC(true);
1619  m_EnableQuickRestrain = true;
1620  }
1621  }
1622  else
1623  {
1624  if (m_EnableQuickRestrain)
1625  {
1626  SendEnableQuickRestrainRPC(false);
1627  m_EnableQuickRestrain = false;
1628  }
1629  }
1630  }
1631 
1632  //---------------------------------------------
1633  void CheckQuickFishing()
1634  {
1635 
1636  if ( DiagMenu.GetBool( DiagMenuIDs.DM_QUICK_FISHING ) )
1637  {
1638  if (!m_EnableQuickFishing)
1639  {
1640  SendEnableQuickFishingRPC(true);
1641  m_EnableQuickFishing = true;
1642  }
1643  }
1644  else
1645  {
1646  if (m_EnableQuickFishing)
1647  {
1648  SendEnableQuickFishingRPC(false);
1649  m_EnableQuickFishing = false;
1650  }
1651  }
1652  }
1653 
1654  //---------------------------------------------
1655 
1656  void CheckCamShake()
1657  {
1658  if ( DiagMenu.GetBool( DiagMenuIDs.DM_CAM_SHAKE ) )
1659  {
1660  GetGame().GetPlayer().GetCurrentCamera().SpawnCameraShake(1,1,15,4);
1661  DiagMenu.SetValue(DiagMenuIDs.DM_CAM_SHAKE, false);
1662  }
1663 
1664 
1665  }
1666  //---------------------------------------------
1667  void CheckAimNoise()
1668  {
1669  DayZPlayerImplement player;
1670  if ( DiagMenu.GetBool( DiagMenuIDs.DM_WEAPON_AIM_NOISE ) )
1671  {
1672  if (!m_AimNoiseEnabled)
1673  {
1674 
1675  Class.CastTo(player, GetGame().GetPlayer());
1676  player.GetAimingModel().SetAimNoiseAllowed(true);
1677  m_AimNoiseEnabled = true;
1678  }
1679  }
1680  else
1681  {
1682  if (m_AimNoiseEnabled)
1683  {
1684  Class.CastTo(player, GetGame().GetPlayer());
1685  player.GetAimingModel().SetAimNoiseAllowed(false);
1686  m_AimNoiseEnabled = false;
1687  }
1688  }
1689  }
1690 
1691  //---------------------------------------------
1692  void CheckDayzPlayerMenu()
1693  {
1694  int actMenuValue = DiagMenu.GetValue(DayZPlayerConstants.DEBUG_SHOWDEBUGPLUGIN);
1695  // Print("Debug Menu:" + actMenuValue.ToString());
1696  if (actMenuValue != m_DayzPlayerDebugMenu)
1697  {
1698  if (g_Plugins != NULL)
1699  {
1701  Class.CastTo(pd, g_Plugins.GetPluginByType(PluginDayzPlayerDebug));
1702  if (pd != NULL)
1703  {
1704  pd.ToggleDebugWindowSetMode(actMenuValue);
1705  //Print("DayzPlayerDebug - switched to:" + actMenuValue.ToString());
1706  }
1707  }
1708  m_DayzPlayerDebugMenu = actMenuValue;
1709  }
1710 
1711  }
1712  //---------------------------------------------
1713 
1714  void CheckDisplayMenu()
1715  {
1716  PluginRemotePlayerDebugClient plugin_remote_client;
1717  int value = DiagMenu.GetRangeValue( DiagMenuIDs.DM_DISPLAY_PLAYER_INFO );
1718 
1719  if ( value != 0 )
1720  {
1721  if ( m_DisplayPlayerInfo != value )
1722  {
1723  plugin_remote_client = PluginRemotePlayerDebugClient.Cast( GetPlugin(PluginRemotePlayerDebugClient) );
1724  plugin_remote_client.RequestPlayerInfo( PlayerBase.Cast(GetGame().GetPlayer()), value );
1725 
1726  m_DisplayPlayerInfo = value;
1727  }
1728  }
1729  else
1730  {
1731  if ( m_DisplayPlayerInfo != 0 )
1732  {
1733  plugin_remote_client = PluginRemotePlayerDebugClient.Cast( GetPlugin(PluginRemotePlayerDebugClient) );
1734  plugin_remote_client.RequestPlayerInfo( PlayerBase.Cast(GetGame().GetPlayer()), 0 );
1735 
1736  m_DisplayPlayerInfo = 0;
1737  }
1738  }
1739  }
1740 
1741  void CheckUniversalTemperatureSources()
1742  {
1743  PluginUniversalTemperatureSourceClient client;
1744  int value = DiagMenu.GetBool(DiagMenuIDs.DM_UNIVERSAL_TEMPERATURE_SOURCES);
1745 
1746  if (m_EnableUniversalTemperatureSources != value)
1747  {
1748  client = PluginUniversalTemperatureSourceClient.Cast(GetPlugin(PluginUniversalTemperatureSourceClient));
1749  client.RequestUniversalTemperatureSources(PlayerBase.Cast(GetGame().GetPlayer()), value);
1750 
1751  m_EnableUniversalTemperatureSources = value;
1752  }
1753  }
1754 
1755  void CheckEnvironmentStats()
1756  {
1757  if (DiagMenu.GetBool(DiagMenuIDs.DM_ENVIRONMENT_DEBUG_ENABLE))
1758  {
1759  if (!m_EnvironmentStats)
1760  m_EnvironmentStats = true;
1761  }
1762  else
1763  {
1764  if (m_EnvironmentStats)
1765  m_EnvironmentStats = false;
1766  }
1767  }
1768 
1769  void CheckDrawCheckerboard()
1770  {
1771  if (DiagMenu.GetBool(DiagMenuIDs.DM_DRAW_CHECKERBOARD))
1772  {
1773  if (!m_DrawCheckerboard) m_DrawCheckerboard = true;
1774  }
1775  else
1776  {
1777  if (m_DrawCheckerboard) m_DrawCheckerboard = false;
1778  }
1779  }
1780 
1781  void CheckPresenceNotifierDebug()
1782  {
1783  if (DiagMenu.GetBool(DiagMenuIDs.DM_PRESENCE_NOTIFIER_DBG))
1784  {
1785  if (!m_PresenceNotifierDebug) m_PresenceNotifierDebug = true;
1786  }
1787  else
1788  {
1789  if (m_PresenceNotifierDebug) m_PresenceNotifierDebug = false;
1790  }
1791  }
1792 
1793  //---------------------------------------------
1794  void CheckSimulateNULLPointer()
1795  {
1796  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SIMULATE_NULL_POINTER) )
1797  {
1798  SendSimulateNULLPointer();
1799  DiagMenu.SetValue(DiagMenuIDs.DM_SIMULATE_NULL_POINTER, false);//to prevent constant RPC calls, switch back to false
1800  }
1801  }
1802  //---------------------------------------------
1803  void CheckSimulateDivisionByZero()
1804  {
1805  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SIMULATE_DIVISION_BY_ZERO) )
1806  {
1807  SendSimulateDivisionByZero();
1808  DiagMenu.SetValue(DiagMenuIDs.DM_SIMULATE_DIVISION_BY_ZERO, false);//to prevent constant RPC calls, switch back to false
1809  }
1810  }
1811  //---------------------------------------------
1812  void CheckSimulateInfiniteLoop()
1813  {
1814  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SIMULATE_INFINITE_LOOP) )
1815  {
1816  SendSimulateInfiniteLoop();
1817  DiagMenu.SetValue(DiagMenuIDs.DM_SIMULATE_INFINITE_LOOP, false);//to prevent constant RPC calls, switch back to false
1818  }
1819  }
1820  //---------------------------------------------
1821  void CheckSimulateErrorFunction()
1822  {
1823  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SIMULATE_ERROR_FUNCTION) )
1824  {
1825  SendSimulateErrorFunction();
1826  DiagMenu.SetValue(DiagMenuIDs.DM_SIMULATE_ERROR_FUNCTION, false);//to prevent constant RPC calls, switch back to false
1827  }
1828  }
1829  //---------------------------------------------
1830  void CheckDoActionLogs()
1831  {
1832  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_ACTIONS) )
1833  {
1834  if ( !m_DoActionLogs )
1835  {
1836  SendSetActionLogs(true);
1837  LogManager.ActionLogEnable(true);
1838  m_DoActionLogs = true;
1839  }
1840  }
1841  else
1842  {
1843  if ( m_DoActionLogs )
1844  {
1845  SendSetActionLogs(false);
1846  LogManager.ActionLogEnable(false);
1847  m_DoActionLogs = false;
1848  }
1849  }
1850  }
1851  //---------------------------------------------
1852  void CheckDoWeaponLogs()
1853  {
1854  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_WEAPON) )
1855  {
1856  if ( !m_DoActionLogs )
1857  {
1858  SendSetWeaponLogs(true);
1859  LogManager.WeaponLogEnable(true);
1860  m_DoWeaponLogs = true;
1861  }
1862  }
1863  else
1864  {
1865  if ( m_DoActionLogs )
1866  {
1867  SendSetWeaponLogs(false);
1868  LogManager.WeaponLogEnable(false);
1869  m_DoWeaponLogs = false;
1870  }
1871  }
1872  }
1873  //---------------------------------------------
1874  void CheckDoInventoryLogs()
1875  {
1876  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_INVENTORY_MOVE) )
1877  {
1878  if ( !m_DoInventoryMoveLogs )
1879  {
1880  SendSetInventoryMoveLogs(true);
1881  LogManager.InventoryMoveLogEnable(true);
1882  m_DoInventoryMoveLogs = true;
1883  }
1884  }
1885  else
1886  {
1887  if ( m_DoInventoryMoveLogs )
1888  {
1889  SendSetInventoryMoveLogs(false);
1890  LogManager.InventoryMoveLogEnable(false);
1891  m_DoInventoryMoveLogs = false;
1892  }
1893  }
1894  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_INVENTORY_RESERVATION) )
1895  {
1896  if ( !m_DoInventoryReservationLogs )
1897  {
1898  SendSetInventoryReservationLogs(true);
1899  LogManager.InventoryReservationLogEnable(true);
1900  m_DoInventoryReservationLogs = true;
1901  }
1902  }
1903  else
1904  {
1905  if ( m_DoInventoryReservationLogs )
1906  {
1907  SendSetInventoryReservationLogs(false);
1908  LogManager.InventoryReservationLogEnable(false);
1909  m_DoInventoryReservationLogs = false;
1910  }
1911  }
1912  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_INVENTORY_MOVE) )
1913  {
1914  if ( !m_DoInventoryHFSMLogs )
1915  {
1916  SendSetInventoryHFSMLogs(true);
1917  LogManager.InventoryHFSMLogEnable(true);
1918  m_DoInventoryHFSMLogs = true;
1919  }
1920  }
1921  else
1922  {
1923  if ( m_DoInventoryHFSMLogs )
1924  {
1925  SendSetInventoryHFSMLogs(false);
1926  LogManager.InventoryHFSMLogEnable(false);
1927  m_DoInventoryHFSMLogs = false;
1928  }
1929  }
1930  }
1931  //---------------------------------------------
1932  void CheckDoSymptomLogs()
1933  {
1934  if ( DiagMenu.GetBool(DiagMenuIDs.DM_LOG_SYMPTOM) )
1935  {
1936  if ( !m_DoSymptomLogs )
1937  {
1938  SendSetSymptomLogs(true);
1939  LogManager.SymptomLogEnable(true);
1940  m_DoSymptomLogs = true;
1941  }
1942  }
1943  else
1944  {
1945  if ( m_DoSymptomLogs )
1946  {
1947  SendSetSymptomLogs(false);
1948  LogManager.SymptomLogEnable(false);
1949  m_DoSymptomLogs = false;
1950  }
1951  }
1952  }
1953 
1954  bool m_Active = false;
1955  void CheckPlugArrows()
1956  {
1957  if ( DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_PLUG_ARROWS) )
1958  {
1959  if ( m_Active == false )
1960  {
1961  for ( int i = 0; i < GetGame().m_EnergyManagerArray.Count(); i++)
1962  {
1963  if ( GetGame().m_EnergyManagerArray[i] )
1964  GetGame().m_EnergyManagerArray[i].SetDebugPlugs( DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_PLUG_ARROWS) );
1965  }
1966  m_Active = true;
1967  }
1968  }
1969  else
1970  {
1971  for ( int j = 0; j < GetGame().m_EnergyManagerArray.Count(); j++)
1972  {
1973  if ( GetGame().m_EnergyManagerArray[j] )
1974  GetGame().m_EnergyManagerArray[j].SetDebugPlugs( DiagMenu.GetBool(DiagMenuIDs.DM_SHOW_PLUG_ARROWS) );
1975  }
1976  m_Active = false;
1977  }
1978  }
1979 
1980  //---------------------------------------------
1981  void SendDebugActionsRPC()
1982  {
1983  CachedObjectsParams.PARAM1_INT.param1 = ItemBase.GetDebugActionsMask();
1984  if ( GetGame() && GetGame().GetPlayer() )
1985  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_ITEM_DEBUG_ACTIONS, CachedObjectsParams.PARAM1_INT, true, GetGame().GetPlayer().GetIdentity() );
1986  }
1987 
1988  //---------------------------------------------
1989  void SendEnableQuickRestrainRPC(bool enable)
1990  {
1991  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
1992  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
1993  if (player) player.SetQuickRestrain(enable);
1994  if ( GetGame() && GetGame().GetPlayer() )
1995  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_ENABLE_QUICK_RESTRAIN, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
1996  }
1997 
1998  //---------------------------------------------
1999  void SendEnableQuickFishingRPC(bool enable)
2000  {
2001  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2002  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
2003  if (player) player.SetQuickFishing(enable);
2004  if ( GetGame() && GetGame().GetPlayer() )
2005  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_ENABLE_QUICK_FISHING, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2006  }
2007 
2008  //---------------------------------------------
2009  void SendProceduralRecoilRPC(bool enable)
2010  {
2011  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2012  PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
2013  if (player) player.GetAimingModel().SetProceduralRecoilEnabled(enable);
2014  if ( GetGame() && GetGame().GetPlayer() )
2015  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_WEAPON_PROC_RECOIL, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2016  }
2017 
2018  //---------------------------------------------
2019  void SendActivateAllBSRPC()
2020  {
2021  if (GetGame() && GetGame().GetPlayer())
2022  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_ACTIVATE_ALL_BS, NULL, true, GetGame().GetPlayer().GetIdentity() );
2023  }
2024  //---------------------------------------------
2025  void SendKillPlayerRPC()
2026  {
2027  if (GetGame() && GetGame().GetPlayer())
2028  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_KILL_PLAYER, NULL, true, GetGame().GetPlayer().GetIdentity() );
2029  }
2030  //---------------------------------------------
2031  void SendInvincibilityRPC(int level)
2032  {
2033  CachedObjectsParams.PARAM1_INT.param1 = level;
2034  if (GetGame() && GetGame().GetPlayer())
2035  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_ENABLE_INVINCIBILITY, CachedObjectsParams.PARAM1_INT, true, GetGame().GetPlayer().GetIdentity() );
2036  }
2037  //---------------------------------------------
2038  void SendStaminaRPC(bool value)
2039  {
2040  CachedObjectsParams.PARAM1_BOOL.param1 = value;
2041  if (GetGame() && GetGame().GetPlayer())
2042  {
2043  GetGame().RPCSingleParam(GetGame().GetPlayer(), ERPCs.DEV_RPC_STAMINA_TOGGLE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity());
2044  }
2045  }
2046  //---------------------------------------------
2047  void SendTargetabilityRPC(bool value)
2048  {
2049  CachedObjectsParams.PARAM1_BOOL.param1 = value;
2050  if (GetGame() && GetGame().GetPlayer())
2051  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_TOGGLE_TARGETABLE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2052  }
2053  //---------------------------------------------
2054  void SendBurstRPC(int opt)
2055  {
2056  CachedObjectsParams.PARAM1_INT.param1 = opt;
2057  if (GetGame() && GetGame().GetPlayer())
2058  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_BURST_OPT, CachedObjectsParams.PARAM1_INT, true, GetGame().GetPlayer().GetIdentity() );
2059  }
2060  //---------------------------------------------
2061  void SendLogPlayerStatsRPC(bool enable)
2062  {
2063  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2064  if (GetGame() && GetGame().GetPlayer())
2065  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_LOG_PLAYER_STATS, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2066  }
2067  //---------------------------------------------
2068  void SendModifiersRPC(bool enable)
2069  {
2070  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2071  if (GetGame() && GetGame().GetPlayer())
2072  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DISABLE_MODIFIERS, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2073  }
2074  //---------------------------------------------
2075  void SendInventoryAccessRPC(bool enable)
2076  {
2077  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2078  if (GetGame() && GetGame().GetPlayer())
2079  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_INVENTORY_ACCESS, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2080  }
2081 
2082  //---------------------------------------------
2083  void SendUnlimitedRPC(bool enable)
2084  {
2085  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2086  if (GetGame() && GetGame().GetPlayer())
2087  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_UNLIMITED_AMMO, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2088  }
2089  //---------------------------------------------
2090  void SendDisableBloodLossRPC(bool enable)
2091  {
2092  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2093  if (GetGame() && GetGame().GetPlayer())
2094  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_DISABLE_BLOODLOOS, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2095  }
2096  //---------------------------------------------
2097  void SendDebugCraftingRPC(bool enable)
2098  {
2099  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2100  if (GetGame() && GetGame().GetPlayer())
2101  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_CRAFTING_DEBUG, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2102  }
2103  //---------------------------------------------
2104  void SendBuildWoodRPC(bool enable)
2105  {
2106  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2107  if (GetGame() && GetGame().GetPlayer())
2108  GetGame().RPCSingleParam( GetGame().GetPlayer(), ERPCs.RPC_BUILD_WOOD, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2109  }
2110  //---------------------------------------------
2111  void SendBuildGateRPC(bool enable)
2112  {
2113  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2114  if (GetGame() && GetGame().GetPlayer())
2115  GetGame().RPCSingleParam( GetGame().GetPlayer(), ERPCs.RPC_BUILD_GATE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2116  }
2117  //---------------------------------------------
2118  void SoftSkillsShowDebugRPC(bool enable)
2119  {
2120  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2121  if (GetGame() && GetGame().GetPlayer())
2122  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_SOFT_SKILLS_DEBUG_WINDOW, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2123  }
2124  //---------------------------------------------
2125  void SoftSkillsToggleStateRPC(bool enable)
2126  {
2127  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2128  if (GetGame() && GetGame().GetPlayer())
2129  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_SOFT_SKILLS_TOGGLE_STATE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2130  }
2131  //---------------------------------------------
2132  void GunParticlesToggleStateRPC(bool enable)
2133  {
2134  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2135  if (GetGame() && GetGame().GetPlayer())
2136  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_GUN_PARTICLES_TOGGLE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2137  }
2138  //---------------------------------------------
2139  void SoftSkillsToggleModelRPC(bool enable)
2140  {
2141  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2142  if (GetGame() && GetGame().GetPlayer())
2143  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_SOFT_SKILLS_TOGGLE_MODEL, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2144  }
2145  //---------------------------------------------
2146  void SoftSkillsSetSpecialtyRPC( float specialty_value )
2147  {
2148  CachedObjectsParams.PARAM1_FLOAT.param1 = specialty_value;
2149  if (GetGame() && GetGame().GetPlayer())
2150  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_SOFT_SKILLS_SET_SPECIALTY, CachedObjectsParams.PARAM1_FLOAT, true, GetGame().GetPlayer().GetIdentity() );
2151  }
2152  //---------------------------------------------
2153  void LifespanBloodyHandsRPC(bool enable)
2154  {
2155  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2156  if (GetGame() && GetGame().GetPlayer())
2157  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_LIFESPAN_BLOODY_HANDS, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2158  }
2159  //---------------------------------------------
2160  void LifespanPlaytimeUpdateRPC( float playtime )
2161  {
2162  CachedObjectsParams.PARAM1_FLOAT.param1 = playtime;
2163  if (GetGame() && GetGame().GetPlayer())
2164  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_LIFESPAN_PLAYTIME_UPDATE, CachedObjectsParams.PARAM1_FLOAT, true, GetGame().GetPlayer().GetIdentity() );
2165  }
2166  //---------------------------------------------
2167  void SendMeleeBlockStanceRPC(bool enable)
2168  {
2169  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2170  if (GetGame() && GetGame().GetPlayer())
2171  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_MELEE_BLOCK_STANCE, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2172  }
2173  //---------------------------------------------
2174  void SendMeleeFightRPC(bool enable)
2175  {
2176  CachedObjectsParams.PARAM1_BOOL.param1 = enable;
2177  if (GetGame() && GetGame().GetPlayer())
2178  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_MELEE_FIGHT, CachedObjectsParams.PARAM1_BOOL, true, GetGame().GetPlayer().GetIdentity() );
2179  }
2180  //---------------------------------------------
2181  void SendGoUnconsciousRPC(bool is_delayed)
2182  {
2183  Param1<bool> p1 = new Param1<bool>(is_delayed);
2184  if (GetGame() && GetGame().GetPlayer())
2185  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_GO_UNCONSCIOUS, p1, true, GetGame().GetPlayer().GetIdentity() );
2186  }
2187  //---------------------------------------------
2188  void SendSimulateNULLPointer()
2189  {
2190  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_SIMULATE_NULL_POINTER, NULL, true, GetGame().GetPlayer().GetIdentity() );
2191  }
2192  //---------------------------------------------
2193  void SendSimulateDivisionByZero()
2194  {
2195  if (GetGame() && GetGame().GetPlayer())
2196  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_SIMULATE_DIVISION_BY_ZERO, NULL, true, GetGame().GetPlayer().GetIdentity() );
2197  }
2198  //---------------------------------------------
2199  void SendSimulateInfiniteLoop()
2200  {
2201  if (GetGame() && GetGame().GetPlayer())
2202  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_SIMULATE_INFINITE_LOOP, NULL, true, GetGame().GetPlayer().GetIdentity() );
2203  }
2204  //---------------------------------------------
2205  void SendSimulateErrorFunction()
2206  {
2207  if (GetGame() && GetGame().GetPlayer())
2208  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_SIMULATE_ERROR_FUNCTION, NULL, true, GetGame().GetPlayer().GetIdentity() );
2209  }
2210 
2211  void SendActivateBleedingSource(int bleeding_source)
2212  {
2213  Param1<int> p1 = new Param1<int>(bleeding_source);
2214  if (GetGame() && GetGame().GetPlayer())
2215  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_ACTIVATE_BS, p1, true, GetGame().GetPlayer().GetIdentity() );
2216  }
2217  //---------------------------------------------
2218  void SendSetHairLevelRPC()
2219  {
2220  if (GetGame() && GetGame().GetPlayer())
2221  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_HAIR_LEVEL, NULL, true, GetGame().GetPlayer().GetIdentity() );
2222  }
2223 
2224  void SendSetHairLevelHideRPC(int level, bool value)
2225  {
2226  Param2<int,bool> p2 = new Param2<int,bool>(level,value);
2227  if (GetGame() && GetGame().GetPlayer())
2228  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_HAIR_LEVEL_HIDE, p2, true, GetGame().GetPlayer().GetIdentity() );
2229  }
2230 
2231  void SendSetActionLogs(bool enable)
2232  {
2233  Param1<bool> p1 = new Param1<bool>(enable);
2234  if (GetGame() && GetGame().GetPlayer())
2235  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_ACTION_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2236  }
2237 
2238  void SendSetWeaponLogs(bool enable)
2239  {
2240  Param1<bool> p1 = new Param1<bool>(enable);
2241  if (GetGame() && GetGame().GetPlayer())
2242  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_WEAPON_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2243  }
2244 
2245  void SendSetSymptomLogs(bool enable)
2246  {
2247  Param1<bool> p1 = new Param1<bool>(enable);
2248  if (GetGame() && GetGame().GetPlayer())
2249  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_SYMPTOMS_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2250  }
2251 
2252  void SendSetInventoryMoveLogs(bool enable)
2253  {
2254  Param1<bool> p1 = new Param1<bool>(enable);
2255  if (GetGame() && GetGame().GetPlayer())
2256  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_INV_MOVE_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2257  }
2258 
2259  void SendSetInventoryReservationLogs(bool enable)
2260  {
2261  Param1<bool> p1 = new Param1<bool>(enable);
2262  if (GetGame() && GetGame().GetPlayer())
2263  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_INV_RESERVATION_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2264  }
2265 
2266  void SendSetInventoryHFSMLogs(bool enable)
2267  {
2268  Param1<bool> p1 = new Param1<bool>(enable);
2269  if (GetGame() && GetGame().GetPlayer())
2270  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.RPC_DO_INV_HFSM_LOGS, p1, true, GetGame().GetPlayer().GetIdentity() );
2271  }
2272 
2273  void SendForceFinisherType(int value)
2274  {
2275  Param1<int> p1 = new Param1<int>(value);
2276  if (GetGame() && GetGame().GetPlayer())
2277  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_RPC_FORCE_FINISHER, p1, true, GetGame().GetPlayer().GetIdentity() );
2278  }
2279 
2280  void SendTimeAccel(Param param)
2281  {
2282  if (GetGame() && GetGame().GetPlayer())
2283  GetGame().RPCSingleParam( GetGame().GetPlayer() ,ERPCs.DEV_TIME_ACCEL, param, true);
2284  }
2285 
2286  //---------------------------------------------
2287  void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
2288  {
2289  bool enable;
2290 
2291  switch (rpc_type)
2292  {
2293  case ERPCs.DEV_SIMULATE_NULL_POINTER:
2294  PlayerBase NULL_player = null;
2295  NULL_player.SetHealth("","", -1);
2296  break;
2297 
2298  case ERPCs.DEV_SIMULATE_DIVISION_BY_ZERO:
2299  int zero = 0;
2300  int division_by_zero = 1/zero;
2301  break;
2302 
2303  case ERPCs.DEV_SIMULATE_INFINITE_LOOP:
2304  while ( true )
2305  {
2306  Print("simulated infinite loop");
2307  }
2308  break;
2309 
2310  case ERPCs.DEV_SIMULATE_ERROR_FUNCTION:
2311  Error("Simulated error");
2312  break;
2313 
2314  case ERPCs.DEV_DIAGMENU_SUBSCRIBE:
2315  if (ctx.Read(CachedObjectsParams.PARAM1_INT))
2316  {
2317  int newMask = CachedObjectsParams.PARAM1_INT.param1;
2318  int currentMask = m_Subscribers.Get(player);
2319 
2320  if (newMask != currentMask)
2321  {
2322  if (newMask == 0)
2323  {
2324  m_Subscribers.Remove(player);
2325  }
2326  else
2327  {
2328  m_Subscribers.Set(player, newMask);
2329  }
2330  }
2331  }
2332 
2333 
2334  break;
2335  case ERPCs.DEV_ACTIVATE_BS:
2336  ctx.Read(CachedObjectsParams.PARAM1_INT);
2337  player.GetBleedingManagerServer().DebugActivateBleedingSource(CachedObjectsParams.PARAM1_INT.param1);
2338  break;
2339 
2340  case ERPCs.DEV_RPC_UNLIMITED_AMMO:
2341  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2342  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2343  if (enable)
2344  {
2345  ItemBase.SetDebugActionsMask( ItemBase.GetDebugActionsMask() | DebugActionType.UNLIMITED_AMMO );
2346  }
2347  else
2348  {
2349  ItemBase.SetDebugActionsMask( ItemBase.GetDebugActionsMask() & (~DebugActionType.UNLIMITED_AMMO) );
2350  }
2351  break;
2352 
2353  case ERPCs.RPC_DISABLE_MODIFIERS:
2354  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2355  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2356  player.SetModifiers( enable );
2357  break;
2358 
2359  case ERPCs.DEV_RPC_DISABLE_BLOODLOOS:
2360  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2361  player.GetBleedingManagerServer().SetBloodLoss( CachedObjectsParams.PARAM1_BOOL.param1 );
2362  break;
2363 
2364  case ERPCs.RPC_KILL_PLAYER:
2365  player.SetHealth("","", -1);
2366  break;
2367 
2368  case ERPCs.DEV_ACTIVATE_ALL_BS:
2369  player.GetBleedingManagerServer().ActivateAllBS();
2370  break;
2371 
2372  case ERPCs.RPC_ENABLE_INVINCIBILITY:
2373  ctx.Read(CachedObjectsParams.PARAM1_INT);
2374  int level = CachedObjectsParams.PARAM1_INT.param1;
2375  if (level == 0)
2376  {
2377  player.SetAllowDamage(true);
2378  player.SetCanBeDestroyed(true);
2379  }
2380  else if (level == 1)
2381  {
2382  player.SetAllowDamage(true);
2383  player.SetCanBeDestroyed(false);
2384  }
2385  else if (level == 2)
2386  {
2387  player.SetAllowDamage(false);
2388  }
2389  break;
2390 
2391  case ERPCs.DEV_RPC_STAMINA_TOGGLE:
2392  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2393  bool staminaState = CachedObjectsParams.PARAM1_BOOL.param1;
2394  player.SetStaminaEnabled(staminaState);
2395  break;
2396 
2397  case ERPCs.DEV_RPC_TOGGLE_TARGETABLE:
2398  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2399  bool value = CachedObjectsParams.PARAM1_BOOL.param1;
2400  player.m_CanBeTargetedDebug = value;
2401  break;
2402 
2403  case ERPCs.RPC_BURST_OPT:
2404  ctx.Read(CachedObjectsParams.PARAM1_INT);
2405  int opt = CachedObjectsParams.PARAM1_INT.param1;
2406  player.GetWeaponManager().SetBurstOption(opt);
2407  break;
2408 
2409  case ERPCs.RPC_ITEM_DEBUG_ACTIONS:
2410  ctx.Read(CachedObjectsParams.PARAM1_INT);
2411  int mask = CachedObjectsParams.PARAM1_INT.param1;
2412  ItemBase.SetDebugActionsMask(mask);
2413  break;
2414 
2415  case ERPCs.RPC_WEAPON_PROC_RECOIL:
2416  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2417  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2418  player.GetAimingModel().SetProceduralRecoilEnabled(enable);
2419  break;
2420 
2421  case ERPCs.RPC_ENABLE_QUICK_RESTRAIN:
2422  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2423  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2424  player.SetQuickRestrain(enable);
2425  break;
2426 
2427  case ERPCs.RPC_ENABLE_QUICK_FISHING:
2428  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2429  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2430  player.SetQuickFishing(enable);
2431  break;
2432 
2433  case ERPCs.RPC_LOG_PLAYER_STATS:
2434  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2435  player.GetPlayerStats().SetAllowLogs(CachedObjectsParams.PARAM1_BOOL.param1);
2436  break;
2437 
2438  case ERPCs.RPC_SOFT_SKILLS_TOGGLE_STATE:
2439  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2440  player.GetSoftSkillsManager().SetSoftSkillsState(CachedObjectsParams.PARAM1_BOOL.param1);
2441  break;
2442 
2443  case ERPCs.RPC_SOFT_SKILLS_DEBUG_WINDOW:
2444  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2445  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2446 
2447  if ( enable )
2448  {
2449  player.GetSoftSkillsManager().StartSynchTimer();
2450  }
2451  else
2452  {
2453  player.GetSoftSkillsManager().StopSynchTimer();
2454  player.GetSoftSkillsManager().ResetDebugWindow();
2455  }
2456 
2457  break;
2458 
2459  case ERPCs.RPC_GUN_PARTICLES_TOGGLE:
2460  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2461  PrtTest.m_GunParticlesState = CachedObjectsParams.PARAM1_BOOL.param1;
2462  break;
2463 
2464  case ERPCs.RPC_CRAFTING_DEBUG:
2465  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2466  PluginRecipesManager plugin_recipes_manager;
2467  Class.CastTo(plugin_recipes_manager, GetPlugin(PluginRecipesManager));
2468  plugin_recipes_manager.SetEnableDebugCrafting(CachedObjectsParams.PARAM1_BOOL.param1);
2469  break;
2470 
2471  case ERPCs.RPC_SOFT_SKILLS_TOGGLE_MODEL:
2472  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2473  player.GetSoftSkillsManager().SetLinearState(CachedObjectsParams.PARAM1_BOOL.param1) ;
2474  break;
2475 
2476  case ERPCs.RPC_SOFT_SKILLS_SET_SPECIALTY:
2477  ctx.Read( CachedObjectsParams.PARAM1_FLOAT );
2478  float specialty = CachedObjectsParams.PARAM1_FLOAT.param1;
2479  SoftSkillsManager soft_skill_manager = player.GetSoftSkillsManager();
2480  soft_skill_manager.SetSpecialtyLevel( specialty );
2481  soft_skill_manager.SynchSpecialtyLevel();
2482  player.GetStatSpecialty().Set( specialty );
2483  break;
2484 
2485  case ERPCs.RPC_LIFESPAN_BLOODY_HANDS:
2486  ctx.Read( CachedObjectsParams.PARAM1_BOOL );
2487  enable = CachedObjectsParams.PARAM1_BOOL.param1;
2488  PluginLifespan lifespan_bloody_hands;
2489  Class.CastTo(lifespan_bloody_hands, GetPlugin( PluginLifespan ));
2490  lifespan_bloody_hands.UpdateBloodyHandsVisibility( player, enable );
2491  break;
2492 
2493  case ERPCs.RPC_LIFESPAN_PLAYTIME_UPDATE:
2494  ctx.Read( CachedObjectsParams.PARAM1_FLOAT );
2495  //reset players playtime
2496  float playtime = player.StatGet("playtime");
2497  float opposite_playtime = playtime * ( -1 );
2498  player.StatUpdate("playtime", opposite_playtime );
2499  //set new playtime
2500  float playtime_update = CachedObjectsParams.PARAM1_FLOAT.param1;
2501  player.StatUpdate("playtime", playtime_update );
2502  player.SetLastShavedSeconds( 0 );
2503  //update lifespan
2504  PluginLifespan module_lifespan_update;
2505  Class.CastTo(module_lifespan_update, GetPlugin( PluginLifespan ));
2506  module_lifespan_update.UpdateLifespan( player, true );
2507  module_lifespan_update.ChangeFakePlaytime( player, playtime_update );
2508 
2509  break;
2510  case ERPCs.DEV_GO_UNCONSCIOUS:
2511  ctx.Read( CachedObjectsParams.PARAM1_BOOL );
2512  if (!CachedObjectsParams.PARAM1_BOOL.param1)
2513  {
2514  GoUnconscious(player);
2515  }
2516  else
2517  {
2518  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GoUnconscious, 10000, false, player);
2519  }
2520  //DayZPlayerSyncJunctures.SendPlayerUnconsciousness(player, !player.IsUnconscious() );
2521  break;
2522  case ERPCs.DEV_HAIR_LEVEL_HIDE:
2523  ctx.Read( CachedObjectsParams.PARAM2_INT_INT ); //PARAM2_INT_INT.param2 is BOOL here
2524  player.SetHairLevelToHide(CachedObjectsParams.PARAM2_INT_INT.param1, CachedObjectsParams.PARAM2_INT_INT.param2, true);
2525  player.UpdateHairSelectionVisibility(true);
2526  break;
2527 
2528  case ERPCs.RPC_DO_ACTION_LOGS:
2529  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2530  LogManager.ActionLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2531  break;
2532 
2533  case ERPCs.RPC_DO_WEAPON_LOGS:
2534  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2535  LogManager.WeaponLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2536  break;
2537 
2538  case ERPCs.RPC_DO_SYMPTOMS_LOGS:
2539  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2540  LogManager.SymptomLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2541  break;
2542 
2543  case ERPCs.RPC_DO_INV_MOVE_LOGS:
2544  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2545  LogManager.InventoryMoveLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2546  break;
2547 
2548  case ERPCs.RPC_DO_INV_RESERVATION_LOGS:
2549  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2550  LogManager.InventoryReservationLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2551  break;
2552 
2553  case ERPCs.RPC_DO_INV_HFSM_LOGS:
2554  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2555  LogManager.InventoryHFSMLogEnable(CachedObjectsParams.PARAM1_BOOL.param1);
2556  break;
2557  case ERPCs.DEV_RPC_ITEMS_FIX:
2558  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2559  player.FixAllInventoryItems();
2560  break;
2561  case ERPCs.DEV_RPC_FORCE_FINISHER:
2562  ctx.Read(CachedObjectsParams.PARAM1_INT);
2563  player.GetMeleeCombat().DebugSetForcedFinisherType(CachedObjectsParams.PARAM1_INT.param1);
2564  break;
2565  case ERPCs.RPC_BUILD_GATE:
2566  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2567  DiagMenu.SetValue(DiagMenuIDs.DM_BUILD_GATE, CachedObjectsParams.PARAM1_BOOL.param1);
2568  break;
2569  case ERPCs.RPC_BUILD_WOOD:
2570  ctx.Read(CachedObjectsParams.PARAM1_BOOL);
2571  DiagMenu.SetValue(DiagMenuIDs.DM_BUILD_WOOD, CachedObjectsParams.PARAM1_BOOL.param1);
2572  break;
2573  case ERPCs.DEV_TIME_ACCEL:
2574  {
2575  TimeAccelParam tap = new TimeAccelParam(false,0,0);
2576 
2577  if (ctx.Read(tap))
2578  {
2579  FeatureTimeAccel.m_CurrentTimeAccel = tap;
2580  /*
2581  Print(" -------- TimeAccelParam -------");
2582  Print(tap.param1);
2583  Print(tap.param2);
2584  Print(tap.param3);
2585  Print(" -------------------------------");
2586  Print(GetFeatureTimeAccelEnabled(ETimeAccelCategories.UNDERGROUND_ENTRANCE));
2587  Print(GetFeatureTimeAccelValue());
2588  Print(" ===============================");
2589  */
2590  }
2591  break;
2592  }
2593  }
2594  }
2595 
2596  // Helper diag functions
2597 
2598  void GoUnconscious(PlayerBase player)
2599  {
2600  if (player.IsUnconscious())
2601  {
2602  player.SetHealth("","Shock",100);
2603  }
2604  else
2605  {
2606  player.m_UnconsciousEndTime = -60;
2607  player.SetHealth("","Shock",0);
2608  }
2609  }
2610 
2611  bool AreTimeAccelParamsSame(TimeAccelParam p1, TimeAccelParam p2)
2612  {
2613  if (p1.param1 != p2.param1)
2614  return false;
2615  if (p1.param2 != p2.param2)
2616  return false;
2617  if (p1.param3 != p2.param3)
2618  return false;
2619  return true;
2620  }
2621 
2622  static void EnableDebugSystemClient(ESubscriberSystems system, bool enable)
2623  {
2624  int mask;
2625  if (enable)
2626  {
2627  mask = (m_SystemsMaks | system);//turn on bit
2628  }
2629  else
2630  {
2631  mask = ((~system) & m_SystemsMaks);//turn off bit
2632  }
2633 
2634  if (mask != m_SystemsMaks)
2635  {
2636  GetGame().RPCSingleParam( GetGame().GetPlayer(),ERPCs.DEV_DIAGMENU_SUBSCRIBE, new Param1<int>(mask) , true, GetGame().GetPlayer().GetIdentity() );
2637  m_SystemsMaks = mask;
2638  }
2639  }
2640 
2641  static void SendDataToSubscribersServer(Object target, ESubscriberSystems system,int rpc_type, Param data, bool guaranteed = true)
2642  {
2643  for (int i = 0; i < m_Subscribers.Count(); i++)
2644  {
2645  Man man = m_Subscribers.GetKey(i);
2646  if (man)
2647  {
2648  int subscribedSystems = m_Subscribers.Get(man);
2649  if (system & subscribedSystems)
2650  {
2651  GetGame().RPCSingleParam( target, rpc_type, data, guaranteed , man.GetIdentity() );
2652  }
2653  }
2654  else
2655  {
2656  m_Subscribers.RemoveElement(i);
2657  i--;
2658  }
2659  }
2660  }
2661 
2662 
2663  // time accel related
2664  int GetTimeAccelBitmask()
2665  {
2666  int bitmask = 0;
2667  WriteCategoryBit(bitmask, DiagMenuIDs.DM_FEATURE_TIME_ACCEL_UG_ENTRANCES, ETimeAccelCategories.UNDERGROUND_ENTRANCE);
2668  WriteCategoryBit(bitmask, DiagMenuIDs.DM_FEATURE_TIME_ACCEL_UG_RESERVOIR, ETimeAccelCategories.UNDERGROUND_RESERVOIR);
2669  WriteCategoryBit(bitmask, DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENERGY_CONSUME, ETimeAccelCategories.ENERGY_CONSUMPTION);
2670  WriteCategoryBit(bitmask, DiagMenuIDs.DM_FEATURE_TIME_ACCEL_ENERGY_RECHARGE, ETimeAccelCategories.ENERGY_RECHARGE);
2671  return bitmask;
2672  }
2673 
2674  void WriteCategoryBit(out int bitmask, int diagMenuID, ETimeAccelCategories category)
2675  {
2676  if (DiagMenu.GetValue(diagMenuID))
2677  {
2678  bitmask = bitmask | category;
2679  }
2680  }
2681 
2682 #endif
2683 }
ItemBase
Definition: inventoryitem.c:730
Param2
Definition: ppeconstants.c:66
GetGame
proto native CGame GetGame()
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
BleedingIndicationConstants
Definition: bleedingindicationconstants.c:1
IsCLIParam
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
Error
void Error(string err)
Messagebox with error message.
Definition: endebug.c:90
LogManager
Definition: debug.c:734
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
SoftSkillsManager
Definition: softskillsmanager.c:1
DiagMenu
Definition: endebug.c:232
TStringArray
array< string > TStringArray
Definition: enscript.c:685
m_Timer
ref Timer m_Timer
Definition: dayzgame.c:690
Print
proto void Print(void var)
Prints content of variable to console/log.
BleedingSourcesManagerBase
Definition: bleedingsourcesmanagerbase.c:1
SceneObject
Definition: sceneobject.c:1
CachedObjectsParams
Definition: utilityclasses.c:9
m_BloodyHands
protected ref map< string, ref BloodyHands > m_BloodyHands
Definition: pluginlifespan.c:34
PluginBase
Definition: pluginadminlog.c:1
PluginDayzPlayerDebug
void PluginDayzPlayerDebug()
Definition: plugindayzplayerdebug.c:275
DebugActionType
DebugActionType
Definition: plugindiagmenu.c:6
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
OnRPC
void OnRPC(ParamsReadContext ctx)
Definition: displaystatus.c:216
DiagMenuIDs
DiagMenuIDs
Definition: ediagmenuids.c:1
PlayerBase
Definition: playerbaseclient.c:1
map
map
Definition: controlsxboxnew.c:3
vector
Definition: enconvert.c:105
PLAYER_AGENTS
@ PLAYER_AGENTS
Definition: plugindiagmenu.c:9
UNLIMITED_AMMO
@ UNLIMITED_AMMO
Definition: plugindiagmenu.c:10
PluginLifespan
void PluginLifespan()
Definition: pluginlifespan.c:45
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
DbgBleedingIndicationStaticInfo
static info (non-constants)
Definition: bleedingindicationstaticinfo.c:2
Object
Definition: objecttyped.c:1
g_Plugins
class PluginManager g_Plugins
DayZPlayerImplement
Definition: manbase.c:1
GENERIC_ACTIONS
@ GENERIC_ACTIONS
Definition: plugindiagmenu.c:8
HumanCommandVehicle
Definition: human.c:689
CfgGameplayHandler
Definition: cfggameplayhandler.c:1
array< string >
Update
proto native volatile void Update()
Definition: playersoundmanager.c:125
HitDirectionEffectBase
Definition: hitdirectionarrow.c:2
PrtTest
Definition: gameplay.c:1496
int
Param3 int
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
Debug
Definition: debug.c:13
ERPCs
ERPCs
Definition: erpcs.c:1
OnInit
void OnInit()
Definition: aibehaviour.c:49
Timer
Definition: dayzplayerimplement.c:62
SoftSkillManagerDebug
void SoftSkillManagerDebug(SoftSkillsManager softskill_manager)
Definition: softskillsmanager.c:570
PlayerBaseClient
Definition: survivorbase.c:1
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
PluginDiagMenu
Definition: plugindiagmenu.c:29
EntityAI
Definition: building.c:5
Shape
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
Hud
Definition: gameplay.c:623