Decompiled source of BetterFallDamage v1.2.0

BetterFallDamage.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BetterFallDamage.Patches;
using GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("BetterFallDamage")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A plugin to make fall damage more difficult, fun, and configurable.")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("BetterFallDamage")]
[assembly: AssemblyTitle("BetterFallDamage")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
namespace BetterFallDamage
{
	[BepInPlugin("lokishorsechild.BetterFallDamage", "BetterFallDamage", "1.2.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInProcess("Lethal Company.exe")]
	public class BetterFallDamageClass : BaseUnityPlugin
	{
		public static ManualLogSource BFDLogger;

		internal static bool disableServerSideConfig;

		internal static bool disableFallDamage;

		internal static bool disableWeightScaling;

		internal static int weightScalingFactor;

		internal static float scaledWeightScalingFactor;

		internal static float scaledFallTimeDamage;

		internal static float scaledFallTimeInstaKill;

		internal static float fallTimeDamageExponent;

		internal const float OneSecondOfFalling = 38f;

		internal const float OnePoundInCode = 0.0095f;

		private ConfigEntry<bool> configDisableServerSideConfig;

		private BoolCheckBoxConfigItem lcDisableServerSideConfig;

		private ConfigEntry<bool> configDisableFallDamage;

		private BoolCheckBoxConfigItem lcDisableFallDamage;

		private ConfigEntry<bool> configDisableWeightScaling;

		private BoolCheckBoxConfigItem lcDisableWeightScaling;

		private ConfigEntry<int> configWeightScalingFactor;

		private IntSliderConfigItem lcWeightScalingFactor;

		private ConfigEntry<float> configFallTimeDamage;

		private FloatSliderConfigItem lcFallTimeDamage;

		private ConfigEntry<float> configFallTimeInstaKill;

		private FloatSliderConfigItem lcFallTimeInstaKill;

		private ConfigEntry<float> configFallTimeDamageExponent;

		private FloatSliderConfigItem lcFallTimeDamageExponent;

		private readonly Harmony harmony = new Harmony("lokishorsechild.BetterFallDamage");

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Expected O, but got Unknown
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Expected O, but got Unknown
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Expected O, but got Unknown
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Expected O, but got Unknown
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Expected O, but got Unknown
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Expected O, but got Unknown
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Expected O, but got Unknown
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Expected O, but got Unknown
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Expected O, but got Unknown
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Expected O, but got Unknown
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Expected O, but got Unknown
			BFDLogger = Logger.CreateLogSource("BetterFallDamage");
			BaseOptions val = new BaseOptions();
			val.RequiresRestart = false;
			val.CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			BaseOptions val2 = val;
			ConfigDescription val3 = new ConfigDescription("Whether or not to use the host's fall damage settings.", (AcceptableValueBase)null, Array.Empty<object>());
			configDisableServerSideConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DisableServerSideConfig", false, val3);
			lcDisableServerSideConfig = new BoolCheckBoxConfigItem(configDisableServerSideConfig, false);
			configDisableServerSideConfig.SettingChanged += delegate
			{
				disableServerSideConfig = configDisableServerSideConfig.Value;
			};
			ConfigDescription val4 = new ConfigDescription("Whether or not fall damage is applied at all.", (AcceptableValueBase)null, Array.Empty<object>());
			configDisableFallDamage = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DisableFallDamage", false, val4);
			ConfigEntry<bool> obj2 = configDisableFallDamage;
			BoolCheckBoxOptions val5 = new BoolCheckBoxOptions();
			((BaseOptions)val5).RequiresRestart = false;
			((BaseOptions)val5).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcDisableFallDamage = new BoolCheckBoxConfigItem(obj2, val5);
			configDisableFallDamage.SettingChanged += delegate
			{
				disableFallDamage = configDisableFallDamage.Value;
			};
			ConfigDescription val6 = new ConfigDescription("How long (in seconds) a player can spend in the air before taking any fall-damage.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 999f), Array.Empty<object>());
			configFallTimeDamage = ((BaseUnityPlugin)this).Config.Bind<float>("FallTime", "FallTimeDamage", 0.66f, val6);
			ConfigEntry<float> obj3 = configFallTimeDamage;
			FloatSliderOptions val7 = new FloatSliderOptions();
			((BaseOptions)val7).RequiresRestart = false;
			((BaseOptions)val7).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcFallTimeDamage = new FloatSliderConfigItem(obj3, val7);
			configFallTimeDamage.SettingChanged += delegate
			{
				scaledFallTimeDamage = configFallTimeDamage.Value * 38f;
			};
			ConfigDescription val8 = new ConfigDescription("How long (in seconds) a player can spend in the air before immediately dying when they hit the ground.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 999f), Array.Empty<object>());
			configFallTimeInstaKill = ((BaseUnityPlugin)this).Config.Bind<float>("FallTime", "FallTimeInstaKill", 1.2f, val8);
			ConfigEntry<float> obj4 = configFallTimeInstaKill;
			val7 = new FloatSliderOptions();
			((BaseOptions)val7).RequiresRestart = false;
			((BaseOptions)val7).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcFallTimeInstaKill = new FloatSliderConfigItem(obj4, val7);
			configFallTimeInstaKill.SettingChanged += delegate
			{
				scaledFallTimeInstaKill = configFallTimeInstaKill.Value * 38f;
			};
			ConfigDescription val9 = new ConfigDescription("Affects the damage ramp-up between FallTimeDamage and FallTimeInstaKill.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 25.5f), Array.Empty<object>());
			configFallTimeDamageExponent = ((BaseUnityPlugin)this).Config.Bind<float>("FallTime", "FallTimeDamageExponent", 1.7f, val9);
			ConfigEntry<float> obj5 = configFallTimeDamageExponent;
			val7 = new FloatSliderOptions();
			((BaseOptions)val7).RequiresRestart = false;
			((BaseOptions)val7).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcFallTimeDamageExponent = new FloatSliderConfigItem(obj5, val7);
			configFallTimeDamageExponent.SettingChanged += delegate
			{
				fallTimeDamageExponent = configFallTimeDamageExponent.Value;
			};
			ConfigDescription val10 = new ConfigDescription("Whether or not carry weight will affect fall-damage.", (AcceptableValueBase)null, Array.Empty<object>());
			configDisableWeightScaling = ((BaseUnityPlugin)this).Config.Bind<bool>("WeightScaling", "DisableWeightScaling", false, val10);
			ConfigEntry<bool> obj6 = configDisableWeightScaling;
			val5 = new BoolCheckBoxOptions();
			((BaseOptions)val5).RequiresRestart = false;
			((BaseOptions)val5).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcDisableWeightScaling = new BoolCheckBoxConfigItem(obj6, val5);
			configDisableWeightScaling.SettingChanged += delegate
			{
				disableWeightScaling = configDisableWeightScaling.Value;
			};
			ConfigDescription val11 = new ConfigDescription("The weight at which the player has half the amount of falltime.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 999), Array.Empty<object>());
			configWeightScalingFactor = ((BaseUnityPlugin)this).Config.Bind<int>("WeightScaling", "WeightScalingFactor", 160, val11);
			ConfigEntry<int> obj7 = configWeightScalingFactor;
			IntSliderOptions val12 = new IntSliderOptions();
			((BaseOptions)val12).RequiresRestart = false;
			((BaseOptions)val12).CanModifyCallback = new CanModifyDelegate(CheckIfAdheringToServerCallback);
			lcWeightScalingFactor = new IntSliderConfigItem(obj7, val12);
			configWeightScalingFactor.SettingChanged += delegate
			{
				scaledWeightScalingFactor = (float)configWeightScalingFactor.Value * 0.0095f;
			};
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcDisableServerSideConfig);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcDisableFallDamage);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcDisableWeightScaling);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcWeightScalingFactor);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcFallTimeDamage);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcFallTimeInstaKill);
			LethalConfigManager.AddConfigItem((BaseConfigItem)(object)lcFallTimeDamageExponent);
			disableServerSideConfig = configDisableServerSideConfig.Value;
			disableFallDamage = configDisableFallDamage.Value;
			disableWeightScaling = configDisableWeightScaling.Value;
			weightScalingFactor = configWeightScalingFactor.Value;
			scaledWeightScalingFactor = (float)configWeightScalingFactor.Value * 0.0095f;
			scaledFallTimeDamage = configFallTimeDamage.Value * 38f;
			scaledFallTimeInstaKill = configFallTimeInstaKill.Value * 38f;
			fallTimeDamageExponent = configFallTimeDamageExponent.Value;
			harmony.PatchAll(typeof(BFDDamageCalcPatch));
			harmony.PatchAll(typeof(BFDLobbyJoinPatch));
			BFDLogger.LogInfo((object)"Plugin lokishorsechild.BetterFallDamage loaded");
			BFDLogger = ((BaseUnityPlugin)this).Logger;
		}

		private static CanModifyResult CheckIfAdheringToServerCallback()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (disableServerSideConfig)
			{
				return CanModifyResult.True();
			}
			StartOfRound val = Object.FindObjectOfType<StartOfRound>();
			if ((Object)(object)val == (Object)null)
			{
				return CanModifyResult.True();
			}
			if (!val.shipHasLanded || ((NetworkBehaviour)val).NetworkManager.IsServer || ((NetworkBehaviour)val).NetworkManager.IsHost)
			{
				return CanModifyResult.True();
			}
			return CanModifyResult.False("Because you're not the host, please tick 'Disable Server Side Config' (and press 'Apply') before attempting to change anything mid-game");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "lokishorsechild.BetterFallDamage";

		public const string PLUGIN_NAME = "BetterFallDamage";

		public const string PLUGIN_VERSION = "1.2.0";
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "BetterFallDamage";

		public const string PLUGIN_NAME = "BetterFallDamage";

		public const string PLUGIN_VERSION = "1.1.0";
	}
}
namespace BetterFallDamage.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class BFDDamageCalcPatch
	{
		[HarmonyPatch("PlayerHitGroundEffects")]
		[HarmonyPrefix]
		private static bool Prefix(PlayerControllerB __instance)
		{
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			__instance.GetCurrentMaterialStandingOn();
			if (__instance.fallValue < -9f)
			{
				if (__instance.fallValue < -16f)
				{
					__instance.movementAudio.PlayOneShot(StartOfRound.Instance.playerHitGroundHard, 1f);
					WalkieTalkie.TransmitOneShotAudio(__instance.movementAudio, StartOfRound.Instance.playerHitGroundHard, 1f);
				}
				else if (__instance.fallValue < -2f)
				{
					__instance.movementAudio.PlayOneShot(StartOfRound.Instance.playerHitGroundSoft, 1f);
				}
				__instance.LandFromJumpServerRpc(__instance.fallValue < -16f);
			}
			if (!BetterFallDamageClass.disableFallDamage && Mathf.Abs(__instance.fallValueUncapped) > BetterFallDamageClass.scaledFallTimeDamage && !__instance.jetpackControls && !__instance.disablingJetpackControls && !__instance.isSpeedCheating)
			{
				int num3;
				if (BetterFallDamageClass.disableWeightScaling)
				{
					float num = BetterFallDamageClass.scaledFallTimeInstaKill - BetterFallDamageClass.scaledFallTimeDamage;
					float num2 = (Mathf.Abs(__instance.fallValueUncapped) - BetterFallDamageClass.scaledFallTimeDamage) / num;
					num3 = Mathf.FloorToInt(Mathf.Pow(num2, BetterFallDamageClass.fallTimeDamageExponent) * 100f);
				}
				else
				{
					float num4 = (__instance.carryWeight - 1f) / BetterFallDamageClass.scaledWeightScalingFactor + 1f;
					float num5 = BetterFallDamageClass.scaledFallTimeDamage / num4;
					float num6 = BetterFallDamageClass.scaledFallTimeInstaKill / num4;
					float num7 = num6 - num5;
					float num8 = (Mathf.Abs(__instance.fallValueUncapped) - num5) / num7;
					num3 = Mathf.FloorToInt(Mathf.Pow(num8, BetterFallDamageClass.fallTimeDamageExponent) * 100f);
				}
				if (num3 > 0)
				{
					__instance.DamagePlayer(Mathf.Min(num3, 100), true, true, (CauseOfDeath)2, 0, true, default(Vector3));
				}
			}
			if (__instance.fallValue < -16f)
			{
				RoundManager.Instance.PlayAudibleNoise(((Component)__instance).transform.position, 7f, 0.5f, 0, false, 0);
			}
			return false;
		}
	}
	[HarmonyPatch]
	internal class BFDLobbyJoinPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "ResetPlayersLoadedValueClientRpc")]
		private static void SendConfigToClient(bool landingShip, StartOfRound __instance)
		{
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			if (!landingShip)
			{
				return;
			}
			MemberInfo[] member = typeof(StartOfRound).GetMember("__rpc_exec_stage", BindingFlags.Instance | BindingFlags.NonPublic);
			if (member.Length < 1)
			{
				BetterFallDamageClass.BFDLogger.LogError((object)"Couldn't find __rpc_exec_stage instance");
				return;
			}
			object value = ((FieldInfo)member[0]).GetValue(__instance);
			if (value != null)
			{
				int num = (int)(object)(value as IConvertible);
				if (!((NetworkBehaviour)__instance).IsServer)
				{
					return;
				}
				try
				{
					BetterFallDamageClass.BFDLogger.LogDebug((object)$"Attempting to send config data to clients (exec_stage: {num})");
					NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
					if (networkManager != null && networkManager.IsListening && num != 2 && (networkManager.IsServer || networkManager.IsHost))
					{
						MethodInfo method = typeof(StartOfRound).GetMethod("__beginSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic);
						ClientRpcParams val = default(ClientRpcParams);
						object[] parameters = new object[3]
						{
							3816480838u,
							val,
							(object)(RpcDelivery)0
						};
						FastBufferWriter val2 = (FastBufferWriter)method.Invoke(__instance, parameters);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.disableFallDamage);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.disableWeightScaling);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.weightScalingFactor);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.scaledWeightScalingFactor);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.scaledFallTimeDamage);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.scaledFallTimeInstaKill);
						BytePacker.WriteValuePacked(val2, BetterFallDamageClass.fallTimeDamageExponent);
						MethodInfo method2 = typeof(StartOfRound).GetMethod("__endSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic);
						object[] parameters2 = new object[4]
						{
							val2,
							3816480838u,
							val,
							(object)(RpcDelivery)0
						};
						method2.Invoke(__instance, parameters2);
						BetterFallDamageClass.BFDLogger.LogDebug((object)" -- Packet send successful");
					}
					return;
				}
				catch
				{
					BetterFallDamageClass.BFDLogger.LogError((object)" -- Error sending config data to clients");
					return;
				}
			}
			BetterFallDamageClass.BFDLogger.LogError((object)"Couldn't acquire __rpc_exec_stage info");
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(StartOfRound), "__initializeRpcs")]
		private static void InitRPCsPatch(StartOfRound __instance)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			BetterFallDamageClass.BFDLogger.LogInfo((object)$"Adding RPC {3816480838u} to StartOfRound RPC Table");
			MethodInfo method = typeof(StartOfRound).GetMethod("__registerRpc", BindingFlags.Instance | BindingFlags.NonPublic);
			object[] parameters = new object[3]
			{
				3816480838u,
				(object)new RpcReceiveHandler(__rpc_handler_3816480838),
				"SendBFDConfigToClient"
			};
			method.Invoke(__instance, parameters);
		}

		private static void __rpc_handler_3816480838(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			if (BetterFallDamageClass.disableServerSideConfig)
			{
				BetterFallDamageClass.BFDLogger.LogInfo((object)"DisableServerSideConfig set to True - Skipping update from host");
				return;
			}
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening && !networkManager.IsServer && !networkManager.IsHost)
			{
				bool flag = default(bool);
				ByteUnpacker.ReadValuePacked(reader, ref flag);
				bool flag2 = default(bool);
				ByteUnpacker.ReadValuePacked(reader, ref flag2);
				int num = default(int);
				ByteUnpacker.ReadValuePacked(reader, ref num);
				float scaledWeightScalingFactor = default(float);
				ByteUnpacker.ReadValuePacked(reader, ref scaledWeightScalingFactor);
				float num2 = default(float);
				ByteUnpacker.ReadValuePacked(reader, ref num2);
				float num3 = default(float);
				ByteUnpacker.ReadValuePacked(reader, ref num3);
				float num4 = default(float);
				ByteUnpacker.ReadValuePacked(reader, ref num4);
				BetterFallDamageClass.disableFallDamage = flag;
				BetterFallDamageClass.disableWeightScaling = flag2;
				BetterFallDamageClass.weightScalingFactor = num;
				BetterFallDamageClass.scaledWeightScalingFactor = scaledWeightScalingFactor;
				BetterFallDamageClass.scaledFallTimeDamage = num2;
				BetterFallDamageClass.scaledFallTimeInstaKill = num3;
				BetterFallDamageClass.fallTimeDamageExponent = num4;
				BetterFallDamageClass.BFDLogger.LogInfo((object)"Data received from host:");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- DisableFallDamage: {flag}");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- DisableWeightScaling: {flag2}");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- WeightScalingFactor: {num}");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- FallTimeDamage: {num2 / 38f}");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- FallTimeInstaKill: {num3 / 38f}");
				BetterFallDamageClass.BFDLogger.LogInfo((object)$" -- FallTimeDamageExponent: {num4}");
			}
		}
	}
}