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 OIIA v1.0.1
BepInEx/plugins/WeirdMods.OIIA.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using LethalLib.Modules; using LobbyCompatibility.Attributes; using Microsoft.CodeAnalysis; using OIIA.Scripts; using Unity.Netcode; using UnityEngine; using WeirdMods.OIIA.NetcodePatcher; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("WeirdMods.OIIA")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+7f04e269862c177673bcf8e7ec94b3c04992d6f9")] [assembly: AssemblyProduct("OIIA")] [assembly: AssemblyTitle("WeirdMods.OIIA")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } 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 OIIA { [BepInPlugin("WeirdMods.OIIA", "OIIA", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [LobbyCompatibility(/*Could not decode attribute arguments.*/)] public class OIIA : BaseUnityPlugin { public static ContentLoader ContentLoader = null; private static readonly string ASSETS_PATH = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "OIIA"); public List<AudioClip> OIIAClips = new List<AudioClip>(); public static OIIA Instance { get; private set; } = null; internal static ManualLogSource Logger { get; private set; } = null; internal static Harmony? Harmony { get; set; } public static AssetBundle MainAssetBundle { get; private set; } = null; private void Awake() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Instance = this; MainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(ASSETS_PATH, "oiiaasset")); ContentLoader = new ContentLoader(((BaseUnityPlugin)Instance).Info, MainAssetBundle, (Action<CustomContent, GameObject>)delegate { }); ContentLoader.Register((CustomContent)new ScrapItem("OIIA_CAT", "Assets/OIIA/OIIACat.asset", 6, (LevelTypes)(-1), (string[])null, (Action<Item>)delegate(Item item) { OIIACatScript oIIACatScript = item.spawnPrefab.AddComponent<OIIACatScript>(); ((GrabbableObject)oIIACatScript).itemProperties = item; })); for (int i = 1; i <= 6; i++) { OIIAClips.Add(MainAssetBundle.LoadAsset<AudioClip>($"Assets/OIIA/Sounds/OIIA_{i}.wav")); OIIAClips.Last().LoadAudioData(); } Patch(); NetcodePatcher(); Logger.LogInfo((object)"WeirdMods.OIIA v1.0.0 has loaded!"); } internal static void Patch() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("WeirdMods.OIIA"); } 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 static 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 static class MyPluginInfo { public const string PLUGIN_GUID = "WeirdMods.OIIA"; public const string PLUGIN_NAME = "OIIA"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace OIIA.Scripts { internal class OIIACatScript : PhysicsProp { private Animator _animator; private AudioSource _audio; private const float BaseAnimSpeed = 0.3f; private const float MaxSpeedMultiplier = 3f; private void Awake() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).grabbable = true; ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.35f, 0.3f, 0.1f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(-90f, 28f, -90f); _animator = ((Component)this).GetComponentInChildren<Animator>(); _audio = ((Component)((Component)this).transform.Find("Cat/OIIAAudio")).gameObject.GetComponent<AudioSource>(); } public override void ItemActivate(bool used, bool buttonDown = true) { SetSpinningServerRpc(buttonDown, Random.Range(1f, 3f)); } [ServerRpc(RequireOwnership = false)] private void SetSpinningServerRpc(bool spinning, float speed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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(954555982u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spinning, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 954555982u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetSpinningClientRpc(spinning, speed); } } } [ClientRpc] private void SetSpinningClientRpc(bool spinning, float speed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4062488745u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spinning, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4062488745u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { _animator.SetBool("Spinning", spinning); _animator.SetFloat("Speed", 0.3f * speed); float num = 3f / (float)OIIA.Instance.OIIAClips.Count; int index = Math.Min((int)Math.Floor(speed / num), OIIA.Instance.OIIAClips.Count - 1); _audio.clip = OIIA.Instance.OIIAClips[index]; if (spinning) { _audio.Play(); } else { _audio.Stop(); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_OIIACatScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(954555982u, new RpcReceiveHandler(__rpc_handler_954555982)); NetworkManager.__rpc_func_table.Add(4062488745u, new RpcReceiveHandler(__rpc_handler_4062488745)); } private static void __rpc_handler_954555982(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool spinning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref spinning, default(ForPrimitives)); float speed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((OIIACatScript)(object)target).SetSpinningServerRpc(spinning, speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4062488745(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool spinning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref spinning, default(ForPrimitives)); float speed = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref speed, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((OIIACatScript)(object)target).SetSpinningClientRpc(spinning, speed); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "OIIACatScript"; } } } namespace WeirdMods.OIIA.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }