Decompiled source of MischievousPlushies v0.5.0

MischievousPlushies.dll

Decompiled 2 weeks 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 GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using MischevoiusPlushies;
using MischievousPlushies;
using MischievousPlushies.NetcodePatcher;
using MischievousPlushies.Patches;
using MischievousPlushies.PlushCode;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MischievousPlushies")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d9b6518ea96935ec6b368ca602cd0dca17a8ebe1")]
[assembly: AssemblyProduct("MischievousPlushies")]
[assembly: AssemblyTitle("MischievousPlushies")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal class PlushConfig
{
	public readonly ConfigEntry<bool> logAll;

	public readonly ConfigEntry<int> plushRarity;

	public readonly ConfigEntry<int> plushValueMin;

	public readonly ConfigEntry<int> plushValueMax;

	public PlushConfig(ConfigFile cfg)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: 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
		plushRarity = cfg.Bind<int>("General", "PlushRarity", 20, new ConfigDescription("How common plushies are", (AcceptableValueBase)null, Array.Empty<object>()));
		plushValueMin = cfg.Bind<int>("General", "PlushValueMin", 40, new ConfigDescription("Minimum plush scrap value", (AcceptableValueBase)null, Array.Empty<object>()));
		plushValueMax = cfg.Bind<int>("General", "PlushValueMax", 110, new ConfigDescription("Maximum plush scrap value", (AcceptableValueBase)null, Array.Empty<object>()));
		logAll = cfg.Bind<bool>("Debug", "logAll", false, new ConfigDescription("Send more logs", (AcceptableValueBase)null, Array.Empty<object>()));
		cfg.SaveOnConfigSet = false;
		ClearOrphanedEntries(cfg);
		cfg.Save();
		cfg.SaveOnConfigSet = true;
	}

	private static void ClearOrphanedEntries(ConfigFile cfg)
	{
		PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
		Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg);
		dictionary.Clear();
	}
}
namespace MischevoiusPlushies
{
	public class NetworkerPatch
	{
		private static GameObject networkerPrefab = global::MischievousPlushies.MischievousPlushies.networkerPrefab;

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "Start")]
		public static void AddPrefab(ref GameNetworkManager __instance)
		{
			networkerPrefab.AddComponent<PlushNetworker>();
			NetworkManager.Singleton.AddNetworkPrefab(networkerPrefab);
			global::MischievousPlushies.MischievousPlushies.Logger.LogInfo((object)"xˬx PlushNet launchning. xˬx");
			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);
					}
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(StartOfRound), "Awake")]
		private static void SpawnNetworkHandler()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)
			{
				GameObject val = Object.Instantiate<GameObject>(networkerPrefab, Vector3.zero, Quaternion.identity);
				val.GetComponent<NetworkObject>().Spawn(false);
			}
		}
	}
}
namespace MischievousPlushies
{
	[BepInPlugin("Kuodos.MischievousPlushies", "MischievousPlushies", "0.4.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MischievousPlushies : BaseUnityPlugin
	{
		public const string GUID = "Kuodos.MischievousPlushies";

		public const string NAME = "MischievousPlushies";

		public const string VERSION = "0.4.0";

		private static AssetBundle plushieAssets { get; set; }

		public static GameObject networkerPrefab { get; set; }

		public static MischievousPlushies Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony harmony { get; set; }

		internal static PlushConfig PlushConfig { get; private set; }

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			PlushConfig = new PlushConfig(((BaseUnityPlugin)this).Config);
			harmony = new Harmony("Kuodos.MischievousPlushies");
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			plushieAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "plushiesbundle"));
			if ((Object)(object)plushieAssets == (Object)null)
			{
				Logger.LogError((object)"Failed to load custom assets.");
				return;
			}
			int value = PlushConfig.plushRarity.Value;
			Item[] array = plushieAssets.LoadAllAssets<Item>();
			Item[] array2 = array;
			foreach (Item val in array2)
			{
				val.minValue = (int)Math.Round((float)PlushConfig.plushValueMin.Value * 2.5f);
				val.maxValue = (int)Math.Round((float)PlushConfig.plushValueMax.Value * 2.5f);
				NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
				Items.RegisterScrap(val, value, (LevelTypes)(-1));
			}
			PlushCosplayer.PlushieAllowList = array.ToList();
			networkerPrefab = plushieAssets.LoadAsset<GameObject>("PlushNetworker");
			Logger.LogInfo((object)harmony.Id);
			Harmony.CreateAndPatchAll(typeof(NetworkerPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(ReportDeathsPatch), (string)null);
			Harmony.CreateAndPatchAll(typeof(EnemySpawnReportPatch), (string)null);
			Logger.LogInfo((object)"MischievousPlushies is loaded! xˬx ");
		}

		public static void LogInfo(string text)
		{
			if (PlushConfig.logAll.Value)
			{
				Logger.LogInfo((object)text);
			}
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			harmony.UnpatchSelf();
			Logger.LogDebug((object)"Finished unpatching!");
		}
	}
	public class PlushNetworker : NetworkBehaviour
	{
		public static PlushNetworker Instance { get; private set; }

		public static List<ulong>? AlivePlayersNetworkObjects { get; private set; }

		private static bool isHost => ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;

