Decompiled source of Poltergeist v1.2.9
BepInEx/plugins/Poltergeist.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; 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 System.Text; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using CSync.Extensions; using CSync.Lib; using DunGen; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using Microsoft.CodeAnalysis; using Poltergeist.GhostInteractibles; using Poltergeist.GhostInteractibles.Specific; using Poltergeist.NetcodePatcher; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Poltergeist")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A template for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d944701c37a26202efa2eb539669f7d5476242ea")] [assembly: AssemblyProduct("Poltergeist")] [assembly: AssemblyTitle("Poltergeist")] [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 Poltergeist { public static class AudioManager { public const string SOUND_FOLDER_NAME = "PoltergeistSounds"; private static AudioClip[] clips; public static AudioClip defaultClip; public static AudioClip GetClip(int index) { if (clips.Length == 0) { return defaultClip; } return clips[index % clips.Length]; } private static void FindAllAudioFiles(string dirPath, List<string> filePaths) { if (!Directory.Exists(dirPath)) { return; } if (Path.GetFileName(dirPath).Equals("PoltergeistSounds")) { string[] files = Directory.GetFiles(dirPath); foreach (string text in files) { if (Poltergeist.Config.DisableDuplicateSounds.Value) { bool flag = false; foreach (string filePath in filePaths) { if (Path.GetFileNameWithoutExtension(text).Equals(Path.GetFileNameWithoutExtension(filePath))) { flag = true; break; } } if (flag) { continue; } } filePaths.Add(text); } } else { string[] files = Directory.GetDirectories(dirPath); for (int i = 0; i < files.Length; i++) { FindAllAudioFiles(files[i], filePaths); } } } public static void LoadClips() { List<string> list = ((!Poltergeist.Config.UseDefaultSounds.Value) ? new List<string>() : new List<string>(Directory.GetFiles(Path.Combine(Poltergeist.dllFolderPath, "sounds")))); FindAllAudioFiles(Paths.PluginPath, list); list.Sort((string path1, string path2) => Path.GetFileName(path1).CompareTo(Path.GetFileName(path2))); List<AudioClip> list2 = new List<AudioClip>(); foreach (string path3 in list) { try { Poltergeist.DebugLog("Found a file in the audio folder"); Task<AudioClip> task = Task.Run<AudioClip>(async () => await GetAudioClip(path3)); Poltergeist.DebugLog("Waiting for file load task to complete"); task.Wait(); if ((Object)(object)task.Result != (Object)null) { list2.Add(task.Result); } Poltergeist.DebugLog("Clip loaded successfully"); } catch (Exception) { Poltergeist.LogError("An exception was encountered while loading audio!"); } } clips = list2.ToArray(); } private static async Task<AudioClip> GetAudioClip(string path) { string extension = Path.GetExtension(path); AudioType val; switch (extension) { case ".wav": val = (AudioType)20; break; case ".ogg": val = (AudioType)14; break; case ".mp3": val = (AudioType)13; break; default: Poltergeist.LogWarning("Ran into illegal extension " + extension + " while loading audio!"); return null; } path = "file:///" + path.Replace("+", "%2B"); UnityWebRequest www2; if ((int)val == 13) { Poltergeist.DebugLog("Loading MP3 file"); DownloadHandlerAudioClip dh = new DownloadHandlerAudioClip(path, (AudioType)13); dh.compressed = true; www2 = new UnityWebRequest(path, "GET", (DownloadHandler)(object)dh, (UploadHandler)null); try { UnityWebRequestAsyncOperation result2 = www2.SendWebRequest(); while (!((AsyncOperation)result2).isDone) { await Task.Yield(); } if ((int)www2.result != 1) { Poltergeist.LogError("An MP3 file failed to load!"); return null; } AudioClip audioClip = dh.audioClip; ((Object)audioClip).name = Path.GetFileNameWithoutExtension(path); return audioClip; } finally { ((IDisposable)www2)?.Dispose(); } } Poltergeist.DebugLog("Loading non-MP3 file"); www2 = UnityWebRequestMultimedia.GetAudioClip(path, val); try { UnityWebRequestAsyncOperation result2 = www2.SendWebRequest(); while (!((AsyncOperation)result2).isDone) { await Task.Yield(); } if ((int)www2.result != 1) { Poltergeist.LogError("A non-MP3 file failed to load!"); return null; } AudioClip content = DownloadHandlerAudioClip.GetContent(www2); ((Object)content).name = Path.GetFileNameWithoutExtension(path); return content; } finally { ((IDisposable)www2)?.Dispose(); } } } public class GhostFollowTrigger : MonoBehaviour { private void OnTriggerEnter(Collider other) { GhostHead component = ((Component)other).GetComponent<GhostHead>(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)SpectatorCamController.instance.head) { SpectatorCamController.instance.ParentTo(((Component)this).transform); } } private void OnTriggerExit(Collider other) { GhostHead component = ((Component)other).GetComponent<GhostHead>(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)SpectatorCamController.instance.head) { SpectatorCamController.instance.ParentTo(null); } } } public class GhostHead : NetworkBehaviour { public static Dictionary<PlayerControllerB, GhostHead> headMapping = new Dictionary<PlayerControllerB, GhostHead>(); private bool initialized; public bool isActive; public bool isHostHead; private float playTime; private Light light; private Renderer renderer; private AudioSource manifestSource; private AudioSource barkSource; private const int KEYFRAMES = 6; private static float[] keyTimes = new float[6] { 0f, 1f, 1.4f, 1.8f, 2.2f, 3f }; private static float[] visibilities = new float[6] { 0f, 1f, 1f, 0.5f, 1f, 0f }; private int keyIndex = 999; private float startTime; public static string[] matNames = new string[9] { "ace_mat", "bi_mat", "lesbian_mat", "pan_mat", "pride_mat", "trans_mat", "nb_mat", "fluid_mat", "aro_mat" }; private static float randMatChance = 0.15f; private static Material[] sharedMats = null; private static Material sharedDefaultMat = null; private Material[] materials; private Material defaultMat; private Material matInstance; private RandomStream matRNG; private ColorAdjustments colorAdj; private float maxOpacity = 1f; private float maxIntensity = 1f; private Color filterCol = Color.white; private void Awake() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) light = ((Component)this).GetComponentInChildren<Light>(); renderer = ((Component)this).GetComponentInChildren<Renderer>(); matInstance = renderer.material; maxOpacity = matInstance.color.a; maxIntensity = light.intensity; manifestSource = ((Component)((Component)this).transform.Find("manifest_audio")).GetComponent<AudioSource>(); manifestSource.volume = Poltergeist.Config.GhostVolume.Value; barkSource = ((Component)((Component)this).transform.Find("bark_audio")).GetComponent<AudioSource>(); barkSource.volume = Poltergeist.Config.GhostVolume.Value; materials = (Material[])(object)new Material[sharedMats.Length]; for (int i = 0; i < sharedMats.Length; i++) { materials[i] = Object.Instantiate<Material>(sharedMats[i]); } defaultMat = Object.Instantiate<Material>(sharedDefaultMat); } private void LateUpdate() { //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) if (!initialized && (Object)(object)SpectatorCamController.instance != (Object)null && ((NetworkBehaviour)this).IsOwner && (!((NetworkBehaviour)this).IsServer || isHostHead)) { initialized = true; SpectatorCamController.instance.head = this; renderer.enabled = false; Object.Instantiate<GameObject>(Poltergeist.colorVolObject).GetComponent<Volume>().profile.TryGet<ColorAdjustments>(ref colorAdj); ((VolumeParameter)colorAdj.colorFilter).overrideState = true; filterCol = ((VolumeParameter<Color>)(object)colorAdj.colorFilter).value; ((VolumeParameter<Color>)(object)colorAdj.colorFilter).value = Color.white; Poltergeist.DebugLog("Assigning head to local client"); AudioManager.defaultClip = manifestSource.clip; manifestSource.spatialBlend = 0f; barkSource.spatialBlend = 0f; } if (keyIndex < 6) { if (Time.time >= startTime + keyTimes[keyIndex]) { keyIndex++; } if (keyIndex == 6) { ((Behaviour)light).enabled = false; ((Component)renderer).gameObject.layer = 23; light.intensity = maxIntensity; matInstance.color = new Color(matInstance.color.r, matInstance.color.g, matInstance.color.b, maxOpacity); if ((Object)(object)colorAdj != (Object)null) { ((VolumeParameter<Color>)(object)colorAdj.colorFilter).value = Color.white; } manifestSource.Stop(); } else { float num = keyTimes[keyIndex] - keyTimes[keyIndex - 1]; float num2 = (Time.time - (startTime + keyTimes[keyIndex - 1])) / num; float num3 = Mathf.Lerp(visibilities[keyIndex - 1], visibilities[keyIndex], num2); Color color = matInstance.color; matInstance.color = new Color(color.r, color.g, color.b, num3 * maxOpacity); light.intensity = num3 * maxIntensity; if ((Object)(object)colorAdj != (Object)null) { ((VolumeParameter<Color>)(object)colorAdj.colorFilter).value = Color.Lerp(Color.white, filterCol, num3); } } } if (playTime > 0f) { playTime -= Time.deltaTime; if (playTime <= 0f) { barkSource.Stop(); } } } public void UpdateHeadMat() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown if (matRNG == null) { matRNG = new RandomStream(); } double num = matRNG.NextDouble(); int index = ((Poltergeist.Config.PrideMode.Value || DateTime.Now.Month == 6 || !(num > (double)randMatChance)) ? (matRNG.Next() % materials.Length) : (-1)); ApplyMatServerRPC(index); } public void Deactivate() { //IL_0010: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.position = StartOfRound.Instance.notSpawnedPosition.position; keyIndex = 6; ((Behaviour)light).enabled = false; ((Component)renderer).gameObject.layer = 23; light.intensity = maxIntensity; matInstance.color = new Color(matInstance.color.r, matInstance.color.g, matInstance.color.b, maxOpacity); if ((Object)(object)colorAdj != (Object)null) { ((VolumeParameter<Color>)(object)colorAdj.colorFilter).value = Color.white; } manifestSource.Stop(); } public static void LoadMats(AssetBundle bundle) { sharedMats = (Material[])(object)new Material[matNames.Length]; for (int i = 0; i < sharedMats.Length; i++) { sharedMats[i] = bundle.LoadAsset<Material>("Assets/Materials/" + matNames[i] + ".mat"); } sharedDefaultMat = bundle.LoadAsset<Material>("Assets/Materials/ghost_mat.mat"); } [ClientRpc] public void ManifestClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1243495895u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1243495895u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayFlickerAnim(); } } } [ServerRpc] public void ManifestServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1669939383u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1669939383u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ManifestClientRpc(); } } public bool IsManifesting() { return keyIndex < 6; } public bool PlayFlickerAnim() { if (IsManifesting()) { return false; } keyIndex = 1; startTime = Time.time; ((Behaviour)light).enabled = true; ((Component)renderer).gameObject.layer = 0; manifestSource.Play(); return true; } [ClientRpc] public void BarkClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(390338682u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 390338682u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayBarkAudio(index); } } } [ServerRpc] public void BarkServerRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3939474390u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3939474390u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BarkClientRpc(index); } } public bool IsBarking() { return barkSource.isPlaying; } public void PlayBarkAudio(int index) { if (!IsBarking()) { Poltergeist.DebugLog("Playing a bark locally"); playTime = Poltergeist.Config.AudioTime.Value; barkSource.clip = AudioManager.GetClip(index); barkSource.Play(); } } [ServerRpc] private void ApplyMatServerRPC(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2520582034u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2520582034u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ApplyMatClientRPC(index); } } [ClientRpc] private void ApplyMatClientRPC(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1685652734u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1685652734u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ApplyMatLocally(index); } } } private void ApplyMatLocally(int index) { if (index < 0) { matInstance = defaultMat; } else { matInstance = materials[index]; } renderer.sharedMaterial = matInstance; } 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 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1243495895u, new RpcReceiveHandler(__rpc_handler_1243495895), "ManifestClientRpc"); ((NetworkBehaviour)this).__registerRpc(1669939383u, new RpcReceiveHandler(__rpc_handler_1669939383), "ManifestServerRpc"); ((NetworkBehaviour)this).__registerRpc(390338682u, new RpcReceiveHandler(__rpc_handler_390338682), "BarkClientRpc"); ((NetworkBehaviour)this).__registerRpc(3939474390u, new RpcReceiveHandler(__rpc_handler_3939474390), "BarkServerRpc"); ((NetworkBehaviour)this).__registerRpc(2520582034u, new RpcReceiveHandler(__rpc_handler_2520582034), "ApplyMatServerRPC"); ((NetworkBehaviour)this).__registerRpc(1685652734u, new RpcReceiveHandler(__rpc_handler_1685652734), "ApplyMatClientRPC"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1243495895(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).ManifestClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1669939383(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).ManifestServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_390338682(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).BarkClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3939474390(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).BarkServerRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2520582034(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).ApplyMatServerRPC(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1685652734(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((GhostHead)(object)target).ApplyMatClientRPC(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GhostHead"; } } public class GhostItemTrigger : MonoBehaviour { private GrabbableObject itemScript; private void Start() { itemScript = ((Component)((Component)this).transform.parent).GetComponent<GrabbableObject>(); } private void OnTriggerEnter(Collider other) { if ((Object)(object)((Component)other).gameObject.GetComponent<GhostHead>() != (Object)null) { itemScript.ActivatePhysicsTrigger(other); } } } [HarmonyPatch] public static class Patches { public static bool vanillaMode; public static GrabbableObject ignoreObj; public static bool shouldGameOver; public static bool camControllerActive; [HarmonyPrefix] [HarmonyPatch(typeof(SandSpiderAI), "TriggerChaseWithPlayer")] public static bool PreventSpiderBug(PlayerControllerB playerScript) { return (Object)(object)playerScript != (Object)null; } [HarmonyPostfix] [HarmonyPatch(typeof(ManualCameraRenderer), "MeetsCameraEnabledConditions")] public static void RenderForGhosts(ref bool __result) { if (camControllerActive) { __result = true; } } [HarmonyPostfix] [HarmonyPatch(typeof(StartMatchLever), "Start")] public static void MakeFollowTrigger(StartMatchLever __instance) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(Poltergeist.followTriggerObject, ((Component)__instance).transform).transform.localPosition = Vector3.zero; } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "SetSpectateCameraToGameOverMode")] public static bool PreventSpectateFollow(bool enableGameOver) { shouldGameOver = enableGameOver; return vanillaMode; } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] public static void OverrideSpectateCam(PlayerControllerB __instance) { if (!vanillaMode) { __instance.playersManager.overrideSpectateCamera = true; } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "SwitchCamera")] public static void ManageCameraController(StartOfRound __instance, Camera newCamera) { if ((Object)(object)newCamera == (Object)(object)__instance.spectateCamera) { SpectatorCamController.instance.EnableCam(); } else { SpectatorCamController.instance.DisableCam(); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] public static void MakeCamController(StartOfRound __instance) { ((Component)__instance.spectateCamera).gameObject.AddComponent<SpectatorCamController>(); } [HarmonyPostfix] [HarmonyPatch(typeof(InteractTrigger), "Start")] public static void AddGhostInteractor(InteractTrigger __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent<DoorLock>() != (Object)null) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.DOOR; return; } if (((Object)__instance).name.Equals("LightSwitch") || ((Object)(object)((Component)__instance).transform.parent != (Object)null && ((Object)((Component)__instance).transform.parent).name.Contains("storage"))) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>(); return; } Transform parent = ((Component)__instance).transform.parent; if ((Object)(object)parent != (Object)null && (((Object)parent).name.Contains("Pumpkin") || ((Object)parent).name.Contains("Television") || ((Object)parent).name.Contains("Record") || ((Object)parent).name.Contains("Romantic") || ((Object)parent).name.Contains("Shower") || ((Object)parent).name.Contains("Toilet") || ((Object)parent).name.Contains("Plushie"))) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>(); } else if ((Object)(object)parent != (Object)null && (((Object)parent).name.Equals("StartButton") || ((Object)parent).name.Equals("StopButton"))) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.SHIPDOOR; } else if ((Object)(object)((Component)__instance).gameObject.GetComponent<SteamValveHazard>() != (Object)null) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.VALVE; } else if ((Object)(object)parent != (Object)null && ((Object)parent).name.Equals("BellDinger")) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.COMPANYBELL; } else if (((Object)__instance).name.Contains("LeverSwitchHandle")) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.HANGARDOOR; } else if ((Object)(object)((Component)__instance).GetComponent<ShipAlarmCord>() != (Object)null) { BasicInteractible basicInteractible = ((Component)__instance).gameObject.AddComponent<BasicInteractible>(); basicInteractible.costType = CostType.MISC; basicInteractible.isHeld = true; } else if ((Object)(object)((Component)__instance).transform.parent != (Object)null && ((Object)((Component)__instance).transform.parent).name.Equals("ElevatorButtonTrigger")) { ((Component)__instance).gameObject.AddComponent<BasicInteractible>().costType = CostType.HANGARDOOR; } } [HarmonyPostfix] [HarmonyPatch(typeof(GrabbableObject), "Start")] public static void AddInteractorForProp(GrabbableObject __instance) { if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && (__instance is NoisemakerProp || __instance is BoomboxItem || __instance is RadarBoosterItem || __instance is RemoteProp)) { GameObject obj = Object.Instantiate<GameObject>(Poltergeist.propInteractibleObject, ((Component)__instance).transform); obj.GetComponent<NetworkedInteractible>().intendedParent = ((Component)__instance).transform; ((Object)obj).name = ((Object)__instance).name + "Interactor"; obj.GetComponent<NetworkObject>().Spawn(false); obj.transform.parent = ((Component)__instance).transform; } } [HarmonyPostfix] [HarmonyPatch(typeof(TerminalAccessibleObject), "Start")] public static void AddInteractorForBigDoors(TerminalAccessibleObject __instance) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) //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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (((Object)__instance).name.Contains("BigDoor")) { GameObject val = new GameObject(); val.transform.parent = ((Component)__instance).transform; val.transform.localPosition = new Vector3(0f, 2.4f, 0f); val.transform.localEulerAngles = Vector3.zero; val.transform.localScale = Vector3.one; val.layer = LayerMask.NameToLayer("Ignore Raycast"); ((Object)val).name = "GhostInteractable"; BoxCollider obj = val.AddComponent<BoxCollider>(); obj.size = new Vector3(0.7f, 4f, 3f); ((Collider)obj).isTrigger = true; val.AddComponent<BigDoorInteractible>(); } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] public static void AddInteractorForEnemies(EnemyAI __instance) { if (!(__instance is DoublewingAI) && !Poltergeist.EnemyInBlacklist(__instance) && (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)) { Poltergeist.DebugLog("Making interactor for " + ((Object)__instance).name); GameObject obj = Object.Instantiate<GameObject>(Poltergeist.enemyInteractibleObject, ((Component)__instance).transform); ((Object)obj).name = ((Object)__instance).name + "Interactor"; obj.GetComponent<NetworkedInteractible>().intendedParent = ((Component)__instance).transform; obj.GetComponent<NetworkObject>().Spawn(false); obj.transform.parent = ((Component)__instance).transform; } } [HarmonyPostfix] [HarmonyPatch(typeof(GrabbableObject), "Start")] public static void WhoopiePatch(GrabbableObject __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (__instance is WhoopieCushionItem) { Object.Instantiate<GameObject>(Poltergeist.itemTriggerObject, ((Component)__instance).transform).transform.localPosition = Vector3.zero; } } [HarmonyPostfix] [HarmonyPatch(typeof(MaskedPlayerEnemy), "Start")] public static void RegisterMasked(MaskedPlayerEnemy __instance) { if ((Object)(object)__instance.mimickingPlayer != (Object)null) { SpectatorCamController.masked.Add(__instance); } } [HarmonyPostfix] [HarmonyPatch(typeof(MaskedPlayerEnemy), "OnDestroy")] public static void DeregisterMasked(MaskedPlayerEnemy __instance) { if ((Object)(object)__instance.mimickingPlayer != (Object)null) { SpectatorCamController.masked.Remove(__instance); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] public static void LoadNetworkPrefabs() { if (!((Object)(object)Poltergeist.propInteractibleObject != (Object)null)) { Poltergeist.propInteractibleObject = Poltergeist.poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/PropInteractible.prefab"); Poltergeist.propInteractibleObject.AddComponent<PropInteractible>(); Poltergeist.enemyInteractibleObject = Poltergeist.poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/EnemyInteractible.prefab"); Poltergeist.enemyInteractibleObject.AddComponent<EnemyInteractible>(); Poltergeist.ghostHeadObject = Poltergeist.poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/ghosthead.prefab"); Poltergeist.ghostHeadObject.AddComponent<RPCTransform>(); Poltergeist.ghostHeadObject.AddComponent<GhostHead>(); NetworkManager.Singleton.AddNetworkPrefab(Poltergeist.propInteractibleObject); NetworkManager.Singleton.AddNetworkPrefab(Poltergeist.enemyInteractibleObject); NetworkManager.Singleton.AddNetworkPrefab(Poltergeist.ghostHeadObject); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "Awake")] public static void MakeGhostHeads(PlayerControllerB __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { GameObject obj = Object.Instantiate<GameObject>(Poltergeist.ghostHeadObject); GhostHead component = obj.GetComponent<GhostHead>(); obj.transform.position = __instance.playersManager.notSpawnedPosition.position; GhostHead.headMapping.Add(__instance, component); obj.GetComponent<NetworkObject>().Spawn(false); component.isHostHead = (Object)(object)((Component)__instance).gameObject == (Object)(object)__instance.playersManager.allPlayerObjects[0]; } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] public static void AssignPlayerHead(StartOfRound __instance, ulong clientId) { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { int num = __instance.ClientPlayerList[clientId]; ((Component)GhostHead.headMapping[__instance.allPlayerScripts[num]]).GetComponent<NetworkObject>().ChangeOwnership(clientId); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Disconnect")] public static void ClearHeadDict() { GhostHead.headMapping.Clear(); Poltergeist.DebugLog("Cleared dict after local dc"); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")] public static void HandleHeadOnDC(StartOfRound __instance, int playerObjectNumber) { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { PlayerControllerB key = __instance.allPlayerScripts[playerObjectNumber]; if (GhostHead.headMapping.ContainsKey(key)) { GhostHead ghostHead = GhostHead.headMapping[key]; Poltergeist.DebugLog("Moving head after client dc: " + ((NetworkBehaviour)ghostHead).IsOwner); ghostHead.Deactivate(); } } } } [BepInPlugin("coderCleric.Poltergeist", "Poltergeist", "1.2.8")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency("com.sigurd.csync", "5.0.1")] public class Poltergeist : BaseUnityPlugin { public const string MOD_GUID = "coderCleric.Poltergeist"; public const string MOD_NAME = "Poltergeist"; public const string MOD_VERSION = "1.2.8"; public static GameObject propInteractibleObject; public static GameObject enemyInteractibleObject; public static GameObject ghostHeadObject; public static GameObject colorVolObject; public static GameObject itemTriggerObject; public static GameObject followTriggerObject; private static Poltergeist instance; public static AssetBundle poltergeistAssetBundle; public static string dllFolderPath; public static PoltergeistConfig Config { get; private set; } public static string[] pesterBlacklist { get; private set; } private void Awake() { instance = this; Config = new PoltergeistConfig(((BaseUnityPlugin)this).Config); DebugLog("Config setup done"); string text = Config.PesterBlacklist.Value.ToLower(); string[] separator = new string[2] { ", ", "," }; pesterBlacklist = text.Split(separator, StringSplitOptions.None); if (pesterBlacklist.Length == 1 && pesterBlacklist[0].Equals("")) { pesterBlacklist = new string[0]; } Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); DebugLog("Patches done"); new PoltergeistCustomInputs(); DebugLog("Input instance created"); dllFolderPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); poltergeistAssetBundle = AssetBundle.LoadFromFile(Path.Combine(dllFolderPath, "bundles", "poltergeist")); DebugLog("Bundle loaded"); GhostHead.LoadMats(poltergeistAssetBundle); colorVolObject = poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/ghosthead_postprocess.prefab"); itemTriggerObject = poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/GhostItemTrigger.prefab"); itemTriggerObject.AddComponent<GhostItemTrigger>(); followTriggerObject = poltergeistAssetBundle.LoadAsset<GameObject>("Assets/Prefabs/GhostFollowTrigger.prefab"); followTriggerObject.AddComponent<GhostFollowTrigger>(); DebugLog("Important objects extracted from bundle"); AudioManager.LoadClips(); DebugLog("Audio loaded"); NetcodePatcher(); DebugLog("Netcode patcher ran"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin coderCleric.Poltergeist v1.2.8 is loaded!"); } public static bool EnemyInBlacklist(EnemyAI enemy) { if ((Config.PesterBlacklistType.Value & PoltergeistConfig.NAME_TYPE.INTERNAL) > (PoltergeistConfig.NAME_TYPE)0) { string text = ((Object)enemy.enemyType).name.ToLower().Trim(); string[] array = pesterBlacklist; foreach (string value in array) { if (text.Contains(value)) { return true; } } } if ((Config.PesterBlacklistType.Value & PoltergeistConfig.NAME_TYPE.COMMON) > (PoltergeistConfig.NAME_TYPE)0) { ScanNodeProperties componentInChildren = ((Component)enemy).GetComponentInChildren<ScanNodeProperties>(); if ((Object)(object)componentInChildren != (Object)null) { string text2 = componentInChildren.headerText.ToLower().Trim(); string[] array = pesterBlacklist; foreach (string value2 in array) { if (text2.Contains(value2)) { return true; } } } } return false; } private static void NetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } public static void DebugLog(string msg) { if (Config.ShowDebugLogs.Value) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)msg); } } public static void Log(string msg) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)msg); } public static void LogError(string msg) { ((BaseUnityPlugin)instance).Logger.LogError((object)msg); } public static void LogWarning(string msg) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)msg); } } public class PoltergeistConfig : SyncedConfig2<PoltergeistConfig> { public enum NAME_TYPE { INTERNAL = 1, COMMON, BOTH } public ConfigEntry<bool> DefaultToVanilla { get; private set; } public ConfigEntry<float> LightIntensity { get; private set; } public ConfigEntry<bool> ShowDebugLogs { get; private set; } public ConfigEntry<float> GhostVolume { get; private set; } public ConfigEntry<bool> DisableDuplicateSounds { get; private set; } public ConfigEntry<bool> UseDefaultSounds { get; private set; } public ConfigEntry<bool> PrideMode { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> MaxPower { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> PowerRegen { get; private set; } [field: SyncedEntryField] public SyncedEntry<int> AliveForMax { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> TimeForAggro { get; private set; } [field: SyncedEntryField] public SyncedEntry<int> HitsForAggro { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> AudioTime { get; private set; } public ConfigEntry<NAME_TYPE> PesterBlacklistType { get; private set; } public ConfigEntry<string> PesterBlacklist { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> DoorCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> BigDoorCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> NoisyItemCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> ValveCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> ShipDoorCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> CompanyBellCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> PesterCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> ManifestCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> BarkCost { get; private set; } [field: SyncedEntryField] public SyncedEntry<float> MiscCost { get; private set; } public PoltergeistConfig(ConfigFile cfg) : base("coderCleric.Poltergeist") { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0032: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0070: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_009c: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00da: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0106: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0132: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_015e: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_019c: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01da: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_0210: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_024e: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0284: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Expected O, but got Unknown //IL_02c2: Expected O, but got Unknown //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Expected O, but got Unknown //IL_02ee: Expected O, but got Unknown //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Expected O, but got Unknown //IL_031e: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Expected O, but got Unknown //IL_035c: Expected O, but got Unknown //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Expected O, but got Unknown //IL_039a: Expected O, but got Unknown //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Expected O, but got Unknown //IL_03d8: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Expected O, but got Unknown //IL_0416: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Expected O, but got Unknown //IL_0454: Expected O, but got Unknown //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_0492: Expected O, but got Unknown //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04d0: Expected O, but got Unknown //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Expected O, but got Unknown //IL_050e: Expected O, but got Unknown //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Expected O, but got Unknown //IL_054c: Expected O, but got Unknown //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Expected O, but got Unknown //IL_058a: Expected O, but got Unknown DefaultToVanilla = cfg.Bind<bool>(new ConfigDefinition("Client-Side", "DefaultToVanilla"), false, new ConfigDescription("If true, you will be placed into the default spectate mode when you die.", (AcceptableValueBase)null, Array.Empty<object>())); LightIntensity = cfg.Bind<float>(new ConfigDefinition("Client-Side", "LightIntensity"), 8f, new ConfigDescription("The intensity of the ghost light.\n", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); ShowDebugLogs = cfg.Bind<bool>(new ConfigDefinition("Client-Side", "ShowDebugLogs"), false, new ConfigDescription("If true, you will see debug logs.", (AcceptableValueBase)null, Array.Empty<object>())); GhostVolume = cfg.Bind<float>(new ConfigDefinition("Client-Side", "Ghost Volume"), 1f, new ConfigDescription("Volume of the audio ghosts make", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); DisableDuplicateSounds = cfg.Bind<bool>(new ConfigDefinition("Client-Side", "Disable Duplicate Sounds"), false, new ConfigDescription("Whether or not sound files with identical names should be loaded alongside each other.", (AcceptableValueBase)null, Array.Empty<object>())); UseDefaultSounds = cfg.Bind<bool>(new ConfigDefinition("Client-Side", "Use Default Sounds"), true, new ConfigDescription("Whether or not the files found in Poltergeist's \"sounds\" folder should be included.", (AcceptableValueBase)null, Array.Empty<object>())); PrideMode = cfg.Bind<bool>(new ConfigDefinition("Client-Side", "Pride mode"), false, new ConfigDescription("If true, forces the mod to give you a pride flag material on your ghost.", (AcceptableValueBase)null, Array.Empty<object>())); MaxPower = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced", "Max power"), 100f, new ConfigDescription("The maximum amount of power that will be available to the ghosts.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); PowerRegen = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced", "Power regen"), 5f, new ConfigDescription("How much power the ghosts regenerate per second.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); AliveForMax = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, new ConfigDefinition("Synced", "Alive for max power"), 1, new ConfigDescription("The maximum number of players that can be alive for the ghosts to have max power.\n(As soon as this number or fewer players are left alive, ghosts will be at max power.)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>())); TimeForAggro = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced", "Pester aggro timespan"), 3f, new ConfigDescription("How many seconds can be between pesterings for an enemy to get mad at a nearby player.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); HitsForAggro = SyncedBindingExtensions.BindSyncedEntry<int>(cfg, new ConfigDefinition("Synced", "Aggro hit requirement"), 2, new ConfigDescription("How many times an enemy has to be pestered in the timespan in order to get mad at a nearby player.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, int.MaxValue), Array.Empty<object>())); AudioTime = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced", "Audio play time"), 5f, new ConfigDescription("The maximum time (in seconds) that ghost audio can play before stopping.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); PesterBlacklistType = cfg.Bind<NAME_TYPE>(new ConfigDefinition("Synced", "Enemy Name Type"), NAME_TYPE.BOTH, new ConfigDescription("What type of name Poltergeist should look at when blacklisting enemies. Valid values are:\nINTERNAL: The internal name used by the game (GiantKiwi). You may need to look it up/ask a mod dev for this name.\nCOMMON: The name that appears when the enemy is scanned (Giant Sapsucker). This may not work for all enemies.\nBOTH: Both of the other name types.\n", (AcceptableValueBase)null, Array.Empty<object>())); PesterBlacklist = cfg.Bind<string>(new ConfigDefinition("Synced", "Pester Blacklist"), "", new ConfigDescription("A comma-separated list of monster names. Monsters who's names contain values from here will not be able to be pestered.\nExample: \"Bracken,mask\" will disable pestering for the \"BRACKEN\", the \"MASKed\", and the \"MASK Hornets\".", (AcceptableValueBase)null, Array.Empty<object>())); DoorCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Door cost"), 10f, new ConfigDescription("The power required to open/close regular doors.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); BigDoorCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Big door cost"), 50f, new ConfigDescription("The power required to open/close larger doors and mess with the mineshaft elevator.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); NoisyItemCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Noisy item cost"), 5f, new ConfigDescription("The power required to use noisy items.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); ValveCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Valve cost"), 20f, new ConfigDescription("The power required to turn valves.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); ShipDoorCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Ship door cost"), 30f, new ConfigDescription("The power required to use the ship doors.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); CompanyBellCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Company bell cost"), 15f, new ConfigDescription("The power required to ring the bell at the company building.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); PesterCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Pester cost"), 20f, new ConfigDescription("The power required to pester enemies.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); ManifestCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Manifest cost"), 60f, new ConfigDescription("The power required to manifest in the realm of the living.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); BarkCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Audio playing cost"), 40f, new ConfigDescription("The power required to play audio that the living can hear.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); MiscCost = SyncedBindingExtensions.BindSyncedEntry<float>(cfg, new ConfigDefinition("Synced: Costs", "Misc cost"), 10f, new ConfigDescription("The power required to do any interactions not covered by another section.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, float.MaxValue), Array.Empty<object>())); ConfigManager.Register<PoltergeistConfig>((SyncedConfig2<PoltergeistConfig>)this); } } public class PoltergeistCustomInputs : LcInputActions { public static PoltergeistCustomInputs instance { get; private set; } [InputAction("<Mouse>/leftButton", Name = "Toggle Ghost Light")] public InputAction SwitchLightButton { get; private set; } [InputAction("<Mouse>/scroll/up", Name = "Accelerate")] public InputAction AccelerateButton { get; private set; } [InputAction("<Mouse>/scroll/down", Name = "Decelerate")] public InputAction DecelerateButton { get; private set; } [InputAction("<Keyboard>/e", Name = "Ghost Interact")] public InputAction InteractButton { get; private set; } [InputAction("<Keyboard>/q", Name = "Toggle Spectate Mode")] public InputAction ToggleButton { get; private set; } [InputAction("<Keyboard>/r", Name = "Up")] public InputAction UpKey { get; private set; } [InputAction("<Keyboard>/f", Name = "Down")] public InputAction DownKey { get; private set; } [InputAction("<Keyboard>/l", Name = "Lock Altitude")] public InputAction LockKey { get; private set; } [InputAction("<Keyboard>/c", Name = "Manifest")] public InputAction ManifestKey { get; private set; } [InputAction("<Keyboard>/v", Name = "Play Audio")] public InputAction BarkKey { get; private set; } [InputAction("<Keyboard>/h", Name = "Toggle Controls")] public InputAction ToggleControlsKey { get; private set; } public PoltergeistCustomInputs() { instance = this; } public static string GetInteractString() { return GetKeyString(instance.InteractButton); } public static string GetKeyString(InputAction action) { string bindingDisplayString = InputActionRebindingExtensions.GetBindingDisplayString(action, (DisplayStringOptions)0, (string)null); if (bindingDisplayString.Length <= 0) { return "None"; } if (!bindingDisplayString.Contains("|")) { return bindingDisplayString; } string[] array = bindingDisplayString.Split(" | "); bool flag = false; bool flag2 = false; if (array[0].Length > 0) { flag = true; } if (array[1].Length > 0) { flag2 = true; } string text = ""; if (flag) { text += array[0]; } if (flag && flag2) { text += " | "; } if (flag2) { text += array[1]; } return text; } } public class RPCTransform : NetworkBehaviour { private float posLastUpdateTime; private float rotLastUpdateTime; private float curUpdateDelay; private float updateDist = 0.1f; private Vector3 lastPos = Vector3.zero; private Vector3 lastRot = Vector3.zero; private float updateDelay; private void Update() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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 (!((NetworkBehaviour)this).IsOwner) { return; } curUpdateDelay -= Time.deltaTime; if (curUpdateDelay <= 0f) { curUpdateDelay = updateDelay; if (Vector3.Distance(lastPos, ((Component)this).transform.position) >= updateDist) { UpdatePosServerRPC(((Component)this).transform.position.x, ((Component)this).transform.position.y, ((Component)this).transform.position.z, Time.time); lastPos = ((Component)this).transform.position; } if (Vector3.Distance(lastRot, ((Component)this).transform.eulerAngles) >= updateDist) { UpdateRotServerRPC(((Component)this).transform.eulerAngles.x, ((Component)this).transform.eulerAngles.y, ((Component)this).transform.eulerAngles.z, Time.time); lastRot = ((Component)this).transform.eulerAngles; } } } [ServerRpc] private void UpdatePosServerRPC(float x, float y, float z, float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00de: 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_00f9: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2162933541u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref time, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2162933541u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdatePosClientRPC(x, y, z, time); } } [ClientRpc] private void UpdatePosClientRPC(float x, float y, float z, float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1733768950u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref time, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1733768950u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdatePosLocally(x, y, z, time); } } } private void UpdatePosLocally(float x, float y, float z, float time) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner && !(time < posLastUpdateTime)) { ((Component)this).transform.position = new Vector3(x, y, z); posLastUpdateTime = time; } } [ServerRpc] private void UpdateRotServerRPC(float x, float y, float z, float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Invalid comparison between Unknown and I4 //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00de: 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_00f9: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(970604896u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref time, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 970604896u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdateRotClientRPC(x, y, z, time); } } [ClientRpc] private void UpdateRotClientRPC(float x, float y, float z, float time) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2154348699u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref time, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2154348699u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UpdateRotLocally(x, y, z, time); } } } private void UpdateRotLocally(float x, float y, float z, float time) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner && !(time < rotLastUpdateTime)) { ((Component)this).transform.eulerAngles = new Vector3(x, y, z); rotLastUpdateTime = time; } } 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 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2162933541u, new RpcReceiveHandler(__rpc_handler_2162933541), "UpdatePosServerRPC"); ((NetworkBehaviour)this).__registerRpc(1733768950u, new RpcReceiveHandler(__rpc_handler_1733768950), "UpdatePosClientRPC"); ((NetworkBehaviour)this).__registerRpc(970604896u, new RpcReceiveHandler(__rpc_handler_970604896), "UpdateRotServerRPC"); ((NetworkBehaviour)this).__registerRpc(2154348699u, new RpcReceiveHandler(__rpc_handler_2154348699), "UpdateRotClientRPC"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2162933541(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } float x = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives)); float y = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives)); float z = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives)); float time = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref time, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCTransform)(object)target).UpdatePosServerRPC(x, y, z, time); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1733768950(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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float x = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives)); float y = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives)); float z = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives)); float time = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref time, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCTransform)(object)target).UpdatePosClientRPC(x, y, z, time); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_970604896(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } float x = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives)); float y = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives)); float z = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives)); float time = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref time, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCTransform)(object)target).UpdateRotServerRPC(x, y, z, time); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_2154348699(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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float x = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives)); float y = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives)); float z = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives)); float time = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref time, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RPCTransform)(object)target).UpdateRotClientRPC(x, y, z, time); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RPCTransform"; } } public class SpectatorCamController : MonoBehaviour { public static SpectatorCamController instance = null; private Camera cam; private float camMoveSpeed = 5f; private Light[] lights = (Light[])(object)new Light[4]; private float maxPower = 100f; private float power; private Transform ghostParent; private PlayerControllerB clientPlayer; public GhostHead head; private IGhostInteractible currentGhostInteractible; private Transform hintPanelRoot; private Transform hintPanelOrigParent; private Transform deathUIRoot; private TextMeshProUGUI controlsText; private bool controlsHidden = true; private float accelTime = -1f; private float decelTime = -1f; private bool altitudeLock; public static List<MaskedPlayerEnemy> masked = new List<MaskedPlayerEnemy>(); private static RandomStream rand = null; public float Power => power; public PlayerControllerB ClientPlayer => clientPlayer; private void Awake() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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) if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)this); return; } instance = this; for (int i = 0; i < 4; i++) { Vector3 eulerAngles = default(Vector3); switch (i) { case 0: ((Vector3)(ref eulerAngles))..ctor(50f, 0f, 0f); break; case 1: ((Vector3)(ref eulerAngles))..ctor(120f, 0f, 0f); break; case 2: ((Vector3)(ref eulerAngles))..ctor(50f, 90f, 0f); break; case 3: ((Vector3)(ref eulerAngles))..ctor(50f, -90f, 0f); break; } GameObject val = new GameObject("GhostLight" + i); Light val2 = val.AddComponent<Light>(); HDAdditionalLightData val3 = val.AddComponent<HDAdditionalLightData>(); val.transform.eulerAngles = eulerAngles; val2.type = (LightType)1; val2.shadows = (LightShadows)0; val2.intensity = Poltergeist.Config.LightIntensity.Value; ((Object)val).hideFlags = (HideFlags)52; val3.affectsVolumetric = false; lights[i] = val2; } cam = ((Component)this).GetComponent<Camera>(); Camera obj = cam; obj.cullingMask |= 0x800000; DisableCam(); } public void ParentTo(Transform parent) { ghostParent = parent; if (((Behaviour)this).enabled && !Patches.vanillaMode) { ((Component)this).transform.parent = ghostParent; } } public void EnableCam() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown if (!((Behaviour)this).enabled) { ((Behaviour)this).enabled = true; head.isActive = true; head.UpdateHeadMat(); if (!Patches.vanillaMode) { ((Component)this).transform.parent = ghostParent; Transform transform = ((Component)StartOfRound.Instance.activeCamera).transform; ((Component)this).transform.position = transform.position; ((Component)this).transform.rotation = transform.rotation; Patches.camControllerActive = true; } if ((Object)(object)hintPanelRoot == (Object)null) { hintPanelRoot = ((Component)HUDManager.Instance.tipsPanelAnimator).transform.parent; hintPanelOrigParent = hintPanelRoot.parent; deathUIRoot = ((Component)HUDManager.Instance.SpectateBoxesContainer).transform.parent; GameObject val = Object.Instantiate<GameObject>(((Component)HUDManager.Instance.holdButtonToEndGameEarlyText).gameObject, deathUIRoot); con