Decompiled source of PizzaClientLagFix v1.2.0

plugins/PizzaClientLagFix/PizzaClientLagFix.dll

Decompiled 4 months ago
using System;
using System.Collections.Generic;
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.Logging;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.Projectile;
using RoR2;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("PizzaClientLagFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PizzaClientLagFix")]
[assembly: AssemblyTitle("PizzaClientLagFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PizzaClientLagFix
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber)
		{
			int num = callerPath.LastIndexOf("PizzaClientLagFix");
			if (num >= 0)
			{
				callerPath = callerPath.Substring(num + "PizzaClientLagFix".Length + 1);
			}
			return $"{callerPath}:{callerLineNumber} ({callerMemberName}) ";
		}

		internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Error_NoCallerPrefix(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Fatal_NoCallerPrefix(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Info_NoCallerPrefix(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Message_NoCallerPrefix(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

		internal static void Warning_NoCallerPrefix(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInPlugin("Gorakh.PizzaClientLagFix", "PizzaClientLagFix", "1.2.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "Gorakh.PizzaClientLagFix";

		public const string PluginAuthor = "Gorakh";

		public const string PluginName = "PizzaClientLagFix";

		public const string PluginVersion = "1.2.0";

		internal static Main Instance { get; private set; }

		private void Awake()
		{
			Stopwatch stopwatch = Stopwatch.StartNew();
			Log.Init(((BaseUnityPlugin)this).Logger);
			Instance = SingletonHelper.Assign<Main>(Instance, this);
			stopwatch.Stop();
			Log.Info_NoCallerPrefix($"Initialized in {stopwatch.Elapsed.TotalSeconds:F2} seconds");
		}

		private void OnDestroy()
		{
			Instance = SingletonHelper.Unassign<Main>(Instance, this);
		}
	}
	public static class OverlapAttackIgnoreNonAuthorityHitsPatch
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_ProcessHits <0>__OverlapAttack_ProcessHits;
		}

		public static bool Enabled;

		[SystemInitializer(new Type[] { })]
		private static void Init()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__OverlapAttack_ProcessHits;
			if (obj == null)
			{
				hook_ProcessHits val = OverlapAttack_ProcessHits;
				<>O.<0>__OverlapAttack_ProcessHits = val;
				obj = (object)val;
			}
			OverlapAttack.ProcessHits += (hook_ProcessHits)obj;
		}

		private static void OverlapAttack_ProcessHits(orig_ProcessHits orig, OverlapAttack self, object boxedHitList)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (!Enabled)
			{
				orig.Invoke(self, boxedHitList);
				return;
			}
			try
			{
				List<OverlapInfo> list = (List<OverlapInfo>)boxedHitList;
				for (int num = list.Count - 1; num >= 0; num--)
				{
					HurtBox hurtBox = list[num].hurtBox;
					if (Object.op_Implicit((Object)(object)hurtBox))
					{
						HealthComponent healthComponent = hurtBox.healthComponent;
						if (Object.op_Implicit((Object)(object)healthComponent) && !((NetworkBehaviour)healthComponent).hasAuthority)
						{
							list.RemoveAt(num);
						}
					}
				}
				orig.Invoke(self, (object)list);
			}
			catch (Exception data)
			{
				Log.Error_NoCallerPrefix(data);
				orig.Invoke(self, boxedHitList);
			}
		}
	}
	internal class ProjectileOverlapAttackClientPrediction : NetworkBehaviour
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Awake <>9__0_0;

			public static hook_FixedUpdate <>9__0_1;

			internal void <Init>b__0_0(orig_Awake orig, ProjectileController self)
			{
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<ProjectileOverlapAttack>()) && (self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherUltLineProjectileRotateLeft") || self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherUltLineProjectileRotateRight") || self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherSunderWave")))
				{
					((Component)self).gameObject.AddComponent<ProjectileOverlapAttackClientPrediction>();
				}
			}

			internal void <Init>b__0_1(orig_FixedUpdate orig, ProjectileOverlapAttack self)
			{
				ProjectileOverlapAttackClientPrediction component = ((Component)self).GetComponent<ProjectileOverlapAttackClientPrediction>();
				OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = Object.op_Implicit((Object)(object)component);
				try
				{
					orig.Invoke(self);
				}
				finally
				{
					OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = false;
				}
				if (!Object.op_Implicit((Object)(object)component) || NetworkServer.active || !NetworkClient.active)
				{
					return;
				}
				if (self.resetInterval >= 0f)
				{
					self.resetTimer -= Time.fixedDeltaTime;
					if (self.resetTimer <= 0f)
					{
						self.resetTimer = self.resetInterval;
						self.ResetOverlapAttack();
					}
				}
				self.fireTimer -= Time.fixedDeltaTime;
				if (self.fireTimer <= 0f)
				{
					self.fireTimer = 1f / self.fireFrequency;
					component.SetOverlapAttackValuesFromServer(self.attack);
					OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = true;
					try
					{
						self.attack.Fire((List<HurtBox>)null);
					}
					finally
					{
						OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = false;
					}
				}
			}
		}

		private GameObject _attacker;

		private NetworkInstanceId _attackerNetId;

		private const uint ATTACKER_DIRTY_BIT = 1u;

		private GameObject _inflictor;

		private NetworkInstanceId _inflictorNetId;

		private const uint INFLICTOR_DIRTY_BIT = 2u;

		private ProcChainMask _procChainMask;

		private const uint PROC_CHAIN_MASK_DIRTY_BIT = 4u;

		private float _procCoefficient;

		private const uint PROC_COEFFICIENT_DIRTY_BIT = 8u;

		private sbyte _teamIndex;

		private const uint TEAM_INDEX_DIRTY_BIT = 16u;

		private float _damage;

		private const uint DAMAGE_DIRTY_BIT = 32u;

		private Vector3 _forceVector;

		private const uint FORCE_VECTOR_DIRTY_BIT = 64u;

		private bool _isCrit;

		private const uint IS_CRIT_DIRTY_BIT = 128u;

		private byte _damageColorIndex;

		private const uint DAMAGE_COLOR_INDEX_DIRTY_BIT = 256u;

		private uint _damageType;

		private const uint DAMAGE_TYPE_DIRTY_BIT = 512u;

		private int _maximumOverlapTargets;

		private const uint MAXIMUM_OVERLAP_TARGETS_DIRTY_BITS = 1024u;

		private ProjectileController _projectileController;

		private ProjectileOverlapAttack _projectileOverlapAttack;

		private ProjectileDamage _projectileDamage;

		public GameObject Attacker
		{
			get
			{
				return _attacker;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVarGameObject(value, ref _attacker, 1u, ref _attackerNetId);
			}
		}

		public GameObject Inflictor
		{
			get
			{
				return _inflictor;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVarGameObject(value, ref _inflictor, 2u, ref _inflictorNetId);
			}
		}

		public ProcChainMask ProcChainMask
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return _procChainMask;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				((NetworkBehaviour)this).SetSyncVar<ProcChainMask>(value, ref _procChainMask, 4u);
			}
		}

		public float ProcCoefficient
		{
			get
			{
				return _procCoefficient;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVar<float>(value, ref _procCoefficient, 8u);
			}
		}

		public TeamIndex TeamIndex
		{
			get
			{
				return (TeamIndex)_teamIndex;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Expected I4, but got Unknown
				((NetworkBehaviour)this).SetSyncVar<sbyte>((sbyte)(int)value, ref _teamIndex, 16u);
			}
		}

		public float Damage
		{
			get
			{
				return _damage;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVar<float>(value, ref _damage, 32u);
			}
		}

		public Vector3 ForceVector
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return _forceVector;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				((NetworkBehaviour)this).SetSyncVar<Vector3>(value, ref _forceVector, 64u);
			}
		}

		public bool IsCrit
		{
			get
			{
				return _isCrit;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVar<bool>(value, ref _isCrit, 128u);
			}
		}

		public DamageColorIndex DamageColorIndex
		{
			get
			{
				return (DamageColorIndex)_damageColorIndex;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Expected I4, but got Unknown
				((NetworkBehaviour)this).SetSyncVar<byte>((byte)(int)value, ref _damageColorIndex, 256u);
			}
		}

		public DamageType DamageType
		{
			get
			{
				return (DamageType)_damageType;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Expected I4, but got Unknown
				((NetworkBehaviour)this).SetSyncVar<uint>((uint)(int)value, ref _damageType, 512u);
			}
		}

		public int MaximumOverlapTargets
		{
			get
			{
				return _maximumOverlapTargets;
			}
			set
			{
				((NetworkBehaviour)this).SetSyncVar<int>(value, ref _maximumOverlapTargets, 1024u);
			}
		}

		[SystemInitializer(new Type[] { })]
		private static void Init()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				hook_Awake val = delegate(orig_Awake orig, ProjectileController self)
				{
					orig.Invoke(self);
					if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<ProjectileOverlapAttack>()) && (self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherUltLineProjectileRotateLeft") || self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherUltLineProjectileRotateRight") || self.catalogIndex == ProjectileCatalog.FindProjectileIndex("BrotherSunderWave")))
					{
						((Component)self).gameObject.AddComponent<ProjectileOverlapAttackClientPrediction>();
					}
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			ProjectileController.Awake += (hook_Awake)obj;
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, ProjectileOverlapAttack self)
				{
					ProjectileOverlapAttackClientPrediction component = ((Component)self).GetComponent<ProjectileOverlapAttackClientPrediction>();
					OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = Object.op_Implicit((Object)(object)component);
					try
					{
						orig.Invoke(self);
					}
					finally
					{
						OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = false;
					}
					if (Object.op_Implicit((Object)(object)component) && !NetworkServer.active && NetworkClient.active)
					{
						if (self.resetInterval >= 0f)
						{
							self.resetTimer -= Time.fixedDeltaTime;
							if (self.resetTimer <= 0f)
							{
								self.resetTimer = self.resetInterval;
								self.ResetOverlapAttack();
							}
						}
						self.fireTimer -= Time.fixedDeltaTime;
						if (self.fireTimer <= 0f)
						{
							self.fireTimer = 1f / self.fireFrequency;
							component.SetOverlapAttackValuesFromServer(self.attack);
							OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = true;
							try
							{
								self.attack.Fire((List<HurtBox>)null);
							}
							finally
							{
								OverlapAttackIgnoreNonAuthorityHitsPatch.Enabled = false;
							}
						}
					}
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			ProjectileOverlapAttack.FixedUpdate += (hook_FixedUpdate)obj2;
		}

		private void Awake()
		{
			_projectileController = ((Component)this).GetComponent<ProjectileController>();
			_projectileOverlapAttack = ((Component)this).GetComponent<ProjectileOverlapAttack>();
			_projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
		}

		public override void PreStartClient()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			((NetworkBehaviour)this).PreStartClient();
			if (!((NetworkInstanceId)(ref _attackerNetId)).IsEmpty())
			{
				_attacker = ClientScene.FindLocalObject(_attackerNetId);
			}
			if (!((NetworkInstanceId)(ref _inflictorNetId)).IsEmpty())
			{
				_inflictor = ClientScene.FindLocalObject(_inflictorNetId);
			}
		}

		private void Update()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)_projectileController))
			{
				Attacker = _projectileController.owner;
				Inflictor = ((Component)this).gameObject;
				ProcChainMask = _projectileController.procChainMask;
				TeamIndex = _projectileController.teamFilter.teamIndex;
				if (Object.op_Implicit((Object)(object)_projectileOverlapAttack))
				{
					ProcCoefficient = _projectileController.procCoefficient * _projectileOverlapAttack.overlapProcCoefficient;
				}
			}
			if (Object.op_Implicit((Object)(object)_projectileOverlapAttack))
			{
				if (Object.op_Implicit((Object)(object)_projectileDamage))
				{
					Damage = _projectileDamage.damage * _projectileOverlapAttack.damageCoefficient;
					ForceVector = _projectileOverlapAttack.forceVector + _projectileDamage.force * ((Component)this).transform.forward;
				}
				MaximumOverlapTargets = _projectileOverlapAttack.maximumOverlapTargets;
			}
			if (Object.op_Implicit((Object)(object)_projectileDamage))
			{
				IsCrit = _projectileDamage.crit;
				DamageColorIndex = _projectileDamage.damageColorIndex;
				DamageType = _projectileDamage.damageType;
			}
		}

		public void SetOverlapAttackValuesFromServer(OverlapAttack overlapAttack)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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)
			overlapAttack.attacker = _attacker;
			overlapAttack.inflictor = _inflictor;
			overlapAttack.procChainMask = _procChainMask;
			overlapAttack.procCoefficient = _procCoefficient;
			overlapAttack.teamIndex = TeamIndex;
			overlapAttack.damage = _damage;
			overlapAttack.forceVector = _forceVector;
			overlapAttack.isCrit = _isCrit;
			overlapAttack.damageColorIndex = DamageColorIndex;
			overlapAttack.damageType = DamageType;
			overlapAttack.maximumOverlapTargets = _maximumOverlapTargets;
		}

		public override bool OnSerialize(NetworkWriter writer, bool initialState)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			if (initialState)
			{
				writer.Write(_attacker);
				writer.Write(_inflictor);
				NetworkExtensions.Write(writer, _procChainMask);
				writer.Write(_procCoefficient);
				writer.Write(_teamIndex);
				writer.Write(_damage);
				writer.Write(_forceVector);
				writer.Write(_isCrit);
				writer.Write(_damageColorIndex);
				writer.WritePackedUInt32(_damageType);
				writer.Write(_maximumOverlapTargets);
				return true;
			}
			uint syncVarDirtyBits = ((NetworkBehaviour)this).syncVarDirtyBits;
			writer.WritePackedUInt32(syncVarDirtyBits);
			bool result = false;
			if ((syncVarDirtyBits & (true ? 1u : 0u)) != 0)
			{
				writer.Write(_attacker);
				result = true;
			}
			if ((syncVarDirtyBits & 2u) != 0)
			{
				writer.Write(_inflictor);
				result = true;
			}
			if ((syncVarDirtyBits & 4u) != 0)
			{
				NetworkExtensions.Write(writer, _procChainMask);
				result = true;
			}
			if ((syncVarDirtyBits & 8u) != 0)
			{
				writer.Write(_procCoefficient);
				result = true;
			}
			if ((syncVarDirtyBits & 0x10u) != 0)
			{
				writer.Write(_teamIndex);
				result = true;
			}
			if ((syncVarDirtyBits & 0x20u) != 0)
			{
				writer.Write(_damage);
				result = true;
			}
			if ((syncVarDirtyBits & 0x40u) != 0)
			{
				writer.Write(_forceVector);
				result = true;
			}
			if ((syncVarDirtyBits & 0x80u) != 0)
			{
				writer.Write(_isCrit);
				result = true;
			}
			if ((syncVarDirtyBits & 0x100u) != 0)
			{
				writer.Write(_damageColorIndex);
				result = true;
			}
			if ((syncVarDirtyBits & 0x200u) != 0)
			{
				writer.WritePackedUInt32(_damageType);
				result = true;
			}
			if ((syncVarDirtyBits & 0x400u) != 0)
			{
				writer.Write(_maximumOverlapTargets);
				result = true;
			}
			return result;
		}

		public override void OnDeserialize(NetworkReader reader, bool initialState)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (initialState)
			{
				_attackerNetId = reader.ReadNetworkId();
				_inflictorNetId = reader.ReadNetworkId();
				_procChainMask = NetworkExtensions.ReadProcChainMask(reader);
				_procCoefficient = reader.ReadSingle();
				_teamIndex = reader.ReadSByte();
				_damage = reader.ReadSingle();
				_forceVector = reader.ReadVector3();
				_isCrit = reader.ReadBoolean();
				_damageColorIndex = reader.ReadByte();
				_damageType = reader.ReadPackedUInt32();
				_maximumOverlapTargets = reader.ReadInt32();
				return;
			}
			uint num = reader.ReadPackedUInt32();
			if ((num & (true ? 1u : 0u)) != 0)
			{
				_attacker = reader.ReadGameObject();
			}
			if ((num & 2u) != 0)
			{
				_inflictor = reader.ReadGameObject();
			}
			if ((num & 4u) != 0)
			{
				_procChainMask = NetworkExtensions.ReadProcChainMask(reader);
			}
			if ((num & 8u) != 0)
			{
				_procCoefficient = reader.ReadSingle();
			}
			if ((num & 0x10u) != 0)
			{
				_teamIndex = reader.ReadSByte();
			}
			if ((num & 0x20u) != 0)
			{
				_damage = reader.ReadSingle();
			}
			if ((num & 0x40u) != 0)
			{
				_forceVector = reader.ReadVector3();
			}
			if ((num & 0x80u) != 0)
			{
				_isCrit = reader.ReadBoolean();
			}
			if ((num & 0x100u) != 0)
			{
				_damageColorIndex = reader.ReadByte();
			}
			if ((num & 0x200u) != 0)
			{
				_damageType = reader.ReadPackedUInt32();
			}
			if ((num & 0x400u) != 0)
			{
				_maximumOverlapTargets = reader.ReadInt32();
			}
		}
	}
}