Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Extendo Zapper v1.0.1
NoteBoxz.Zapper.dll
Decompiled 7 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using NoteBoxz.Zapper.NetcodePatcher; 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 = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("NoteBoxz.Zapper")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("Zapper")] [assembly: AssemblyTitle("NoteBoxz.Zapper")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 Zapper { [BepInPlugin("NoteBoxz.Zapper", "Zapper", "1.0.1")] public class Zapper : BaseUnityPlugin { internal static AssetBundle assetBundle; public static Zapper Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; NetcodePatcher(); Patch(); LoadAssetBundle(); Item val = assetBundle.LoadAsset<Item>("Assets/LethalCompany/Mods/ZapMod/Zapper.asset"); Utilities.FixMixerGroups(val.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); TerminalNode val2 = assetBundle.LoadAsset<TerminalNode>("Assets/LethalCompany/Mods/ZapMod/ZapperInfo.asset"); Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, 625); Logger.LogInfo((object)"NoteBoxz.Zapper v1.0.1 has loaded!"); } internal static void LoadAssetBundle() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (directoryName == null) { throw new InvalidOperationException("Unable to determine assembly location."); } string text = Path.Combine(directoryName, "zapmod"); assetBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)assetBundle == (Object)null) { throw new InvalidOperationException("Failed to load AssetBundle."); } } internal static void Patch() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("NoteBoxz.Zapper"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } private void NetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public class ZapperItem : GrabbableObject { [CompilerGenerated] private sealed class <ZapCorutine>d__13 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 origin; public Vector3 forward; public float coneAngleDegrees; public float maxDistance; public ZapperItem <>4__this; private Collider[] <hits>5__1; private int <i>5__2; private Collider[] <>s__3; private int <>s__4; private Collider <col>5__5; private PlayerControllerB <player>5__6; private EnemyAI <enemy>5__7; private Vector3 <targetPos>5__8; private Vector3 <toTarget>5__9; private float <angle>5__10; private GameObject <spawned>5__11; private float <targetDistance>5__12; private RaycastHit <rayHit>5__13; private bool <hitSomething>5__14; private Renderer <rend>5__15; private Vector3 <rayPoint>5__16; private int <i>5__17; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ZapCorutine>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <hits>5__1 = null; <>s__3 = null; <col>5__5 = null; <player>5__6 = null; <enemy>5__7 = null; <spawned>5__11 = null; <rend>5__15 = null; <>1__state = -2; } private bool MoveNext() { //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown Bounds bounds; switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (((NetworkBehaviour)((GrabbableObject)<>4__this).playerHeldBy).IsOwner) { <>4__this.DarkenScreen.SetActive(true); } <i>5__2 = <>4__this.zapTargets.Count - 1; while (<i>5__2 >= 0) { if ((Object)(object)<>4__this.zapTargets[<i>5__2] != (Object)null) { Object.Destroy((Object)(object)<>4__this.zapTargets[<i>5__2]); } <i>5__2--; } <>4__this.zapTargets.Clear(); <hits>5__1 = Physics.OverlapSphere(origin, maxDistance); <>s__3 = <hits>5__1; <>s__4 = 0; goto IL_0486; case 1: <>1__state = -1; <targetDistance>5__12 = ((Vector3)(ref <toTarget>5__9)).magnitude; <hitSomething>5__14 = Physics.Raycast(origin, forward, ref <rayHit>5__13, <targetDistance>5__12, StartOfRound.Instance.collidersAndRoomMaskAndDefault); if (!<hitSomething>5__14) { <rayPoint>5__16 = origin + ((Vector3)(ref forward)).normalized * <targetDistance>5__12; bounds = <col>5__5.bounds; if (((Bounds)(ref bounds)).Contains(<rayPoint>5__16)) { Zapper.Logger.LogInfo((object)("Zapped " + ((Object)<col>5__5).name)); if ((Object)(object)<player>5__6 != (Object)null && ((NetworkBehaviour)<player>5__6).IsOwner) { <player>5__6.DamagePlayer(25, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } else { if (!((Object)(object)<enemy>5__7 != (Object)null) || !((NetworkBehaviour)<enemy>5__7).IsOwner) { goto IL_044d; } <enemy>5__7.HitEnemy(1, ((GrabbableObject)<>4__this).playerHeldBy, true, -1); } goto IL_0499; } } goto IL_044d; case 2: { <>1__state = -1; <>4__this.DarkenScreen.SetActive(false); <i>5__17 = <>4__this.zapTargets.Count - 1; while (<i>5__17 >= 0) { if ((Object)(object)<>4__this.zapTargets[<i>5__17] != (Object)null) { Object.Destroy((Object)(object)<>4__this.zapTargets[<i>5__17]); } <i>5__17--; } <>4__this.zapTargets.Clear(); <>4__this.zapCoroutine = null; return false; } IL_0499: <>s__3 = null; <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 2; return true; IL_044d: Object.Destroy((Object)(object)<spawned>5__11); goto IL_045a; IL_0462: <player>5__6 = null; <enemy>5__7 = null; <col>5__5 = null; goto IL_0478; IL_045a: <spawned>5__11 = null; goto IL_0462; IL_0478: <>s__4++; goto IL_0486; IL_0486: if (<>s__4 < <>s__3.Length) { <col>5__5 = <>s__3[<>s__4]; if (!((Object)(object)<col>5__5 == (Object)null) && (((Component)<col>5__5).CompareTag("Enemy") || ((Component)<col>5__5).CompareTag("Player"))) { <player>5__6 = ((Component)<col>5__5).gameObject.GetComponentInParent<PlayerControllerB>(); <enemy>5__7 = ((Component)<col>5__5).gameObject.GetComponentInParent<EnemyAI>(); if (!((Object)(object)<player>5__6 != (Object)null) || !((Object)(object)<player>5__6 == (Object)(object)((GrabbableObject)<>4__this).playerHeldBy)) { bounds = <col>5__5.bounds; <targetPos>5__8 = ((Bounds)(ref bounds)).center; <toTarget>5__9 = <targetPos>5__8 - origin; <angle>5__10 = Vector3.Angle(forward, <toTarget>5__9); if (<angle>5__10 <= coneAngleDegrees) { <spawned>5__11 = Object.Instantiate<GameObject>(<>4__this.zapTargetPrefab, <targetPos>5__8, Quaternion.LookRotation(forward)); if ((Object)(object)<spawned>5__11 != (Object)null) { Transform transform = <spawned>5__11.transform; bounds = <col>5__5.bounds; transform.localScale = ((Bounds)(ref bounds)).size; <>4__this.zapTargets.Add(<spawned>5__11); if (!((NetworkBehaviour)((GrabbableObject)<>4__this).playerHeldBy).IsOwner) { <rend>5__15 = <spawned>5__11.GetComponentInChildren<Renderer>(); <rend>5__15.enabled = false; <rend>5__15 = null; } <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 1; return true; } goto IL_045a; } goto IL_0462; } } goto IL_0478; } goto IL_0499; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject DebugArrow = null; public GameObject zapTargetPrefab = null; public GameObject DarkenScreen = null; public AudioSource gunShootAudio = null; public AudioClip zapSound = null; public List<GameObject> zapTargets = new List<GameObject>(); private bool localClientSendingShootGunRPC; private Coroutine? zapCoroutine; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner && zapCoroutine == null) { ShootGunAndSync(); } } public void ShootGunAndSync() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_006f: 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_008f: Unknown result type (might be due to invalid IL or missing references) Vector3 shotgunPosition = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.up * 0.45f; Vector3 forward = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.forward; Zapper.Logger.LogInfo((object)"Calling shoot gun...."); ShootGun(shotgunPosition, forward); Zapper.Logger.LogInfo((object)"Calling shoot gun and sync"); localClientSendingShootGunRPC = true; ShootGunServerRpc(shotgunPosition, forward); } [ServerRpc(RequireOwnership = false)] public void ShootGunServerRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2786371283u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2786371283u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootGunClientRpc(shotgunPosition, shotgunForward); } } } [ClientRpc] public void ShootGunClientRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) //IL_0119: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1548251590u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1548251590u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Zapper.Logger.LogInfo((object)"Shoot gun client rpc received"); if (localClientSendingShootGunRPC) { localClientSendingShootGunRPC = false; Zapper.Logger.LogInfo((object)"localClientSendingShootGunRPC was true"); } else { ShootGun(shotgunPosition, shotgunForward); } } } public void ShootGun(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { base.playerHeldBy.playerBodyAnimator.SetTrigger("ShootShotgun"); } gunShootAudio.PlayOneShot(zapSound); WalkieTalkie.TransmitOneShotAudio(gunShootAudio, zapSound, 1f); DebugArrow.transform.SetParent((Transform)null); DebugArrow.transform.position = shotgunPosition; DebugArrow.transform.forward = shotgunForward; if (zapCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(zapCoroutine); } zapCoroutine = ((MonoBehaviour)this).StartCoroutine(ZapCorutine(shotgunPosition, shotgunForward)); } [IteratorStateMachine(typeof(<ZapCorutine>d__13))] private IEnumerator ZapCorutine(Vector3 origin, Vector3 forward, float coneAngleDegrees = 90f, float maxDistance = 50f) { //IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ZapCorutine>d__13(0) { <>4__this = this, origin = origin, forward = forward, coneAngleDegrees = coneAngleDegrees, maxDistance = maxDistance }; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2786371283u, new RpcReceiveHandler(__rpc_handler_2786371283), "ShootGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(1548251590u, new RpcReceiveHandler(__rpc_handler_1548251590), "ShootGunClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_2786371283(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 shotgunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunPosition); Vector3 shotgunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((ZapperItem)(object)target).ShootGunServerRpc(shotgunPosition, shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1548251590(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 shotgunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunPosition); Vector3 shotgunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((ZapperItem)(object)target).ShootGunClientRpc(shotgunPosition, shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ZapperItem"; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "NoteBoxz.Zapper"; public const string PLUGIN_NAME = "Zapper"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace NoteBoxz.Zapper.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }