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 OuijaBoard v1.5.5
LCOuijaBoard.dll
Decompiled 4 months agousing System; using System.CodeDom.Compiler; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LCOuijaBoard.NetcodePatcher; using LCOuijaBoard.Properties; using LethalCompanyInputUtils; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("LCOuijaBoard")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LCOuijaBoard")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1c1acc88-8f86-45d6-beb9-9b98f2302980")] [assembly: AssemblyFileVersion("1.0.0.0")] [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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LCOuijaBoard { [BepInPlugin("Electric.OuijaBoard", "OuijaBoard", "1.5.5")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private class UIHandler { public static GameObject inputObject; public static TMP_InputField input; public static bool registered; public static float lastError; public static TMP_InputField GetInput() { if (registered && (Object)(object)input != (Object)null) { return input; } inputObject = ((Component)OuijaTextUI.transform.GetChild(2)).gameObject; input = inputObject.GetComponent<TMP_InputField>(); ((UnityEvent<string>)(object)input.onSubmit).AddListener((UnityAction<string>)SubmitUI); ((UnityEvent<string>)(object)input.onEndEdit).AddListener((UnityAction<string>)EndEditUI); registered = true; return input; } public static void hide() { OuijaTextUI.SetActive(false); Traverse.Create(typeof(LcInputActionApi)).Method("ReEnableFromRebind", Array.Empty<object>()).GetValue(); input.text = ""; } public static void ToggleUI(CallbackContext context) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!Object.op_Implicit((Object)(object)localPlayerController)) { return; } logger.LogInfo((object)"Ouija Text UI Toggle Requested"); if (!DEVDEBUG && ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerDead)) { logger.LogInfo((object)"Ouija Text UI Toggle Denied: Not Dead"); return; } if ((Object)(object)OuijaTextUI == (Object)null) { logger.LogError((object)"Ouija Text UI Toggle Denied: No UI"); return; } bool flag = !OuijaTextUI.active; GetInput(); logger.LogInfo((object)$"Ouija Text UI Toggle Accepted: New State is {flag}"); if (!flag) { if (!input.isFocused || !OuijaTextUI.active) { OuijaTextUI.SetActive(false); Traverse.Create(typeof(LcInputActionApi)).Method("ReEnableFromRebind", Array.Empty<object>()).GetValue(); } } else { Traverse.Create(typeof(LcInputActionApi)).Method("DisableForRebind", Array.Empty<object>()).GetValue(); OuijaTextUI.SetActive(true); input.ActivateInputField(); ((Selectable)input).Select(); } } public static void SubmitUI(string msg) { AttemptSend(msg); } public static void EndEditUI(string msg) { hide(); } public static bool AttemptSend(string msg) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) string[] value = msg.Split(' ').ToArray(); Object[] array = Object.FindObjectsOfType(typeof(GameObject)); List<GameObject> list = new List<GameObject>(); Object[] array2 = array; for (int i = 0; i < array2.Length; i++) { GameObject val = (GameObject)array2[i]; if ((((Object)val).name == "OuijaBoardScrap(Clone)" || ((Object)val).name == "OuijaBoardStore(Clone)") && !((GrabbableObject)(PhysicsProp)val.GetComponent(typeof(PhysicsProp))).isHeld) { list.Add(val); } } if (list.Count > 0) { if (!StartOfRoundPatch.complete) { ShowError("Boards on cooldown"); return false; } string text = string.Join("", value); if (Regex.Match(text, "([A-Za-z\\d ])+").Value.Length != text.Length) { ShowError("Invalid character(s)"); return false; } text = text.Replace(" ", ""); if (text.Length > 10) { ShowError("Too many characters"); return false; } OuijaNetworker.Instance.WriteOut(text); return true; } ShowError("No valid boards"); return false; } public static void ShowError(string msg) { if ((Object)(object)OuijaErrorUI != (Object)null) { logger.LogInfo((object)("Ouija Board showing erorr: " + msg)); ((Component)OuijaErrorUI.transform.GetChild(0)).GetComponent<TMP_Text>().text = msg; OuijaErrorUI.SetActive(true); lastError = Time.time; } } } [HarmonyPatch(typeof(StartOfRound))] public class StartOfRoundPatch { public static int writeIndex = 0; public static List<string> names = new List<string>(); public static List<GameObject> boards = new List<GameObject>(); public static float timer = 0f; public static double amount = 0.0; public static bool complete = true; [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update(ref StartOfRound __instance) { PlayerControllerB localPlayerController = __instance.localPlayerController; if (!Object.op_Implicit((Object)(object)localPlayerController)) { return; } if (!DEVDEBUG && !localPlayerController.isPlayerDead && Object.op_Implicit((Object)(object)OuijaTextUI) && OuijaTextUI.active) { logger.LogInfo((object)"Ouija Text UI closed since player is not dead"); OuijaTextUI.SetActive(false); Traverse.Create(typeof(LcInputActionApi)).Method("ReEnableFromRebind", Array.Empty<object>()).GetValue(); } if (Object.op_Implicit((Object)(object)OuijaErrorUI) && OuijaErrorUI.active && Time.time - UIHandler.lastError > 2f) { logger.LogInfo((object)"Ouija Error UI closed"); OuijaErrorUI.SetActive(false); Traverse.Create(typeof(LcInputActionApi)).Method("ReEnableFromRebind", Array.Empty<object>()).GetValue(); } if (writeIndex < names.Count) { amount = Mathf.Clamp(timer / 1.2f, 0f, 1f); MoveUpdate(names[writeIndex]); timer += Time.deltaTime; if (timer >= 3f) { amount = 1.0; MoveUpdate(names[writeIndex]); timer = 0f; writeIndex++; } } else if (!complete) { if (timer < 5f) { timer += Time.deltaTime; } else { complete = true; timer = 0f; amount = 0.0; } } if ((Object)(object)OuijaTextUI != (Object)null) { ((Component)OuijaTextUI.transform.GetChild(3)).gameObject.SetActive(!complete); } } public static void MoveUpdate(string name) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0233: 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_0224: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown int num = -1; bool flag = false; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; foreach (GameObject board in boards) { if (!Object.op_Implicit((Object)(object)board) || ((GrabbableObject)(PhysicsProp)board.GetComponent(typeof(PhysicsProp))).isHeld) { continue; } flag = true; if (num == -1) { num = 0; foreach (Transform item in board.transform.GetChild(0).GetChild(3)) { Transform val = item; GameObject gameObject = ((Component)val).gameObject; if (((Object)gameObject).name == name) { break; } num++; } if (num == -1) { amount = 0.0; writeIndex++; break; } } Vector3 localPosition = board.transform.GetChild(0).GetChild(3).GetChild(num) .localPosition; Vector3 localPosition2 = board.transform.GetChild(0).GetChild(4).localPosition; GameObject gameObject2 = ((Component)board.transform.GetChild(0).GetChild(2)).gameObject; if (amount == 0.0) { gameObject2.GetComponent<AudioSource>().Play(); if (makesSound) { RoundManager.Instance.PlayAudibleNoise(board.transform.position, 8f, 0.3f, 0, false, 8925); } } Vector3 val2 = localPosition + new Vector3(0f, 0.166f, 0f); gameObject2.transform.localPosition = Vector3.Lerp(localPosition2, val2, (float)amount); if (amount == 1.0) { board.transform.GetChild(0).GetChild(4).localPosition = val2; } if (Vector3.Distance(((Component)localPlayerController).transform.position, board.transform.position) < 5f) { localPlayerController.insanityLevel += Time.deltaTime * 0.5f; } } if (!flag) { writeIndex = names.Count; } } } [HarmonyPatch(typeof(PlayerControllerB))] [HarmonyPriority(500)] public class PlayerPatch { [HarmonyPatch("Interact_performed")] [HarmonyPrefix] private static void InteractPrefixPatch(ref PlayerControllerB __instance, out bool __state) { __state = __instance.isPlayerDead; if (Object.op_Implicit((Object)(object)OuijaTextUI) && OuijaTextUI.active) { __instance.isPlayerDead = false; } } [HarmonyPatch("Interact_performed")] [HarmonyPostfix] private static void InteractPostfixPatch(ref PlayerControllerB __instance, bool __state) { __instance.isPlayerDead = __state; } } public class OuijaNetworker : NetworkBehaviour { public static OuijaNetworker Instance; private void Awake() { Instance = this; } public void WriteOut(string message) { if (((NetworkBehaviour)this).IsOwner) { WriteOutClientRpc(message); } else { WriteOutServerRpc(message); } } [ClientRpc] public void WriteOutClientRpc(string message) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0088: 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_00ff: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0166: 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)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3508306228u, val, (RpcDelivery)0); bool flag = message != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(message, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3508306228u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; Object[] array = Object.FindObjectsOfType(typeof(GameObject)); List<GameObject> list = new List<GameObject>(); Object[] array2 = array; for (int i = 0; i < array2.Length; i++) { GameObject val3 = (GameObject)array2[i]; if ((((Object)val3).name == "OuijaBoardScrap(Clone)" || ((Object)val3).name == "OuijaBoardStore(Clone)") && !((GrabbableObject)(PhysicsProp)val3.GetComponent(typeof(PhysicsProp))).isHeld) { list.Add(val3); } } List<string> list2 = new List<string>(); switch (message) { case "yes": case "y": list2.Add("Yes"); break; case "no": case "n": list2.Add("No"); break; case "goodbye": case "bye": list2.Add("Goodbye"); break; default: list2 = (from c in message.ToUpper().ToCharArray() select c.ToString()).ToList(); break; } StartOfRoundPatch.amount = 0.0; StartOfRoundPatch.complete = false; StartOfRoundPatch.writeIndex = 0; StartOfRoundPatch.names = list2; StartOfRoundPatch.boards = list; } [ServerRpc(RequireOwnership = false)] public void WriteOutServerRpc(string message) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0088: 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_00ff: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3320529116u, val, (RpcDelivery)0); bool flag = message != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(message, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3320529116u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; WriteOutClientRpc(message); } } protected override void __initializeVariables() { ((NetworkBehaviour)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(3508306228u, new RpcReceiveHandler(__rpc_handler_3508306228), "WriteOutClientRpc"); ((NetworkBehaviour)this).__registerRpc(3320529116u, new RpcReceiveHandler(__rpc_handler_3320529116), "WriteOutServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3508306228(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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string message = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((OuijaNetworker)(object)target).WriteOutClientRpc(message); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3320529116(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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string message = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((OuijaNetworker)(object)target).WriteOutServerRpc(message); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "OuijaNetworker"; } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(ref RoundManager __instance) { if (((NetworkBehaviour)__instance).IsServer && (Object)(object)OuijaNetworker.Instance == (Object)null) { logger.LogInfo((object)OuijaNetworkerPrefab); GameObject val = Object.Instantiate<GameObject>(OuijaNetworkerPrefab); val.GetComponent<NetworkObject>().Spawn(true); } logger.LogInfo((object)OuijaTextUIPrefab); OuijaTextUI = Object.Instantiate<GameObject>(OuijaTextUIPrefab); Traverse.Create(typeof(LcInputActionApi)).Method("ReEnableFromRebind", Array.Empty<object>()).GetValue(); OuijaErrorUI = Object.Instantiate<GameObject>(OuijaErrorUIPrefab); OuijaErrorUI.SetActive(false); } } private const string modGUID = "Electric.OuijaBoard"; private const string modName = "OuijaBoard"; private const string modVersion = "1.5.5"; private readonly Harmony harmony = new Harmony("Electric.OuijaBoard"); public static bool storeEnabled; public static int storeCost; public static bool scrapEnabled; public static int scrapRarity; public static bool makesSound; private static bool DEVDEBUG; public static ManualLogSource logger; public static GameObject OuijaNetworkerPrefab; public static GameObject OuijaTextUIPrefab; public static GameObject OuijaTextUI; public static GameObject OuijaErrorUIPrefab; public static GameObject OuijaErrorUI; private void Awake() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown logger = ((BaseUnityPlugin)this).Logger; AssetBundle val = AssetBundle.LoadFromMemory(Resources.fullboard); OuijaNetworkerPrefab = val.LoadAsset<GameObject>("Assets/OuijaNetworker.prefab"); OuijaNetworkerPrefab.AddComponent<OuijaNetworker>(); OuijaTextUIPrefab = val.LoadAsset<GameObject>("Assets/OuijaTextUI.prefab"); OuijaErrorUIPrefab = val.LoadAsset<GameObject>("Assets/OuijaErrorUI.prefab"); GameObject val2 = val.LoadAsset<GameObject>("Assets/OuijaBoardStore.prefab"); GameObject val3 = val.LoadAsset<GameObject>("Assets/OuijaBoardScrap.prefab"); NetworkPrefabs.RegisterNetworkPrefab(OuijaNetworkerPrefab); NetworkPrefabs.RegisterNetworkPrefab(val2); NetworkPrefabs.RegisterNetworkPrefab(val3); InputAction val4 = new InputAction((string)null, (InputActionType)0, "<Keyboard>/#(" + ((BaseUnityPlugin)this).Config.Bind<string>("General", "Keybind", "o", "(Clientside) The key that will open the Ouija Board UI. Note: This will NOT change the tooltip on the item").Value + ")", (string)null, (string)null, (string)null); val4.performed += UIHandler.ToggleUI; val4.Enable(); storeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Store", "Enabled", true, "Allow Ouija Board to be bought in the store").Value; storeCost = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "Cost", 100, "Cost of a Ouija Board in the store (Store must be enabled)").Value; scrapEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Scrap", "Enabled", false, "Allow the Ouija Board to spawn in the facility").Value; scrapRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "Rarity Weight", 20, "Chance for a Ouija Board to spawn as scrap").Value; if (storeCost < 0) { storeCost = 0; } if (scrapRarity < 0) { scrapRarity = 0; } makesSound = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Makes Sound", true, "Enables the Ouija Board's sliding to be heard by enemies").Value; Item val5 = val.LoadAsset<Item>("Assets/OuijaBoardStoreItem.asset"); Item val6 = val.LoadAsset<Item>("Assets/OuijaBoardScrapItem.asset"); if (storeEnabled) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Ouija Board store enabled at {storeCost} credits"); Items.RegisterShopItem(val5, storeCost); } if (scrapEnabled) { ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Ouija Board scrap spawn enabled at {scrapRarity} rarity weight"); val6.minValue = Mathf.Max(((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "Min Value", 60, "The minimum value of the Ouija Board (must be > 0)").Value, 1); val6.maxValue = Mathf.Max(((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "Max Value", 80, "The maximum value of the Ouija Board (must be > min value)").Value, val6.minValue); Items.RegisterScrap(val6, scrapRarity, (LevelTypes)(-1)); } NetcodeWeaver(); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OuijaBoard loaded!"); } private static void NetcodeWeaver() { 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 PluginInfo { public const string PLUGIN_GUID = "LCOuijaBoard"; public const string PLUGIN_NAME = "LCOuijaBoard"; public const string PLUGIN_VERSION = "1.5.5"; } } namespace LCOuijaBoard.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("LCOuijaBoard.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] fullboard { get { object @object = ResourceManager.GetObject("fullboard", resourceCulture); return (byte[])@object; } } internal Resources() { } } } 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 LCOuijaBoard.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }