Decompiled source of SawTapes v1.1.5

SawTapes.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DunGen;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SawTapes.Behaviours;
using SawTapes.Files;
using SawTapes.Files.Values;
using SawTapes.Managers;
using SawTapes.NetcodePatcher;
using SawTapes.Patches;
using SawTapes.Values;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
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("DissonanceVoip")]
[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.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("SawTapes")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SawTapes")]
[assembly: AssemblyTitle("SawTapes")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SawTapes
{
	public class Constants
	{
		public const string IMPOSSIBLE_ACTION = "Impossible Action";

		public const string INFORMATION = "Information";

		public const string MESSAGE_INFO_CHEAT = "You tried to cheat, the rules were clear";

		public const string MESSAGE_IMPAC_KEY = "This key is needed by the tested player to survive";

		public const string MESSAGE_IMPAC_TESTED_PLAYER = "You are not the tested player, the game can't start";

		public const string MESSAGE_INFO_LOCKED = "You've been locked in, find the tape to get out";

		public const string MESSAGE_IMPAC_LOCKED_DOOR = "You can't open the door until the end of the game!";

		public const string MESSAGE_IMPAC_LOCKED_ENTRANCE = "You can't use the entrance until the end of the game!";

		public const string GLOBAL = "_Global_";

		public const string HUD = "_HUD_";

		public const string SURVIVAL_GAME = "Survival Game";

		public const string HUNTING_GAME = "Hunting Game";

		public const string SHOVEL = "Shovel";
	}
	public class ConfigManager
	{
		public static ConfigEntry<int> rarityIncrement;

		public static ConfigEntry<bool> isDebug;

		public static ConfigEntry<bool> isInfoInGame;

		public static ConfigEntry<bool> isSawTheme;

		public static ConfigEntry<bool> isSubtitles;

		public static ConfigEntry<float> chronoPosX;

		public static ConfigEntry<float> chronoPosY;

		public static ConfigEntry<int> survivalRarity;

		public static ConfigEntry<bool> penalizePlayerWhoCamp;

		public static ConfigEntry<int> campDuration;

		public static ConfigEntry<int> huntingRarity;

		public static ConfigEntry<float> huntingGassedDistance;

		public static ConfigEntry<float> huntingCheatDistance;

		public static ConfigEntry<int> huntingDuration;

		public static ConfigEntry<int> huntingBillyValue;

		public static ConfigEntry<int> huntingReverseBearTrapValue;

		public static ConfigEntry<float> huntingAura;

		public static ConfigEntry<string> huntingExclusions;

		public static int SurvivalRarity => survivalRarity.Value;

		public static int HuntingRarity => huntingRarity.Value;

		public static void Load()
		{
			rarityIncrement = SawTapes.configFile.Bind<int>("_Global_", "Rarity increment", 10, "By how much does the chance of a Saw game appearing increase with each round if it hasn't appeared?");
			isDebug = SawTapes.configFile.Bind<bool>("_Global_", "Enable debugging", false, "Is debugging enabled?");
			isInfoInGame = SawTapes.configFile.Bind<bool>("_Global_", "Enable Saw theme", true, "Display a tip when the player enters the mini-game to inform them to find the tape");
			isSawTheme = SawTapes.configFile.Bind<bool>("_Global_", "Enable Saw theme", true, "Is Saw theme enabled?");
			isSubtitles = SawTapes.configFile.Bind<bool>("_HUD_", "Enable subtitles", false, "Is subtitles enabled?");
			chronoPosX = SawTapes.configFile.Bind<float>("_HUD_", "Chrono pos X", 106f, "X position of chrono on interface.");
			chronoPosY = SawTapes.configFile.Bind<float>("_HUD_", "Chrono pos Y", -50f, "Y position of chrono on interface.");
			survivalRarity = SawTapes.configFile.Bind<int>("Survival Game", "Rarity", 20, "Default probability of the Survival Game mini-game appearing");
			penalizePlayerWhoCamp = SawTapes.configFile.Bind<bool>("Survival Game", "Penalize campers", true, "Enable the possibility to penalize the player who is camping by spawning a Nutcracker");
			campDuration = SawTapes.configFile.Bind<int>("Survival Game", "Camping duration", 5, "Total camping duration before the player is killed");
			huntingRarity = SawTapes.configFile.Bind<int>("Hunting Game", "Rarity", 20, "Default probability of the Hunting Game mini-game appearing");
			huntingGassedDistance = SawTapes.configFile.Bind<float>("Hunting Game", "Gassed distance", 25f, "Maximum distance between the player and the tape before he is gassed");
			huntingCheatDistance = SawTapes.configFile.Bind<float>("Hunting Game", "Cheat distance", 15f, "Maximum distance the player can move before launching the tape. Beyond that, he'll be killed.");
			huntingDuration = SawTapes.configFile.Bind<int>("Hunting Game", "Duration", 150, "Duration of the Hunting Game");
			huntingBillyValue = SawTapes.configFile.Bind<int>("Hunting Game", "Billy value", 90, "Billy value for the Hunting Game");
			huntingReverseBearTrapValue = SawTapes.configFile.Bind<int>("Hunting Game", "Reverse bear trap value", 30, "Reverse Bear Trap value for the Hunting Game");
			huntingAura = SawTapes.configFile.Bind<float>("Hunting Game", "Aura duration", 10f, "Duration for which the enemy's aura is visible through walls");
			huntingExclusions = SawTapes.configFile.Bind<string>("Hunting Game", "Exclusion list", "Blob,Maneater,Lasso,Red pill", "List of creatures that will not be selected by the Hunting Game.\nYou can add enemies by separating them with a comma.");
		}
	}
	[BepInPlugin("Lega.SawTapes", "Saw Tapes", "1.1.5")]
	public class SawTapes : BaseUnityPlugin
	{
		private const string modGUID = "Lega.SawTapes";

		private const string modName = "Saw Tapes";

		private const string modVersion = "1.1.5";

		private readonly Harmony harmony = new Harmony("Lega.SawTapes");

		private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "sawtapes"));

		internal static ManualLogSource mls;

		public static ConfigFile configFile;

		public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("SawTapesNetworkManager");

		public static List<SawTapeValue> sawTapeValues = new List<SawTapeValue>();

		public static GameObject billyPuppetObj;

		public static GameObject reverseBearTrapObj;

		public static GameObject sawKeyObj;

		public static GameObject pursuerEyeObj;

		public static GameObject sawTheme;

		public static GameObject sawRecordingSurvival;

		public static GameObject sawRecordingHunting;

		public static GameObject billyRecordingSurvival;

		public static GameObject steamAudio;

		public static GameObject tapeParticle;

		public static GameObject spawnParticle;

		public static GameObject despawnParticle;

		public static GameObject steamParticle;

		public static EnemyType billyEnemy;

		public static Material wallhackShader;

		public static HashSet<EnemyType> allEnemies = new HashSet<EnemyType>();

		public static List<Tile> eligibleTiles = new List<Tile>();

		public static HashSet<Room> rooms = new HashSet<Room>();

		public static HashSet<Horde> hordes = new HashSet<Horde>();

		public void Awake()
		{
			mls = Logger.CreateLogSource("SawTapes");
			configFile = ((BaseUnityPlugin)this).Config;
			ConfigManager.Load();
			LoadManager();
			NetcodePatcher();
			LoadItems();
			LoadEnemies();
			LoadParticles();
			LoadAudios();
			LoadShaders();
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(DungeonPatch));
			harmony.PatchAll(typeof(TilePatch));
			harmony.PatchAll(typeof(DoorLockPatch));
			harmony.PatchAll(typeof(ManualCameraRendererPatch));
			harmony.PatchAll(typeof(ShipTeleporterPatch));
			harmony.PatchAll(typeof(RoundManagerPatch));
			harmony.PatchAll(typeof(EnemyAIPatch));
		}

		public static void LoadManager()
		{
			Utilities.FixMixerGroups(managerPrefab);
			managerPrefab.AddComponent<SawTapesNetworkManager>();
		}

		private static void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}

		public void LoadItems()
		{
			List<SawTapeValue> list = new List<SawTapeValue>();
			list.Add(new SawTapeValue(typeof(SurvivalTape), bundle.LoadAsset<Item>("Assets/SawTape/SurvivalTapeItem.asset"), ConfigManager.SurvivalRarity, isTileGame: true));
			list.Add(new SawTapeValue(typeof(HuntingTape), bundle.LoadAsset<Item>("Assets/SawTape/HuntingTapeItem.asset"), ConfigManager.HuntingRarity, isTileGame: false));
			sawTapeValues = list;
			foreach (SawTapeValue sawTapeValue in sawTapeValues)
			{
				RegisterItem(sawTapeValue.Type, sawTapeValue.Item);
			}
			billyPuppetObj = RegisterItem(typeof(BillyPuppet), bundle.LoadAsset<Item>("Assets/BillyPuppet/BillyPuppetItem.asset"));
			reverseBearTrapObj = RegisterItem(typeof(ReverseBearTrap), bundle.LoadAsset<Item>("Assets/ReverseBearTrap/ReverseBearTrapItem.asset"));
			sawKeyObj = RegisterItem(typeof(SawKey), bundle.LoadAsset<Item>("Assets/SawKey/SawKeyItem.asset"));
			pursuerEyeObj = RegisterItem(typeof(PursuerEye), bundle.LoadAsset<Item>("Assets/PursuerEye/PursuerEyeItem.asset"));
		}

		public GameObject RegisterItem(Type type, Item item)
		{
			Component obj = item.spawnPrefab.AddComponent(type);
			PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null);
			((GrabbableObject)val).grabbable = true;
			((GrabbableObject)val).grabbableToEnemies = true;
			((GrabbableObject)val).itemProperties = item;
			NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
			Utilities.FixMixerGroups(item.spawnPrefab);
			Items.RegisterItem(item);
			return item.spawnPrefab;
		}

		public void LoadEnemies()
		{
			billyEnemy = bundle.LoadAsset<EnemyType>("Assets/BillyPuppet/BillyEnemy.asset");
			billyEnemy.enemyPrefab.AddComponent<Billy>();
			NetworkPrefabs.RegisterNetworkPrefab(billyEnemy.enemyPrefab);
		}

		public void LoadParticles()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>
			{
				tapeParticle = bundle.LoadAsset<GameObject>("Assets/Particles/TapeParticle.prefab"),
				spawnParticle = bundle.LoadAsset<GameObject>("Assets/Particles/SpawnParticle.prefab"),
				despawnParticle = bundle.LoadAsset<GameObject>("Assets/Particles/DespawnParticle.prefab"),
				steamParticle = bundle.LoadAsset<GameObject>("Assets/Particles/SteamParticle.prefab")
			};
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}

		public void LoadAudios()
		{
			HashSet<GameObject> hashSet = new HashSet<GameObject>
			{
				sawTheme = bundle.LoadAsset<GameObject>("Assets/Audios/SawTheme.prefab"),
				sawRecordingSurvival = bundle.LoadAsset<GameObject>("Assets/Audios/SawRecording_Survival.prefab"),
				sawRecordingHunting = bundle.LoadAsset<GameObject>("Assets/Audios/SawRecording_Hunting.prefab"),
				billyRecordingSurvival = bundle.LoadAsset<GameObject>("Assets/Audios/BillyRecording_Survival.prefab"),
				steamAudio = bundle.LoadAsset<GameObject>("Assets/Audios/SteamAudio.prefab")
			};
			foreach (GameObject item in hashSet)
			{
				NetworkPrefabs.RegisterNetworkPrefab(item);
				Utilities.FixMixerGroups(item);
			}
		}

		public static void LoadShaders()
		{
			wallhackShader = bundle.LoadAsset<Material>("Assets/Shaders/WallhackMaterial.mat");
		}
	}
	public class STUtilities
	{
		public static void Shuffle<T>(List<T> list)
		{
			for (int num = list.Count - 1; num > 0; num--)
			{
				int num2 = Random.Range(0, num + 1);
				int index = num2;
				int index2 = num;
				T value = list[num];
				T value2 = list[num2];
				list[index] = value;
				list[index2] = value2;
			}
		}

		public static IEnumerator ShowEnemyCoroutine(EnemyAI enemy)
		{
			if ((Object)(object)enemy != (Object)null)
			{
				CustomPassManager.SetupCustomPassForEnemy(enemy);
				yield return (object)new WaitForSeconds(ConfigManager.huntingAura.Value);
			}
			CustomPassManager.RemoveAura();
		}

		public static Transform FindMainEntrancePoint()
		{
			return ((IEnumerable<EntranceTeleport>)Object.FindObjectsOfType<EntranceTeleport>()).FirstOrDefault((Func<EntranceTeleport, bool>)((EntranceTeleport e) => e.entranceId == 0 && !e.isEntranceToBuilding)).entrancePoint;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SawTapes";

		public const string PLUGIN_NAME = "SawTapes";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace SawTapes.Values
{
	public class Horde
	{
		public string HordeName { get; internal set; }

		public int GameDuration { get; internal set; }

		public int BillyValue { get; internal set; }

		public int MinHour { get; internal set; }

		public int MaxHour { get; internal set; }

		public Dictionary<int, EnemyType> EnemiesSpawn { get; internal set; }

		public Horde(string hordeName, int gameDuration, int billyValue, int minHour, int maxHour, Dictionary<int, EnemyType> enemiesSpawn)
		{
			HordeName = hordeName;
			GameDuration = gameDuration;
			BillyValue = billyValue;
			MinHour = minHour;
			MaxHour = maxHour;
			EnemiesSpawn = enemiesSpawn;
		}
	}
	public class Room
	{
		public string RoomName { get; internal set; }

		public List<string> DoorsNames { get; internal set; }

		public int Weight { get; internal set; }

		public List<Horde> Hordes { get; internal set; }

		public Room(string roomName, List<string> doorsNames, int weight, List<Horde> hordes)
		{
			RoomName = roomName;
			DoorsNames = doorsNames;
			Weight = weight;
			Hordes = hordes;
		}
	}
	public class SawTapeValue
	{
		public Type Type { get; internal set; }

		public Item Item { get; internal set; }

		public int DefaultRarity { get; internal set; }

		public int Rarity { get; internal set; }

		public bool IsTileGame { get; internal set; }

		public SawTapeValue(Type type, Item item, int rarity, bool isTileGame)
		{
			Type = type;
			Item = item;
			DefaultRarity = rarity;
			Rarity = rarity;
			IsTileGame = isTileGame;
		}
	}
}
namespace SawTapes.Patches
{
	internal class DoorLockPatch
	{
		public static Dictionary<DoorLock, Tile> blockedDoors = new Dictionary<DoorLock, Tile>();

		[HarmonyPatch(typeof(DoorLock), "OnTriggerStay")]
		[HarmonyPrefix]
		private static bool OpenDoorAsEnemy(ref DoorLock __instance)
		{
			return !IsDoorBlocked(ref __instance);
		}

		[HarmonyPatch(typeof(DoorLock), "TryDoorHaunt")]
		[HarmonyPrefix]
		private static bool OpenDoorAsHaunt(ref DoorLock __instance)
		{
			return !IsDoorBlocked(ref __instance);
		}

		[HarmonyPatch(typeof(DoorLock), "OpenOrCloseDoor")]
		[HarmonyPrefix]
		private static bool OpenDoorAsPlayer(ref DoorLock __instance, ref PlayerControllerB playerWhoTriggered)
		{
			if (IsDoorBlocked(ref __instance))
			{
				if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerWhoTriggered)
				{
					HUDManager.Instance.DisplayTip("Impossible Action", "You can't open the door until the end of the game!", false, false, "LC_Tip1");
				}
				return false;
			}
			return true;
		}

		public static bool IsDoorBlocked(ref DoorLock doorLock)
		{
			if (blockedDoors.ContainsKey(doorLock))
			{
				return true;
			}
			return false;
		}
	}
	internal class DungeonPatch
	{
		public static bool isGenerateTileGame = true;

		[HarmonyPatch(typeof(Dungeon), "SpawnDoorPrefab")]
		[HarmonyPrefix]
		private static void SpawnDoor(ref Doorway a, ref Doorway b)
		{
			if (isGenerateTileGame)
			{
				RemoveSpawnEmptyDoor(a);
				RemoveSpawnEmptyDoor(b);
			}
		}

		private static void RemoveSpawnEmptyDoor(Doorway doorway)
		{
			Room room = SawTapes.rooms.FirstOrDefault((Room r) => ((Object)doorway.tile).name.Contains(r.RoomName));
			if (room == null || !DungeonUtil.HasAnyViableEntries(doorway.ConnectorPrefabWeights) || !DungeonUtil.HasAnyViableEntries(doorway.ConnectedDoorway.ConnectorPrefabWeights) || !doorway.ConnectorPrefabWeights.Any(delegate(GameObjectWeight d)
			{
				List<string> doorsNames = room.DoorsNames;
				GameObject gameObject = d.GameObject;
				return doorsNames.Contains((gameObject != null) ? ((Object)gameObject).name : null);
			}))
			{
				return;
			}
			doorway.ConnectorPrefabWeights.RemoveAll((GameObjectWeight d) => !room.DoorsNames.Contains(((Object)d.GameObject).name));
			doorway.ConnectedDoorway.ConnectorPrefabWeights.RemoveAll((GameObjectWeight d) => !room.DoorsNames.Contains(((Object)d.GameObject).name));
			if (!SawTapes.eligibleTiles.Contains(doorway.tile))
			{
				for (int i = 0; i < room.Weight; i++)
				{
					SawTapes.eligibleTiles.Add(doorway.tile);
				}
			}
		}
	}
	internal class EnemyAIPatch
	{
		[HarmonyPatch(typeof(EnemyAI), "HitEnemy")]
		[HarmonyPostfix]
		private static void HitEnemy(ref EnemyAI __instance, int force = 1, PlayerControllerB playerWhoHit = null)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			EnemyAI val = ((playerWhoHit == null) ? null : ((Component)playerWhoHit).GetComponent<PlayerSTBehaviour>().huntingTape?.assignedEnemy);
			if (!__instance.isEnemyDead && (float)(__instance.enemyHP - force) <= 0f && (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerWhoHit && (Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)__instance)
			{
				SawTapesNetworkManager.Instance.SpawnPursuerEyeServerRpc(((Component)__instance).transform.position);
			}
		}

		[HarmonyPatch(typeof(EnemyAI), "KillEnemy")]
		[HarmonyPostfix]
		private static void KillEnemy(ref EnemyAI __instance)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer)
			{
				EnemyAI val = Object.FindFirstObjectByType<HuntingTape>()?.assignedEnemy;
				if ((Object)(object)val != (Object)null && (Object)(object)__instance == (Object)(object)val)
				{
					SawTapesNetworkManager.Instance.SpawnSawKeyServerRpc(((Component)__instance).transform.position);
				}
			}
		}
	}
	internal class HUDManagerPatch
	{
		public static TextMeshProUGUI chronoText;

		public static TextMeshProUGUI subtitleText;

		public static bool isChronoEnded = false;

		public static Dictionary<EntranceTeleport, Tile> blockedEntrances = new Dictionary<EntranceTeleport, Tile>();

		public static bool isFlashFilterUsed = false;

		[HarmonyPatch(typeof(HUDManager), "Start")]
		[HarmonyPostfix]
		private static void StartHUDManager(ref HUDManager __instance)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0020: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("ChronoUI");
			val.transform.localPosition = new Vector3(0f, 0f, 0f);
			val.AddComponent<RectTransform>();
			TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
			RectTransform rectTransform = ((TMP_Text)val2).rectTransform;
			((Transform)rectTransform).SetParent(GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform, false);
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(0f, 1f);
			rectTransform.pivot = new Vector2(0f, 1f);
			rectTransform.anchoredPosition = new Vector2(ConfigManager.chronoPosX.Value, ConfigManager.chronoPosY.Value);
			rectTransform.sizeDelta = new Vector2(300f, 300f);
			((TMP_Text)val2).alignment = (TextAlignmentOptions)257;
			((TMP_Text)val2).font = ((TMP_Text)__instance.controlTipLines[0]).font;
			((TMP_Text)val2).fontSize = 14f;
			chronoText = val2;
			if (ConfigManager.isSubtitles.Value)
			{
				GameObject val3 = new GameObject("SubtitleUI");
				val3.transform.localPosition = new Vector3(0f, -125f, 0f);
				val3.AddComponent<RectTransform>();
				TextMeshProUGUI val4 = val3.AddComponent<TextMeshProUGUI>();
				RectTransform rectTransform2 = ((TMP_Text)val4).rectTransform;
				((Transform)rectTransform2).SetParent(GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform, false);
				rectTransform2.sizeDelta = new Vector2(600f, 200f);
				rectTransform2.anchoredPosition = new Vector2(0f, -125f);
				((TMP_Text)val4).alignment = (TextAlignmentOptions)514;
				((TMP_Text)val4).font = ((TMP_Text)__instance.controlTipLines[0]).font;
				((TMP_Text)val4).fontSize = 14f;
				subtitleText = val4;
			}
		}

		public static IEnumerator StartChronoCoroutine(int seconds)
		{
			while (!IsChronoEnded(seconds))
			{
				seconds--;
				yield return (object)new WaitForSeconds(1f);
			}
		}

		private static bool IsChronoEnded(int totalSeconds)
		{
			int num = (int)Math.Floor((double)totalSeconds / 60.0);
			int num2 = (int)Math.Floor((double)totalSeconds % 60.0);
			((TMP_Text)chronoText).text = $"{num:D2}:{num2:D2}";
			if (GameNetworkManager.Instance.localPlayerController.isPlayerDead || isChronoEnded || (num == 0 && num2 == 0))
			{
				((TMP_Text)chronoText).text = "";
				isChronoEnded = false;
				return true;
			}
			return false;
		}

		[HarmonyPatch(typeof(HUDManager), "HoldInteractionFill")]
		[HarmonyPostfix]
		private static void HoldInteraction(ref bool __result)
		{
			if (!__result)
			{
				return;
			}
			InteractTrigger hoveringOverTrigger = GameNetworkManager.Instance.localPlayerController.hoveringOverTrigger;
			if (!((Object)(object)hoveringOverTrigger == (Object)null))
			{
				EntranceTeleport entranceTeleport = ((Component)hoveringOverTrigger).GetComponent<EntranceTeleport>();
				if ((Object)(object)entranceTeleport != (Object)null && IsEntranceBlocked(ref entranceTeleport))
				{
					HUDManager.Instance.DisplayTip("Impossible Action", "You can't use the entrance until the end of the game!", false, false, "LC_Tip1");
					__result = false;
				}
			}
		}

		public static bool IsEntranceBlocked(ref EntranceTeleport entranceTeleport)
		{
			if (blockedEntrances.ContainsKey(entranceTeleport))
			{
				return true;
			}
			return false;
		}

		[HarmonyPatch(typeof(HUDManager), "SetScreenFilters")]
		[HarmonyPrefix]
		private static bool UpdateScreenFilters()
		{
			return !isFlashFilterUsed;
		}
	}
	internal class ManualCameraRendererPatch
	{
		[HarmonyPatch(typeof(ManualCameraRenderer), "updateMapTarget")]
		[HarmonyPostfix]
		private static void MapCameraText(ref ManualCameraRenderer __instance)
		{
			MapCameraSTManager.UpdateMapCamera(ref __instance);
		}
	}
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		private static void StartPlayerControllerB(ref PlayerControllerB __instance)
		{
			PlayerSTManager.AddPlayerBehaviour(__instance);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")]
		[HarmonyPrefix]
		private static bool TeleportPlayer(ref PlayerControllerB __instance)
		{
			return !PlayerSTManager.PreventTeleportPlayer(ref __instance);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "KillPlayerClientRpc")]
		[HarmonyPostfix]
		private static void PlayerDeath(ref PlayerControllerB __instance, int playerId)
		{
			PlayerSTBehaviour playerBehaviour = __instance.playersManager.allPlayerObjects[playerId].GetComponentInChildren<PlayerSTBehaviour>();
			if ((Object)(object)playerBehaviour != (Object)null)
			{
				PlayerSTManager.ResetPlayerGame(ref playerBehaviour);
			}
		}
	}
	internal class RoundManagerPatch
	{
		public static SawTapeValue tapeToSpawn;

		[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
		[HarmonyPostfix]
		private static void LoadNewGame(ref RoundManager __instance)
		{
			SawTapes.eligibleTiles.Clear();
			tapeToSpawn = null;
			if (!((NetworkBehaviour)__instance).IsServer)
			{
				return;
			}
			STUtilities.Shuffle(SawTapes.sawTapeValues);
			foreach (SawTapeValue sawTapeValue in SawTapes.sawTapeValues)
			{
				if (tapeToSpawn == null && new Random().Next(1, 100) <= sawTapeValue.Rarity)
				{
					tapeToSpawn = sawTapeValue;
					sawTapeValue.Rarity = sawTapeValue.DefaultRarity;
				}
				else if (sawTapeValue.Rarity > 0 && sawTapeValue.Rarity < 100)
				{
					sawTapeValue.Rarity = Mathf.Min(100, sawTapeValue.Rarity + ConfigManager.rarityIncrement.Value);
				}
			}
			SawTapesNetworkManager.Instance.SetGenerateGameTileClientRpc(tapeToSpawn != null && tapeToSpawn.IsTileGame);
		}

		[HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")]
		[HarmonyPostfix]
		private static void SpawnItems(ref RoundManager __instance)
		{
			AddNewItems(ref __instance);
		}

		public static void AddNewItems(ref RoundManager roundManager)
		{
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: 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_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			if (tapeToSpawn == null)
			{
				return;
			}
			if (tapeToSpawn.IsTileGame)
			{
				STUtilities.Shuffle(SawTapes.eligibleTiles);
				{
					foreach (Tile tile in SawTapes.eligibleTiles.ToList())
					{
						List<DoorLock> list = new List<DoorLock>();
						bool flag = false;
						foreach (Doorway doorway in tile.UsedDoorways)
						{
							Vector3 position = ((Component)doorway).transform.position;
							DoorLock val = (from d in Object.FindObjectsOfType<DoorLock>()
								where Vector3.Distance(((Component)d).transform.position, ((Component)doorway).transform.position) < 5f
								orderby Vector3.Distance(((Component)d).transform.position, ((Component)doorway).transform.position)
								select d).FirstOrDefault();
							if ((Object)(object)val == (Object)null)
							{
								flag = true;
								break;
							}
							list.Add(val);
						}
						if (flag)
						{
							SawTapes.eligibleTiles.Remove(tile);
							continue;
						}
						List<RandomScrapSpawn> list2 = Object.FindObjectsOfType<RandomScrapSpawn>().Where(delegate(RandomScrapSpawn s)
						{
							//IL_000e: Unknown result type (might be due to invalid IL or missing references)
							//IL_0013: Unknown result type (might be due to invalid IL or missing references)
							//IL_001c: Unknown result type (might be due to invalid IL or missing references)
							if (!s.spawnUsed)
							{
								Bounds bounds2 = tile.Bounds;
								return ((Bounds)(ref bounds2)).Contains(((Component)s).transform.position);
							}
							return false;
						}).ToList();
						if (list2.Count <= 0)
						{
							SawTapes.eligibleTiles.Remove(tile);
							continue;
						}
						Vector3 randomSpawnItemPosition = GetRandomSpawnItemPosition(list2, roundManager, tapeToSpawn.Item);
						GrabbableObject val2 = SpawnItem(ref tapeToSpawn.Item.spawnPrefab, randomSpawnItemPosition);
						Vector3[] doorsPos = list.Select((DoorLock d) => ((Component)d).transform.position).ToArray();
						List<NetworkObjectReference> list3 = new List<NetworkObjectReference>();
						foreach (EntranceTeleport entranceTeleport in Object.FindObjectsOfType<EntranceTeleport>().Where(delegate(EntranceTeleport e)
						{
							//IL_0006: Unknown result type (might be due to invalid IL or missing references)
							//IL_000b: Unknown result type (might be due to invalid IL or missing references)
							//IL_0014: Unknown result type (might be due to invalid IL or missing references)
							Bounds bounds = tile.Bounds;
							return ((Bounds)(ref bounds)).Contains(((Component)e).transform.position);
						}))
						{
							NetworkObject component = ((Component)entranceTeleport).GetComponent<NetworkObject>();
							if (!((Object)(object)component != (Object)null))
							{
								continue;
							}
							list3.Add(NetworkObjectReference.op_Implicit(component));
							foreach (EntranceTeleport item in from e in Object.FindObjectsOfType<EntranceTeleport>()
								where e.isEntranceToBuilding != entranceTeleport.isEntranceToBuilding && e.entranceId == entranceTeleport.entranceId
								select e)
							{
								NetworkObject component2 = ((Component)item).GetComponent<NetworkObject>();
								if ((Object)(object)component2 != (Object)null)
								{
									list3.Add(NetworkObjectReference.op_Implicit(component2));
								}
							}
						}
						SawTapesNetworkManager.Instance.AddTileInfosClientRpc(((Component)tile).transform.position, doorsPos, list3.ToArray(), NetworkObjectReference.op_Implicit(((Component)val2).GetComponent<NetworkObject>()));
						SawTapes.eligibleTiles.RemoveAll((Tile t) => (Object)(object)t != (Object)(object)tile);
						break;
					}
					return;
				}
			}
			Vector3 randomSpawnItemPosition2 = GetRandomSpawnItemPosition((from s in Object.FindObjectsOfType<RandomScrapSpawn>()
				where !s.spawnUsed
				select s).ToList(), roundManager, tapeToSpawn.Item);
			GrabbableObject val3 = SpawnItem(ref tapeToSpawn.Item.spawnPrefab, randomSpawnItemPosition2);
		}

		public static Vector3 GetRandomSpawnItemPosition(List<RandomScrapSpawn> listRandomScrapSpawn, RoundManager roundManager, Item item)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008d: 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)
			Random random = new Random();
			int index = random.Next(0, listRandomScrapSpawn.Count);
			RandomScrapSpawn val = listRandomScrapSpawn[index];
			if (val.spawnedItemsCopyPosition)
			{
				val.spawnUsed = true;
				listRandomScrapSpawn.RemoveAt(index);
			}
			else
			{
				((Component)val).transform.position = roundManager.GetRandomNavMeshPositionInBoxPredictable(((Component)val).transform.position, val.itemSpawnRange, roundManager.navHit, roundManager.AnomalyRandom, -1) + Vector3.up * item.verticalOffset;
			}
			return ((Component)val).transform.position + Vector3.up * 0.5f;
		}

		public static GrabbableObject SpawnItem(ref GameObject spawnPrefab, Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			return SpawnItem(ref spawnPrefab, position, Quaternion.identity);
		}

		public static GrabbableObject SpawnItem(ref GameObject spawnPrefab, Vector3 position, Quaternion rotation)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost)
			{
				try
				{
					GameObject val = Object.Instantiate<GameObject>(spawnPrefab, position, rotation, StartOfRound.Instance.propsContainer);
					GrabbableObject component = val.GetComponent<GrabbableObject>();
					component.fallTime = 0f;
					val.GetComponent<NetworkObject>().Spawn(false);
					if (component is SawTape)
					{
						SawTapesNetworkManager.Instance.SpawnTapeParticleClientRpc(NetworkObjectReference.op_Implicit(((Component)component).GetComponent<NetworkObject>()));
					}
					return component;
				}
				catch (Exception arg)
				{
					SawTapes.mls.LogError((object)$"Error in SpawnItem: {arg}");
				}
			}
			return null;
		}
	}
	internal class ShipTeleporterPatch
	{
		[HarmonyPatch(typeof(ShipTeleporter), "PressTeleportButtonOnLocalClient")]
		[HarmonyPrefix]
		private static bool PreventTeleport(ref ShipTeleporter __instance)
		{
			if (!__instance.isInverseTeleporter && (Object)(object)StartOfRound.Instance.mapScreen.targetedPlayer != (Object)null)
			{
				PlayerSTBehaviour component = ((Component)StartOfRound.Instance.mapScreen.targetedPlayer).GetComponent<PlayerSTBehaviour>();
				if (component.isInGame)
				{
					return false;
				}
			}
			return true;
		}
	}
	internal class StartOfRoundPatch
	{
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyBefore(new string[] { "evaisa.lethallib" })]
		[HarmonyPostfix]
		private static void StartRound(ref StartOfRound __instance)
		{
			if (NetworkManager.Singleton.IsHost && (Object)(object)SawTapesNetworkManager.Instance == (Object)null)
			{
				GameObject val = Object.Instantiate<GameObject>(SawTapes.managerPrefab, ((Component)__instance).transform.parent);
				val.GetComponent<NetworkObject>().Spawn(false);
				SawTapes.mls.LogInfo((object)"Spawning SawTapesNetworkManager");
			}
			SawTapes.allEnemies.Clear();
			EnemyAI val2 = default(EnemyAI);
			foreach (EnemyType item in (from e in Resources.FindObjectsOfTypeAll<EnemyType>()
				where (Object)(object)e?.enemyPrefab != (Object)null && e.enemyPrefab.TryGetComponent<EnemyAI>(ref val2) && (Object)(object)val2 != (Object)null
				select e).Distinct())
			{
				SawTapes.allEnemies.Add(item);
			}
			SurvivalGameFile.LoadJSON();
			SubtitleFile.LoadJSON();
		}

		[HarmonyPatch(typeof(StartOfRound), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable()
		{
			SawTapesNetworkManager.Instance = null;
		}

		[HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")]
		[HarmonyPostfix]
		private static void PlayerConnection(ref StartOfRound __instance)
		{
			PlayerControllerB[] allPlayerScripts = __instance.allPlayerScripts;
			foreach (PlayerControllerB player in allPlayerScripts)
			{
				PlayerSTManager.AddPlayerBehaviour(player);
			}
		}
	}
	internal class TilePatch
	{
		[HarmonyPatch(typeof(Tile), "OnTriggerEnter")]
		[HarmonyPrefix]
		private static void EnterTile(ref Tile __instance, Collider other)
		{
			TileSTManager.LogTileDebugInfo(ref __instance, ref other);
			TileSTManager.HandleTileBehaviour(ref __instance, ref other);
		}
	}
}
namespace SawTapes.Managers
{
	public class CustomPassManager : MonoBehaviour
	{
		private static WallhackCustomPass wallhackPass;

		private static CustomPassVolume customPassVolume;

		public static CustomPassVolume CustomPassVolume
		{
			get
			{
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)customPassVolume == (Object)null)
				{
					customPassVolume = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).gameObject.AddComponent<CustomPassVolume>();
					if ((Object)(object)customPassVolume != (Object)null)
					{
						customPassVolume.targetCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera;
						customPassVolume.injectionPoint = (CustomPassInjectionPoint)1;
						customPassVolume.isGlobal = true;
						wallhackPass = new WallhackCustomPass();
						customPassVolume.customPasses.Add((CustomPass)(object)wallhackPass);
					}
				}
				return customPassVolume;
			}
		}

		public static void SetupCustomPassForEnemy(EnemyAI enemy)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			LayerMask wallhackLayer = LayerMask.op_Implicit(524288);
			List<Renderer> list = (from r in ((Component)enemy).GetComponentsInChildren<Renderer>()
				where (LayerMask.op_Implicit(wallhackLayer) & (1 << ((Component)r).gameObject.layer)) != 0
				select r).ToList();
			if (list.Any((Renderer r) => ((Object)r).name.Contains("LOD")))
			{
				list.RemoveAll((Renderer r) => !((Object)r).name.Contains("LOD"));
			}
			if (list == null || list.Count == 0)
			{
				SawTapes.mls.LogError((object)("No renderer could be found on " + enemy.enemyType.enemyName + "."));
				return;
			}
			if ((Object)(object)CustomPassVolume == (Object)null)
			{
				SawTapes.mls.LogError((object)"CustomPassVolume is not assigned.");
				return;
			}
			wallhackPass = CustomPassVolume.customPasses.Find((CustomPass pass) => pass is WallhackCustomPass) as WallhackCustomPass;
			if (wallhackPass == null)
			{
				SawTapes.mls.LogError((object)"WallhackCustomPass could not be found in CustomPassVolume.");
			}
			else
			{
				wallhackPass.SetTargetRenderers(list.ToArray(), SawTapes.wallhackShader);
			}
		}

		public static void RemoveAura()
		{
			wallhackPass?.ClearTargetRenderers();
		}
	}
	public class EnemySTManager
	{
		public static Vector3 GetFurthestPositionFromPlayer(PlayerControllerB player)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			return RoundManager.Instance.insideAINodes.OrderByDescending((GameObject n) => Vector3.Distance(((Component)player).transform.position, n.transform.position)).FirstOrDefault().transform.position;
		}

		public static NetworkObject SpawnEnemy(EnemyType enemyType, Vector3 spawnPosition)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(enemyType.enemyPrefab, spawnPosition, Quaternion.identity);
			NetworkObject componentInChildren = val.GetComponentInChildren<NetworkObject>();
			componentInChildren.Spawn(true);
			return componentInChildren;
		}

		public static void DespawnEnemy(NetworkObject spawnedEnemy)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			EnemyAI componentInChildren = ((Component)spawnedEnemy).GetComponentInChildren<EnemyAI>();
			if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.isEnemyDead)
			{
				SawTapesNetworkManager.Instance.PlayDespawnParticleClientRpc(((Component)spawnedEnemy).transform.position);
				NutcrackerEnemyAI val = (NutcrackerEnemyAI)(object)((componentInChildren is NutcrackerEnemyAI) ? componentInChildren : null);
				if (val != null && (Object)(object)val.gun != (Object)null)
				{
					SawTapesNetworkManager.Instance.DestroyObjectClientRpc(NetworkObjectReference.op_Implicit(((Component)val.gun).GetComponent<NetworkObject>()));
				}
				spawnedEnemy.Despawn(true);
			}
		}
	}
	public class MapCameraSTManager
	{
		public static void UpdateMapCamera(ref ManualCameraRenderer mapScreen)
		{
			if (StartOfRound.Instance.shipHasLanded && (Object)(object)mapScreen.targetedPlayer != (Object)null)
			{
				PlayerSTBehaviour component = ((Component)StartOfRound.Instance.mapScreen.targetedPlayer).GetComponent<PlayerSTBehaviour>();
				if (component.isInGame)
				{
					((Behaviour)StartOfRound.Instance.mapScreenPlayerName).enabled = false;
					((Behaviour)StartOfRound.Instance.screenLevelDescription).enabled = true;
					((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = mapScreen.targetedPlayer.playerUsername + " is playing a game";
				}
				else
				{
					((Behaviour)StartOfRound.Instance.mapScreenPlayerName).enabled = true;
					((Behaviour)StartOfRound.Instance.screenLevelDescription).enabled = false;
					((TMP_Text)StartOfRound.Instance.screenLevelDescription).text = "";
				}
			}
		}
	}
	public class PlayerSTManager
	{
		public static void AddPlayerBehaviour(PlayerControllerB player)
		{
			if (player.isPlayerControlled && (Object)(object)((Component)player).GetComponent<PlayerSTBehaviour>() == (Object)null)
			{
				PlayerSTBehaviour playerSTBehaviour = ((Component)player).gameObject.AddComponent<PlayerSTBehaviour>();
				playerSTBehaviour.playerProperties = player;
			}
		}

		public static bool PreventTeleportPlayer(ref PlayerControllerB player)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			PlayerSTBehaviour component = ((Component)player).GetComponent<PlayerSTBehaviour>();
			if ((Object)(object)component != (Object)null && component.isInGame && ((Object)(object)component.tileGame != (Object)null || (Object)(object)component.huntingTape?.assignedEnemy != (Object)null))
			{
				player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3));
				if ((Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					HUDManager.Instance.DisplayTip("Information", "You tried to cheat, the rules were clear", false, false, "LC_Tip1");
				}
				return true;
			}
			return false;
		}

		public static void ResetPlayerGame(ref PlayerSTBehaviour playerBehaviour)
		{
			Tile tileGame = playerBehaviour.tileGame;
			TileSTBehaviour tileSTBehaviour = ((tileGame != null) ? ((Component)tileGame).GetComponent<TileSTBehaviour>() : null);
			TileSTManager.UnlockDoors(ref tileSTBehaviour);
			playerBehaviour.campTime = 0;
			playerBehaviour.isInGame = false;
			playerBehaviour.tileGame = null;
			playerBehaviour.huntingTape = null;
		}
	}
	public class SawTapesNetworkManager : NetworkBehaviour
	{
		public static SawTapesNetworkManager Instance;

		public void Awake()
		{
			Instance = this;
		}

		[ClientRpc]
		public void SetGenerateGameTileClientRpc(bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_0097: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1706180775u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1706180775u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					DungeonPatch.isGenerateTileGame = enable;
				}
			}
		}

		[ClientRpc]
		public void SpawnTapeParticleClientRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_0097: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(540767694u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 540767694u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject grabbableObject = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					TapeSTManager.SpawnTapeParticle(ref grabbableObject);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void TapeSearchServerRpc(int playerId)
		{
			//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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2461051688u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2461051688u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				if (TapeSTManager.tapeSearchCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(TapeSTManager.tapeSearchCoroutine);
				}
				TapeSTManager.tapeSearchCoroutine = ((MonoBehaviour)this).StartCoroutine(TapeSTManager.TapeSearchCoroutine(playerId));
			}
		}

		[ClientRpc]
		public void UnlockDoorsClientRpc(int playerId)
		{
			//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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2904460298u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2904460298u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Tile tileGame = StartOfRound.Instance.allPlayerObjects[playerId].GetComponentInChildren<PlayerSTBehaviour>().tileGame;
					TileSTBehaviour tileSTBehaviour = ((tileGame != null) ? ((Component)tileGame).GetComponent<TileSTBehaviour>() : null);
					TileSTManager.UnlockDoors(ref tileSTBehaviour);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ChangeTapePositionServerRpc(NetworkObjectReference obj, Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00a4: 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_00e5: 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.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3852654402u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3852654402u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ChangeTapePositionClientRpc(obj, position);
				}
			}
		}

		[ClientRpc]
		public void ChangeTapePositionClientRpc(NetworkObjectReference obj, Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2137301244u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2137301244u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject grabbableObject = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					TapeSTManager.ChangeTapePosition(ref grabbableObject, position);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void EnableParticleServerRpc(NetworkObjectReference obj, bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1233568695u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1233568695u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					EnableParticleClientRpc(obj, enable);
				}
			}
		}

		[ClientRpc]
		public void EnableParticleClientRpc(NetworkObjectReference obj, bool enable)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(540426511u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enable, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 540426511u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					TapeSTManager.EnableParticle(componentInChildren, enable);
				}
			}
		}

		[ClientRpc]
		public void AddTileInfosClientRpc(Vector3 tilePos, Vector3[] doorsPos, NetworkObjectReference[] entrancesObj, NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: 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_0095: 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)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4233735192u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref tilePos);
				bool flag = doorsPos != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(doorsPos);
				}
				bool flag2 = entrancesObj != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
				if (flag2)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(entrancesObj, default(ForNetworkSerializable));
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4233735192u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				TileSTManager.AddTileInfos(tilePos, doorsPos, entrancesObj, obj);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void DestroyObjectServerRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3111254174u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3111254174u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DestroyObjectClientRpc(obj);
				}
			}
		}

		[ClientRpc]
		public void DestroyObjectClientRpc(NetworkObjectReference obj)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_0097: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2084577577u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2084577577u, val, (RpcDelivery)0);
				}
				NetworkObject val3 = default(NetworkObject);
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null))
				{
					GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>();
					componentInChildren.DestroyObjectInHand(componentInChildren.playerHeldBy);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void KillPlayerServerRpc(int playerId, Vector3 velocity, bool spawnBody, int causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2527174329u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnBody, default(ForPrimitives));
					BytePacker.WriteValueBitPacked(val2, causeOfDeath);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2527174329u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					KillPlayerClientRpc(playerId, velocity, spawnBody, causeOfDeath);
				}
			}
		}

		[ClientRpc]
		public void KillPlayerClientRpc(int playerId, Vector3 velocity, bool spawnBody, int causeOfDeath)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(998721621u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, playerId);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref velocity);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref spawnBody, default(ForPrimitives));
				BytePacker.WriteValueBitPacked(val2, causeOfDeath);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 998721621u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
				if ((Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					component.KillPlayer(velocity, spawnBody, (CauseOfDeath)causeOfDeath, 0, default(Vector3));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnSawKeyServerRpc(Vector3 position)
		{
			//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_0089: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3499751603u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3499751603u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RoundManagerPatch.SpawnItem(ref SawTapes.sawKeyObj, position);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnPursuerEyeServerRpc(Vector3 position)
		{
			//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_0089: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1100417780u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1100417780u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					RoundManagerPatch.SpawnItem(ref SawTapes.pursuerEyeObj, position);
				}
			}
		}

		[ClientRpc]
		public void PlayDespawnParticleClientRpc(Vector3 position)
		{
			//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_0089: 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_00ce: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3869059331u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3869059331u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					GameObject val3 = Object.Instantiate<GameObject>(SawTapes.despawnParticle, position, Quaternion.identity);
					ParticleSystem component = val3.GetComponent<ParticleSystem>();
					MainModule main = component.main;
					float duration = ((MainModule)(ref main)).duration;
					main = component.main;
					MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
					Object.Destroy((Object)(object)val3, duration + ((MinMaxCurve)(ref startLifetime)).constantMax);
				}
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_SawTapesNetworkManager()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1706180775u, new RpcReceiveHandler(__rpc_handler_1706180775));
			NetworkManager.__rpc_func_table.Add(540767694u, new RpcReceiveHandler(__rpc_handler_540767694));
			NetworkManager.__rpc_func_table.Add(2461051688u, new RpcReceiveHandler(__rpc_handler_2461051688));
			NetworkManager.__rpc_func_table.Add(2904460298u, new RpcReceiveHandler(__rpc_handler_2904460298));
			NetworkManager.__rpc_func_table.Add(3852654402u, new RpcReceiveHandler(__rpc_handler_3852654402));
			NetworkManager.__rpc_func_table.Add(2137301244u, new RpcReceiveHandler(__rpc_handler_2137301244));
			NetworkManager.__rpc_func_table.Add(1233568695u, new RpcReceiveHandler(__rpc_handler_1233568695));
			NetworkManager.__rpc_func_table.Add(540426511u, new RpcReceiveHandler(__rpc_handler_540426511));
			NetworkManager.__rpc_func_table.Add(4233735192u, new RpcReceiveHandler(__rpc_handler_4233735192));
			NetworkManager.__rpc_func_table.Add(3111254174u, new RpcReceiveHandler(__rpc_handler_3111254174));
			NetworkManager.__rpc_func_table.Add(2084577577u, new RpcReceiveHandler(__rpc_handler_2084577577));
			NetworkManager.__rpc_func_table.Add(2527174329u, new RpcReceiveHandler(__rpc_handler_2527174329));
			NetworkManager.__rpc_func_table.Add(998721621u, new RpcReceiveHandler(__rpc_handler_998721621));
			NetworkManager.__rpc_func_table.Add(3499751603u, new RpcReceiveHandler(__rpc_handler_3499751603));
			NetworkManager.__rpc_func_table.Add(1100417780u, new RpcReceiveHandler(__rpc_handler_1100417780));
			NetworkManager.__rpc_func_table.Add(3869059331u, new RpcReceiveHandler(__rpc_handler_3869059331));
		}

		private static void __rpc_handler_1706180775(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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool generateGameTileClientRpc = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref generateGameTileClientRpc, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).SetGenerateGameTileClientRpc(generateGameTileClientRpc);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_540767694(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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).SpawnTapeParticleClientRpc(obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2461051688(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 playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawTapesNetworkManager)(object)target).TapeSearchServerRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2904460298(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 playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).UnlockDoorsClientRpc(playerId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3852654402(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_0051: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawTapesNetworkManager)(object)target).ChangeTapePositionServerRpc(obj, position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2137301244(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_0051: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).ChangeTapePositionClientRpc(obj, position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1233568695(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				bool enable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enable, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawTapesNetworkManager)(object)target).EnableParticleServerRpc(obj, enable);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_540426511(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				bool enable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enable, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).EnableParticleClientRpc(obj, enable);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4233735192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_00be: 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_00d8: 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_00f3: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 tilePos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref tilePos);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				Vector3[] doorsPos = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref doorsPos);
				}
				bool flag2 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
				NetworkObjectReference[] entrancesObj = null;
				if (flag2)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref entrancesObj, default(ForNetworkSerializable));
				}
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).AddTileInfosClientRpc(tilePos, doorsPos, entrancesObj, obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3111254174(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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawTapesNetworkManager)(object)target).DestroyObjectServerRpc(obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2084577577(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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference obj = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).DestroyObjectClientRpc(obj);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2527174329(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 velocity = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity);
				bool spawnBody = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref spawnBody, default(ForPrimitives));
				int causeOfDeath = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SawTapesNetworkManager)(object)target).KillPlayerServerRpc(playerId, velocity, spawnBody, causeOfDeath);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_998721621(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int playerId = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 velocity = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity);
				bool spawnBody = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref spawnBody, default(ForPrimitives));
				int causeOfDeath = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SawTapesNetworkManager)(object)target).KillPlayerClientRpc(playerId, velocity, spawnBody, causeOfDeath);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3499751603(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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)
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__Rp