		public override void OnNetworkSpawn()
		{
			Instance = this;
			MischievousPlushies.LogInfo("xˬx PlushNet operational. Launching nuclear missiles. xˬx");
			AlivePlayersNetworkObjects = new List<ulong>();
			UpdateAlivePlayerListServerRPC();
			if (((NetworkBehaviour)this).IsHost)
			{
			}
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		public static void OnEnemySpawn()
		{
			if (isHost)
			{
				Instance.UpdateBeeHivesClientRPC();
			}
		}

		public override void OnDestroy()
		{
			((NetworkBehaviour)this).OnDestroy();
		}

		[ServerRpc(RequireOwnership = false)]
		public void DiscardHeldItemMinifierServerRPC(ulong source)
		{
			//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 != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3981304423u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, source);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3981304423u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					DiscardHeldItemMinifierClientRPC(source);
				}
			}
		}

		[ClientRpc]
		public void DiscardHeldItemMinifierClientRPC(ulong source)
		{
			//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(2167658126u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, source);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2167658126u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[source];
					((Component)val3).GetComponentInChildren<MinifyingObjectSurface>().DiscardHeldItem();
				}
			}
		}

		[ClientRpc]
		public void SetAutoObjectParentSyncClientRPC(ulong source, ulong grabbableObject, bool state)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_007e: 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_00b1: 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(2217401766u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, source);
					BytePacker.WriteValueBitPacked(val2, grabbableObject);
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref state, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2217401766u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					MinifyingObjectSurface componentInChildren = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[source]).GetComponentInChildren<MinifyingObjectSurface>();
					GrabbableObject component = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[grabbableObject]).GetComponent<GrabbableObject>();
					componentInChildren.prevParentSync = ((NetworkBehaviour)component).NetworkObject.AutoObjectParentSync;
					((NetworkBehaviour)component).NetworkObject.AutoObjectParentSync = state;
				}
			}
		}

		[ClientRpc]
		public void AnimatorSyncBoolClientRPC(ulong source, string var, bool val)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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_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_00c8: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val2 = default(ClientRpcParams);
				FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendClientRpc(2123381564u, val2, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val3, source);
				bool flag = var != null;
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val3)).WriteValueSafe(var, false);
				}
				((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref val, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val3, 2123381564u, val2, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				Animator componentInChildren = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[source]).GetComponentInChildren<Animator>();
				componentInChildren.SetBool(var, val);
			}
		}

		[ClientRpc]
		public void AnimatorSyncPlayClientRPC(ulong source, string var)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_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_00c7: 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(2860675440u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, source);
				bool flag = var != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(var, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2860675440u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				Animator componentInChildren = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[source]).GetComponentInChildren<Animator>();
				componentInChildren.Play(var);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void PlaceObjectMinifierServerRPC(ulong source, ulong player, ulong grabbableObject, bool sendToOwner)
		{
			//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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_00aa: 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_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: 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(1599033910u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, source);
				BytePacker.WriteValueBitPacked(val2, player);
				BytePacker.WriteValueBitPacked(val2, grabbableObject);
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref sendToOwner, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1599033910u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			MischievousPlushies.LogInfo("PlaceObjectMinifierServerRPC to " + sendToOwner);
			MinifyingObjectSurface componentInChildren = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[source]).GetComponentInChildren<MinifyingObjectSurface>();
			PlayerControllerB component = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[player]).GetComponent<PlayerControllerB>();
			GrabbableObject component2 = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[grabbableObject]).GetComponent<GrabbableObject>();
			ClientRpcParams val3;
			if (sendToOwner)
			{
				SetAutoObjectParentSyncClientRPC(source, grabbableObject, state: false);
				val3 = default(ClientRpcParams);
				val3.Send = new ClientRpcSendParams
				{
					TargetClientIds = new ulong[1] { component.actualClientId }
				};
				ClientRpcParams clientRpcParams = val3;
				MischievousPlushies.LogInfo("Sent to " + component.actualClientId);
				PlaceObjectMinifierClientRPC(source, player, grabbableObject, clientRpcParams);
				return;
			}
			List<ulong> list = new List<ulong>();
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val4 in allPlayerScripts)
			{
				MischievousPlushies.LogInfo("added " + val4.actualClientId);
				list.Add(val4.actualClientId);
			}
			list = list.Distinct().ToList();
			list.Remove(component.actualClientId);
			val3 = default(ClientRpcParams);
			val3.Send = new ClientRpcSendParams
			{
				TargetClientIds = list
			};
			ClientRpcParams clientRpcParams2 = val3;
			foreach (ulong item in list)
			{
				MischievousPlushies.LogInfo("Sent to " + item);
			}
			PlaceObjectMinifierClientRPC(source, player, grabbableObject, clientRpcParams2);
		}

		[ClientRpc]
		public void PlaceObjectMinifierClientRPC(ulong source, ulong player, ulong grabbableObject, ClientRpcParams clientRpcParams)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2801819596u, clientRpcParams, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val, source);
					BytePacker.WriteValueBitPacked(val, player);
					BytePacker.WriteValueBitPacked(val, grabbableObject);
					((NetworkBehaviour)this).__endSendClientRpc(ref val, 2801819596u, clientRpcParams, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					MinifyingObjectSurface componentInChildren = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[source]).GetComponentInChildren<MinifyingObjectSurface>();
					PlayerControllerB component = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[player]).GetComponent<PlayerControllerB>();
					GrabbableObject component2 = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[grabbableObject]).GetComponent<GrabbableObject>();
					((MonoBehaviour)this).StartCoroutine(componentInChildren.PlaceObject(component, component2));
				}
			}
		}

		[ClientRpc]
		public void UpdateBeeHivesClientRPC()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			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(4217903388u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4217903388u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					PlushBeeMagnet.UpdateBeeHives();
				}
			}
		}

		[ClientRpc]
		public void SetTargetClientRPC(ulong agent, Vector3 target)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3873736186u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, agent);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref target);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3873736186u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[agent];
					((Component)val3).GetComponent<GrabbableNavMeshAgent>().SetTargetPosition(target);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UpdateAlivePlayerListServerRPC()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			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(1676187354u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1676187354u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || AlivePlayersNetworkObjects == null)
			{
				return;
			}
			AlivePlayersNetworkObjects.Clear();
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val3 in array)
			{
				if (!val3.isPlayerDead && val3.isPlayerControlled)
				{
					AlivePlayersNetworkObjects.Add(((Component)val3).GetComponent<NetworkObject>().NetworkObjectId);
				}
			}
			LifeboundExploderCheckOwners();
		}

		[ServerRpc(RequireOwnership = false)]
		public void RequestCosplayerListServerRPC(ulong clientId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: 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(2647887876u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, clientId);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2647887876u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			ClientRpcParams val3 = default(ClientRpcParams);
			val3.Send = new ClientRpcSendParams
			{
				TargetClientIds = new ulong[1] { clientId }
			};
			ClientRpcParams clientRpcParams = val3;
			PlushCosplayer.PruneConvertedList();
			List<GrabbableObject> convertedPlushies = PlushCosplayer.ConvertedPlushies;
			List<ulong> list = new List<ulong>();
			foreach (GrabbableObject item in convertedPlushies)
			{
				list.Add(((NetworkBehaviour)item).NetworkObjectId);
			}
			SendCosplayerListClientRPC(list.ToArray(), clientRpcParams);
		}

		[ClientRpc]
		public void SendCosplayerListClientRPC(ulong[] CosplayerList, ClientRpcParams clientRpcParams)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3160392204u, clientRpcParams, (RpcDelivery)0);
				bool flag = CosplayerList != null;
				((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(CosplayerList, default(ForPrimitives));
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val, 3160392204u, clientRpcParams, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsOwner)
			{
				PlushCosplayer.SetConvertedPlushies(CosplayerList);
				MischievousPlushies.LogInfo("xˬx PlushNet: Sent convertees list. xˬx");
			}
		}

		[ClientRpc]
		public void CosplayClientRPC(ulong source, ulong target)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: 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(2520982718u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, source);
					BytePacker.WriteValueBitPacked(val2, target);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2520982718u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[source];
					NetworkObject val4 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[target];
					GrabbableObject component = ((Component)val4).GetComponent<GrabbableObject>();
					((Component)val3).GetComponent<PlushCosplayer>().PlushConvert(component);
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetLifeboundExploderServerRPC(ulong sourceId, ulong targetId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: 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(167281621u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, sourceId);
					BytePacker.WriteValueBitPacked(val2, targetId);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 167281621u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SetLifeboundExploderClientRPC(sourceId, targetId);
				}
			}
		}

		[ClientRpc]
		public void SetLifeboundExploderClientRPC(ulong sourceId, ulong targetId)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0096: 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(409653895u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, sourceId);
					BytePacker.WriteValueBitPacked(val2, targetId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 409653895u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[sourceId];
					NetworkObject val4 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[targetId];
					((Component)val3).GetComponent<PlushLifeboundExploder>().SetOwner(((Component)val4).GetComponent<PlayerControllerB>());
				}
			}
		}

		[ClientRpc]
		public void ExplodeLifeboundExploderClientRPC(ulong sourceId)
		{
			//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(3291351358u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, sourceId);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3291351358u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[sourceId];
					((Component)val3).GetComponent<PlushLifeboundExploder>().Explode();
				}
			}
		}

		[ClientRpc]
		public void TeleportPlayerClientRPC(ulong playerId, Vector3 pos)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1754041960u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, playerId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1754041960u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[playerId];
					((Component)val3).GetComponent<PlayerControllerB>().TeleportPlayer(pos, false, 0f, false, true);
				}
			}
		}

		[ClientRpc]
		public void TeleportItemClientRPC(ulong itemId, Vector3 pos)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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)
			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(653386491u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, itemId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 653386491u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					GrabbableObject component = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[itemId]).GetComponent<GrabbableObject>();
					component.targetFloorPosition = pos;
				}
			}
		}

		[ClientRpc]
		public void TeleportNavMeshItemClientRPC(ulong itemId, Vector3 pos)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1489410406u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, itemId);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1489410406u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					GrabbableNavMeshAgent component = ((Component)NetworkManager.Singleton.SpawnManager.SpawnedObjects[itemId]).GetComponent<GrabbableNavMeshAgent>();
					component.Teleport(pos);
				}
			}
		}

		[ClientRpc]
		public void StopPathingClientRPC(ulong agent)
		{
			//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(459157174u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, agent);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 459157174u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					NetworkObject val3 = NetworkManager.Singleton.SpawnManager.SpawnedObjects[agent];
					((Component)val3).GetComponent<GrabbableNavMeshAgent>().StopPathing();
				}
			}
		}

		public void LifeboundExploderCheckOwners()
		{
			PlushLifeboundExploder[] array = Object.FindObjectsByType<PlushLifeboundExploder>((FindObjectsSortMode)0);
			foreach (PlushLifeboundExploder plushLifeboundExploder in array)
			{
				if (plushLifeboundExploder.isOwnerDead())
				{
					ExplodeLifeboundExploderClientRPC(((Component)plushLifeboundExploder).GetComponent<NetworkObject>().NetworkObjectId);
				}
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PlushNetworker()
		{
			//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
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3981304423u, new RpcReceiveHandler(__rpc_handler_3981304423));
			NetworkManager.__rpc_func_table.Add(2167658126u, new RpcReceiveHandler(__rpc_handler_2167658126));
			NetworkManager.__rpc_func_table.Add(2217401766u, new RpcReceiveHandler(__rpc_handler_2217401766));
			NetworkManager.__rpc_func_table.Add(2123381564u, new RpcReceiveHandler(__rpc_handler_2123381564));
			NetworkManager.__rpc_func_table.Add(2860675440u, new RpcReceiveHandler(__rpc_handler_2860675440));
			NetworkManager.__rpc_func_table.Add(1599033910u, new RpcReceiveHandler(__rpc_handler_1599033910));
			NetworkManager.__rpc_func_table.Add(2801819596u, new RpcReceiveHandler(__rpc_handler_2801819596));
			NetworkManager.__rpc_func_table.Add(4217903388u, new RpcReceiveHandler(__rpc_handler_4217903388));
			NetworkManager.__rpc_func_table.Add(3873736186u, new RpcReceiveHandler(__rpc_handler_3873736186));
			NetworkManager.__rpc_func_table.Add(1676187354u, new RpcReceiveHandler(__rpc_handler_1676187354));
			NetworkManager.__rpc_func_table.Add(2647887876u, new RpcReceiveHandler(__rpc_handler_2647887876));
			NetworkManager.__rpc_func_table.Add(3160392204u, new RpcReceiveHandler(__rpc_handler_3160392204));
			NetworkManager.__rpc_func_table.Add(2520982718u, new RpcReceiveHandler(__rpc_handler_2520982718));
			NetworkManager.__rpc_func_table.Add(167281621u, new RpcReceiveHandler(__rpc_handler_167281621));
			NetworkManager.__rpc_func_table.Add(409653895u, new RpcReceiveHandler(__rpc_handler_409653895));
			NetworkManager.__rpc_func_table.Add(3291351358u, new RpcReceiveHandler(__rpc_handler_3291351358));
			NetworkManager.__rpc_func_table.Add(1754041960u, new RpcReceiveHandler(__rpc_handler_1754041960));
			NetworkManager.__rpc_func_table.Add(653386491u, new RpcReceiveHandler(__rpc_handler_653386491));
			NetworkManager.__rpc_func_table.Add(1489410406u, new RpcReceiveHandler(__rpc_handler_1489410406));
			NetworkManager.__rpc_func_table.Add(459157174u, new RpcReceiveHandler(__rpc_handler_459157174));
		}

		private static void __rpc_handler_3981304423(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)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PlushNetworker)(object)target).DiscardHeldItemMinifierServerRPC(source);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2167658126(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)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).DiscardHeldItemMinifierClientRPC(source);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2217401766(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				ulong grabbableObject = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref grabbableObject);
				bool state = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref state, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).SetAutoObjectParentSyncClientRPC(source, grabbableObject, state);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2123381564(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//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_0074: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string var = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref var, false);
				}
				bool val = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref val, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).AnimatorSyncBoolClientRPC(source, var, val);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2860675440(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string var = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref var, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).AnimatorSyncPlayClientRPC(source, var);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1599033910(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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_006b: 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)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				ulong player = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref player);
				ulong grabbableObject = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref grabbableObject);
				bool sendToOwner = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref sendToOwner, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PlushNetworker)(object)target).PlaceObjectMinifierServerRPC(source, player, grabbableObject, sendToOwner);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2801819596(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				ulong player = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref player);
				ulong grabbableObject = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref grabbableObject);
				ClientRpcParams client = rpcParams.Client;
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).PlaceObjectMinifierClientRPC(source, player, grabbableObject, client);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_4217903388(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).UpdateBeeHivesClientRPC();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3873736186(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong agent = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref agent);
				Vector3 target2 = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref target2);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).SetTargetClientRPC(agent, target2);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1676187354(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PlushNetworker)(object)target).UpdateAlivePlayerListServerRPC();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2647887876(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)
			{
				ulong clientId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PlushNetworker)(object)target).RequestCosplayerListServerRPC(clientId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3160392204(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_0068: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: 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 flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				ulong[] cosplayerList = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe<ulong>(ref cosplayerList, default(ForPrimitives));
				}
				ClientRpcParams client = rpcParams.Client;
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).SendCosplayerListClientRPC(cosplayerList, client);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2520982718(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong source = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref source);
				ulong target2 = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref target2);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).CosplayClientRPC(source, target2);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_167281621(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong sourceId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref sourceId);
				ulong targetId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref targetId);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PlushNetworker)(object)target).SetLifeboundExploderServerRPC(sourceId, targetId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_409653895(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong sourceId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref sourceId);
				ulong targetId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref targetId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).SetLifeboundExploderClientRPC(sourceId, targetId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3291351358(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)
			{
				ulong sourceId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref sourceId);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).ExplodeLifeboundExploderClientRPC(sourceId);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1754041960(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong playerId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
				Vector3 pos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref pos);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).TeleportPlayerClientRPC(playerId, pos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_653386491(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong itemId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref itemId);
				Vector3 pos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref pos);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).TeleportItemClientRPC(itemId, pos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1489410406(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				ulong itemId = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref itemId);
				Vector3 pos = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref pos);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).TeleportNavMeshItemClientRPC(itemId, pos);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_459157174(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)
			{
				ulong agent = default(ulong);
				ByteUnpacker.ReadValueBitPacked(reader, ref agent);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PlushNetworker)(object)target).StopPathingClientRPC(agent);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "PlushNetworker";
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "MischievousPlushies";

		public const string PLUGIN_NAME = "MischievousPlushies";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace MischievousPlushies.PlushCode
{
	public class GrabbableNavMeshAgent : MonoBehaviour
	{
		private GrabbableObject obj;

		private NavMeshAgent agent;

		private Transform? targetTransform;

		private bool stopPathing = false;

		public void Init(float speed, float baseOffset = 0.2f, bool updateRotation = false, float stoppingDistance = 0f)
		{
			obj = ((Component)this).GetComponent<GrabbableObject>();
			if ((Object)(object)((Component)obj).GetComponent<NavMeshAgent>() != (Object)null)
			{
				agent = ((Component)obj).GetComponent<NavMeshAgent>();
			}
			else
			{
				agent = ((Component)obj).gameObject.AddComponent<NavMeshAgent>();
			}
			agent.areaMask = -1;
			agent.speed = speed;
			agent.updatePosition = false;
			agent.updateRotation = updateRotation;
			agent.baseOffset = baseOffset;
			agent.height = 2f;
			agent.obstacleAvoidanceType = (ObstacleAvoidanceType)2;
			agent.stoppingDistance = stoppingDistance;
			agent.autoBraking = false;
			agent.angularSpeed = 360f;
			agent.acceleration = 100f;
			agent.autoTraverseOffMeshLink = true;
		}

		public void SetTargetPosition(Vector3 target)
		{
			//IL_002b: 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_0040: 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)
			if (((Behaviour)agent).enabled)
			{
				agent.Warp(RoundManager.Instance.GetNavMeshPosition(((Component)obj).transform.position, RoundManager.Instance.navHit, 2f, -1));
				if (agent.SetDestination(target))
				{
					stopPathing = false;
				}
			}
		}

		public void SetTarget(Transform? targetTransform)
		{
			this.targetTransform = targetTransform;
			if ((Object)(object)targetTransform == (Object)null)
			{
				StopPathing();
			}
			else
			{
				GetNewPosition();
			}
		}

		public void Teleport(Vector3 target)
		{
			//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)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = target;
			MischievousPlushies.LogInfo("Teleporting object to " + ((object)(Vector3)(ref val)).ToString());
			((Component)this).transform.position = target;
			StopPathing();
			Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(target, RoundManager.Instance.navHit, 2f, -1);
			agent.Warp(navMeshPosition);
			SetObjectPosition();
			this.obj.isInFactory = agent.nextPosition.y < -80f;
			GrabbableObject obj = this.obj;
			Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds;
			obj.isInShipRoom = ((Bounds)(ref bounds)).Contains(navMeshPosition);
			this.obj.isInElevator = this.obj.isInShipRoom;
			if (this.obj.isInShipRoom)
			{
				((Component)this.obj).transform.SetParent(StartOfRound.Instance.elevatorTransform);
			}
		}

		private void GetNewPosition()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)targetTransform == (Object)null))
			{
				SetTargetPosition(((Component)targetTransform).transform.position);
			}
		}

		public void StopPathing()
		{
			stopPathing = true;
			agent.ResetPath();
		}

		private void LateUpdate()
		{
			if (!stopPathing)
			{
				if (obj.isHeld)
				{
					StopPathing();
				}
				SetObjectPosition();
			}
		}

		private void SetObjectPosition()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((Component)obj).transform.parent != (Object)null)
			{
				obj.targetFloorPosition = ((Component)obj).transform.parent.InverseTransformPoint(agent.nextPosition);
			}
			else
			{
				obj.targetFloorPosition = agent.nextPosition;
			}
		}
	}
	public class MinifyingObjectSurface : NetworkBehaviour
	{
		public NetworkObject parentTo;

		public Collider placeableBounds;

		public InteractTrigger triggerScript;

		private GrabbableObject? objectHeld;

		private static float sizeMultiplier = 0.6f;

		private static bool matchRotation = true;

		public bool prevParentSync = false;

		public bool prevGrabbableToEnemies = false;

		public UnityEvent<PlayerControllerB> onItemStored;

		public UnityEvent onItemDiscarded;

		private static bool isInActivePhase => !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded && !StartOfRound.Instance.shipIsLeaving;

		private static bool isHost => ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;

		private void OnEnable()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			onItemDiscarded = new UnityEvent();
			onItemStored = new UnityEvent<PlayerControllerB>();
		}

		private void OnDisable()
		{
			((UnityEventBase)onItemDiscarded).RemoveAllListeners();
			((UnityEventBase)onItemStored).RemoveAllListeners();
		}

		private void Update()
		{
			if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null)
			{
				triggerScript.interactable = GameNetworkManager.Instance.localPlayerController.isHoldingObject && (Object)(object)objectHeld == (Object)null && isInActivePhase && !((Component)parentTo).GetComponent<GrabbableObject>().isHeld;
				placeableBounds.enabled = triggerScript.interactable;
			}
			if ((Object)(object)objectHeld != (Object)null && isHost && objectHeld.isHeld)
			{
				MischievousPlushies.LogInfo("Obj held by " + ((Object)objectHeld.playerHeldBy).name + ", discarding");
				DiscardHeldItemSendRPC();
			}
		}

		public void DiscardHeldItemSendRPC()
		{
			PlushNetworker.Instance.DiscardHeldItemMinifierServerRPC(parentTo.NetworkObjectId);
		}

		public void DiscardHeldItem()
		{
			//IL_0077: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)objectHeld == (Object)null))
			{
				objectHeld.grabbableToEnemies = prevGrabbableToEnemies;
				MischievousPlushies.LogInfo("Obj discarded from: " + (object)((Component)objectHeld).transform.parent);
				((Component)objectHeld).transform.SetParent((Transform)null, true);
				objectHeld.isInFactory = ((Component)objectHeld).transform.position.y < -80f;
				GrabbableObject? obj = objectHeld;
				Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds;
				obj.isInShipRoom = ((Bounds)(ref bounds)).Contains(((Component)objectHeld).transform.position);
				objectHeld.isInElevator = objectHeld.isInShipRoom;
				if (objectHeld.isInShipRoom)
				{
					((Component)objectHeld).transform.SetParent(StartOfRound.Instance.elevatorTransform);
					objectHeld.targetFloorPosition = ((Component)objectHeld).transform.parent.InverseTransformPoint(((Component)objectHeld).transform.position);
					MischievousPlushies.LogInfo("!!!!" + ((Object)objectHeld).name + " parent:" + ((Object)((Component)objectHeld).transform.parent).name);
				}
				if (!objectHeld.isHeld)
				{
					objectHeld.targetFloorPosition = ((Component)this).transform.position;
					objectHeld.startFallingPosition = objectHeld.targetFloorPosition + Vector3.up;
					objectHeld.FallToGround(false);
					objectHeld.PlayDropSFX();
				}
				onItemDiscarded.Invoke();
				((Component)objectHeld).transform.localScale = objectHeld.originalScale;
				((NetworkBehaviour)objectHeld).NetworkObject.AutoObjectParentSync = prevParentSync;
				objectHeld = null;
			}
		}

		public void PlaceObjectSendRPC(PlayerControllerB playerWhoTriggered)
		{
			if (playerWhoTriggered.isHoldingObject && !playerWhoTriggered.isGrabbingObjectAnimation && (Object)(object)playerWhoTriggered.currentlyHeldObjectServer != (Object)null)
			{
				PlushNetworker.Instance.PlaceObjectMinifierServerRPC(parentTo.NetworkObjectId, ((NetworkBehaviour)playerWhoTriggered).NetworkObjectId, ((NetworkBehaviour)playerWhoTriggered.currentlyHeldObjectServer).NetworkObjectId, sendToOwner: true);
			}
		}

		public IEnumerator PlaceObject(PlayerControllerB playerWhoTriggered, GrabbableObject obj)
		{
			obj.isHeld = false;
			objectHeld = obj;
			prevGrabbableToEnemies = obj.grabbableToEnemies;
			obj.grabbableToEnemies = false;
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)playerWhoTriggered)
			{
				playerWhoTriggered.DiscardHeldObject(true, parentTo, Vector3.zero, true);
				yield return null;
				PlushNetworker.Instance.PlaceObjectMinifierServerRPC(parentTo.NetworkObjectId, ((NetworkBehaviour)playerWhoTriggered).NetworkObjectId, ((NetworkBehaviour)obj).NetworkObjectId, sendToOwner: false);
			}
			((Component)obj).transform.SetParent(((Component)this).transform, false);
			obj.targetFloorPosition = ((obj.itemProperties.verticalOffset > 0.1f) ? (Vector3.up * (obj.itemProperties.verticalOffset - 0.1f)) : Vector3.zero);
			((Component)obj).transform.localScale = obj.originalScale * sizeMultiplier;
			if (matchRotation)
			{
				Vector3 matchedRot = obj.itemProperties.restingRotation;
				matchedRot.y = obj.itemProperties.floorYOffset;
				if (((Object)obj).name.ToLower().Contains("flashlight"))
				{
					matchedRot.y = 90f;
				}
				if (((Object)obj).name.ToLower().Contains("plush"))
				{
					matchedRot.y -= 90f;
				}
				((Component)objectHeld).transform.localRotation = Quaternion.Euler(matchedRot);
			}
			MischievousPlushies.LogInfo(Time.time + " " + (isHost ? "host" : "client") + "Obj placed:" + ((Object)((Component)obj).transform.parent).name + " sync" + ((NetworkBehaviour)obj).NetworkObject.AutoObjectParentSync + " " + ((Object)obj).name);
			onItemStored.Invoke(playerWhoTriggered);
		}

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

		protected internal override string __getTypeName()
		{
			return "MinifyingObjectSurface";
		}
	}
	public class PlushAFKTeleporter : MonoBehaviour
	{
		private static bool isActivePlayerOnShip = false;

		private float checkAFK_Cur = 60f;

		private static float checkAFK_Timer = 30f;

		private static bool teleporting = false;

		private static bool setup = false;

		private GrabbableObject plushObj { get; set; } = null;


		private static bool isHost => ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;

		private static bool isInActivePhase => !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded && !StartOfRound.Instance.shipIsLeaving;

		private static ShipLights shipLights { get; set; } = null;


		private static InteractTrigger lightSwitch { get; set; } = null;


		private static PlayerControllerB[] Players { get; set; } = null;


		private static Dictionary<PlayerControllerB, Vector3> PlayerRots { get; set; } = null;


		private static List<PlayerControllerB> AfkPlayers { get; set; } = null;


		private void Awake()
		{
			plushObj = ((Component)this).GetComponent<GrabbableObject>();
			if (isHost && !setup)
			{
				Init();
			}
		}

		private void Init()
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			setup = true;
			shipLights = Object.FindFirstObjectByType<ShipLights>();
			lightSwitch = GameObject.Find("LightSwitchContainer").GetComponentInChildren<InteractTrigger>();
			AfkPlayers = new List<PlayerControllerB>();
			PlayerRots = new Dictionary<PlayerControllerB, Vector3>();
			Players = StartOfRound.Instance.allPlayerScripts;
			PlayerControllerB[] players = Players;
			foreach (PlayerControllerB key in players)
			{
				PlayerRots.Add(key, Vector3.zero);
			}
			MischievousPlushies.LogInfo("Found " + PlayerRots.Keys.Count() + " players");
		}

		private void Update()
		{
			if (isHost && plushObj.isInShipRoom)
			{
				checkAFK_Cur -= Time.deltaTime;
				if (checkAFK_Cur < 0f)
				{
					checkAFK_Cur = checkAFK_Timer;
					ScanAFK();
				}
			}
		}

		private static void ScanAFK()
		{
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			isActivePlayerOnShip = false;
			GrabbableObject val = null;
			if (!isInActivePhase || teleporting)
			{
				return;
			}
			PlushAFKTeleporter[] array = Object.FindObjectsByType<PlushAFKTeleporter>((FindObjectsSortMode)0);
			foreach (PlushAFKTeleporter plushAFKTeleporter in array)
			{
				if (plushAFKTeleporter.plushObj.isInShipRoom && !plushAFKTeleporter.plushObj.isHeld)
				{
					val = plushAFKTeleporter.plushObj;
					break;
				}
			}
			if (!((Object)(object)val != (Object)null))
			{
				return;
			}
			MischievousPlushies.LogInfo("Looking for AFK players...");
			PlayerControllerB[] players = Players;
			foreach (PlayerControllerB val2 in players)
			{
				if (isPlayerAFK(val2))
				{
					if (AfkPlayers.Contains(val2))
					{
						if (!isActivePlayerOnShip)
						{
							MischievousPlushies.LogInfo("xˬx target locked xˬx");
							((Component)val).GetComponent<PlushAFKTeleporter>().StartTeleportSequence(val2);
						}
						AfkPlayers.Clear();
					}
					else
					{
						AfkPlayers.Add(val2);
					}
				}
				else if (AfkPlayers.Contains(val2))
				{
					AfkPlayers.Remove(val2);
				}
				Dictionary<PlayerControllerB, Vector3> playerRots = PlayerRots;
				Quaternion rotation = ((Component)val2).transform.rotation;
				playerRots[val2] = ((Quaternion)(ref rotation)).eulerAngles;
			}
		}

		private static bool isPlayerAFK(PlayerControllerB player)
		{
			//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_0046: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if (player.isPlayerDead)
			{
				return false;
			}
			if (player.inTerminalMenu)
			{
				return false;
			}
			if (player.isInHangarShipRoom)
			{
				Vector3 val = PlayerRots[player];
				Quaternion rotation = ((Component)player).transform.rotation;
				Vector3 val2 = val - ((Quaternion)(ref rotation)).eulerAngles;
				float magnitude = ((Vector3)(ref val2)).magnitude;
				if (player.timeSincePlayerMoving > checkAFK_Timer && magnitude < 0.5f)
				{
					MischievousPlushies.LogInfo(((Object)player).name + " is AFK! ");
					return true;
				}
				isActivePlayerOnShip = true;
			}
			return false;
		}

		public void StartTeleportSequence(PlayerControllerB player)
		{
			teleporting = true;
			((MonoBehaviour)this).StartCoroutine(TeleportPlayerSequence(player));
		}

		private IEnumerator TeleportPlayerSequence(PlayerControllerB player)
		{
			ShipTeleporter teleporter = null;
			ShipTeleporter[] array = Object.FindObjectsByType<ShipTeleporter>((FindObjectsSortMode)0);
			foreach (ShipTeleporter tp in array)
			{
				if (tp.isInverseTeleporter && tp.CanUseInverseTeleporter())
				{
					teleporter = tp;
				}
			}
			if ((Object)(object)teleporter != (Object)null)
			{
				if (shipLights.areLightsOn)
				{
					lightSwitch.Interact(((Component)player).transform);
				}
				yield return (object)new WaitForSeconds(15f);
				if (!isPlayerAFK(player))
				{
					teleporting = false;
					yield break;
				}
				MischievousPlushies.LogInfo("xˬx teleporting xˬx");
				Vector3 buttonPos = ((Component)teleporter).transform.GetChild(1).GetChild(0).GetChild(0)
					.position - ((Component)this).transform.parent.position + Vector3.up * 0.05f;
				PlushNetworker.Instance.TeleportItemClientRPC(((NetworkBehaviour)plushObj).NetworkObjectId, buttonPos);
				PlushNetworker.Instance.TeleportPlayerClientRPC(((NetworkBehaviour)player).NetworkObjectId, teleporter.teleporterPosition.position);
				teleporter.PressTeleportButtonServerRpc();
				teleporting = false;
			}
			else
			{
				teleporting = false;
			}
		}
	}
	public class PlushBeeMagnet : MonoBehaviour
	{
		private static Random random = new Random();

		private static List<GrabbableObject> Hives = new List<GrabbableObject>();

		private float beeMagnetTimer = 10f;

		private static float beeMagnetTimerMax = 10f;

		private static float beeMagnetStopRadius = 1f;

		private static float beeMagnetShipStopRadius = 3f;

		private static float beeMagnetSpeed = 0.5f;

		private static Vector3 shipCenter;

		private PlushGrabbableObject plushObj { get; set; } = null;


		private static bool isHost => ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;

		private static bool isInActivePhase => !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded && !StartOfRound.Instance.shipIsLeaving;

		private void Awake()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			beeMagnetTimer += random.Next(0, 10);
			plushObj = ((Component)this).GetComponent<PlushGrabbableObject>();
			RoundManager instance = RoundManager.Instance;
			Bounds bounds = StartOfRound.Instance.shipBounds.bounds;
			shipCenter = instance.GetNavMeshPosition(((Bounds)(ref bounds)).center, RoundManager.Instance.navHit, 1.75f, -1);
			if (isHost)
			{
				PlushNetworker.Instance.UpdateBeeHivesClientRPC();
			}
		}

		private void OnEnable()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			if (isHost)
			{
				plushObj.onDiscardEvent.AddListener(new UnityAction(AttractBees));
			}
		}

		private void Update()
		{
			if (!isHost || !isInActivePhase || ((GrabbableObject)plushObj).isInFactory)
			{
				return;
			}
			beeMagnetTimer -= Time.deltaTime;
			if (((GrabbableObject)plushObj).isHeld)
			{
				beeMagnetTimer -= Time.deltaTime * 7f;
			}
			if (beeMagnetTimer < 0f)
			{
				beeMagnetTimer = beeMagnetTimerMax;
				if (Object.op_Implicit((Object)(object)plushObj))
				{
					AttractBees();
				}
			}
		}

		public static void UpdateBeeHives()
		{
			MischievousPlushies.LogInfo("Searching for bees...");
			RedLocustBees[] array = Object.FindObjectsByType<RedLocustBees>((FindObjectsSortMode)0);
			foreach (GrabbableObject item in Hives.ToList())
			{
				if ((Object)(object)item == (Object)null)
				{
					Hives.Remove(item);
				}
			}
			if (array.Length == 0)
			{
				return;
			}
			RedLocustBees[] array2 = array;
			foreach (RedLocustBees val in array2)
			{
				if (!((Object)(object)val.hive == (Object)null) && !Hives.Contains(val.hive))
				{
					GrabbableNavMeshAgent grabbableNavMeshAgent = ((Component)val.hive).gameObject.AddComponent<GrabbableNavMeshAgent>();
					grabbableNavMeshAgent.Init(beeMagnetSpeed);
					Hives.Add(val.hive);
				}
			}
		}

		public void AttractBees()
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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)
			foreach (GrabbableObject hive in Hives)
			{
				if ((Object)(object)hive != (Object)null)
				{
					GrabbableNavMeshAgent component = ((Component)hive).GetComponent<GrabbableNavMeshAgent>();
					if (((GrabbableObject)plushObj).isInShipRoom)
					{
						Vector3 point = Vector3.MoveTowards(StartOfRound.Instance.shipBounds.ClosestPointOnBounds(((Component)hive).transform.position), ((Component)hive).transform.position, beeMagnetShipStopRadius);
						Vector3 closestNavMesh = GetClosestNavMesh(point);
						PlushNetworker.Instance.SetTargetClientRPC(((NetworkBehaviour)hive).NetworkObjectId, closestNavMesh);
					}
					else
					{
						Vector3 closestNavMesh = GetClosestNavMesh(Vector3.MoveTowards(((Component)plushObj).transform.position, ((Component)hive).transform.position, beeMagnetStopRadius));
						PlushNetworker.Instance.SetTargetClientRPC(((NetworkBehaviour)hive).NetworkObjectId, closestNavMesh);
					}
				}
			}
		}

		private static Vector3 GetClosestNavMesh(Vector3 point)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			return RoundManager.Instance.GetNavMeshPosition(point, RoundManager.Instance.navHit, 2f, -1);
		}

		public void StopAttractingBees()
		{
			foreach (GrabbableObject hive in Hives)
			{
				if ((Object)(object)hive != (Object)null)
				{
					GrabbableNavMeshAgent component = ((Component)hive).GetComponent<GrabbableNavMeshAgent>();
					component.StopPathing();
				}
			}
		}

		private void OnDisable()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if (isHost)
			{
				plushObj.onDiscardEvent.RemoveListener(new UnityAction(At