3 private static string m_Path =
"$mission:cfggameplay.json";
14 private static void ValidateItems()
18 if (!item.ValidateServer())
20 string itemName = item.Type().ToString();
21 itemName.Replace(
"ITEM_",
"");
22 PrintToRPT(
"Validation failed during loading of 'cfggameplay.json' for " + itemName);
29 private static void InitData()
40 Print(m_Items.Count());
44 static bool LoadData()
50 m_Path =
string.Format(
"dz/worlds/%1/ce/cfggameplay.json", m_Path);
53 bool cfgGameplayFileEnabled =
GetGame().ServerConfigGetInt(
"enableCfgGameplayFile" );
56 if (!
GetGame().IsDedicatedServer())
58 cfgGameplayFileEnabled =
true;
62 if (!cfgGameplayFileEnabled || !
FileExist(m_Path))
71 if (!JsonFileLoader<CfgGameplayJson>.LoadFile(m_Path,
m_Data, errorMessage))
81 static void OnLoaded()
83 GetGame().GetMission().OnGameplayDataHandlerLoad();
84 DayZGame.Cast(
GetGame()).OnGameplayDataHandlerLoad();
88 static void SyncDataSend(notnull Man player)
90 GetGame().RPCSingleParam(player,
ERPCs.RPC_CFG_GAMEPLAY_SYNC,
new Param1<CfgGameplayJson>(
m_Data),
true, player.GetIdentity());
97 GetGame().RPCSingleParam(
null,
ERPCs.RPC_CFG_GAMEPLAY_SYNC,
new Param1<CfgGameplayJson>(
m_Data),
true, identity);
104 Param1<CfgGameplayJson> data =
new Param1<CfgGameplayJson>(
null);
106 if ( ctx.Read(data) )
112 ErrorEx(
"CfgGameplayHandler - client failed to read incoming data");
129 static bool GetDisablePersonalLight()
131 return m_Data.PlayerData.disablePersonalLight;
136 static int GetLightingConfig()
138 return m_Data.WorldsData.lightingConfig;
143 return m_Data.WorldsData.objectSpawnersArr;
148 return m_Data.WorldsData.environmentMinTemps;
153 return m_Data.WorldsData.environmentMaxTemps;
157 return m_Data.WorldsData.wetnessWeightModifiers;
162 static bool GetDisableBaseDamage()
164 return m_Data.GeneralData.disableBaseDamage;
168 static bool GetDisableContainerDamage()
170 return m_Data.GeneralData.disableContainerDamage;
173 static bool GetDisableRespawnDialog()
175 return m_Data.GeneralData.disableRespawnDialog;
178 static bool GetDisableRespawnInUnconsciousness()
180 return m_Data.GeneralData.disableRespawnInUnconsciousness;
183 static float GetSprintStaminaModifierErc()
185 return m_Data.PlayerData.StaminaData.sprintStaminaModifierErc;
188 static float GetSprintStaminaModifierCro()
190 return m_Data.PlayerData.StaminaData.sprintStaminaModifierCro;
193 static float GetSprintSwimmingStaminaModifier()
195 return m_Data.PlayerData.StaminaData.sprintSwimmingStaminaModifier;
197 static float GetSprintLadderStaminaModifier()
199 return m_Data.PlayerData.StaminaData.sprintLadderStaminaModifier;
202 static float GetStaminaWeightLimitThreshold()
204 return m_Data.PlayerData.StaminaData.staminaWeightLimitThreshold;
207 static float GetStaminaMax()
209 return m_Data.PlayerData.StaminaData.staminaMax;
212 static float GetStaminaKgToStaminaPercentPenalty()
214 return m_Data.PlayerData.StaminaData.staminaKgToStaminaPercentPenalty;
217 static float GetStaminaMinCap()
219 return m_Data.PlayerData.StaminaData.staminaMinCap;
222 static float GetMeleeStaminaModifier()
224 return m_Data.PlayerData.StaminaData.meleeStaminaModifier;
227 static float GetObstacleTraversalStaminaModifier()
229 return m_Data.PlayerData.StaminaData.obstacleTraversalStaminaModifier;
232 static float GetHoldBreathStaminaModifier()
234 return m_Data.PlayerData.StaminaData.holdBreathStaminaModifier;
237 static float GetMovementTimeToStrafeJog()
239 return Math.Max(0.01,
m_Data.PlayerData.MovementData.timeToStrafeJog);
242 static float GetMovementTimeToSprint()
244 return Math.Max(0.01,
m_Data.PlayerData.MovementData.timeToSprint);
247 static float GetMovementTimeToStrafeSprint()
249 return Math.Max(0.01,
m_Data.PlayerData.MovementData.timeToStrafeSprint);
252 static float GetMovementRotationSpeedJog()
254 return Math.Max(0.01,
m_Data.PlayerData.MovementData.rotationSpeedJog);
257 static float GetMovementRotationSpeedSprint()
259 return Math.Max(0.01,
m_Data.PlayerData.MovementData.rotationSpeedSprint);
262 static bool GetDisable2dMap()
264 return m_Data.PlayerData.disable2dMap;
267 static bool GetDisableIsCollidingBBoxCheck()
269 return m_Data.BaseBuildingData.HologramData.disableIsCollidingBBoxCheck;
272 static bool GetDisableIsCollidingPlayerCheck()
274 return m_Data.BaseBuildingData.HologramData.disableIsCollidingPlayerCheck;
277 static bool GetDisableIsClippingRoofCheck()
279 return m_Data.BaseBuildingData.HologramData.disableIsClippingRoofCheck;
282 static bool GetDisableIsBaseViableCheck()
284 return m_Data.BaseBuildingData.HologramData.disableIsBaseViableCheck;
287 static bool GetDisableIsInTerrainCheck()
289 return m_Data.BaseBuildingData.HologramData.disableIsInTerrainCheck;
292 static bool GetDisableIsUnderwaterCheck()
294 return m_Data.BaseBuildingData.HologramData.disableIsUnderwaterCheck;
297 static bool GetDisableHeightPlacementCheck()
299 return m_Data.BaseBuildingData.HologramData.disableHeightPlacementCheck;
302 static bool GetDisableIsPlacementPermittedCheck()
304 return m_Data.BaseBuildingData.HologramData.disableIsPlacementPermittedCheck;
307 static bool GetDisableIsCollidingAngleCheck()
309 return m_Data.BaseBuildingData.HologramData.disableIsCollidingAngleCheck;
312 static bool GetDisableIsCollidingGPlotCheck()
314 return m_Data.BaseBuildingData.HologramData.disableIsCollidingGPlotCheck;
317 static bool GetDisableIsCollidingCheck()
319 return m_Data.BaseBuildingData.ConstructionData.disableIsCollidingCheck;
322 static bool GetDisablePerformRoofCheck()
324 return m_Data.BaseBuildingData.ConstructionData.disablePerformRoofCheck;
327 static bool GetDisableDistanceCheck()
329 return m_Data.BaseBuildingData.ConstructionData.disableDistanceCheck;
332 static TStringSet GetDisallowedTypesInUnderground()
334 return m_Data.BaseBuildingData.HologramData.disallowedTypesInUnderground;
337 static bool GetHitIndicationOverrideEnabled()
339 return m_Data.UIData.HitIndicationData.hitDirectionOverrideEnabled;
342 static int GetHitIndicationMode()
344 return m_Data.UIData.HitIndicationData.hitDirectionBehaviour;
347 static int GetHitIndicationTypeID()
349 return m_Data.UIData.HitIndicationData.hitDirectionStyle;
352 static int GetHitIndicationIndicatorColor()
354 return m_Data.UIData.HitIndicationData.hitDirectionIndicatorColorStr.HexToInt();
357 static float GetHitIndicationMaxDuration()
359 return m_Data.UIData.HitIndicationData.hitDirectionMaxDuration;
362 static float GetHitIndicationBreakPoint()
364 return m_Data.UIData.HitIndicationData.hitDirectionBreakPointRelative;
367 static float GetHitIndicationScatter()
369 return m_Data.UIData.HitIndicationData.hitDirectionScatter;
372 static bool GetHitIndicationPPEEnabled()
374 return m_Data.UIData.HitIndicationData.hitIndicationPostProcessEnabled;
377 static bool GetUse3DMap()
379 return m_Data.UIData.use3DMap;
382 static float GetShockRefillSpeedConscious()
384 return m_Data.PlayerData.ShockHandlingData.shockRefillSpeedConscious;
387 static float GetShockRefillSpeedUnconscious()
389 return m_Data.PlayerData.ShockHandlingData.shockRefillSpeedUnconscious;
392 static bool GetAllowRefillSpeedModifier()
394 return m_Data.PlayerData.ShockHandlingData.allowRefillSpeedModifier;
398 static bool GetMapIgnoreMapOwnership()
400 return m_Data.MapData.ignoreMapOwnership;
403 static bool GetMapIgnoreNavItemsOwnership()
405 return m_Data.MapData.ignoreNavItemsOwnership;
408 static bool GetMapDisplayPlayerPosition()
410 return m_Data.MapData.displayPlayerPosition;
413 static bool GetMapDisplayNavigationInfo()
415 return m_Data.MapData.displayNavInfo;
418 static float GetStaminaDepletionSpeed()
420 return m_Data.PlayerData.DrowningData.staminaDepletionSpeed;
423 static float GetHealthDepletionSpeed()
425 return m_Data.PlayerData.DrowningData.healthDepletionSpeed;
428 static float GetShockDepletionSpeed()
430 return m_Data.PlayerData.DrowningData.shockDepletionSpeed;
433 static bool GetAllowStaminaAffectInertia()
435 return m_Data.PlayerData.MovementData.allowStaminaAffectInertia;
440 return m_Data.PlayerData.spawnGearPresetFiles;