Decompiled source of WE LOVE THE COMPANY v1.0.3

plugins/2018-LC_API/LC_API.dll

Decompiled 10 months ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LC_API.BundleAPI;
using LC_API.ClientAPI;
using LC_API.Comp;
using LC_API.Data;
using LC_API.Extensions;
using LC_API.GameInterfaceAPI;
using LC_API.ManualPatches;
using LC_API.ServerAPI;
using Microsoft.CodeAnalysis;
using Steamworks;
using Steamworks.Data;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("LC_API")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Utilities for plugin devs")]
[assembly: AssemblyFileVersion("2.1.4.0")]
[assembly: AssemblyInformationalVersion("2.1.4")]
[assembly: AssemblyProduct("LC_API")]
[assembly: AssemblyTitle("LC_API")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LC_API
{
	internal static class CheatDatabase
	{
		private const string DAT_CD_BROADCAST = "LC_API_CD_Broadcast";

		private const string SIG_REQ_GUID = "LC_API_ReqGUID";

		private const string SIG_SEND_MODS = "LC_APISendMods";

		private static Dictionary<string, PluginInfo> PluginsLoaded = new Dictionary<string, PluginInfo>();

		public static void RunLocalCheatDetector()
		{
			PluginsLoaded = Chainloader.PluginInfos;
			using Dictionary<string, PluginInfo>.ValueCollection.Enumerator enumerator = PluginsLoaded.Values.GetEnumerator();
			while (enumerator.MoveNext())
			{
				switch (enumerator.Current.Metadata.GUID)
				{
				case "mikes.lethalcompany.mikestweaks":
				case "mom.llama.enhancer":
				case "Posiedon.GameMaster":
				case "LethalCompanyScalingMaster":
				case "verity.amberalert":
					ModdedServer.SetServerModdedOnly();
					break;
				}
			}
		}

		public static void OtherPlayerCheatDetector()
		{
			Plugin.Log.LogWarning((object)"Asking all other players for their mod list..");
			GameTips.ShowTip("Mod List:", "Asking all other players for installed mods..");
			GameTips.ShowTip("Mod List:", "Check the logs for more detailed results.\n<size=13>(Note that if someone doesnt show up on the list, they may not have LC_API installed)</size>");
			Networking.Broadcast("LC_API_CD_Broadcast", "LC_API_ReqGUID");
		}

		internal static void CDNetGetString(string data, string signature)
		{
			if (data == "LC_API_CD_Broadcast" && signature == "LC_API_ReqGUID")
			{
				string text = "";
				foreach (PluginInfo value in PluginsLoaded.Values)
				{
					text = text + "\n" + value.Metadata.GUID;
				}
				Networking.Broadcast(GameNetworkManager.Instance.localPlayerController.playerUsername + " responded with these mods:" + text, "LC_APISendMods");
			}
			if (signature == "LC_APISendMods")
			{
				GameTips.ShowTip("Mod List:", data);
				Plugin.Log.LogWarning((object)data);
			}
		}
	}
	[BepInPlugin("LC_API", "LC_API", "2.1.4")]
	public sealed class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private ConfigEntry<bool> configOverrideModServer;

		private ConfigEntry<bool> configLegacyAssetLoading;

		private ConfigEntry<bool> configDisableBundleLoader;

		public static bool Initialized { get; private set; }

		private void Awake()
		{
			//IL_00c9: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Expected O, but got Unknown
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Expected O, but got Unknown
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Expected O, but got Unknown
			configOverrideModServer = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Force modded server browser", false, "Should the API force you into the modded server browser?");
			configLegacyAssetLoading = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Legacy asset bundle loading", false, "Should the BundleLoader use legacy asset loading? Turning this on may help with loading assets from older plugins.");
			configDisableBundleLoader = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Disable BundleLoader", false, "Should the BundleLoader be turned off? Enable this if you are having problems with mods that load assets using a different method from LC_API's BundleLoader.");
			CommandHandler.commandPrefix = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Prefix", "/", "Command prefix");
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogWarning((object)"\n.____    _________           _____  __________ .___  \r\n|    |   \\_   ___ \\         /  _  \\ \\______   \\|   | \r\n|    |   /    \\  \\/        /  /_\\  \\ |     ___/|   | \r\n|    |___\\     \\____      /    |    \\|    |    |   | \r\n|_______ \\\\______  /______\\____|__  /|____|    |___| \r\n        \\/       \\//_____/        \\/                 \r\n                                                     ");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Starting up..");
			if (configOverrideModServer.Value)
			{
				ModdedServer.SetServerModdedOnly();
			}
			Harmony val = new Harmony("ModAPI");
			MethodInfo methodInfo = AccessTools.Method(typeof(GameNetworkManager), "SteamMatchmaking_OnLobbyCreated", (Type[])null, (Type[])null);
			AccessTools.Method(typeof(GameNetworkManager), "LobbyDataIsJoinable", (Type[])null, (Type[])null);
			MethodInfo methodInfo2 = AccessTools.Method(typeof(ServerPatch), "OnLobbyCreate", (Type[])null, (Type[])null);
			MethodInfo methodInfo3 = AccessTools.Method(typeof(MenuManager), "Awake", (Type[])null, (Type[])null);
			MethodInfo methodInfo4 = AccessTools.Method(typeof(ServerPatch), "CacheMenuManager", (Type[])null, (Type[])null);
			MethodInfo methodInfo5 = AccessTools.Method(typeof(HUDManager), "AddChatMessage", (Type[])null, (Type[])null);
			MethodInfo methodInfo6 = AccessTools.Method(typeof(ServerPatch), "ChatInterpreter", (Type[])null, (Type[])null);
			MethodInfo methodInfo7 = AccessTools.Method(typeof(HUDManager), "SubmitChat_performed", (Type[])null, (Type[])null);
			MethodInfo methodInfo8 = AccessTools.Method(typeof(CommandHandler.SubmitChatPatch), "Transpiler", (Type[])null, (Type[])null);
			val.Patch((MethodBase)methodInfo3, new HarmonyMethod(methodInfo4), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)methodInfo5, new HarmonyMethod(methodInfo6), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			val.Patch((MethodBase)methodInfo7, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(methodInfo8), (HarmonyMethod)null, (HarmonyMethod)null);
			Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(CheatDatabase.CDNetGetString));
			Networking.GetListString = (Action<List<string>, string>)Delegate.Combine(Networking.GetListString, new Action<List<string>, string>(Networking.LCAPI_NET_SYNCVAR_SET));
		}

		internal void Start()
		{
			Initialize();
		}

		internal void OnDestroy()
		{
			Initialize();
		}

		internal void Initialize()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if (!Initialized)
			{
				Initialized = true;
				if (!configDisableBundleLoader.Value)
				{
					BundleLoader.Load(configLegacyAssetLoading.Value);
				}
				GameObject val = new GameObject("API");
				Object.DontDestroyOnLoad((Object)val);
				val.AddComponent<LC_APIManager>();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"LC_API Started!");
				CheatDatabase.RunLocalCheatDetector();
			}
		}

		internal static void PatchMethodManual(MethodInfo method, MethodInfo patch, Harmony harmony)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			harmony.Patch((MethodBase)method, new HarmonyMethod(patch), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "LC_API";

		public const string PLUGIN_NAME = "LC_API";

		public const string PLUGIN_VERSION = "2.1.4";
	}
}
namespace LC_API.ServerAPI
{
	public static class ModdedServer
	{
		private static bool moddedOnly;

		[Obsolete("Use SetServerModdedOnly() instead. This will be removed/private in a future update.")]
		public static bool setModdedOnly;

		public static bool ModdedOnly => moddedOnly;

		public static void SetServerModdedOnly()
		{
			moddedOnly = true;
			Plugin.Log.LogMessage((object)"A plugin has set your game to only allow you to play with other people who have mods!");
		}

		public static void OnSceneLoaded()
		{
			if (Object.op_Implicit((Object)(object)GameNetworkManager.Instance) && ModdedOnly)
			{
				GameNetworkManager instance = GameNetworkManager.Instance;
				instance.gameVersionNum += 16440;
				setModdedOnly = true;
			}
		}
	}
	public static class Networking
	{
		public static Action<string, string> GetString = delegate
		{
		};

		public static Action<List<string>, string> GetListString = delegate
		{
		};

		public static Action<int, string> GetInt = delegate
		{
		};

		public static Action<float, string> GetFloat = delegate
		{
		};

		public static Action<Vector3, string> GetVector3 = delegate
		{
		};

		private static Dictionary<string, string> syncStringVars = new Dictionary<string, string>();

		public static void Broadcast(string data, string signature)
		{
			if (data.Contains("/"))
			{
				Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )");
				return;
			}
			HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDstring.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1);
		}

		public static void Broadcast(List<string> data, string signature)
		{
			string text = "";
			foreach (string datum in data)
			{
				if (datum.Contains("/"))
				{
					Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( / )");
					return;
				}
				if (datum.Contains("\n"))
				{
					Plugin.Log.LogError((object)"Invalid character in broadcasted string event! ( NewLine )");
					return;
				}
				text = text + datum + "\n";
			}
			HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data?.ToString() + "/" + signature + "/" + NetworkBroadcastDataType.BDlistString.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1);
		}

		public static void Broadcast(int data, string signature)
		{
			HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDint.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1);
		}

		public static void Broadcast(float data, string signature)
		{
			HUDManager.Instance.AddTextToChatOnServer("<size=0>NWE/" + data + "/" + signature + "/" + NetworkBroadcastDataType.BDfloat.ToString() + "/" + GameNetworkManager.Instance.localPlayerController.playerClientId + "/</size>", -1);
		}

		public static void Broadcast(Vector3 data, string signature)
		{
			//IL_0016: 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)
			HUDManager instance = HUDManager.Instance;
			string[] obj = new string[9] { "<size=0>NWE/", null, null, null, null, null, null, null, null };
			Vector3 val = data;
			obj[1] = ((object)(Vector3)(ref val)).ToString();
			obj[2] = "/";
			obj[3] = signature;
			obj[4] = "/";
			obj[5] = NetworkBroadcastDataType.BDvector3.ToString();
			obj[6] = "/";
			obj[7] = GameNetworkManager.Instance.localPlayerController.playerClientId.ToString();
			obj[8] = "/</size>";
			instance.AddTextToChatOnServer(string.Concat(obj), -1);
		}

		public static void RegisterSyncVariable(string name)
		{
			if (!syncStringVars.ContainsKey(name))
			{
				syncStringVars.Add(name, "");
			}
			else
			{
				Plugin.Log.LogError((object)("Cannot register Sync Variable! A Sync Variable has already been registered with name " + name));
			}
		}

		public static void SetSyncVariable(string name, string value)
		{
			if (syncStringVars.ContainsKey(name))
			{
				syncStringVars[name] = value;
				Broadcast(new List<string> { name, value }, "LCAPI_NET_SYNCVAR_SET");
			}
			else
			{
				Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!"));
			}
		}

		private static void SetSyncVariableB(string name, string value)
		{
			if (syncStringVars.ContainsKey(name))
			{
				syncStringVars[name] = value;
			}
			else
			{
				Plugin.Log.LogError((object)("Cannot set the value of Sync Variable " + name + " as it is not registered!"));
			}
		}

		internal static void LCAPI_NET_SYNCVAR_SET(List<string> list, string arg2)
		{
			if (arg2 == "LCAPI_NET_SYNCVAR_SET")
			{
				SetSyncVariableB(list[0], list[1]);
			}
		}

		public static string GetSyncVariable(string name)
		{
			if (syncStringVars.ContainsKey(name))
			{
				return syncStringVars[name];
			}
			Plugin.Log.LogError((object)("Cannot get the value of Sync Variable " + name + " as it is not registered!"));
			return "";
		}

		private static void GotString(string data, string signature)
		{
		}

		private static void GotInt(int data, string signature)
		{
		}

		private static void GotFloat(float data, string signature)
		{
		}

		private static void GotVector3(Vector3 data, string signature)
		{
		}
	}
}
namespace LC_API.ManualPatches
{
	internal static class ServerPatch
	{
		internal static bool OnLobbyCreate(GameNetworkManager __instance, Result result, Lobby lobby)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Invalid comparison between Unknown and I4
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if ((int)result != 1)
			{
				Debug.LogError((object)$"Lobby could not be created! {result}", (Object)(object)__instance);
			}
			__instance.lobbyHostSettings.lobbyName = "[MODDED]" + __instance.lobbyHostSettings.lobbyName.ToString();
			Plugin.Log.LogMessage((object)"server pre-setup success");
			return true;
		}

		internal static bool CacheMenuManager(MenuManager __instance)
		{
			LC_APIManager.MenuManager = __instance;
			return true;
		}

		internal static bool ChatInterpreter(HUDManager __instance, string chatMessage)
		{
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: 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)
			if (!chatMessage.Contains("NWE") || !chatMessage.Contains("<size=0>"))
			{
				return true;
			}
			string[] array = chatMessage.Split(new char[1] { '/' });
			if (array.Length < 5)
			{
				if (array.Length >= 3)
				{
					if (!int.TryParse(array[4], out var result))
					{
						Plugin.Log.LogWarning((object)"Failed to parse player ID!!");
						return false;
					}
					if ((result == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester)
					{
						return false;
					}
					Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result2);
					switch (result2)
					{
					case NetworkBroadcastDataType.BDstring:
						Networking.GetString(array[1], array[2]);
						break;
					case NetworkBroadcastDataType.BDint:
						Networking.GetInt(int.Parse(array[1]), array[2]);
						break;
					case NetworkBroadcastDataType.BDfloat:
						Networking.GetFloat(float.Parse(array[1]), array[2]);
						break;
					case NetworkBroadcastDataType.BDvector3:
					{
						string[] array2 = array[1].Replace("(", "").Replace(")", "").Split(new char[1] { ',' });
						Vector3 arg = default(Vector3);
						if (array2.Length == 3)
						{
							if (float.TryParse(array2[0], out var result3) && float.TryParse(array2[1], out var result4) && float.TryParse(array2[2], out var result5))
							{
								arg.x = result3;
								arg.y = result4;
								arg.z = result5;
							}
							else
							{
								Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug.");
							}
						}
						else
						{
							Plugin.Log.LogError((object)"Vector3 Network receive fail. This is a failure of the API, and it should be reported as a bug.");
						}
						Networking.GetVector3(arg, array[2]);
						break;
					}
					case NetworkBroadcastDataType.BDlistString:
					{
						string[] source = array[1].Split(new char[1] { '\n' });
						Networking.GetListString(source.ToList(), array[2]);
						break;
					}
					}
					_ = LC_APIManager.netTester;
					return false;
				}
				Plugin.Log.LogError((object)"Generic Network receive fail. This is a failure of the API, and it should be reported as a bug.");
				Plugin.Log.LogError((object)$"Generic Network receive fail (expected 5+ data fragments, got {array.Length}). This is a failure of the API, and it should be reported as a bug.");
				return true;
			}
			if (!int.TryParse(array[4], out var result6))
			{
				Plugin.Log.LogWarning((object)("Failed to parse player ID '" + array[4] + "'!!"));
				return false;
			}
			if ((result6 == (int)GameNetworkManager.Instance.localPlayerController.playerClientId) & !LC_APIManager.netTester)
			{
				return false;
			}
			if (!Enum.TryParse<NetworkBroadcastDataType>(array[3], out var result7))
			{
				Plugin.Log.LogError((object)("Unknown datatype - unable to parse '" + array[3] + "' into a known data type!"));
				return false;
			}
			switch (result7)
			{
			case NetworkBroadcastDataType.BDstring:
				Networking.GetString.InvokeActionSafe(array[1], array[2]);
				break;
			case NetworkBroadcastDataType.BDint:
				Networking.GetInt.InvokeActionSafe(int.Parse(array[1]), array[2]);
				break;
			case NetworkBroadcastDataType.BDfloat:
				Networking.GetFloat.InvokeActionSafe(float.Parse(array[1]), array[2]);
				break;
			case NetworkBroadcastDataType.BDvector3:
			{
				string text = array[1].Trim('(', ')');
				string[] array3 = text.Split(new char[1] { ',' });
				Vector3 param = default(Vector3);
				float result8;
				float result9;
				float result10;
				if (array3.Length != 3)
				{
					Plugin.Log.LogError((object)$"Vector3 Network receive fail (expected 3 numbers, got {array3.Length} number(?)(s) instead). This is a failure of the API, and it should be reported as a bug. (passing an empty Vector3 in its place)");
				}
				else if (float.TryParse(array3[0], out result8) && float.TryParse(array3[1], out result9) && float.TryParse(array3[2], out result10))
				{
					param.x = result8;
					param.y = result9;
					param.z = result10;
				}
				else
				{
					Plugin.Log.LogError((object)("Vector3 Network receive fail (failed to parse '" + text + "' as numbers). This is a failure of the API, and it should be reported as a bug."));
				}
				Networking.GetVector3.InvokeActionSafe(param, array[2]);
				break;
			}
			}
			_ = LC_APIManager.netTester;
			return false;
		}

		internal static bool ChatCommands(HUDManager __instance, CallbackContext context)
		{
			if (__instance.chatTextField.text.ToLower().Contains("/modcheck"))
			{
				CheatDatabase.OtherPlayerCheatDetector();
				return false;
			}
			return true;
		}
	}
}
namespace LC_API.GameInterfaceAPI
{
	public static class GameState
	{
		private static readonly Action NothingAction = delegate
		{
		};

		public static int AlivePlayerCount { get; private set; }

		public static ShipState ShipState { get; private set; }

		public static event Action PlayerDied;

		public static event Action LandOnMoon;

		public static event Action WentIntoOrbit;

		public static event Action ShipStartedLeaving;

		internal static void GSUpdate()
		{
			if (!((Object)(object)StartOfRound.Instance == (Object)null))
			{
				if (StartOfRound.Instance.shipHasLanded && ShipState != ShipState.OnMoon)
				{
					ShipState = ShipState.OnMoon;
					GameState.LandOnMoon.InvokeActionSafe();
				}
				if (StartOfRound.Instance.inShipPhase && ShipState != 0)
				{
					ShipState = ShipState.InOrbit;
					GameState.WentIntoOrbit.InvokeActionSafe();
				}
				if (StartOfRound.Instance.shipIsLeaving && ShipState != ShipState.LeavingMoon)
				{
					ShipState = ShipState.LeavingMoon;
					GameState.ShipStartedLeaving.InvokeActionSafe();
				}
				if (AlivePlayerCount < StartOfRound.Instance.livingPlayers)
				{
					GameState.PlayerDied.InvokeActionSafe();
				}
				AlivePlayerCount = StartOfRound.Instance.livingPlayers;
			}
		}

		static GameState()
		{
			GameState.PlayerDied = NothingAction;
			GameState.LandOnMoon = NothingAction;
			GameState.WentIntoOrbit = NothingAction;
			GameState.ShipStartedLeaving = NothingAction;
		}
	}
	public class GameTips
	{
		private static List<string> tipHeaders = new List<string>();

		private static List<string> tipBodys = new List<string>();

		private static float lastMessageTime;

		public static void ShowTip(string header, string body)
		{
			tipHeaders.Add(header);
			tipBodys.Add(body);
		}

		public static void UpdateInternal()
		{
			lastMessageTime -= Time.deltaTime;
			if ((tipHeaders.Count > 0) & (lastMessageTime < 0f))
			{
				lastMessageTime = 5f;
				if ((Object)(object)HUDManager.Instance != (Object)null)
				{
					HUDManager.Instance.DisplayTip(tipHeaders[0], tipBodys[0], false, false, "LC_Tip1");
				}
				tipHeaders.RemoveAt(0);
				tipBodys.RemoveAt(0);
			}
		}
	}
}
namespace LC_API.Extensions
{
	public static class DelegateExtensions
	{
		private static readonly PropertyInfo PluginGetLogger = AccessTools.Property(typeof(BaseUnityPlugin), "Logger");

		public static void InvokeActionSafe(this Action action)
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if (action == null)
			{
				return;
			}
			Delegate[] invocationList = action.GetInvocationList();
			foreach (Delegate @delegate in invocationList)
			{
				try
				{
					((Action)@delegate)();
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)"Exception while invoking hook callback!");
					string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName;
					PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName));
					if (val == null)
					{
						Plugin.Log.LogError((object)ex.ToString());
						break;
					}
					((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString());
				}
			}
		}

		public static void InvokeActionSafe<T>(this Action<T> action, T param)
		{
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			if (action == null)
			{
				return;
			}
			Delegate[] invocationList = action.GetInvocationList();
			foreach (Delegate @delegate in invocationList)
			{
				try
				{
					((Action<T>)@delegate)(param);
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)"Exception while invoking hook callback!");
					string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName;
					PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName));
					if (val == null)
					{
						Plugin.Log.LogError((object)ex.ToString());
						break;
					}
					((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString());
				}
			}
		}

		public static void InvokeActionSafe<T1, T2>(this Action<T1, T2> action, T1 param1, T2 param2)
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			if (action == null)
			{
				return;
			}
			Delegate[] invocationList = action.GetInvocationList();
			foreach (Delegate @delegate in invocationList)
			{
				try
				{
					((Action<T1, T2>)@delegate)(param1, param2);
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)"Exception while invoking hook callback!");
					string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName;
					PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName));
					if (val == null)
					{
						Plugin.Log.LogError((object)ex.ToString());
						break;
					}
					((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString());
				}
			}
		}

		internal static void InvokeParameterlessDelegate<T>(this T paramlessDelegate) where T : Delegate
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			if ((Delegate?)paramlessDelegate == (Delegate?)null)
			{
				return;
			}
			Delegate[] invocationList = paramlessDelegate.GetInvocationList();
			foreach (Delegate @delegate in invocationList)
			{
				try
				{
					((T)@delegate).DynamicInvoke();
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)"Exception while invoking hook callback!");
					string asmName = @delegate.GetMethodInfo().DeclaringType.Assembly.FullName;
					PluginInfo val = ((IEnumerable<PluginInfo>)Chainloader.PluginInfos.Values).FirstOrDefault((Func<PluginInfo, bool>)((PluginInfo pi) => ((object)pi.Instance).GetType().Assembly.FullName == asmName));
					if (val == null)
					{
						Plugin.Log.LogError((object)ex.ToString());
						break;
					}
					((ManualLogSource)PluginGetLogger.GetValue(val.Instance)).LogError((object)ex.ToString());
				}
			}
		}
	}
}
namespace LC_API.Data
{
	internal enum NetworkBroadcastDataType
	{
		Unknown,
		BDint,
		BDfloat,
		BDvector3,
		BDstring,
		BDlistString
	}
	public enum ShipState
	{
		InOrbit,
		OnMoon,
		LeavingMoon
	}
}
namespace LC_API.Comp
{
	internal class LC_APIManager : MonoBehaviour
	{
		public static MenuManager MenuManager;

		public static bool netTester;

		private static int playerCount;

		private static bool wanttoCheckMods;

		private static float lobbychecktimer;

		public void Update()
		{
			GameState.GSUpdate();
			GameTips.UpdateInternal();
			if ((((Object)(object)HUDManager.Instance != (Object)null) & netTester) && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null)
			{
				Networking.Broadcast("testerData", "testerSignature");
			}
			if (!ModdedServer.setModdedOnly)
			{
				ModdedServer.OnSceneLoaded();
			}
			else if (ModdedServer.ModdedOnly && (Object)(object)MenuManager != (Object)null && Object.op_Implicit((Object)(object)MenuManager.versionNumberText))
			{
				((TMP_Text)MenuManager.versionNumberText).text = $"v{GameNetworkManager.Instance.gameVersionNum - 16440}\nMOD";
			}
			if ((Object)(object)GameNetworkManager.Instance != (Object)null)
			{
				if (playerCount < GameNetworkManager.Instance.connectedPlayers)
				{
					lobbychecktimer = -4.5f;
					wanttoCheckMods = true;
				}
				playerCount = GameNetworkManager.Instance.connectedPlayers;
			}
			if (lobbychecktimer < 0f)
			{
				lobbychecktimer += Time.deltaTime;
			}
			else if (wanttoCheckMods && (Object)(object)HUDManager.Instance != (Object)null)
			{
				wanttoCheckMods = false;
				CD();
			}
		}

		private void CD()
		{
			CheatDatabase.OtherPlayerCheatDetector();
		}
	}
}
namespace LC_API.ClientAPI
{
	public static class CommandHandler
	{
		internal static class SubmitChatPatch
		{
			private static bool HandleMessage(HUDManager manager)
			{
				string text = manager.chatTextField.text;
				if (!Utility.IsNullOrWhiteSpace(text) && text.StartsWith(commandPrefix.Value))
				{
					string[] array = text.Split(new char[1] { ' ' });
					string text2 = array[0].Substring(commandPrefix.Value.Length);
					if (TryGetCommandHandler(text2, out var handler))
					{
						string[] obj = array.Skip(1).ToArray();
						try
						{
							handler(obj);
						}
						catch (Exception ex)
						{
							Plugin.Log.LogError((object)("Error handling command: " + text2));
							Plugin.Log.LogError((object)ex);
						}
					}
					manager.localPlayer.isTypingChat = false;
					manager.chatTextField.text = "";
					EventSystem.current.SetSelectedGameObject((GameObject)null);
					((Behaviour)manager.typingIndicator).enabled = false;
					return true;
				}
				return false;
			}

			internal static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				List<CodeInstruction> newInstructions = new List<CodeInstruction>(instructions);
				Label label = generator.DefineLabel();
				newInstructions[newInstructions.Count - 1].labels.Add(label);
				int index = newInstructions.FindIndex((CodeInstruction i) => i.opcode == OpCodes.Ldfld && (FieldInfo)i.operand == AccessTools.Field(typeof(PlayerControllerB), "isPlayerDead")) - 2;
				newInstructions.InsertRange(index, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[3]
				{
					CodeInstructionExtensions.MoveLabelsFrom(new CodeInstruction(OpCodes.Ldarg_0, (object)null), newInstructions[index]),
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SubmitChatPatch), "HandleMessage", (Type[])null, (Type[])null)),
					new CodeInstruction(OpCodes.Brtrue, (object)label)
				});
				for (int z = 0; z < newInstructions.Count; z++)
				{
					yield return newInstructions[z];
				}
			}
		}

		internal static ConfigEntry<string> commandPrefix;

		internal static Dictionary<string, Action<string[]>> CommandHandlers = new Dictionary<string, Action<string[]>>();

		internal static Dictionary<string, List<string>> CommandAliases = new Dictionary<string, List<string>>();

		public static bool RegisterCommand(string command, Action<string[]> handler)
		{
			if (command.Contains(" ") || CommandHandlers.ContainsKey(command))
			{
				return false;
			}
			CommandHandlers.Add(command, handler);
			return true;
		}

		public static bool RegisterCommand(string command, List<string> aliases, Action<string[]> handler)
		{
			if (command.Contains(" ") || GetCommandHandler(command) != null)
			{
				return false;
			}
			foreach (string alias in aliases)
			{
				if (alias.Contains(" ") || GetCommandHandler(alias) != null)
				{
					return false;
				}
			}
			CommandHandlers.Add(command, handler);
			CommandAliases.Add(command, aliases);
			return true;
		}

		public static bool UnregisterCommand(string command)
		{
			CommandAliases.Remove(command);
			return CommandHandlers.Remove(command);
		}

		internal static Action<string[]> GetCommandHandler(string command)
		{
			if (CommandHandlers.TryGetValue(command, out var value))
			{
				return value;
			}
			foreach (KeyValuePair<string, List<string>> commandAlias in CommandAliases)
			{
				if (commandAlias.Value.Contains(command))
				{
					return CommandHandlers[commandAlias.Key];
				}
			}
			return null;
		}

		internal static bool TryGetCommandHandler(string command, out Action<string[]> handler)
		{
			handler = GetCommandHandler(command);
			return handler != null;
		}
	}
}
namespace LC_API.BundleAPI
{
	public static class BundleLoader
	{
		[Obsolete("Use OnLoadedBundles instead. This will be removed/private in a future update.")]
		public delegate void OnLoadedAssetsDelegate();

		[Obsolete("Use GetLoadedAsset instead. This will be removed/private in a future update.")]
		public static ConcurrentDictionary<string, Object> assets = new ConcurrentDictionary<string, Object>();

		[Obsolete("Use OnLoadedBundles instead. This will be removed/private in a future update.")]
		public static OnLoadedAssetsDelegate OnLoadedAssets = LoadAssetsCompleted;

		public static bool AssetsInLegacyDirectory { get; private set; }

		public static bool LegacyLoadingEnabled { get; private set; }

		public static event Action OnLoadedBundles;

		internal static void Load(bool legacyLoading)
		{
			LegacyLoadingEnabled = legacyLoading;
			Plugin.Log.LogMessage((object)"BundleAPI will now load all asset bundles...");
			string path = Path.Combine(Paths.BepInExRootPath, "Bundles");
			if (!Directory.Exists(path))
			{
				Directory.CreateDirectory(path);
				Plugin.Log.LogMessage((object)"BundleAPI Created legacy bundle directory in BepInEx/Bundles");
			}
			string[] array = (from x in Directory.GetFiles(path, "*", SearchOption.AllDirectories)
				where !x.EndsWith(".manifest", StringComparison.CurrentCultureIgnoreCase)
				select x).ToArray();
			AssetsInLegacyDirectory = array.Length != 0;
			if (!AssetsInLegacyDirectory)
			{
				Plugin.Log.LogMessage((object)"BundleAPI got no assets to load from legacy directory");
			}
			if (AssetsInLegacyDirectory)
			{
				Plugin.Log.LogWarning((object)"The path BepInEx > Bundles is outdated and should not be used anymore! Bundles will be loaded from BepInEx > plugins from now on");
				LoadAllAssetsFromDirectory(array, legacyLoading);
			}
			string[] invalidEndings = new string[8] { ".dll", ".json", ".png", ".md", ".old", ".txt", ".exe", ".lem" };
			path = Path.Combine(Paths.BepInExRootPath, "plugins");
			array = (from file in Directory.GetFiles(path, "*", SearchOption.AllDirectories)
				where !invalidEndings.Any((string ending) => file.EndsWith(ending, StringComparison.CurrentCultureIgnoreCase))
				select file).ToArray();
			byte[] bytes = Encoding.ASCII.GetBytes("UnityFS");
			List<string> list = new List<string>();
			string[] array2 = array;
			foreach (string text in array2)
			{
				byte[] array3 = new byte[bytes.Length];
				using (FileStream fileStream = File.Open(text, FileMode.Open))
				{
					fileStream.Read(array3, 0, array3.Length);
				}
				if (array3.SequenceEqual(bytes))
				{
					list.Add(text);
				}
			}
			array = list.ToArray();
			if (array.Length == 0)
			{
				Plugin.Log.LogMessage((object)"BundleAPI got no assets to load from plugins folder");
			}
			else
			{
				LoadAllAssetsFromDirectory(array, legacyLoading);
			}
			OnLoadedAssets.InvokeParameterlessDelegate();
			BundleLoader.OnLoadedBundles.InvokeActionSafe();
		}

		private static void LoadAllAssetsFromDirectory(string[] array, bool legacyLoading)
		{
			if (legacyLoading)
			{
				Plugin.Log.LogMessage((object)("BundleAPI got " + array.Length + " AssetBundles to load!"));
				for (int i = 0; i < array.Length; i++)
				{
					try
					{
						SaveAsset(array[i], legacyLoading);
					}
					catch (Exception)
					{
						Plugin.Log.LogError((object)("Failed to load an assetbundle! Path: " + array[i]));
					}
				}
				return;
			}
			Plugin.Log.LogMessage((object)("BundleAPI got " + array.Length + " AssetBundles to load!"));
			for (int j = 0; j < array.Length; j++)
			{
				try
				{
					SaveAsset(array[j], legacyLoading);
				}
				catch (Exception)
				{
					Plugin.Log.LogError((object)("Failed to load an assetbundle! Path: " + array[j]));
				}
			}
		}

		public static void SaveAsset(string path, bool legacyLoad)
		{
			AssetBundle val = AssetBundle.LoadFromFile(path);
			try
			{
				string[] allAssetNames = val.GetAllAssetNames();
				foreach (string text in allAssetNames)
				{
					Plugin.Log.LogMessage((object)("Got asset for load: " + text));
					Object val2 = val.LoadAsset(text);
					if (val2 == (Object)null)
					{
						Plugin.Log.LogWarning((object)$"Skipped/failed loading an asset (from bundle '{((Object)val).name}') - Asset path: {val2}");
						continue;
					}
					string key = (legacyLoad ? text.ToUpper() : text.ToLower());
					if (assets.ContainsKey(key))
					{
						Plugin.Log.LogError((object)"BundleAPI got duplicate asset!");
						break;
					}
					assets.TryAdd(key, val2);
					Plugin.Log.LogMessage((object)("Loaded asset: " + val2.name));
				}
			}
			finally
			{
				if (val != null)
				{
					val.Unload(false);
				}
			}
		}

		public static TAsset GetLoadedAsset<TAsset>(string itemPath) where TAsset : Object
		{
			Object value = null;
			if (LegacyLoadingEnabled)
			{
				assets.TryGetValue(itemPath.ToUpper(), out value);
			}
			if (value == (Object)null)
			{
				assets.TryGetValue(itemPath.ToLower(), out value);
			}
			return (TAsset)(object)value;
		}

		private static void LoadAssetsCompleted()
		{
			Plugin.Log.LogMessage((object)"BundleAPI finished loading all assets.");
		}

		static BundleLoader()
		{
			BundleLoader.OnLoadedBundles = LoadAssetsCompleted;
		}
	}
}

plugins/299792458-ScanForEnemies/EnemyScan.dll

Decompiled 10 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using EnemyScan.Helper;
using HarmonyLib;
using TerminalApi;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("EnemyScan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EnemyScan")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f9c8f099-56b1-4532-bf30-fcefcdb185c1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EnemyScan
{
	[BepInPlugin("299792458.EnemyScan", "EnemyScan", "1.1.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class EnemyScan : BaseUnityPlugin
	{
		private const string modGUID = "299792458.EnemyScan";

		private const string modName = "EnemyScan";

		private const string modVersion = "1.1.1";

		private void Awake()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			TerminalKeyword val = TerminalApi.CreateTerminalKeyword("list", true, (TerminalNode)null);
			TerminalKeyword val2 = TerminalApi.CreateTerminalKeyword("enemies", false, (TerminalNode)null);
			TerminalNode val3 = TerminalApi.CreateTerminalNode("No Enemies Found.\n", true, "");
			TerminalApi.AddTerminalKeyword(val2.defaultVerb = TerminalExtenstionMethods.AddCompatibleNoun(val, val2, val3));
			TerminalApi.AddTerminalKeyword(val2);
		}

		public static void UpdateEnemyCommand()
		{
			TerminalApi.UpdateKeywordCompatibleNoun("list", "enemies", TerminalApi.CreateTerminalNode(ScanEnemies.enemyString + "\n", true, ""));
		}
	}
}
namespace EnemyScan.Helper
{
	[HarmonyPatch(typeof(RoundManager))]
	public static class ScanEnemies
	{
		public static string enemyString = "No Enemies Found";

		[HarmonyPatch("BeginEnemySpawning")]
		[HarmonyPostfix]
		public static void BeginEnemySpawningUpdate()
		{
			UpdateEnemyCount();
		}

		[HarmonyPatch("SpawnEnemyFromVent")]
		[HarmonyPostfix]
		public static void SpawnEnemyFromVentUpdate()
		{
			UpdateEnemyCount();
		}

		[HarmonyPatch("AdvanceHourAndSpawnNewBatchOfEnemies")]
		[HarmonyPostfix]
		public static void AdvanceHourAndSpawnNewBatchOfEnemiesUpdate()
		{
			UpdateEnemyCount();
		}

		private static void UpdateEnemyCount()
		{
			EnemyAI[] source = Object.FindObjectsOfType<EnemyAI>();
			enemyString = BuildEnemyCountString(source.ToList());
			EnemyScan.UpdateEnemyCommand();
		}

		private static string BuildEnemyCountString(List<EnemyAI> enemies)
		{
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			foreach (EnemyAI enemy in enemies)
			{
				string enemyName = enemy.enemyType.enemyName;
				if (dictionary.ContainsKey(enemyName))
				{
					dictionary[enemyName]++;
				}
				else
				{
					dictionary[enemyName] = 1;
				}
			}
			StringBuilder stringBuilder = new StringBuilder();
			foreach (KeyValuePair<string, int> item in dictionary)
			{
				stringBuilder.AppendLine($"{item.Key}: {item.Value}");
			}
			if (stringBuilder.ToString() == "")
			{
				return "No Enemies Found.";
			}
			return stringBuilder.ToString();
		}
	}
}

plugins/amnsoft-EmployeeAssignments/EmployeeAssignments.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using LC_API.GameInterfaceAPI;
using LC_API.ServerAPI;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EmployeeAssignments")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("PersonalAssignments")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyInformationalVersion("1.0.4")]
[assembly: AssemblyProduct("EmployeeAssignments")]
[assembly: AssemblyTitle("EmployeeAssignments")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace PersonalAssignments
{
	[BepInPlugin("EmployeeAssignments", "EmployeeAssignments", "1.0.4")]
	public class Plugin : BaseUnityPlugin
	{
		private static bool Initialized;

		public static ManualLogSource Log { get; private set; }

		private void Start()
		{
			Initialize();
		}

		private void OnDestroy()
		{
			Initialize();
		}

		private void Initialize()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			if (!Initialized)
			{
				Initialized = true;
				GameObject val = new GameObject("PersonalAssignmentManager");
				Object.DontDestroyOnLoad((Object)(object)val);
				val.AddComponent<PersonalAssignmentManager>();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin EmployeeAssignments is loaded!");
			}
		}
	}
	[Serializable]
	public enum AssignmentType
	{
		CollectScrapItem,
		KillMonster,
		RepairValve
	}
	[Serializable]
	public struct Assignment
	{
		public string Name;

		public string BodyText;

		public string ShortText;

		public string TargetText;

		public string FailureReason;

		public int CashReward;

		public int XPReward;

		public AssignmentType Type;

		public ulong PlayerId;

		public ulong[] targetIds;

		public int TargetsComplete;

		public Vector3 FixedTargetPosition;
	}
	public static class Assignments
	{
		public static readonly Assignment[] All = new Assignment[3]
		{
			new Assignment
			{
				Name = "SCRAP RETRIEVAL",
				BodyText = "YOU MUST COLLECT THE FOLLOWING SCRAP ITEM: [{0}] IT WILL BE MARKED AS [ASSIGNMENT TARGET]",
				ShortText = "FIND THE [{0}] MARKED 'ASSIGNMENT TARGET'",
				CashReward = 100,
				XPReward = 0,
				Type = AssignmentType.CollectScrapItem,
				targetIds = new ulong[1]
			},
			new Assignment
			{
				Name = "HUNT & KILL",
				BodyText = "YOU MUST HUNT AND KILL THE FOLLOWING ENEMY: [{0}] IT WILL BE MARKED AS [ASSIGNMENT TARGET]",
				ShortText = "FIND AND KILL THE [{0}]",
				CashReward = 200,
				XPReward = 0,
				Type = AssignmentType.KillMonster,
				targetIds = new ulong[1]
			},
			new Assignment
			{
				Name = "REPAIR VALVE",
				BodyText = "YOU MUST FIND AND REPAIR THE BROKEN VALVE",
				ShortText = "FIND AND REPAIR THE BROKEN VALVE",
				CashReward = 100,
				XPReward = 0,
				Type = AssignmentType.RepairValve,
				targetIds = new ulong[1]
			}
		};
	}
	public class AssignmentUI : MonoBehaviour
	{
		private readonly Color NONE_TEXT_COLOR = new Color(1f, 0.8277124f, 0.5235849f, 0.3254902f);

		private readonly Color BG_COLOR = new Color(1f, 0.6916346f, 0.259434f, 1f);

		private readonly Color TITLE_COLOR = new Color(1f, 0.9356132f, 0.8160377f, 1f);

		private readonly Color TEXT_COLOR = new Color(0.3584906f, 0.2703371f, 0f, 1f);

		private Canvas _canvas;

		private GameObject _noneText;

		private CanvasGroup _assignment;

		private Text _assignmentTitle;

		private Text _assignmentText;

		private Font _font;

		private QuickMenuManager _menuManager;

		public Assignment? _activeAssignment;

		private void Awake()
		{
			//IL_0030: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: 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_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			((Component)this).gameObject.layer = 5;
			_font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
			_canvas = new GameObject("Canvas").AddComponent<Canvas>();
			((Component)_canvas).transform.SetParent(((Component)this).transform);
			_canvas.sortingOrder = -100;
			_canvas.renderMode = (RenderMode)0;
			RectTransform component = ((Component)_canvas).GetComponent<RectTransform>();
			component.sizeDelta = new Vector2(1920f, 1080f);
			component.anchorMin = Vector2.zero;
			component.anchorMax = Vector2.zero;
			component.pivot = Vector2.zero / 2f;
			CanvasScaler val = ((Component)_canvas).gameObject.AddComponent<CanvasScaler>();
			val.uiScaleMode = (ScaleMode)1;
			val.screenMatchMode = (ScreenMatchMode)2;
			val.referenceResolution = new Vector2(1920f, 1080f);
			_noneText = new GameObject("NoneText");
			Text val2 = _noneText.AddComponent<Text>();
			val2.fontSize = 20;
			val2.font = _font;
			val2.fontStyle = (FontStyle)1;
			val2.text = "NO ASSIGNMENT ACTIVE";
			((Graphic)val2).color = NONE_TEXT_COLOR;
			val2.alignment = (TextAnchor)4;
			RectTransform component2 = _noneText.GetComponent<RectTransform>();
			((Transform)component2).SetParent((Transform)(object)component);
			component2.pivot = Vector2.one;
			component2.anchorMin = Vector2.one;
			component2.anchorMax = Vector2.one;
			component2.anchoredPosition = new Vector2(-70f, -310f);
			component2.sizeDelta = new Vector2(310f, 50f);
			_assignment = new GameObject("AssignmentPanel").AddComponent<CanvasGroup>();
			_assignment.alpha = 0.5f;
			Image val3 = ((Component)_assignment).gameObject.AddComponent<Image>();
			((Graphic)val3).color = BG_COLOR;
			RectTransform component3 = ((Component)_assignment).gameObject.GetComponent<RectTransform>();
			((Transform)component3).SetParent((Transform)(object)component);
			component3.pivot = Vector2.one;
			component3.anchorMin = Vector2.one;
			component3.anchorMax = Vector2.one;
			component3.anchoredPosition = new Vector2(-50f, -300f);
			component3.sizeDelta = new Vector2(350f, 80f);
			_assignmentTitle = new GameObject("Title").AddComponent<Text>();
			_assignmentTitle.font = _font;
			_assignmentTitle.fontSize = 20;
			_assignmentTitle.fontStyle = (FontStyle)1;
			_assignmentTitle.text = "NO ASSIGNMENT ACTIVE";
			((Graphic)_assignmentTitle).color = TITLE_COLOR;
			_assignmentTitle.alignment = (TextAnchor)0;
			RectTransform component4 = ((Component)_assignmentTitle).gameObject.GetComponent<RectTransform>();
			((Transform)component4).SetParent((Transform)(object)component3);
			component4.pivot = new Vector2(0.5f, 1f);
			component4.anchorMin = new Vector2(0f, 1f);
			component4.anchorMax = Vector2.one;
			component4.anchoredPosition = new Vector2(0f, -10f);
			component4.sizeDelta = new Vector2(-40f, 100f);
			_assignmentText = new GameObject("Text").AddComponent<Text>();
			_assignmentText.font = _font;
			_assignmentText.fontSize = 16;
			_assignmentText.fontStyle = (FontStyle)1;
			_assignmentText.text = "NO ASSIGNMENT ACTIVE";
			((Graphic)_assignmentText).color = TEXT_COLOR;
			_assignmentText.alignment = (TextAnchor)6;
			RectTransform component5 = ((Component)_assignmentText).gameObject.GetComponent<RectTransform>();
			((Transform)component5).SetParent((Transform)(object)component3);
			component5.pivot = new Vector2(0.5f, 0.5f);
			component5.anchorMin = new Vector2(0f, 0f);
			component5.anchorMax = Vector2.one;
			component5.anchoredPosition = new Vector2(0f, -10f);
			component5.sizeDelta = new Vector2(-40f, -40f);
		}

		public void SetAssignment(Assignment assignment)
		{
			_activeAssignment = assignment;
			_assignmentTitle.text = assignment.Name;
			_assignmentText.text = string.Format(assignment.ShortText, assignment.TargetText);
		}

		public void ClearAssignment()
		{
			_activeAssignment = null;
		}

		private void Update()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			bool flag = (Object)(object)GameNetworkManager.Instance?.localPlayerController != (Object)null && !GameNetworkManager.Instance.localPlayerController.isPlayerDead;
			if ((Object)(object)_menuManager == (Object)null)
			{
				flag = false;
				_menuManager = Object.FindAnyObjectByType<QuickMenuManager>();
			}
			else
			{
				flag &= !_menuManager.isMenuOpen;
			}
			if (_activeAssignment.HasValue && _activeAssignment.Value.FixedTargetPosition != Vector3.zero)
			{
				float num = Vector3.Distance(_activeAssignment.Value.FixedTargetPosition, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
				_assignmentText.text = string.Format(_activeAssignment.Value.ShortText, _activeAssignment.Value.TargetText) + $" {(int)num}m";
			}
			((Component)_assignment).gameObject.SetActive(_activeAssignment.HasValue);
			_noneText.SetActive(!_activeAssignment.HasValue);
			((Behaviour)_canvas).enabled = flag;
		}
	}
	public class PersonalAssignmentManager : MonoBehaviour
	{
		private AssignmentUI _assignmentUI;

		private int _maxAssignedPlayers = 20;

		private int _minAssignedPlayers = 1;

		private bool _isHost;

		private bool _assignmentsGenerated;

		private List<Assignment> _activeServerAssignments = new List<Assignment>();

		private List<Assignment> _completedServerAssignments = new List<Assignment>();

		private Assignment? _currentAssignment;

		private List<ulong> _excludeTargetIds = new List<ulong>();

		private List<string> _enemyTypeWhitelist = new List<string> { "Centipede", "Bunker Spider", "Hoarding bug", "Crawler" };

		public void Awake()
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(OnGetData));
			GameState.LandOnMoon += LandedOnMoon;
			GameState.WentIntoOrbit += ShipTookOff;
			GameState.ShipStartedLeaving += ShipTakingOff;
			_assignmentUI = new GameObject("UI").AddComponent<AssignmentUI>();
			((Component)_assignmentUI).transform.SetParent(((Component)this).transform);
		}

		private void Log(string log)
		{
			Plugin.Log.LogInfo((object)log);
		}

		public void LandedOnMoon()
		{
			_assignmentsGenerated = false;
		}

		public void ShipTookOff()
		{
			_assignmentsGenerated = false;
			_assignmentUI.ClearAssignment();
		}

		public void ShipTakingOff()
		{
			_assignmentsGenerated = false;
		}

		public void Update()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Invalid comparison between Unknown and I4
			if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)RoundManager.Instance?.playersManager == (Object)null || RoundManager.Instance.playersManager.newGameIsLoading || !RoundManager.Instance.dungeonFinishedGeneratingForAllPlayers)
			{
				return;
			}
			if ((int)GameState.ShipState != 1 || !RoundManager.Instance.currentLevel.sceneName.StartsWith("Level"))
			{
				_assignmentsGenerated = false;
				return;
			}
			if (_currentAssignment.HasValue)
			{
				_assignmentUI.SetAssignment(_currentAssignment.Value);
			}
			_isHost = GameNetworkManager.Instance.isHostingGame;
			if (_isHost)
			{
				if (!_assignmentsGenerated)
				{
					GenerateAssignments();
				}
				else if (_assignmentsGenerated)
				{
					CheckCompleted();
				}
			}
		}

		private void GenerateAssignments()
		{
			_completedServerAssignments.Clear();
			_activeServerAssignments.Clear();
			_excludeTargetIds.Clear();
			PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts;
			int num = Mathf.Max(_minAssignedPlayers, Mathf.Min(_maxAssignedPlayers, GameState.AlivePlayerCount / 2));
			List<int> list = new List<int>();
			for (int i = 0; i < allPlayerScripts.Length; i++)
			{
				if (allPlayerScripts[i].isPlayerControlled)
				{
					list.Add(i);
				}
			}
			Log($"Starting assignment generation for {num} players");
			for (int j = 0; j < num; j++)
			{
				int index = Random.Range(0, list.Count);
				int num2 = list[index];
				list.RemoveAt(index);
				Assignment assignment = Assignments.All[Random.Range(0, Assignments.All.Length)];
				assignment.PlayerId = allPlayerScripts[num2].playerClientId;
				Log($"created assignment for player {allPlayerScripts[num2].playerClientId}");
				switch (assignment.Type)
				{
				case AssignmentType.CollectScrapItem:
					SetupCollectScrapAssignment(ref assignment);
					break;
				case AssignmentType.KillMonster:
					SetupKillEnemyAssignment(ref assignment);
					break;
				case AssignmentType.RepairValve:
					SetupRepairValveAssignment(ref assignment);
					break;
				}
				string text = JsonUtility.ToJson((object)assignment);
				Log("Sending Message (Allocation): " + text);
				Networking.Broadcast(text, "PersonalAssignment-Allocation");
				if (assignment.PlayerId == GameNetworkManager.Instance.localPlayerController.actualClientId)
				{
					OnGetData(text, "PersonalAssignment-Allocation");
				}
				_activeServerAssignments.Add(assignment);
			}
			_assignmentsGenerated = true;
			Log("Finishing assignment generation");
		}

		private void CheckCompleted()
		{
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_043d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			foreach (Assignment activeServerAssignment in _activeServerAssignments)
			{
				switch (activeServerAssignment.Type)
				{
				case AssignmentType.CollectScrapItem:
					foreach (GrabbableObject item in RoundManager.Instance.scrapCollectedThisRound)
					{
						if (item.isInShipRoom && ((NetworkBehaviour)item).NetworkObjectId == activeServerAssignment.targetIds[0])
						{
							_activeServerAssignments.Remove(activeServerAssignment);
							_completedServerAssignments.Add(activeServerAssignment);
							if (((NetworkBehaviour)item).OwnerClientId == activeServerAssignment.PlayerId)
							{
								string text3 = JsonUtility.ToJson((object)activeServerAssignment);
								Networking.Broadcast(text3, "PersonalAssignment-Complete");
								OnGetData(text3, "PersonalAssignment-Complete");
								Log("Sending Message (Complete): " + text3);
							}
							else
							{
								Assignment assignment2 = activeServerAssignment;
								assignment2.FailureReason = "ANOTHER EMPLOYEE COLLETED THE TARGET ITEM";
								string text4 = JsonUtility.ToJson((object)assignment2);
								Networking.Broadcast(text4, "PersonalAssignment-Failed");
								OnGetData(text4, "PersonalAssignment-Failed");
								Log("Sending Message (Failed): " + text4);
							}
							break;
						}
					}
					break;
				case AssignmentType.KillMonster:
					foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
					{
						if (((NetworkBehaviour)spawnedEnemy).NetworkObjectId == activeServerAssignment.targetIds[0] && spawnedEnemy.isEnemyDead)
						{
							string text5 = JsonUtility.ToJson((object)activeServerAssignment);
							Networking.Broadcast(text5, "PersonalAssignment-Complete");
							OnGetData(text5, "PersonalAssignment-Complete");
							Item val4 = (from a in RoundManager.Instance.currentLevel.spawnableScrap?.Select((SpawnableItemWithRarity a) => a.spawnableItem)
								where a.itemName == "Gold bar"
								select a).First();
							GameObject val5 = Object.Instantiate<GameObject>(val4.spawnPrefab, spawnedEnemy.serverPosition, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer);
							GrabbableObject component3 = val5.GetComponent<GrabbableObject>();
							((Component)component3).transform.rotation = Quaternion.Euler(component3.itemProperties.restingRotation);
							component3.fallTime = 0f;
							component3.scrapValue = activeServerAssignment.CashReward;
							NetworkObject component4 = val5.GetComponent<NetworkObject>();
							component4.Spawn(false);
							((MonoBehaviour)this).StartCoroutine(WaitForScrapToSpawnToSync((NetworkObjectReference[])(object)new NetworkObjectReference[1] { NetworkObjectReference.op_Implicit(component4) }, new int[1] { activeServerAssignment.CashReward }));
							_activeServerAssignments.Remove(activeServerAssignment);
							_completedServerAssignments.Add(activeServerAssignment);
							return;
						}
					}
					break;
				case AssignmentType.RepairValve:
				{
					SteamValveHazard[] array = Object.FindObjectsOfType<SteamValveHazard>();
					SteamValveHazard[] array2 = array;
					foreach (SteamValveHazard val in array2)
					{
						if (((NetworkBehaviour)val).NetworkObjectId != activeServerAssignment.targetIds[0] || val.triggerScript.interactable)
						{
							continue;
						}
						if (((NetworkBehaviour)val.triggerScript).OwnerClientId == activeServerAssignment.PlayerId)
						{
							string text = JsonUtility.ToJson((object)activeServerAssignment);
							Networking.Broadcast(text, "PersonalAssignment-Complete");
							OnGetData(text, "PersonalAssignment-Complete");
							Log("Sending Message (Complete): " + text);
							Item val2 = (from a in RoundManager.Instance.currentLevel.spawnableScrap?.Select((SpawnableItemWithRarity a) => a.spawnableItem)
								where a.itemName == "Gold bar"
								select a).First();
							GameObject val3 = Object.Instantiate<GameObject>(val2.spawnPrefab, ((Component)val).gameObject.transform.position, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer);
							GrabbableObject component = val3.GetComponent<GrabbableObject>();
							((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation);
							component.fallTime = 0f;
							component.scrapValue = activeServerAssignment.CashReward;
							NetworkObject component2 = val3.GetComponent<NetworkObject>();
							component2.Spawn(false);
							((MonoBehaviour)this).StartCoroutine(WaitForScrapToSpawnToSync((NetworkObjectReference[])(object)new NetworkObjectReference[1] { NetworkObjectReference.op_Implicit(component2) }, new int[1] { activeServerAssignment.CashReward }));
						}
						else
						{
							Assignment assignment = activeServerAssignment;
							assignment.FailureReason = "ANOTHER EMPLOYEE COLLETED THE TARGET ITEM";
							string text2 = JsonUtility.ToJson((object)assignment);
							Networking.Broadcast(text2, "PersonalAssignment-Failed");
							OnGetData(text2, "PersonalAssignment-Failed");
							Log("Sending Message (Failed): " + text2);
						}
						_activeServerAssignments.Remove(activeServerAssignment);
						_completedServerAssignments.Add(activeServerAssignment);
						return;
					}
					break;
				}
				}
			}
		}

		private IEnumerator WaitForScrapToSpawnToSync(NetworkObjectReference[] spawnedScrap, int[] scrapValues)
		{
			yield return (object)new WaitForSeconds(11f);
			RoundManager.Instance.SyncScrapValuesClientRpc(spawnedScrap, scrapValues);
		}

		private void OnGetData(string data, string sig)
		{
			if (!sig.StartsWith("PersonalAssignment"))
			{
				return;
			}
			Log("Inoming data " + sig + " " + data);
			switch (sig)
			{
			case "PersonalAssignment-Allocation":
			{
				Assignment value = JsonUtility.FromJson<Assignment>(data);
				bool flag = value.PlayerId == GameNetworkManager.Instance.localPlayerController.actualClientId;
				if (flag)
				{
					_currentAssignment = value;
					ShowAssignment(_currentAssignment.Value);
				}
				switch (value.Type)
				{
				case AssignmentType.CollectScrapItem:
				{
					if (!flag)
					{
						break;
					}
					GrabbableObject[] array = Object.FindObjectsByType<GrabbableObject>((FindObjectsSortMode)0);
					for (int i = 0; i < array.Length; i++)
					{
						if (((NetworkBehaviour)array[i]).NetworkObjectId == value.targetIds[0])
						{
							SetScrapAsAssignmentTarget(array[i]);
							break;
						}
					}
					break;
				}
				case AssignmentType.KillMonster:
				{
					foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
					{
						if (((NetworkBehaviour)spawnedEnemy).NetworkObjectId == value.targetIds[0])
						{
							ScanNodeProperties componentInChildren = ((Component)spawnedEnemy).gameObject.GetComponentInChildren<ScanNodeProperties>();
							componentInChildren.headerText = "ASSIGNMENT TARGET";
						}
					}
					break;
				}
				case AssignmentType.RepairValve:
					break;
				}
				break;
			}
			case "PersonalAssignment-Complete":
			{
				Assignment assignment2 = JsonUtility.FromJson<Assignment>(data);
				switch (assignment2.Type)
				{
				case AssignmentType.CollectScrapItem:
				{
					if (((NetworkBehaviour)RoundManager.Instance).NetworkManager.SpawnManager.SpawnedObjects.TryGetValue(assignment2.targetIds[0], out var value2))
					{
						GrabbableObject component = ((Component)value2).gameObject.GetComponent<GrabbableObject>();
						SetScrapTargetAsCompleted(component, assignment2.CashReward);
					}
					break;
				}
				}
				if (assignment2.PlayerId == GameNetworkManager.Instance.localPlayerController.actualClientId)
				{
					CompleteAssignment();
				}
				break;
			}
			case "PersonalAssignment-Failed":
			{
				Assignment assignment = JsonUtility.FromJson<Assignment>(data);
				if (assignment.PlayerId == GameNetworkManager.Instance.localPlayerController.actualClientId)
				{
					FailAssignment(assignment.FailureReason);
				}
				break;
			}
			}
		}

		private void ShowAssignment(Assignment assignment)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			if (!((Object)(object)HUDManager.Instance == (Object)null))
			{
				DialogueSegment[] array = (DialogueSegment[])(object)new DialogueSegment[1]
				{
					new DialogueSegment
					{
						speakerText = "ASSIGNMENT:" + assignment.Name,
						bodyText = "YOU HAVE BEEN SELECTED BY THE COMPANY FOR ASSIGNMENT, " + string.Format(assignment.BodyText, assignment.TargetText),
						waitTime = 10f
					}
				};
				_assignmentUI.SetAssignment(assignment);
				HUDManager.Instance.ReadDialogue(array);
			}
		}

		private void CompleteAssignment()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0044: Expected O, but got Unknown
			if (_currentAssignment.HasValue)
			{
				DialogueSegment[] array = (DialogueSegment[])(object)new DialogueSegment[1]
				{
					new DialogueSegment
					{
						speakerText = "ASSIGNMENT COMPLETE",
						bodyText = "YOU HAVE COMPLETED THE ASSIGNMENT, WELL DONE. THE COMPANY VALUES YOUR LOYALTY",
						waitTime = 5f
					}
				};
				_assignmentUI.ClearAssignment();
				HUDManager.Instance.ReadDialogue(array);
				_currentAssignment = null;
			}
		}

		private void FailAssignment(string reason)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			if (_currentAssignment.HasValue)
			{
				DialogueSegment[] array = (DialogueSegment[])(object)new DialogueSegment[1]
				{
					new DialogueSegment
					{
						speakerText = "ASSIGNMENT FAILED",
						bodyText = "YOU FAILED TO COMPLETE THE ASSIGNMENT. REASON: " + reason,
						waitTime = 5f
					}
				};
				HUDManager.Instance.ReadDialogue(array);
				_currentAssignment = null;
			}
		}

		private void SetScrapAsAssignmentTarget(GrabbableObject scrap)
		{
			Item val = Object.Instantiate<Item>(scrap.itemProperties);
			val.itemName = "ASSIGNMENT TARGET";
			scrap.itemProperties = val;
			ScanNodeProperties componentInChildren = ((Component)scrap).gameObject.GetComponentInChildren<ScanNodeProperties>();
			if ((Object)(object)componentInChildren == (Object)null)
			{
				Debug.LogError((object)("Scan node is missing for item!: " + ((Object)((Component)this).gameObject).name));
				return;
			}
			componentInChildren.headerText = "ASSIGNMENT TARGET";
			componentInChildren.subText = "Value : ???";
		}

		private void SetScrapTargetAsCompleted(GrabbableObject scrap, int reward)
		{
			scrap.SetScrapValue(reward + scrap.scrapValue);
		}

		private void SetupCollectScrapAssignment(ref Assignment assignment)
		{
			GrabbableObject[] array = Object.FindObjectsByType<GrabbableObject>((FindObjectsSortMode)0);
			for (int i = 0; i < array.Length; i++)
			{
				if (!_excludeTargetIds.Contains(((NetworkBehaviour)array[i]).NetworkObjectId) && !array[i].scrapPersistedThroughRounds && array[i].itemProperties.isScrap)
				{
					assignment.targetIds[0] = ((NetworkBehaviour)array[i]).NetworkObjectId;
					assignment.TargetText = array[i].itemProperties.itemName.ToUpper();
					_excludeTargetIds.Add(((NetworkBehaviour)array[i]).NetworkObjectId);
					break;
				}
			}
		}

		private void SetupKillEnemyAssignment(ref Assignment assignment)
		{
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)RoundManager.Instance == (Object)null)
			{
				return;
			}
			bool flag = false;
			for (int i = 0; i < RoundManager.Instance.SpawnedEnemies.Count; i++)
			{
				EnemyAI val = RoundManager.Instance.SpawnedEnemies[i];
				if (_enemyTypeWhitelist.Contains(val.enemyType.enemyName) && ((NetworkBehaviour)val).IsSpawned && !val.isEnemyDead && !_excludeTargetIds.Contains(((NetworkBehaviour)val).NetworkObjectId))
				{
					assignment.targetIds[0] = ((NetworkBehaviour)val).NetworkObjectId;
					assignment.TargetText = val.enemyType.enemyName.ToUpper();
					_excludeTargetIds.Add(((NetworkBehaviour)val).NetworkObjectId);
					flag = true;
					ScanNodeProperties componentInChildren = ((Component)val).gameObject.GetComponentInChildren<ScanNodeProperties>();
					componentInChildren.headerText = "ASSIGNMENT TARGET";
					break;
				}
			}
			if (flag)
			{
				return;
			}
			List<int> list = new List<int>();
			for (int j = 0; j < RoundManager.Instance.currentLevel.Enemies.Count; j++)
			{
				SpawnableEnemyWithRarity val2 = RoundManager.Instance.currentLevel.Enemies[j];
				if (_enemyTypeWhitelist.Contains(val2.enemyType.enemyName))
				{
					list.Add(j);
				}
			}
			Vector3 val3 = Vector3.zero;
			EntranceTeleport[] array = Object.FindObjectsOfType<EntranceTeleport>();
			for (int k = 0; k < array.Length; k++)
			{
				if (!array[k].isEntranceToBuilding && array[k].entranceId == 0)
				{
					val3 = ((Component)array[k]).transform.position;
				}
			}
			int num = list[Random.Range(0, list.Count)];
			List<(EnemyVent, float)> list2 = new List<(EnemyVent, float)>();
			EnemyVent[] allEnemyVents = RoundManager.Instance.allEnemyVents;
			foreach (EnemyVent val4 in allEnemyVents)
			{
				list2.Add((val4, Vector3.Distance(val4.floorNode.position, val3)));
			}
			list2 = list2.OrderByDescending<(EnemyVent, float), float>(((EnemyVent vent, float distance) a) => a.distance).ToList();
			EnemyVent item = list2[Random.Range(0, list2.Count / 2)].Item1;
			RoundManager instance = RoundManager.Instance;
			Vector3 position = item.floorNode.position;
			Quaternion rotation = item.floorNode.rotation;
			instance.SpawnEnemyOnServer(position, ((Quaternion)(ref rotation)).eulerAngles.y, num);
			ulong[] targetIds = assignment.targetIds;
			List<EnemyAI> spawnedEnemies = RoundManager.Instance.SpawnedEnemies;
			targetIds[0] = ((NetworkBehaviour)spawnedEnemies[spawnedEnemies.Count - 1]).NetworkObjectId;
			List<EnemyAI> spawnedEnemies2 = RoundManager.Instance.SpawnedEnemies;
			assignment.TargetText = spawnedEnemies2[spawnedEnemies2.Count - 1].enemyType.enemyName.ToUpper();
			Log($"Didnt find enemy for assignment, spawning a new one {assignment.TargetText} at {item.floorNode.position}");
			_excludeTargetIds.Add(assignment.targetIds[0]);
			List<EnemyAI> spawnedEnemies3 = RoundManager.Instance.SpawnedEnemies;
			ScanNodeProperties componentInChildren2 = ((Component)spawnedEnemies3[spawnedEnemies3.Count - 1]).gameObject.GetComponentInChildren<ScanNodeProperties>();
			componentInChildren2.headerText = "ASSIGNMENT TARGET";
		}

		private void SetupRepairValveAssignment(ref Assignment assignment)
		{
			//IL_0002: 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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = RoundManager.FindMainEntrancePosition(false);
			SteamValveHazard[] array = Object.FindObjectsByType<SteamValveHazard>((FindObjectsSortMode)0);
			float num = 0f;
			int num2 = 0;
			for (int i = 0; i < array.Length; i++)
			{
				float num3 = Vector3.Distance(val, ((Component)array[i]).transform.position);
				if (num3 > num && num3 > 80f)
				{
					num2 = i;
					num = num3;
				}
			}
			if (!_excludeTargetIds.Contains(((NetworkBehaviour)array[num2]).NetworkObjectId) && ((NetworkBehaviour)array[num2]).IsSpawned)
			{
				assignment.targetIds[0] = ((NetworkBehaviour)array[num2]).NetworkObjectId;
				assignment.TargetText = "BROKEN VALVE";
				_excludeTargetIds.Add(((NetworkBehaviour)array[num2]).NetworkObjectId);
				array[num2].valveCrackTime = 0.001f;
				array[num2].valveBurstTime = 0.01f;
				array[num2].triggerScript.interactable = true;
				assignment.FixedTargetPosition = ((Component)array[num2]).gameObject.transform.position;
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "EmployeeAssignments";

		public const string PLUGIN_NAME = "EmployeeAssignments";

		public const string PLUGIN_VERSION = "1.0.4";
	}
}

plugins/anormaltwig-LateCompany/LateCompanyV1.0.6.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("LateCompany")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+31dbb98cfa5670c23f3ffb21c05582c54159b82d")]
[assembly: AssemblyProduct("LateCompany")]
[assembly: AssemblyTitle("LateCompany")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LateCompany
{
	public static class PluginInfo
	{
		public const string GUID = "twig.latecompany";

		public const string PrintName = "Late Company";

		public const string Version = "1.0.6";
	}
	[BepInPlugin("twig.latecompany", "Late Company", "1.0.6")]
	internal class Plugin : BaseUnityPlugin
	{
		private ConfigEntry<bool> configLateJoinOrbitOnly;

		public static bool OnlyLateJoinInOrbit = false;

		public static bool LobbyJoinable = true;

		public void Awake()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			configLateJoinOrbitOnly = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Late join orbit only", true, "Don't allow joining while the ship is not in orbit.");
			OnlyLateJoinInOrbit = configLateJoinOrbitOnly.Value;
			Harmony val = new Harmony("twig.latecompany");
			val.PatchAll(typeof(Plugin).Assembly);
			((BaseUnityPlugin)this).Logger.Log((LogLevel)16, (object)"Late Company loaded!");
		}

		public static void SetLobbyJoinable(bool joinable)
		{
			LobbyJoinable = joinable;
			GameNetworkManager.Instance.SetLobbyJoinable(joinable);
			QuickMenuManager val = Object.FindObjectOfType<QuickMenuManager>();
			if (Object.op_Implicit((Object)(object)val))
			{
				val.inviteFriendsTextAlpha.alpha = (joinable ? 1f : 0.2f);
			}
		}
	}
}
namespace LateCompany.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager), "LeaveLobbyAtGameStart")]
	[HarmonyWrapSafe]
	internal static class LeaveLobbyAtGameStart_Patch
	{
		[HarmonyPrefix]
		private static bool Prefix()
		{
			return false;
		}
	}
	[HarmonyPatch(typeof(GameNetworkManager), "ConnectionApproval")]
	[HarmonyWrapSafe]
	internal static class ConnectionApproval_Patch
	{
		[HarmonyPostfix]
		private static void Postfix(ConnectionApprovalRequest request, ConnectionApprovalResponse response)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if (request.ClientNetworkId != NetworkManager.Singleton.LocalClientId && response.Reason.Contains("Game has already started") && Plugin.LobbyJoinable)
			{
				response.Reason = "";
				response.CreatePlayerObject = false;
				response.Approved = true;
				response.Pending = false;
			}
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "DisableInviteFriendsButton")]
	[HarmonyWrapSafe]
	internal static class DisableInviteFriendsButton_Patch
	{
		[HarmonyPrefix]
		private static bool Prefix()
		{
			return false;
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "InviteFriendsButton")]
	[HarmonyWrapSafe]
	internal static class InviteFriendsButton_Patch
	{
		[HarmonyPrefix]
		private static bool Prefix()
		{
			if (Plugin.LobbyJoinable)
			{
				GameNetworkManager.Instance.InviteFriendsUI();
			}
			return false;
		}
	}
	internal class RpcEnum : NetworkBehaviour
	{
		public static int None => 0;

		public static int Client => 2;

		public static int Server => 1;
	}
	internal static class WeatherSync
	{
		public static bool DoOverride = false;

		public static LevelWeatherType CurrentWeather = (LevelWeatherType)(-1);
	}
	[HarmonyPatch(typeof(RoundManager), "__rpc_handler_1193916134")]
	[HarmonyWrapSafe]
	internal static class __rpc_handler_1193916134_Patch
	{
		public static FieldInfo RPCExecStage = typeof(NetworkBehaviour).GetField("__rpc_exec_stage", BindingFlags.Instance | BindingFlags.NonPublic);

		[HarmonyPrefix]
		private static bool Prefix(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			try
			{
				int num = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num);
				int num2 = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num2);
				int num3 = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref num3);
				WeatherSync.DoOverride = true;
				WeatherSync.CurrentWeather = (LevelWeatherType)num3;
				RPCExecStage.SetValue(target, RpcEnum.Client);
				((RoundManager)((target is RoundManager) ? target : null)).GenerateNewLevelClientRpc(num, num2);
				RPCExecStage.SetValue(target, RpcEnum.None);
			}
			catch
			{
				((FastBufferReader)(ref reader)).Seek(0);
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(RoundManager), "SetToCurrentLevelWeather")]
	[HarmonyWrapSafe]
	internal static class SetToCurrentLevelWeather_Patch
	{
		[HarmonyPrefix]
		private static bool Prefix()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (!WeatherSync.DoOverride)
			{
				return true;
			}
			WeatherSync.DoOverride = false;
			TimeOfDay.Instance.currentLevelWeather = WeatherSync.CurrentWeather;
			return false;
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")]
	[HarmonyWrapSafe]
	internal class OnPlayerConnectedClientRpc_Patch
	{
		public static MethodInfo BeginSendClientRpc = typeof(RoundManager).GetMethod("__beginSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic);

		public static MethodInfo EndSendClientRpc = typeof(RoundManager).GetMethod("__endSendClientRpc", BindingFlags.Instance | BindingFlags.NonPublic);

		[HarmonyPostfix]
		private static void Postfix(ulong clientId, int connectedPlayers, ulong[] connectedPlayerIdsOrdered, int assignedPlayerObjectId, int serverMoneyAmount, int levelID, int profitQuota, int timeUntilDeadline, int quotaFulfilled, int randomSeed)
		{
			//IL_0066: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: 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_0163: 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_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: 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)
			StartOfRound instance = StartOfRound.Instance;
			PlayerControllerB val = instance.allPlayerScripts[assignedPlayerObjectId];
			if (instance.connectedPlayersAmount + 1 >= instance.allPlayerScripts.Length)
			{
				Plugin.SetLobbyJoinable(joinable: false);
			}
			val.DisablePlayerModel(instance.allPlayerObjects[assignedPlayerObjectId], true, true);
			if (((NetworkBehaviour)instance).IsServer && !instance.inShipPhase)
			{
				RoundManager instance2 = RoundManager.Instance;
				ClientRpcParams val2 = default(ClientRpcParams);
				val2.Send = new ClientRpcSendParams
				{
					TargetClientIds = new List<ulong> { clientId }
				};
				ClientRpcParams val3 = val2;
				FastBufferWriter val4 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 1193916134u, val3, 0 });
				BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.randomMapSeed);
				BytePacker.WriteValueBitPacked(val4, StartOfRound.Instance.currentLevelID);
				BytePacker.WriteValueBitPacked(val4, (short)instance2.currentLevel.currentWeather);
				EndSendClientRpc.Invoke(instance2, new object[4] { val4, 1193916134u, val3, 0 });
				FastBufferWriter val5 = (FastBufferWriter)BeginSendClientRpc.Invoke(instance2, new object[3] { 2729232387u, val3, 0 });
				EndSendClientRpc.Invoke(instance2, new object[4] { val5, 2729232387u, val3, 0 });
			}
			instance.livingPlayers = instance.connectedPlayersAmount + 1;
			for (int i = 0; i < instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val6 = instance.allPlayerScripts[i];
				if (val6.isPlayerControlled && val6.isPlayerDead)
				{
					instance.livingPlayers--;
				}
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")]
	[HarmonyWrapSafe]
	internal class OnPlayerDC_Patch
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			if (StartOfRound.Instance.inShipPhase || !Plugin.OnlyLateJoinInOrbit)
			{
				Plugin.SetLobbyJoinable(joinable: true);
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "StartGame")]
	[HarmonyWrapSafe]
	internal class StartGame_Patch
	{
		[HarmonyPrefix]
		public static void Prefix()
		{
			if (Plugin.OnlyLateJoinInOrbit)
			{
				Plugin.SetLobbyJoinable(joinable: false);
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")]
	[HarmonyWrapSafe]
	internal class SetShipReadyToLand_Patch
	{
		[HarmonyPrefix]
		public static void Postfix()
		{
			if (Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length)
			{
				Plugin.SetLobbyJoinable(joinable: true);
			}
		}
	}
}

plugins/BatTeam-LethalFashion/LethalFashion.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[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("LethalFashion")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adding immediate outfits for the crew")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyInformationalVersion("1.0.4")]
[assembly: AssemblyProduct("LethalFashion")]
[assembly: AssemblyTitle("LethalFashion")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalFashion
{
	[BepInPlugin("LethalFashion", "LethalFashion", "1.0.4")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		private static Harmony harmonyInstance;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LethalFashion is loaded!");
			InitializeHarmony();
		}

		private void InitializeHarmony()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			if (harmonyInstance == null)
			{
				harmonyInstance = new Harmony("LethalFashion");
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Harmony instance created");
				try
				{
					harmonyInstance.PatchAll(typeof(SuitFashion));
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Patch applied successfully. You are now FASHIONABLE.");
				}
				catch (Exception ex)
				{
					((BaseUnityPlugin)this).Logger.LogError((object)("Error applying patch: " + ex.Message));
				}
			}
		}
	}
	public class SuitFashion
	{
		private static readonly MethodInfo unlockItem;

		private static bool isHost;

		static SuitFashion()
		{
			unlockItem = typeof(StartOfRound).GetMethod("SpawnUnlockable", BindingFlags.Instance | BindingFlags.NonPublic);
			if (unlockItem == null)
			{
				Plugin.Log.LogError((object)"SpawnUnlockable method not found in StartOfRound. Please check game/plugin version.");
			}
		}

		public static void SpawnUnlockableDelegate(StartOfRound instance, int ID)
		{
			if (unlockItem == null)
			{
				Plugin.Log.LogError((object)"Cannot invoke SpawnUnlockable - method reference is null. Please check game/plugin version.");
			}
			else if (!instance.SpawnedShipUnlockables.ContainsKey(ID))
			{
				try
				{
					unlockItem.Invoke(instance, new object[1] { ID });
				}
				catch (Exception ex)
				{
					Plugin.Log.LogError((object)("Error invoking SpawnUnlockable: " + ex.Message));
				}
			}
		}

		public static void PositionSuitsOnRack(StartOfRound startOfRoundInstance)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			UnlockableSuit[] array = Object.FindObjectsOfType<UnlockableSuit>();
			for (int i = 0; i < array.Length; i++)
			{
				UnlockableSuit val = array[i];
				AutoParentToShip component = ((Component)val).gameObject.GetComponent<AutoParentToShip>();
				if ((Object)(object)component != (Object)null)
				{
					component.overrideOffset = true;
					component.positionOffset = new Vector3(-2.45f, 2.75f, -8.41f) + startOfRoundInstance.rightmostSuitPosition.forward * 0.18f * (float)i;
					component.rotationOffset = new Vector3(0f, 90f, 0f);
				}
			}
		}

		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyPostfix]
		public static void StartOfRoundSuitPatch(StartOfRound __instance)
		{
			if (!isHost)
			{
				return;
			}
			int[] array = new int[3] { 1, 2, 3 };
			int[] array2 = array;
			foreach (int num in array2)
			{
				if (num >= 0 && num < __instance.unlockablesList.unlockables.Count)
				{
					UnlockableItem val = __instance.unlockablesList.unlockables[num];
					if (val != null)
					{
						val.alreadyUnlocked = true;
						val.hasBeenUnlockedByPlayer = true;
						val.inStorage = false;
						SpawnUnlockableDelegate(__instance, num);
					}
				}
			}
			PositionSuitsOnRack(__instance);
		}

		[HarmonyPatch(typeof(StartOfRound), "ResetShip")]
		[HarmonyPostfix]
		public static void ResetShipSuitPatch(StartOfRound __instance)
		{
			if (isHost)
			{
				StartOfRoundSuitPatch(__instance);
			}
		}

		[HarmonyPatch(typeof(RoundManager), "Start")]
		[HarmonyPrefix]
		private static void SetIsHost()
		{
			isHost = ((NetworkBehaviour)RoundManager.Instance).NetworkManager.IsHost;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalFashion";

		public const string PLUGIN_NAME = "LethalFashion";

		public const string PLUGIN_VERSION = "1.0.4";
	}
}

plugins/BlueAmulet-LCBetterClock/BetterClock.dll

Decompiled 10 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("BetterClock")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BetterClock")]
[assembly: AssemblyCopyright("Copyright © BlueAmulet 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("de27b4d1-820d-4505-a953-6001420281e4")]
[assembly: AssemblyFileVersion("1.0.3")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.3.0")]
namespace BetterClock
{
	[BepInPlugin("BlueAmulet.BetterClock", "BetterClock", "1.0.3")]
	public class BetterClock : BaseUnityPlugin
	{
		internal const string Name = "BetterClock";

		internal const string Author = "BlueAmulet";

		internal const string ID = "BlueAmulet.BetterClock";

		internal const string Version = "1.0.3";

		public void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Settings.InitConfig(((BaseUnityPlugin)this).Config);
			Harmony val = new Harmony("BlueAmulet.BetterClock");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Applying Harmony patches");
			val.PatchAll(Assembly.GetExecutingAssembly());
			int num = 0;
			foreach (MethodBase patchedMethod in val.GetPatchedMethods())
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)("Patched " + patchedMethod.DeclaringType.Name + "." + patchedMethod.Name));
				num++;
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)(num + " patches applied"));
		}
	}
	internal static class Settings
	{
		internal static ConfigEntry<bool> compact;

		internal static ConfigEntry<bool> leadingZero;

		internal static ConfigEntry<bool> darkZero;

		internal static ConfigEntry<bool> fasterUpdate;

		internal static ConfigEntry<bool> raiseClock;

		internal static ConfigEntry<bool> hours24;

		internal static ConfigEntry<bool> properTime;

		internal static ConfigEntry<float> visibilityShip;

		internal static ConfigEntry<float> visibilityOutside;

		internal static ConfigEntry<float> visibilityInside;

		internal static ConfigEntry<float> visibilityOverride;

		internal static ConfigEntry<KeyboardShortcut> overrideKeybind;

		internal static ConfigEntry<bool> overrideToggle;

		public static void InitConfig(ConfigFile config)
		{
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			compact = config.Bind<bool>("Clock", "CompactClock", true, "Makes the clock more compact");
			leadingZero = config.Bind<bool>("Clock", "LeadingZero", true, "Adds a leading zero to hours before 10");
			darkZero = config.Bind<bool>("Clock", "DarkZero", true, "Leading zeros are dark");
			fasterUpdate = config.Bind<bool>("Clock", "FasterUpdate", true, "Update the clock more often");
			raiseClock = config.Bind<bool>("Clock", "RaiseClock", true, "Raise the clock near the top of the screen");
			hours24 = config.Bind<bool>("Clock", "24Hours", false, "Use 24 hour time");
			properTime = config.Bind<bool>("Clock", "ProperTime", true, "Fix time formatting caused by the game or other mods");
			visibilityShip = config.Bind<float>("Clock", "VisibilityShip", 1f, "Visibility of clock inside ship");
			visibilityOutside = config.Bind<float>("Clock", "VisibilityOutside", 1f, "Visibility of clock outside");
			visibilityInside = config.Bind<float>("Clock", "VisibilityInside", 0.25f, "Visibility of clock inside factory");
			visibilityOverride = config.Bind<float>("Clock", "VisibilityOverride", 1f, "Visibility when using override keybind");
			overrideKeybind = config.Bind<KeyboardShortcut>("Clock", "OverrideKeybind", KeyboardShortcut.Empty, "Keybind to trigger visibility override");
			overrideToggle = config.Bind<bool>("Clock", "OverrideToggle", false, "Switch the override keybind between toggle or hold");
		}
	}
}
namespace BetterClock.Patches
{
	[HarmonyPatch(typeof(HUDManager))]
	internal static class ClockPatch
	{
		private static int lastTime = -1;

		private static bool overrideDisplay = false;

		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		public static void PostfixAwake(ref HUDManager __instance)
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_0063: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			if (!Settings.compact.Value)
			{
				return;
			}
			Transform parent = ((TMP_Text)__instance.clockNumber).transform.parent;
			if (Settings.raiseClock.Value)
			{
				Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos;
				if (pluginInfos.ContainsKey("SolosRingCompass") || pluginInfos.ContainsKey("LineCompassPlugin"))
				{
					parent.localPosition += new Vector3(0f, 20f, 0f);
				}
				else
				{
					parent.localPosition += new Vector3(0f, 40f, 0f);
				}
			}
			RectTransform component = ((Component)parent).GetComponent<RectTransform>();
			component.sizeDelta = new Vector2(component.sizeDelta.x, 50f);
			((TMP_Text)__instance.clockNumber).enableWordWrapping = false;
			RectTransform component2 = ((Component)__instance.clockIcon).GetComponent<RectTransform>();
			component2.sizeDelta *= 0.6f;
			if (!Settings.hours24.Value)
			{
				Transform transform = ((TMP_Text)__instance.clockNumber).transform;
				transform.localPosition += new Vector3(10f, -1f, 0f);
				Transform transform2 = ((Component)__instance.clockIcon).transform;
				transform2.localPosition += new Vector3(-25f, -2f, 0f);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("SetClockVisible")]
		public static bool PrefixVisible(ref HUDManager __instance)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut value = Settings.overrideKeybind.Value;
			if (Settings.overrideToggle.Value)
			{
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					overrideDisplay = !overrideDisplay;
				}
			}
			else
			{
				overrideDisplay = ((KeyboardShortcut)(ref value)).IsPressed();
			}
			if (overrideDisplay)
			{
				__instance.Clock.targetAlpha = Settings.visibilityOverride.Value;
				return false;
			}
			GameNetworkManager instance = GameNetworkManager.Instance;
			PlayerControllerB val = null;
			if ((Object)(object)instance != (Object)null)
			{
				val = instance.localPlayerController;
			}
			if ((Object)(object)val != (Object)null)
			{
				if (val.isInHangarShipRoom)
				{
					__instance.Clock.targetAlpha = Settings.visibilityShip.Value;
				}
				else if (val.isInsideFactory)
				{
					__instance.Clock.targetAlpha = Settings.visibilityInside.Value;
				}
				else
				{
					__instance.Clock.targetAlpha = Settings.visibilityOutside.Value;
				}
				return false;
			}
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetClock")]
		public static void PostfixSetClock(ref HUDManager __instance, ref float timeNormalized, ref float numberOfHours)
		{
			int num = (int)(timeNormalized * (60f * numberOfHours)) + 360;
			int num2 = num / 60 % 24;
			int num3 = num % 60;
			string text = ((!Settings.hours24.Value) ? ((TMP_Text)__instance.clockNumber).text : $"{num2}:{num3:00}");
			if (Settings.properTime.Value)
			{
				if (text.Length >= 3 && text[0] == '0' && text[2] == ':')
				{
					text = text.Substring(1);
				}
				else if (text.StartsWith("24:"))
				{
					text = "0:" + text.Substring(3);
				}
				if (text.StartsWith("0:") && text.EndsWith("M"))
				{
					text = "12:" + text.Substring(2);
				}
				if (num2 < 12 && text.EndsWith("PM"))
				{
					text = text.Substring(0, text.Length - 2) + "AM";
				}
				else if (num2 >= 12 && text.EndsWith("AM"))
				{
					text = text.Substring(0, text.Length - 2) + "PM";
				}
			}
			if (Settings.compact.Value)
			{
				text = text.Replace('\n', ' ').Replace("   ", " ");
			}
			if (Settings.leadingZero.Value && (text.Length <= 4 || text.Length == 7))
			{
				text = ((!Settings.darkZero.Value) ? ("0" + text) : ("<color=#602000>0</color>" + text));
			}
			((TMP_Text)__instance.clockNumber).text = text;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(TimeOfDay))]
		[HarmonyPatch("MoveTimeOfDay")]
		public static void PostfixMoveTimeOfDay(ref TimeOfDay __instance, ref float ___changeHUDTimeInterval)
		{
			if (Settings.fasterUpdate.Value)
			{
				int num = (int)(__instance.normalizedTimeOfDay * (60f * (float)__instance.numberOfHours));
				if (num != lastTime)
				{
					lastTime = num;
					HUDManager.Instance.SetClock(__instance.normalizedTimeOfDay, (float)__instance.numberOfHours, true);
					___changeHUDTimeInterval = 0f;
				}
			}
		}
	}
}

plugins/EladNLG-EladsHUD/EladsHUD.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using CustomHUD;
using GameNetcodeStuff;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EladsHUD")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Custom HUD for lethal company :]")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("EladsHUD")]
[assembly: AssemblyTitle("EladsHUD")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal class CustomHUD_Mono : MonoBehaviour
{
	public static CustomHUD_Mono instance;

	[Header("Health")]
	public CanvasGroup healthGroup;

	public Image healthBar;

	public TextMeshProUGUI healthText;

	[Header("Stamina")]
	public CanvasGroup staminaGroup;

	public Image staminaBar;

	public Image staminaBarChangeFG;

	public TextMeshProUGUI staminaText;

	public TextMeshProUGUI carryText;

	[Header("Battery")]
	public CanvasGroup batteryGroup;

	public Image batteryBar;

	public TextMeshProUGUI batteryText;

	[Header("Flashlight")]
	public CanvasGroup flashlightGroup;

	public Image flashlightBar;

	public TextMeshProUGUI flashlightText;

	private Color staminaColor;

	private Color staminaWarnColor = new Color(255f, 0f, 0f);

	private float colorLerp;

	private int lastHealth = 100;

	private float lastHealthChange = 0f;

	private void Awake()
	{
		if ((Object)(object)instance != (Object)null)
		{
			throw new Exception("2 instances of CustomHUD_Mono!");
		}
		instance = this;
	}

	private void Start()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		staminaColor = ((Graphic)staminaBar).color;
	}

	public void UpdateFromPlayer(PlayerControllerB player)
	{
		//IL_017d: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		lastHealthChange += Time.deltaTime;
		if (lastHealth != player.health)
		{
			lastHealth = player.health;
			lastHealthChange = 0f;
		}
		bool privateField = player.GetPrivateField<bool>("isWalking");
		int health = player.health;
		float sprintMeter = player.sprintMeter;
		float sprintTime = player.sprintTime;
		float num = 1f;
		if ((double)player.drunkness > 0.019999999552965164)
		{
			num *= Mathf.Abs(StartOfRound.Instance.drunknessSpeedEffect.Evaluate(player.drunkness) - 1.25f);
		}
		float num2 = (player.isSprinting ? (-1f / sprintTime * player.carryWeight * num) : ((player.isMovementHindered > 0 && privateField) ? (-1f / sprintTime * num * 0.5f) : ((!privateField) ? (1f / (sprintTime + 4f) * num) : (1f / (sprintTime + 9f) * num))));
		float num3 = num2 * 100f;
		if ((double)sprintMeter < 0.3)
		{
			colorLerp = Mathf.Clamp01(colorLerp + Time.deltaTime * 8f);
		}
		else
		{
			colorLerp = Mathf.Clamp01(colorLerp - Time.deltaTime * 8f);
		}
		((Graphic)staminaBar).color = Color.Lerp(staminaColor, staminaWarnColor, colorLerp);
		int num4 = Mathf.RoundToInt(sprintMeter * 100f);
		float num5 = Mathf.Sign(num2);
		float num6 = num5;
		if (num6 != -1f)
		{
			if (num6 != 0f)
			{
				if (num6 != 1f)
				{
				}
				staminaBar.fillAmount = sprintMeter;
				staminaBarChangeFG.fillAmount = 0f;
				((TMP_Text)staminaText).text = string.Format("{0}<size=75%><voffset=1>%</voffset></size> | +{1}<size=75%>/sec</size>", num4, num3.ToString("0.0"));
			}
			else
			{
				staminaBar.fillAmount = sprintMeter;
				staminaBarChangeFG.fillAmount = 0f;
				((TMP_Text)staminaText).text = $"{num4}<size=75%><voffset=1>%</voffset></size> | +0.0<size=75%>/sec</size>";
			}
		}
		else
		{
			staminaBar.fillAmount = sprintMeter - Mathf.Abs(num2);
			((Graphic)staminaBarChangeFG).color = Color.Lerp(Color.white, staminaWarnColor, colorLerp);
			staminaBarChangeFG.fillAmount = Mathf.Min(sprintMeter, Mathf.Abs(num2));
			((Transform)((Graphic)staminaBarChangeFG).rectTransform).localPosition = new Vector3(270f * Mathf.Max(0f, sprintMeter - Mathf.Abs(num2)), 0f);
			((TMP_Text)staminaText).text = string.Format("{0}<size=75%><voffset=1>%</voffset></size> | {1}<size=75%>/sec</size>", num4, num3.ToString("0.0"));
		}
		float num7 = Mathf.RoundToInt(Mathf.Clamp(player.carryWeight - 1f, 0f, 100f) * 105f);
		if (Plugin.shouldDoKGConversion)
		{
			num7 *= 0.453592f;
			((TMP_Text)carryText).text = $"{num7}<size=60%>kg</size>";
		}
		else
		{
			((TMP_Text)carryText).text = $"{num7}<size=60%>lb</size>";
		}
		healthBar.fillAmount = (float)health / 100f;
		((TMP_Text)healthText).text = health.ToString();
		healthGroup.alpha = Mathf.InverseLerp(5f, 4f, lastHealthChange);
		((Component)flashlightGroup).gameObject.SetActive(UpdateFlashlight(player));
		((Component)batteryGroup).gameObject.SetActive(UpdateBattery(player));
	}

	private bool UpdateFlashlight(PlayerControllerB player)
	{
		if (!((Behaviour)player.helmetLight).enabled)
		{
			return false;
		}
		GrabbableObject pocketedFlashlight = player.pocketedFlashlight;
		if ((Object)(object)pocketedFlashlight == (Object)null)
		{
			return false;
		}
		if (!pocketedFlashlight.itemProperties.requiresBattery)
		{
			return false;
		}
		flashlightBar.fillAmount = pocketedFlashlight.insertedBattery.charge;
		int num = Mathf.CeilToInt(pocketedFlashlight.insertedBattery.charge * pocketedFlashlight.itemProperties.batteryUsage);
		((TMP_Text)flashlightText).text = string.Format("{0}% <size=60%>{1}:{2}", Mathf.CeilToInt(pocketedFlashlight.insertedBattery.charge * 100f), num / 60, (num % 60).ToString("D2"));
		return true;
	}

	private bool UpdateBattery(PlayerControllerB player)
	{
		GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer;
		if ((Object)(object)currentlyHeldObjectServer == (Object)null)
		{
			return false;
		}
		if (!currentlyHeldObjectServer.itemProperties.requiresBattery)
		{
			return false;
		}
		batteryBar.fillAmount = currentlyHeldObjectServer.insertedBattery.charge;
		int num = (int)(currentlyHeldObjectServer.insertedBattery.charge / currentlyHeldObjectServer.itemProperties.batteryUsage);
		int num2 = Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * currentlyHeldObjectServer.itemProperties.batteryUsage);
		if (currentlyHeldObjectServer.itemProperties.itemIsTrigger)
		{
			((TMP_Text)batteryText).text = $"{Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * 100f)}% ({num} uses remaining)";
		}
		else
		{
			((TMP_Text)batteryText).text = string.Format("{0}% ({1}:{2} remaining)", Mathf.CeilToInt(currentlyHeldObjectServer.insertedBattery.charge * 100f), num2 / 60, (num2 % 60).ToString("D2"));
		}
		return true;
	}
}
namespace EladsHUD
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "EladsHUD";

		public const string PLUGIN_NAME = "EladsHUD";

		public const string PLUGIN_VERSION = "1.1.0";
	}
}
namespace CustomHUD
{
	[BepInPlugin("me.eladnlg.customhud", "Elads HUD", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		public AssetBundle assets;

		public GameObject HUD;

		public static bool shouldDoKGConversion;

		private void Awake()
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			if ((Object)(object)instance != (Object)null)
			{
				throw new Exception("what the cuck??? more than 1 plugin instance.");
			}
			instance = this;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Elad's HUD is loaded!");
			assets = AssetUtils.LoadAssetBundleFromResources("customhud", typeof(PlayerPatches).Assembly);
			HUD = assets.LoadAsset<GameObject>("PlayerInfo");
			Harmony val = new Harmony("me.eladnlg.customhud");
			val.PatchAll(Assembly.GetExecutingAssembly());
		}

		private void Start()
		{
			shouldDoKGConversion = Chainloader.PluginInfos.Any((KeyValuePair<string, PluginInfo> pair) => pair.Value.Metadata.GUID == "com.zduniusz.lethalcompany.lbtokg");
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	public class HUDPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void Awake_Postfix(HUDManager __instance)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			HUDElement[] privateField = __instance.GetPrivateField<HUDElement[]>("HUDElements");
			privateField[2].canvasGroup.alpha = 0f;
			GameObject val = Object.Instantiate<GameObject>(Plugin.instance.HUD, ((Component)privateField[2].canvasGroup).transform.parent);
			val.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f);
			privateField[2].canvasGroup = val.GetComponent<CanvasGroup>();
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	public static class PlayerPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch("LateUpdate")]
		private static void LateUpdate_Prefix(PlayerControllerB __instance)
		{
			if (((NetworkBehaviour)__instance).IsOwner && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject) && !((Object)(object)CustomHUD_Mono.instance == (Object)null))
			{
				CustomHUD_Mono.instance.UpdateFromPlayer(__instance);
			}
		}
	}
	internal static class ReflectionUtils
	{
		public static T GetPrivateField<T>(this object obj, string field)
		{
			return (T)obj.GetType().GetField(field, BindingFlags.Instance | BindingFlags.NonPublic).GetValue(obj);
		}
	}
}
namespace Jotunn.Utils
{
	public static class AssetUtils
	{
		public const char AssetBundlePathSeparator = '$';

		public static Texture2D LoadTexture(string texturePath, bool relativePath = true)
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			string text = texturePath;
			if (relativePath)
			{
				text = Path.Combine(Paths.PluginPath, texturePath);
			}
			if (!File.Exists(text))
			{
				return null;
			}
			if (!text.EndsWith(".png") && !text.EndsWith(".jpg"))
			{
				throw new Exception("LoadTexture can only load png or jpg textures");
			}
			byte[] array = File.ReadAllBytes(text);
			Texture2D val = new Texture2D(2, 2);
			val.LoadRawTextureData(array);
			return val;
		}

		public static Sprite LoadSpriteFromFile(string spritePath)
		{
			//IL_002e: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = LoadTexture(spritePath);
			if ((Object)(object)val != (Object)null)
			{
				return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), default(Vector2), 100f);
			}
			return null;
		}

		public static AssetBundle LoadAssetBundle(string bundlePath)
		{
			string text = Path.Combine(Paths.PluginPath, bundlePath);
			if (!File.Exists(text))
			{
				return null;
			}
			return AssetBundle.LoadFromFile(text);
		}

		public static AssetBundle LoadAssetBundleFromResources(string bundleName, Assembly resourceAssembly)
		{
			if (resourceAssembly == null)
			{
				throw new ArgumentNullException("Parameter resourceAssembly can not be null.");
			}
			string text = null;
			try
			{
				text = resourceAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith(bundleName));
			}
			catch (Exception)
			{
			}
			if (text == null)
			{
				Debug.LogError((object)("AssetBundle " + bundleName + " not found in assembly manifest"));
				return null;
			}
			AssetBundle result;
			using (Stream stream = resourceAssembly.GetManifestResourceStream(text))
			{
				result = AssetBundle.LoadFromStream(stream);
			}
			return result;
		}

		public static string LoadText(string path)
		{
			string text = Path.Combine(Paths.PluginPath, path);
			if (!File.Exists(text))
			{
				Debug.LogError((object)("Error, failed to load contents from non-existant path: $" + text));
				return null;
			}
			return File.ReadAllText(text);
		}

		public static Sprite LoadSprite(string assetPath)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			string text = Path.Combine(Paths.PluginPath, assetPath);
			if (!File.Exists(text))
			{
				return null;
			}
			if (text.Contains('$'.ToString()))
			{
				string[] array = text.Split('$');
				string text2 = array[0];
				string text3 = array[1];
				AssetBundle val = AssetBundle.LoadFromFile(text2);
				Sprite result = val.LoadAsset<Sprite>(text3);
				val.Unload(false);
				return result;
			}
			Texture2D val2 = LoadTexture(text, relativePath: false);
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return null;
			}
			return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), Vector2.zero);
		}
	}
}

plugins/EliteMasterEric-Coroner/Coroner.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LC_API.ServerAPI;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;

[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("EliteMasterEric")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Rework the Performance Report with new info, including cause of death.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Coroner")]
[assembly: AssemblyTitle("Coroner")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Coroner
{
	internal class AdvancedDeathTracker
	{
		public const int PLAYER_CAUSE_OF_DEATH_DROPSHIP = 300;

		private static readonly Dictionary<int, AdvancedCauseOfDeath> PlayerCauseOfDeath = new Dictionary<int, AdvancedCauseOfDeath>();

		public static void ClearDeathTracker()
		{
			PlayerCauseOfDeath.Clear();
		}

		public static void SetCauseOfDeath(int playerIndex, AdvancedCauseOfDeath causeOfDeath, bool broadcast = true)
		{
			PlayerCauseOfDeath[playerIndex] = causeOfDeath;
			if (broadcast)
			{
				DeathBroadcaster.BroadcastCauseOfDeath(playerIndex, causeOfDeath);
			}
		}

		public static void SetCauseOfDeath(int playerIndex, CauseOfDeath causeOfDeath, bool broadcast = true)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			SetCauseOfDeath(playerIndex, ConvertCauseOfDeath(causeOfDeath), broadcast);
		}

		public static void SetCauseOfDeath(PlayerControllerB playerController, CauseOfDeath causeOfDeath, bool broadcast = true)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			SetCauseOfDeath((int)playerController.playerClientId, ConvertCauseOfDeath(causeOfDeath), broadcast);
		}

		public static void SetCauseOfDeath(PlayerControllerB playerController, AdvancedCauseOfDeath causeOfDeath, bool broadcast = true)
		{
			SetCauseOfDeath((int)playerController.playerClientId, causeOfDeath, broadcast);
		}

		public static AdvancedCauseOfDeath GetCauseOfDeath(int playerIndex)
		{
			PlayerControllerB playerController = StartOfRound.Instance.allPlayerScripts[playerIndex];
			return GetCauseOfDeath(playerController);
		}

		public static AdvancedCauseOfDeath GetCauseOfDeath(PlayerControllerB playerController)
		{
			if (!PlayerCauseOfDeath.ContainsKey((int)playerController.playerClientId))
			{
				Plugin.Instance.PluginLogger.LogInfo((object)$"Player {playerController.playerClientId} has no custom cause of death stored! Using fallback...");
				return GuessCauseOfDeath(playerController);
			}
			Plugin.Instance.PluginLogger.LogInfo((object)$"Player {playerController.playerClientId} has custom cause of death stored! {PlayerCauseOfDeath[(int)playerController.playerClientId]}");
			return PlayerCauseOfDeath[(int)playerController.playerClientId];
		}

		public static AdvancedCauseOfDeath GuessCauseOfDeath(PlayerControllerB playerController)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Invalid comparison between Unknown and I4
			if (playerController.isPlayerDead)
			{
				if (IsHoldingJetpack(playerController))
				{
					if ((int)playerController.causeOfDeath == 2)
					{
						return AdvancedCauseOfDeath.Jetpack_Gravity;
					}
					if ((int)playerController.causeOfDeath == 3)
					{
						return AdvancedCauseOfDeath.Jetpack_Blast;
					}
				}
				return ConvertCauseOfDeath(playerController.causeOfDeath);
			}
			return AdvancedCauseOfDeath.Unknown;
		}

		public static bool IsHoldingJetpack(PlayerControllerB playerController)
		{
			GrabbableObject currentlyHeldObjectServer = playerController.currentlyHeldObjectServer;
			if ((Object)(object)currentlyHeldObjectServer == (Object)null)
			{
				return false;
			}
			GameObject gameObject = ((Component)currentlyHeldObjectServer).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				return false;
			}
			GrabbableObject component = gameObject.GetComponent<GrabbableObject>();
			if ((Object)(object)component == (Object)null)
			{
				return false;
			}
			if (component is JetpackItem)
			{
				return true;
			}
			return false;
		}

		public static AdvancedCauseOfDeath ConvertCauseOfDeath(CauseOfDeath causeOfDeath)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected I4, but got Unknown
			return (int)causeOfDeath switch
			{
				0 => AdvancedCauseOfDeath.Unknown, 
				1 => AdvancedCauseOfDeath.Bludgeoning, 
				2 => AdvancedCauseOfDeath.Gravity, 
				3 => AdvancedCauseOfDeath.Blast, 
				4 => AdvancedCauseOfDeath.Strangulation, 
				5 => AdvancedCauseOfDeath.Suffocation, 
				6 => AdvancedCauseOfDeath.Mauling, 
				7 => AdvancedCauseOfDeath.Gunshots, 
				8 => AdvancedCauseOfDeath.Crushing, 
				9 => AdvancedCauseOfDeath.Drowning, 
				10 => AdvancedCauseOfDeath.Abandoned, 
				11 => AdvancedCauseOfDeath.Electrocution, 
				_ => AdvancedCauseOfDeath.Unknown, 
			};
		}

		public static string StringifyCauseOfDeath(CauseOfDeath causeOfDeath)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return StringifyCauseOfDeath(ConvertCauseOfDeath(causeOfDeath));
		}

		public static string StringifyCauseOfDeath(AdvancedCauseOfDeath causeOfDeath)
		{
			return causeOfDeath switch
			{
				AdvancedCauseOfDeath.Bludgeoning => "Bludgeoned to death.", 
				AdvancedCauseOfDeath.Gravity => "Fell to their death.", 
				AdvancedCauseOfDeath.Blast => "Went out with a bang.", 
				AdvancedCauseOfDeath.Strangulation => "Strangled to death.", 
				AdvancedCauseOfDeath.Suffocation => "Suffocated to death.", 
				AdvancedCauseOfDeath.Mauling => "Mauled to death.", 
				AdvancedCauseOfDeath.Gunshots => "Shot to death by a turret.", 
				AdvancedCauseOfDeath.Crushing => "Crushed to death.", 
				AdvancedCauseOfDeath.Drowning => "Drowned to death.", 
				AdvancedCauseOfDeath.Abandoned => "Abandoned by their coworkers.", 
				AdvancedCauseOfDeath.Electrocution => "Electrocuted to death.", 
				AdvancedCauseOfDeath.Enemy_Bracken => "Had their neck snapped by a Bracken.", 
				AdvancedCauseOfDeath.Enemy_EyelessDog => "Was eaten by an Eyeless Dog.", 
				AdvancedCauseOfDeath.Enemy_ForestGiant => "Swallowed whole by a Forest Giant.", 
				AdvancedCauseOfDeath.Enemy_CircuitBees => "Electro-stung to death by Circuit Bees.", 
				AdvancedCauseOfDeath.Enemy_GhostGirl => "Died a mysterious death.", 
				AdvancedCauseOfDeath.Enemy_EarthLeviathan => "Swallowed whole by an Earth Leviathan.", 
				AdvancedCauseOfDeath.Enemy_BaboonHawk => "Was eaten by a Baboon Hawk.", 
				AdvancedCauseOfDeath.Enemy_Jester => "Was the butt of a joke.", 
				AdvancedCauseOfDeath.Enemy_SnareFlea => "Was suffocated a Snare Flea.", 
				AdvancedCauseOfDeath.Enemy_Hygrodere => "Was absorbed by a Hygrodere.", 
				AdvancedCauseOfDeath.Enemy_HoarderBug => "Was hoarded by a Hoarder Bug.", 
				AdvancedCauseOfDeath.Enemy_SporeLizard => "Was puffed by a Spore Lizard.", 
				AdvancedCauseOfDeath.Enemy_SandSpider => "Ensnared in the Sand Spider's web.", 
				AdvancedCauseOfDeath.Jetpack_Gravity => "Flew too close to the sun.", 
				AdvancedCauseOfDeath.Jetpack_Blast => "Turned into a firework.", 
				AdvancedCauseOfDeath.Player_Murder => "Was the victim of a murder.", 
				AdvancedCauseOfDeath.Player_Quicksand => "Got stuck in quicksand.", 
				AdvancedCauseOfDeath.Player_DepositItemsDesk => "Received a demotion.", 
				AdvancedCauseOfDeath.Player_Dropship => "Couldn't wait for their items.", 
				AdvancedCauseOfDeath.Player_StunGrenade => "Was the victim of a murder.", 
				AdvancedCauseOfDeath.Unknown => "Most sincerely dead.", 
				_ => "Most sincerely dead.", 
			};
		}

		internal static void SetCauseOfDeath(PlayerControllerB playerControllerB, object enemy_BaboonHawk)
		{
			throw new NotImplementedException();
		}
	}
	internal enum AdvancedCauseOfDeath
	{
		Unknown,
		Bludgeoning,
		Gravity,
		Blast,
		Strangulation,
		Suffocation,
		Mauling,
		Gunshots,
		Crushing,
		Drowning,
		Abandoned,
		Electrocution,
		Enemy_BaboonHawk,
		Enemy_Bracken,
		Enemy_CircuitBees,
		Enemy_EarthLeviathan,
		Enemy_EyelessDog,
		Enemy_ForestGiant,
		Enemy_GhostGirl,
		Enemy_Jester,
		Enemy_SnareFlea,
		Enemy_SporeLizard,
		Enemy_Hygrodere,
		Enemy_SandSpider,
		Enemy_Thumper,
		Enemy_HoarderBug,
		Jetpack_Gravity,
		Jetpack_Blast,
		Player_Quicksand,
		Player_Murder,
		Player_DepositItemsDesk,
		Player_Dropship,
		Player_StunGrenade
	}
	internal class DeathBroadcaster
	{
		private const string SIGNATURE_DEATH = "com.elitemastereric.coroner.death";

		public static void Initialize()
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Initializing DeathBroadcaster...");
			if (Plugin.Instance.IsLC_APIPresent)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is present! Registering signature...");
				Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(OnBroadcastString));
			}
			else
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is not present! Skipping registration...");
			}
		}

		private static void OnBroadcastString(string data, string signature)
		{
			if (signature == "com.elitemastereric.coroner.death")
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Broadcast has been received from LC_API!");
				string[] array = data.Split('|');
				int playerIndex = int.Parse(array[0]);
				int num = int.Parse(array[1]);
				AdvancedCauseOfDeath causeOfDeath = (AdvancedCauseOfDeath)num;
				Plugin.Instance.PluginLogger.LogInfo((object)("Player " + playerIndex + " died of " + AdvancedDeathTracker.StringifyCauseOfDeath(causeOfDeath)));
				AdvancedDeathTracker.SetCauseOfDeath(playerIndex, causeOfDeath, broadcast: false);
			}
		}

		public static void BroadcastCauseOfDeath(int playerId, AdvancedCauseOfDeath causeOfDeath)
		{
			AttemptBroadcast(BuildData(playerId, causeOfDeath), "com.elitemastereric.coroner.death");
		}

		private static string BuildData(int playerId, AdvancedCauseOfDeath causeOfDeath)
		{
			string text = playerId.ToString();
			int num = (int)causeOfDeath;
			return text + "|" + num;
		}

		private static void AttemptBroadcast(string data, string signature)
		{
			if (Plugin.Instance.IsLC_APIPresent)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is present! Broadcasting...");
				Networking.Broadcast(data, signature);
			}
			else
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"LC_API is not present! Skipping broadcast...");
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "Coroner";

		public const string PLUGIN_NAME = "Coroner";

		public const string PLUGIN_VERSION = "1.0.0";

		public const string PLUGIN_GUID = "com.elitemastereric.coroner";
	}
	[BepInPlugin("com.elitemastereric.coroner", "Coroner", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public ManualLogSource PluginLogger;

		public PluginConfig PluginConfig;

		public bool IsLC_APIPresent = false;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			Instance = this;
			PluginLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("com.elitemastereric.coroner");
			val.PatchAll();
			PluginLogger.LogInfo((object)"Plugin Coroner (com.elitemastereric.coroner) is loaded!");
			LoadConfig();
			QueryLC_API();
			DeathBroadcaster.Initialize();
		}

		private void QueryLC_API()
		{
			PluginLogger.LogInfo((object)"Checking for LC_API...");
			if (Chainloader.PluginInfos.ContainsKey("LC_API"))
			{
				Chainloader.PluginInfos.TryGetValue("LC_API", out var value);
				if (value == null)
				{
					PluginLogger.LogError((object)"Detected LC_API, but could not get plugin info!");
					IsLC_APIPresent = false;
				}
				else
				{
					PluginLogger.LogInfo((object)("LCAPI is present! " + value.Metadata.GUID + ":" + value.Metadata.Version));
					IsLC_APIPresent = true;
				}
			}
			else
			{
				PluginLogger.LogInfo((object)"LCAPI is not present.");
				IsLC_APIPresent = false;
			}
		}

		private void LoadConfig()
		{
			PluginConfig = new PluginConfig();
			PluginConfig.BindConfig(((BaseUnityPlugin)this).Config);
		}
	}
	public class PluginConfig
	{
		private ConfigEntry<bool> DisplayCauseOfDeath;

		private ConfigEntry<bool> DisplayFunnyNotes;

		private ConfigEntry<bool> DeathReplacesNotes;

		public void BindConfig(ConfigFile _config)
		{
			DisplayCauseOfDeath = _config.Bind<bool>("General", "DisplayCauseOfDeath", true, "Display the cause of death in the player notes.");
			DisplayFunnyNotes = _config.Bind<bool>("General", "DisplayFunnyNotes", true, "Display a random note when the player has no notes.");
			DeathReplacesNotes = _config.Bind<bool>("General", "DeathReplacesNotes", true, "True to replace notes when the player dies, false to append.");
		}

		public bool ShouldDisplayCauseOfDeath()
		{
			return DisplayCauseOfDeath.Value;
		}

		public bool ShouldDisplayFunnyNotes()
		{
			return DisplayFunnyNotes.Value;
		}

		public bool ShouldDeathReplaceNotes()
		{
			return DeathReplacesNotes.Value;
		}
	}
}
namespace Coroner.Patch
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	[HarmonyPatch("KillPlayer")]
	internal class PlayerControllerBKillPlayerPatch
	{
		public static void Prefix(PlayerControllerB __instance, ref CauseOfDeath causeOfDeath)
		{
			if ((int)causeOfDeath == 300)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player died from item dropship! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Dropship);
				causeOfDeath = (CauseOfDeath)8;
			}
			else if (__instance.isSinking && (int)causeOfDeath == 5)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player died of suffociation while sinking in quicksand! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Quicksand);
			}
			else
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is dying! No cause of death...");
			}
		}
	}
	[HarmonyPatch(typeof(DepositItemsDesk))]
	[HarmonyPatch("AnimationGrabPlayer")]
	internal class DepositItemsDeskAnimationGrabPlayerPatch
	{
		public static void Postfix(int playerID)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after tentacle devouring...");
			PlayerControllerB playerController = StartOfRound.Instance.allPlayerScripts[playerID];
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is dying! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(playerController, AdvancedCauseOfDeath.Player_DepositItemsDesk);
		}
	}
	[HarmonyPatch(typeof(JesterAI))]
	[HarmonyPatch("killPlayerAnimation")]
	internal class JesterAIKillPlayerAnimationPatch
	{
		public static void Postfix(JesterAI __instance, int playerId)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after Jester mauling...");
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_Jester);
		}
	}
	[HarmonyPatch(typeof(SandWormAI))]
	[HarmonyPatch("EatPlayer")]
	internal class SandWormAIEatPlayerPatch
	{
		public static void Postfix(PlayerControllerB playerScript)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after Sand Worm devouring...");
			if ((Object)(object)playerScript == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(playerScript, AdvancedCauseOfDeath.Enemy_EarthLeviathan);
		}
	}
	[HarmonyPatch(typeof(RedLocustBees))]
	[HarmonyPatch("BeeKillPlayerOnLocalClient")]
	internal class RedLocustBeesBeeKillPlayerOnLocalClientPatch
	{
		public static void Postfix(int playerId)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after Circuit Bee electrocution...");
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
			}
			else if (val.isPlayerDead)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_CircuitBees);
			}
			else
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Player is somehow still alive! Skipping...");
			}
		}
	}
	[HarmonyPatch(typeof(DressGirlAI))]
	[HarmonyPatch("OnCollideWithPlayer")]
	internal class DressGirlAIOnCollideWithPlayerPatch
	{
		public static void Postfix(DressGirlAI __instance, Collider other)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Processing Ghost Girl player collision...");
			if ((Object)(object)__instance.hauntingPlayer == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after collision!");
			}
			else if (__instance.hauntingPlayer.isPlayerDead)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(__instance.hauntingPlayer, AdvancedCauseOfDeath.Enemy_GhostGirl);
			}
		}
	}
	[HarmonyPatch(typeof(FlowermanAI))]
	[HarmonyPatch("killAnimation")]
	internal class FlowermanAIKillAnimationPatch
	{
		public static void Postfix(FlowermanAI __instance)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after Bracken snapping neck...");
			if ((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after snapping neck!");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(((EnemyAI)__instance).inSpecialAnimationWithPlayer, AdvancedCauseOfDeath.Enemy_Bracken);
		}
	}
	[HarmonyPatch(typeof(ForestGiantAI))]
	[HarmonyPatch("EatPlayerAnimation")]
	internal class ForestGiantAIEatPlayerAnimationPatch
	{
		public static void Postfix(PlayerControllerB playerBeingEaten)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after Forest Giant devouring...");
			if ((Object)(object)playerBeingEaten == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(playerBeingEaten, AdvancedCauseOfDeath.Enemy_ForestGiant);
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	[HarmonyPatch("KillPlayer")]
	internal class MouthDogAIKillPlayerPatch
	{
		public static void Postfix(int playerId)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Accessing state after dog devouring...");
			PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId];
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
				return;
			}
			Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
			AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_EyelessDog);
		}
	}
	[HarmonyPatch(typeof(CentipedeAI))]
	[HarmonyPatch("DamagePlayerOnIntervals")]
	internal class CentipedeAIDamagePlayerOnIntervalsPatch
	{
		public static void Postfix(CentipedeAI __instance)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Invalid comparison between Unknown and I4
			Plugin.Instance.PluginLogger.LogInfo((object)"Handling Snare Flea damage...");
			if ((Object)(object)__instance.clingingToPlayer == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player being clung to!");
			}
			else if (__instance.clingingToPlayer.isPlayerDead && (int)__instance.clingingToPlayer.causeOfDeath == 5)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(__instance.clingingToPlayer, AdvancedCauseOfDeath.Enemy_SnareFlea);
			}
			else if (__instance.clingingToPlayer.isPlayerDead)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Player died while attacked by Snare Flea! Skipping...");
			}
		}
	}
	[HarmonyPatch(typeof(BaboonBirdAI))]
	[HarmonyPatch("OnCollideWithPlayer")]
	internal class BaboonBirdAIOnCollideWithPlayerPatch
	{
		public static void Postfix(BaboonBirdAI __instance, Collider other)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Handling Baboon Hawk damage...");
			bool value = Traverse.Create((object)__instance).Field("doingKillAnimation").GetValue<bool>();
			PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, ((EnemyAI)__instance).inSpecialAnimation || value, false);
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access player after death!");
			}
			else if (val.isPlayerDead)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(val, AdvancedCauseOfDeath.Enemy_BaboonHawk);
			}
			else
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Player is somehow still alive! Skipping...");
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	[HarmonyPatch("DamagePlayerFromOtherClientClientRpc")]
	internal class PlayerControllerBDamagePlayerFromOtherClientClientRpcPatch
	{
		public static void Postfix(PlayerControllerB __instance, int playerWhoHit)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Handling friendly fire damage...");
			if ((Object)(object)__instance == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Could not access victim after death!");
			}
			else if (__instance.isPlayerDead)
			{
				Plugin.Instance.PluginLogger.LogInfo((object)"Player is now dead! Setting special cause of death...");
				AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder);
			}
			else
			{
				Plugin.Instance.PluginLogger.LogWarning((object)"Player is somehow still alive! Skipping...");
			}
		}
	}
	[HarmonyPatch(typeof(ExtensionLadderItem))]
	[HarmonyPatch("StartLadderAnimation")]
	internal class ExtensionLadderItemStartLadderAnimationPatch
	{
		public static void Postfix(ExtensionLadderItem __instance)
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Instance.PluginLogger.LogInfo((object)"Extension ladder started animation! Modifying kill trigger...");
			GameObject gameObject = ((Component)__instance).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch GameObject from ExtensionLadderItem.");
			}
			Transform val = gameObject.transform.Find("AnimContainer/MeshContainer/LadderMeshContainer/BaseLadder/LadderSecondPart/KillTrigger");
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger Transform from ExtensionLadderItem.");
			}
			GameObject gameObject2 = ((Component)val).gameObject;
			if ((Object)(object)gameObject2 == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger GameObject from ExtensionLadderItem.");
			}
			KillLocalPlayer component = gameObject2.GetComponent<KillLocalPlayer>();
			if ((Object)(object)component == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillLocalPlayer from KillTrigger GameObject.");
			}
			component.causeOfDeath = (CauseOfDeath)8;
		}
	}
	[HarmonyPatch(typeof(ItemDropship))]
	[HarmonyPatch("Start")]
	internal class ItemDropshipStartPatch
	{
		public static void Postfix(ItemDropship __instance)
		{
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Instance.PluginLogger.LogInfo((object)"Item dropship spawned! Modifying kill trigger...");
			GameObject gameObject = ((Component)__instance).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch GameObject from ItemDropship.");
			}
			Transform val = gameObject.transform.Find("ItemShip/KillTrigger");
			if ((Object)(object)val == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger Transform from ItemDropship.");
			}
			GameObject gameObject2 = ((Component)val).gameObject;
			if ((Object)(object)gameObject2 == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillTrigger GameObject from ItemDropship.");
			}
			KillLocalPlayer component = gameObject2.GetComponent<KillLocalPlayer>();
			if ((Object)(object)component == (Object)null)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Could not fetch KillLocalPlayer from KillTrigger GameObject.");
			}
			component.causeOfDeath = (CauseOfDeath)300;
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	[HarmonyPatch("FillEndGameStats")]
	internal class HUDManagerFillEndGameStatsPatch
	{
		public static readonly string[] FUNNY_NOTES = new string[20]
		{
			"* The goofiest goober.\n", "* The cutest employee.\n", "* Had the most fun.\n", "* Had the least fun.\n", "* The bravest employee.\n", "* Did a sick flip.\n", "* Stubbed their toe.\n", "* The most likely to die next time.\n", "* The least likely to die next time.\n", "* Dislikes smoke.\n",
			"* A team player.\n", "* A real go-getter.\n", "* Ate the most snacks.\n", "* Passed GO and collected $200.\n", "* Got freaky on a Friday night.\n", "* I think this one's a serial killer.\n", "* Perfectly unremarkable.\n", "* Hasn't called their mother in a while.\n", "* Has IP address 127.0.0.1.\n", "* Secretly a lizard.\n"
		};

		private static readonly Random RANDOM = new Random();

		public static void Postfix(HUDManager __instance)
		{
			try
			{
				OverridePerformanceReport(__instance);
			}
			catch (Exception ex)
			{
				Plugin.Instance.PluginLogger.LogError((object)"Coroner threw an exception while Caught an exception overriding performance report: ");
				Plugin.Instance.PluginLogger.LogError((object)ex.ToString());
				Plugin.Instance.PluginLogger.LogError((object)ex.StackTrace.ToString());
			}
		}

		private static void OverridePerformanceReport(HUDManager __instance)
		{
			Plugin.Instance.PluginLogger.LogInfo((object)"Applying Coroner patches to player notes...");
			for (int i = 0; i < __instance.statsUIElements.playerNotesText.Length; i++)
			{
				PlayerControllerB val = __instance.playersManager.allPlayerScripts[i];
				if (!val.disconnectedMidGame && !val.isPlayerDead && !val.isPlayerControlled)
				{
					Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is not controlled by a player. Skipping..."));
					continue;
				}
				TextMeshProUGUI val2 = __instance.statsUIElements.playerNotesText[i];
				if (val.isPlayerDead)
				{
					if (Plugin.Instance.PluginConfig.ShouldDisplayCauseOfDeath())
					{
						AdvancedCauseOfDeath causeOfDeath = AdvancedDeathTracker.GetCauseOfDeath(val);
						string text = AdvancedDeathTracker.StringifyCauseOfDeath(causeOfDeath);
						if (Plugin.Instance.PluginConfig.ShouldDeathReplaceNotes())
						{
							Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is dead! Replacing notes with Cause of Death..."));
							((TMP_Text)val2).text = "Notes: \n";
						}
						else
						{
							Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is dead! Appending notes with Cause of Death..."));
						}
						((TMP_Text)val2).text = ((TMP_Text)val2).text + "* " + text + "\n";
					}
					else
					{
						Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is dead, but Config says leave it be..."));
					}
					continue;
				}
				Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " is not dead!"));
				if (((TMP_Text)val2).text == "Notes: \n")
				{
					if (Plugin.Instance.PluginConfig.ShouldDisplayFunnyNotes())
					{
						Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " has no notes! Injecting something funny..."));
						((TMP_Text)val2).text = "Notes: \n";
						((TMP_Text)val2).text = ((TMP_Text)val2).text + ChooseFunnyNote();
					}
					else
					{
						Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " has no notes, but Config says leave it be..."));
					}
				}
				else
				{
					Plugin.Instance.PluginLogger.LogInfo((object)("Player " + i + " has notes! Let's leave it be..."));
				}
			}
			AdvancedDeathTracker.ClearDeathTracker();
		}

		private static string ChooseFunnyNote()
		{
			return FUNNY_NOTES[RANDOM.Next(FUNNY_NOTES.Length)];
		}
	}
}

plugins/Evaisa-LethalLib/LethalLib/LethalLib.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DunGen;
using DunGen.Graph;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On;
using Unity.Netcode;
using UnityEngine;

[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("LethalLib")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Mod for Lethal Company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a7bb0da5babd2808c30ccbaf9654dbbf38015de8")]
[assembly: AssemblyProduct("LethalLib")]
[assembly: AssemblyTitle("LethalLib")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalLib
{
	[BepInPlugin("evaisa.lethallib", "LethalLib", "0.6.2")]
	public class Plugin : BaseUnityPlugin
	{
		public const string ModGUID = "evaisa.lethallib";

		public const string ModName = "LethalLib";

		public const string ModVersion = "0.6.2";

		public static AssetBundle MainAssets;

		public static ManualLogSource logger;

		private void Awake()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			logger = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"LethalLib loaded!!");
			new ILHook((MethodBase)typeof(StackTrace).GetMethod("AddFrames", BindingFlags.Instance | BindingFlags.NonPublic), new Manipulator(IlHook));
			Enemies.Init();
			Items.Init();
			Unlockables.Init();
			MapObjects.Init();
			Dungeon.Init();
			NetworkPrefabs.Init();
		}

		private void IlHook(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, (MethodBase)typeof(StackFrame).GetMethod("GetFileLineNumber", BindingFlags.Instance | BindingFlags.Public))
			});
			val.RemoveRange(2);
			val.EmitDelegate<Func<StackFrame, string>>((Func<StackFrame, string>)GetLineOrIL);
		}

		private static string GetLineOrIL(StackFrame instance)
		{
			int fileLineNumber = instance.GetFileLineNumber();
			if (fileLineNumber == -1 || fileLineNumber == 0)
			{
				return "IL_" + instance.GetILOffset().ToString("X4");
			}
			return fileLineNumber.ToString();
		}
	}
}
namespace LethalLib.Modules
{
	public class Dungeon
	{
		public class CustomDungeonArchetype
		{
			public DungeonArchetype archeType;

			public Levels.LevelTypes LevelTypes;

			public int lineIndex = -1;
		}

		public class CustomGraphLine
		{
			public GraphLine graphLine;

			public Levels.LevelTypes LevelTypes;
		}

		public class CustomDungeon
		{
			public int rarity;

			public DungeonFlow dungeonFlow;

			public Levels.LevelTypes LevelTypes;

			public int dungeonIndex = -1;

			public AudioClip firstTimeDungeonAudio;
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_GenerateNewFloor <0>__RoundManager_GenerateNewFloor;

			public static hook_Start <1>__RoundManager_Start;

			public static hook_Start <2>__StartOfRound_Start;
		}

		public static List<CustomDungeonArchetype> customDungeonArchetypes = new List<CustomDungeonArchetype>();

		public static List<CustomGraphLine> customGraphLines = new List<CustomGraphLine>();

		public static Dictionary<string, TileSet> extraTileSets = new Dictionary<string, TileSet>();

		public static Dictionary<string, GameObjectChance> extraRooms = new Dictionary<string, GameObjectChance>();

		public static List<CustomDungeon> customDungeons = new List<CustomDungeon>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//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_005e: Expected O, but got Unknown
			object obj = <>O.<0>__RoundManager_GenerateNewFloor;
			if (obj == null)
			{
				hook_GenerateNewFloor val = RoundManager_GenerateNewFloor;
				<>O.<0>__RoundManager_GenerateNewFloor = val;
				obj = (object)val;
			}
			RoundManager.GenerateNewFloor += (hook_GenerateNewFloor)obj;
			object obj2 = <>O.<1>__RoundManager_Start;
			if (obj2 == null)
			{
				hook_Start val2 = RoundManager_Start;
				<>O.<1>__RoundManager_Start = val2;
				obj2 = (object)val2;
			}
			RoundManager.Start += (hook_Start)obj2;
			object obj3 = <>O.<2>__StartOfRound_Start;
			if (obj3 == null)
			{
				hook_Start val3 = StartOfRound_Start;
				<>O.<2>__StartOfRound_Start = val3;
				obj3 = (object)val3;
			}
			StartOfRound.Start += (hook_Start)obj3;
		}

		private static void StartOfRound_Start(orig_Start orig, StartOfRound self)
		{
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			foreach (CustomDungeon dungeon in customDungeons)
			{
				SelectableLevel[] levels = self.levels;
				foreach (SelectableLevel val in levels)
				{
					string name = ((Object)val).name;
					if (Enum.IsDefined(typeof(Levels.LevelTypes), name))
					{
						Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name);
						if (dungeon.LevelTypes.HasFlag(levelTypes) && !val.dungeonFlowTypes.Any((IntWithRarity rarityInt) => rarityInt.id == dungeon.dungeonIndex))
						{
							List<IntWithRarity> list = val.dungeonFlowTypes.ToList();
							list.Add(new IntWithRarity
							{
								id = dungeon.dungeonIndex,
								rarity = dungeon.rarity
							});
							val.dungeonFlowTypes = list.ToArray();
						}
					}
				}
			}
			Plugin.logger.LogInfo((object)"Added custom dungeons to levels");
			orig.Invoke(self);
		}

		private static void RoundManager_Start(orig_Start orig, RoundManager self)
		{
			foreach (CustomDungeon customDungeon in customDungeons)
			{
				if (self.dungeonFlowTypes.Contains(customDungeon.dungeonFlow))
				{
					continue;
				}
				List<DungeonFlow> list = self.dungeonFlowTypes.ToList();
				list.Add(customDungeon.dungeonFlow);
				self.dungeonFlowTypes = list.ToArray();
				int dungeonIndex = self.dungeonFlowTypes.Length - 1;
				customDungeon.dungeonIndex = dungeonIndex;
				List<AudioClip> list2 = self.firstTimeDungeonAudios.ToList();
				if (list2.Count != self.dungeonFlowTypes.Length - 1)
				{
					while (list2.Count < self.dungeonFlowTypes.Length - 1)
					{
						list2.Add(null);
					}
				}
				list2.Add(customDungeon.firstTimeDungeonAudio);
				self.firstTimeDungeonAudios = list2.ToArray();
			}
			orig.Invoke(self);
		}

		private static void RoundManager_GenerateNewFloor(orig_GenerateNewFloor orig, RoundManager self)
		{
			string name = ((Object)self.currentLevel).name;
			if (Enum.IsDefined(typeof(Levels.LevelTypes), name))
			{
				Levels.LevelTypes levelEnum = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name);
				int index = 0;
				self.dungeonGenerator.Generator.DungeonFlow.Lines.ForEach(delegate(GraphLine line)
				{
					foreach (CustomDungeonArchetype customDungeonArchetype in customDungeonArchetypes)
					{
						if (customDungeonArchetype.LevelTypes.HasFlag(levelEnum) && !line.DungeonArchetypes.Contains(customDungeonArchetype.archeType) && (customDungeonArchetype.lineIndex == -1 || customDungeonArchetype.lineIndex == index))
						{
							line.DungeonArchetypes.Add(customDungeonArchetype.archeType);
							Plugin.logger.LogInfo((object)("Added " + ((Object)customDungeonArchetype.archeType).name + " to " + name));
						}
					}
					foreach (DungeonArchetype dungeonArchetype in line.DungeonArchetypes)
					{
						string name2 = ((Object)dungeonArchetype).name;
						if (extraTileSets.ContainsKey(name2))
						{
							TileSet val4 = extraTileSets[name2];
							if (!dungeonArchetype.TileSets.Contains(val4))
							{
								dungeonArchetype.TileSets.Add(val4);
								Plugin.logger.LogInfo((object)("Added " + ((Object)val4).name + " to " + name));
							}
						}
						foreach (TileSet tileSet in dungeonArchetype.TileSets)
						{
							string name3 = ((Object)tileSet).name;
							if (extraRooms.ContainsKey(name3))
							{
								GameObjectChance item = extraRooms[name3];
								if (!tileSet.TileWeights.Weights.Contains(item))
								{
									tileSet.TileWeights.Weights.Add(item);
								}
							}
						}
					}
					index++;
				});
				foreach (CustomGraphLine customGraphLine in customGraphLines)
				{
					if (customGraphLine.LevelTypes.HasFlag(levelEnum) && !self.dungeonGenerator.Generator.DungeonFlow.Lines.Contains(customGraphLine.graphLine))
					{
						self.dungeonGenerator.Generator.DungeonFlow.Lines.Add(customGraphLine.graphLine);
					}
				}
			}
			orig.Invoke(self);
			NetworkManager val = Object.FindObjectOfType<NetworkManager>();
			RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>();
			RandomMapObject[] array2 = array;
			foreach (RandomMapObject val2 in array2)
			{
				for (int j = 0; j < val2.spawnablePrefabs.Count; j++)
				{
					string prefabName = ((Object)val2.spawnablePrefabs[j]).name;
					NetworkPrefab val3 = val.NetworkConfig.Prefabs.m_Prefabs.First((NetworkPrefab x) => ((Object)x.Prefab).name == prefabName);
					if (val3 != null && (Object)(object)val3.Prefab != (Object)(object)val2.spawnablePrefabs[j])
					{
						val2.spawnablePrefabs[j] = val3.Prefab;
					}
				}
			}
		}

		public static void AddArchetype(DungeonArchetype archetype, Levels.LevelTypes levelFlags, int lineIndex = -1)
		{
			CustomDungeonArchetype customDungeonArchetype = new CustomDungeonArchetype();
			customDungeonArchetype.archeType = archetype;
			customDungeonArchetype.LevelTypes = levelFlags;
			customDungeonArchetype.lineIndex = lineIndex;
			customDungeonArchetypes.Add(customDungeonArchetype);
		}

		public static void AddLine(GraphLine line, Levels.LevelTypes levelFlags)
		{
			CustomGraphLine customGraphLine = new CustomGraphLine();
			customGraphLine.graphLine = line;
			customGraphLine.LevelTypes = levelFlags;
			customGraphLines.Add(customGraphLine);
		}

		public static void AddLine(DungeonGraphLineDef line, Levels.LevelTypes levelFlags)
		{
			AddLine(line.graphLine, levelFlags);
		}

		public static void AddTileSet(TileSet set, string archetypeName)
		{
			extraTileSets.Add(archetypeName, set);
		}

		public static void AddRoom(GameObjectChance room, string tileSetName)
		{
			extraRooms.Add(tileSetName, room);
		}

		public static void AddRoom(GameObjectChanceDef room, string tileSetName)
		{
			AddRoom(room.gameObjectChance, tileSetName);
		}

		public static void AddDungeon(DungeonDef dungeon, Levels.LevelTypes levelFlags)
		{
			AddDungeon(dungeon.dungeonFlow, dungeon.rarity, levelFlags, dungeon.firstTimeDungeonAudio);
		}

		public static void AddDungeon(DungeonFlow dungeon, int rarity, Levels.LevelTypes levelFlags, AudioClip firstTimeDungeonAudio = null)
		{
			customDungeons.Add(new CustomDungeon
			{
				dungeonFlow = dungeon,
				rarity = rarity,
				LevelTypes = levelFlags,
				firstTimeDungeonAudio = firstTimeDungeonAudio
			});
		}
	}
	public class Enemies
	{
		public enum SpawnType
		{
			Default,
			Daytime,
			Outside
		}

		public class SpawnableEnemy
		{
			public EnemyType enemy;

			public int rarity;

			public Levels.LevelTypes spawnLevels;

			public SpawnType spawnType;

			public TerminalNode terminalNode;

			public TerminalKeyword infoKeyword;

			public string modName;

			public SpawnableEnemy(EnemyType enemy, int rarity, Levels.LevelTypes spawnLevels, SpawnType spawnType)
			{
				this.enemy = enemy;
				this.rarity = rarity;
				this.spawnLevels = spawnLevels;
				this.spawnType = spawnType;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__RegisterLevelEnemies;

			public static hook_Start <1>__Terminal_Start;
		}

		public static List<SpawnableEnemy> spawnableEnemies = new List<SpawnableEnemy>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			object obj = <>O.<0>__RegisterLevelEnemies;
			if (obj == null)
			{
				hook_Awake val = RegisterLevelEnemies;
				<>O.<0>__RegisterLevelEnemies = val;
				obj = (object)val;
			}
			StartOfRound.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__Terminal_Start;
			if (obj2 == null)
			{
				hook_Start val2 = Terminal_Start;
				<>O.<1>__Terminal_Start = val2;
				obj2 = (object)val2;
			}
			Terminal.Start += (hook_Start)obj2;
		}

		private static void Terminal_Start(orig_Start orig, Terminal self)
		{
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Expected O, but got Unknown
			TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info");
			List<string> list = new List<string>();
			foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies)
			{
				if (list.Contains(spawnableEnemy.enemy.enemyName))
				{
					Plugin.logger.LogInfo((object)("Skipping " + spawnableEnemy.enemy.enemyName + " because it was already added"));
					continue;
				}
				if ((Object)(object)spawnableEnemy.terminalNode == (Object)null)
				{
					spawnableEnemy.terminalNode = ScriptableObject.CreateInstance<TerminalNode>();
					spawnableEnemy.terminalNode.displayText = spawnableEnemy.enemy.enemyName + "\n\nDanger level: Unknown\n\n[No information about this creature was found.]\n\n";
					spawnableEnemy.terminalNode.clearPreviousText = true;
					spawnableEnemy.terminalNode.maxCharactersToType = 35;
					spawnableEnemy.terminalNode.creatureName = spawnableEnemy.enemy.enemyName;
				}
				TerminalKeyword val2 = (((Object)(object)spawnableEnemy.infoKeyword != (Object)null) ? spawnableEnemy.infoKeyword : TerminalUtils.CreateTerminalKeyword(spawnableEnemy.terminalNode.creatureName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val));
				val2.defaultVerb = val;
				List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList();
				list2.Add(val2);
				self.terminalNodes.allKeywords = list2.ToArray();
				List<CompatibleNoun> list3 = val.compatibleNouns.ToList();
				list3.Add(new CompatibleNoun
				{
					noun = val2,
					result = spawnableEnemy.terminalNode
				});
				val.compatibleNouns = list3.ToArray();
				spawnableEnemy.terminalNode.creatureFileID = self.enemyFiles.Count;
				self.enemyFiles.Add(spawnableEnemy.terminalNode);
				spawnableEnemy.enemy.enemyPrefab.GetComponentInChildren<ScanNodeProperties>().creatureScanID = spawnableEnemy.terminalNode.creatureFileID;
			}
			orig.Invoke(self);
		}

		private static void RegisterLevelEnemies(orig_Awake orig, StartOfRound self)
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Expected O, but got Unknown
			orig.Invoke(self);
			SelectableLevel[] levels = self.levels;
			foreach (SelectableLevel val in levels)
			{
				string name = ((Object)val).name;
				if (!Enum.IsDefined(typeof(Levels.LevelTypes), name))
				{
					continue;
				}
				Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name);
				foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies)
				{
					if (!spawnableEnemy.spawnLevels.HasFlag(levelTypes))
					{
						continue;
					}
					SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity
					{
						enemyType = spawnableEnemy.enemy,
						rarity = spawnableEnemy.rarity
					};
					switch (spawnableEnemy.spawnType)
					{
					case SpawnType.Default:
						if (!val.Enemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy))
						{
							val.Enemies.Add(item);
							Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Default]"));
						}
						break;
					case SpawnType.Daytime:
						if (!val.DaytimeEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy))
						{
							val.DaytimeEnemies.Add(item);
							Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Daytime]"));
						}
						break;
					case SpawnType.Outside:
						if (!val.OutsideEnemies.Any((SpawnableEnemyWithRarity x) => (Object)(object)x.enemyType == (Object)(object)spawnableEnemy.enemy))
						{
							val.OutsideEnemies.Add(item);
							Plugin.logger.LogInfo((object)("Added " + ((Object)spawnableEnemy.enemy).name + " to " + name + " with SpawnType [Outside]"));
						}
						break;
					}
				}
			}
		}

		public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, SpawnType spawnType, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null)
		{
			SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, spawnType);
			spawnableEnemy.terminalNode = infoNode;
			spawnableEnemy.infoKeyword = infoKeyword;
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			spawnableEnemy.modName = name;
			spawnableEnemies.Add(spawnableEnemy);
		}

		public static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null)
		{
			SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, enemy.isDaytimeEnemy ? SpawnType.Daytime : (enemy.isOutsideEnemy ? SpawnType.Outside : SpawnType.Default));
			spawnableEnemy.terminalNode = infoNode;
			spawnableEnemy.infoKeyword = infoKeyword;
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			spawnableEnemy.modName = name;
			spawnableEnemies.Add(spawnableEnemy);
		}
	}
	public class Items
	{
		public class ScrapItem
		{
			public Item item;

			public int rarity;

			public Levels.LevelTypes spawnLevels;

			public string modName;

			public ScrapItem(Item item, int rarity, Levels.LevelTypes spawnLevels)
			{
				this.item = item;
				this.rarity = rarity;
				this.spawnLevels = spawnLevels;
			}
		}

		public class ShopItem
		{
			public Item item;

			public TerminalNode buyNode1;

			public TerminalNode buyNode2;

			public TerminalNode itemInfo;

			public int price;

			public string modName;

			public ShopItem(Item item, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = 0)
			{
				this.item = item;
				this.price = price;
				if ((Object)(object)buyNode1 != (Object)null)
				{
					this.buyNode1 = buyNode1;
				}
				if ((Object)(object)buyNode2 != (Object)null)
				{
					this.buyNode2 = buyNode2;
				}
				if ((Object)(object)itemInfo != (Object)null)
				{
					this.itemInfo = itemInfo;
				}
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__StartOfRound_Awake;

			public static hook_Awake <1>__Terminal_Awake;
		}

		public static List<ScrapItem> scrapItems = new List<ScrapItem>();

		public static List<ShopItem> shopItems = new List<ShopItem>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			object obj = <>O.<0>__StartOfRound_Awake;
			if (obj == null)
			{
				hook_Awake val = StartOfRound_Awake;
				<>O.<0>__StartOfRound_Awake = val;
				obj = (object)val;
			}
			StartOfRound.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__Terminal_Awake;
			if (obj2 == null)
			{
				hook_Awake val2 = Terminal_Awake;
				<>O.<1>__Terminal_Awake = val2;
				obj2 = (object)val2;
			}
			Terminal.Awake += (hook_Awake)obj2;
		}

		private static void Terminal_Awake(orig_Awake orig, Terminal self)
		{
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Expected O, but got Unknown
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Expected O, but got Unknown
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Expected O, but got Unknown
			List<Item> list = self.buyableItemsList.ToList();
			TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy");
			TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result;
			TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info");
			Plugin.logger.LogInfo((object)$"Adding {shopItems.Count} items to terminal");
			foreach (ShopItem item in shopItems)
			{
				if (list.Any((Item x) => x.itemName == item.item.itemName))
				{
					Plugin.logger.LogInfo((object)("Item " + item.item.itemName + " already exists in terminal, skipping"));
					continue;
				}
				if (item.price == -1)
				{
					item.price = item.item.creditsWorth;
				}
				else
				{
					item.item.creditsWorth = item.price;
				}
				list.Add(item.item);
				string itemName = item.item.itemName;
				char c = itemName[itemName.Length - 1];
				string text = itemName;
				TerminalNode val3 = item.buyNode2;
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val3).name = itemName.Replace(" ", "-") + "BuyNode2";
					val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n";
					val3.clearPreviousText = true;
					val3.maxCharactersToType = 15;
				}
				val3.buyItemIndex = list.Count - 1;
				val3.isConfirmationNode = false;
				val3.itemCost = item.price;
				val3.playSyncedClip = 0;
				TerminalNode val4 = item.buyNode1;
				if ((Object)(object)val4 == (Object)null)
				{
					val4 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val4).name = itemName.Replace(" ", "-") + "BuyNode1";
					val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n";
					val4.clearPreviousText = true;
					val4.maxCharactersToType = 35;
				}
				val4.buyItemIndex = list.Count - 1;
				val4.isConfirmationNode = true;
				val4.overrideOptions = true;
				val4.itemCost = item.price;
				val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2]
				{
					new CompatibleNoun
					{
						noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"),
						result = val3
					},
					new CompatibleNoun
					{
						noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"),
						result = result
					}
				};
				TerminalKeyword val5 = TerminalUtils.CreateTerminalKeyword(itemName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val);
				List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList();
				list2.Add(val5);
				self.terminalNodes.allKeywords = list2.ToArray();
				List<CompatibleNoun> list3 = val.compatibleNouns.ToList();
				list3.Add(new CompatibleNoun
				{
					noun = val5,
					result = val4
				});
				val.compatibleNouns = list3.ToArray();
				TerminalNode val6 = item.itemInfo;
				if ((Object)(object)val6 == (Object)null)
				{
					val6 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val6).name = itemName.Replace(" ", "-") + "InfoNode";
					val6.displayText = "[No information about this object was found.]\n\n";
					val6.clearPreviousText = true;
					val6.maxCharactersToType = 25;
				}
				self.terminalNodes.allKeywords = list2.ToArray();
				List<CompatibleNoun> list4 = val2.compatibleNouns.ToList();
				list4.Add(new CompatibleNoun
				{
					noun = val5,
					result = val6
				});
				val2.compatibleNouns = list4.ToArray();
				Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.item.itemName));
			}
			self.buyableItemsList = list.ToArray();
			orig.Invoke(self);
		}

		private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			orig.Invoke(self);
			SelectableLevel[] levels = self.levels;
			foreach (SelectableLevel val in levels)
			{
				string name = ((Object)val).name;
				if (!Enum.IsDefined(typeof(Levels.LevelTypes), name))
				{
					continue;
				}
				Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name);
				foreach (ScrapItem scrapItem in scrapItems)
				{
					if (scrapItem.spawnLevels.HasFlag(levelTypes))
					{
						SpawnableItemWithRarity item = new SpawnableItemWithRarity
						{
							spawnableItem = scrapItem.item,
							rarity = scrapItem.rarity
						};
						if (!val.spawnableScrap.Any((SpawnableItemWithRarity x) => (Object)(object)x.spawnableItem == (Object)(object)scrapItem.item))
						{
							val.spawnableScrap.Add(item);
						}
					}
				}
			}
			foreach (ScrapItem scrapItem2 in scrapItems)
			{
				if (!self.allItemsList.itemsList.Contains(scrapItem2.item))
				{
					Plugin.logger.LogInfo((object)(scrapItem2.modName + " registered item: " + scrapItem2.item.itemName));
					self.allItemsList.itemsList.Add(scrapItem2.item);
				}
			}
			foreach (ShopItem shopItem in shopItems)
			{
				if (!self.allItemsList.itemsList.Contains(shopItem.item))
				{
					Plugin.logger.LogInfo((object)(shopItem.modName + " registered item: " + shopItem.item.itemName));
					self.allItemsList.itemsList.Add(shopItem.item);
				}
			}
		}

		public static void RegisterScrap(Item spawnableItem, int rarity, Levels.LevelTypes levelFlags)
		{
			ScrapItem scrapItem = new ScrapItem(spawnableItem, rarity, levelFlags);
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			scrapItem.modName = name;
			scrapItems.Add(scrapItem);
		}

		public static void RegisterShopItem(Item shopItem, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1)
		{
			ShopItem shopItem2 = new ShopItem(shopItem, buyNode1, buyNode2, itemInfo, price);
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			shopItem2.modName = name;
			shopItems.Add(shopItem2);
		}

		public static void RegisterShopItem(Item shopItem, int price = -1)
		{
			ShopItem shopItem2 = new ShopItem(shopItem, null, null, null, price);
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			shopItem2.modName = name;
			shopItems.Add(shopItem2);
		}
	}
	public class Levels
	{
		[Flags]
		public enum LevelTypes
		{
			None = 1,
			ExperimentationLevel = 2,
			AssuranceLevel = 4,
			VowLevel = 8,
			OffenseLevel = 0x10,
			MarchLevel = 0x20,
			RendLevel = 0x40,
			DineLevel = 0x80,
			TitanLevel = 0x100,
			All = 0x1FE
		}
	}
	public class MapObjects
	{
		public class RegisteredMapObject
		{
			public SpawnableMapObject mapObject;

			public SpawnableOutsideObjectWithRarity outsideObject;

			public Levels.LevelTypes levels;

			public Func<SelectableLevel, AnimationCurve> spawnRateFunction;
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__StartOfRound_Awake;

			public static hook_SpawnMapObjects <1>__RoundManager_SpawnMapObjects;
		}

		public static List<RegisteredMapObject> mapObjects = new List<RegisteredMapObject>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			object obj = <>O.<0>__StartOfRound_Awake;
			if (obj == null)
			{
				hook_Awake val = StartOfRound_Awake;
				<>O.<0>__StartOfRound_Awake = val;
				obj = (object)val;
			}
			StartOfRound.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__RoundManager_SpawnMapObjects;
			if (obj2 == null)
			{
				hook_SpawnMapObjects val2 = RoundManager_SpawnMapObjects;
				<>O.<1>__RoundManager_SpawnMapObjects = val2;
				obj2 = (object)val2;
			}
			RoundManager.SpawnMapObjects += (hook_SpawnMapObjects)obj2;
		}

		private static void RoundManager_SpawnMapObjects(orig_SpawnMapObjects orig, RoundManager self)
		{
			RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>();
			RandomMapObject[] array2 = array;
			foreach (RandomMapObject val in array2)
			{
				foreach (RegisteredMapObject mapObject in mapObjects)
				{
					if (mapObject.mapObject != null && !val.spawnablePrefabs.Any((GameObject prefab) => (Object)(object)prefab == (Object)(object)mapObject.mapObject.prefabToSpawn))
					{
						val.spawnablePrefabs.Add(mapObject.mapObject.prefabToSpawn);
					}
				}
			}
			orig.Invoke(self);
		}

		private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self)
		{
			orig.Invoke(self);
			SelectableLevel[] levels = self.levels;
			foreach (SelectableLevel val in levels)
			{
				string name = ((Object)val).name;
				if (!Enum.IsDefined(typeof(Levels.LevelTypes), name))
				{
					continue;
				}
				Levels.LevelTypes levelTypes = (Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name);
				foreach (RegisteredMapObject mapObject in mapObjects)
				{
					if (!mapObject.levels.HasFlag(levelTypes))
					{
						continue;
					}
					if (mapObject.mapObject != null)
					{
						if (!val.spawnableMapObjects.Any((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn))
						{
							List<SpawnableMapObject> list = val.spawnableMapObjects.ToList();
							list.RemoveAll((SpawnableMapObject x) => (Object)(object)x.prefabToSpawn == (Object)(object)mapObject.mapObject.prefabToSpawn);
							val.spawnableMapObjects = list.ToArray();
						}
						SpawnableMapObject mapObject2 = mapObject.mapObject;
						if (mapObject.spawnRateFunction != null)
						{
							mapObject2.numberToSpawn = mapObject.spawnRateFunction(val);
						}
						List<SpawnableMapObject> list2 = val.spawnableMapObjects.ToList();
						list2.Add(mapObject2);
						val.spawnableMapObjects = list2.ToArray();
						Plugin.logger.LogInfo((object)("Added " + ((Object)mapObject2.prefabToSpawn).name + " to " + name));
					}
					else
					{
						if (mapObject.outsideObject == null)
						{
							continue;
						}
						if (!val.spawnableOutsideObjects.Any((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn))
						{
							List<SpawnableOutsideObjectWithRarity> list3 = val.spawnableOutsideObjects.ToList();
							list3.RemoveAll((SpawnableOutsideObjectWithRarity x) => (Object)(object)x.spawnableObject.prefabToSpawn == (Object)(object)mapObject.outsideObject.spawnableObject.prefabToSpawn);
							val.spawnableOutsideObjects = list3.ToArray();
						}
						SpawnableOutsideObjectWithRarity outsideObject = mapObject.outsideObject;
						if (mapObject.spawnRateFunction != null)
						{
							outsideObject.randomAmount = mapObject.spawnRateFunction(val);
						}
						List<SpawnableOutsideObjectWithRarity> list4 = val.spawnableOutsideObjects.ToList();
						list4.Add(outsideObject);
						val.spawnableOutsideObjects = list4.ToArray();
						Plugin.logger.LogInfo((object)("Added " + ((Object)outsideObject.spawnableObject.prefabToSpawn).name + " to " + name));
					}
				}
			}
		}

		public static void RegisterMapObject(SpawnableMapObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null)
		{
			RegisterMapObject(mapObject.spawnableMapObject, levels, spawnRateFunction);
		}

		public static void RegisterMapObject(SpawnableMapObject mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null)
		{
			mapObjects.Add(new RegisteredMapObject
			{
				mapObject = mapObject,
				levels = levels,
				spawnRateFunction = spawnRateFunction
			});
		}

		public static void RegisterOutsideObject(SpawnableOutsideObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null)
		{
			RegisterOutsideObject(mapObject.spawnableMapObject, levels, spawnRateFunction);
		}

		public static void RegisterOutsideObject(SpawnableOutsideObjectWithRarity mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null)
		{
			mapObjects.Add(new RegisteredMapObject
			{
				outsideObject = mapObject,
				levels = levels,
				spawnRateFunction = spawnRateFunction
			});
		}
	}
	public class NetworkPrefabs
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Start <0>__GameNetworkManager_Start;
		}

		private static List<GameObject> _networkPrefabs = new List<GameObject>();

		internal static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__GameNetworkManager_Start;
			if (obj == null)
			{
				hook_Start val = GameNetworkManager_Start;
				<>O.<0>__GameNetworkManager_Start = val;
				obj = (object)val;
			}
			GameNetworkManager.Start += (hook_Start)obj;
		}

		public static void RegisterNetworkPrefab(GameObject prefab)
		{
			_networkPrefabs.Add(prefab);
		}

		private static void GameNetworkManager_Start(orig_Start orig, GameNetworkManager self)
		{
			orig.Invoke(self);
			foreach (GameObject networkPrefab in _networkPrefabs)
			{
				((Component)self).GetComponent<NetworkManager>().AddNetworkPrefab(networkPrefab);
			}
		}
	}
	public class Shaders
	{
		public static void FixShaders(GameObject gameObject)
		{
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				Material[] materials = val.materials;
				foreach (Material val2 in materials)
				{
					if (((Object)val2.shader).name.Contains("Standard"))
					{
						val2.shader = Shader.Find("HDRP/Lit");
					}
				}
			}
		}
	}
	public class TerminalUtils
	{
		public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, CompatibleNoun[] compatibleNouns = null, TerminalNode specialKeywordResult = null, TerminalKeyword defaultVerb = null, bool accessTerminalObjects = false)
		{
			TerminalKeyword val = ScriptableObject.CreateInstance<TerminalKeyword>();
			((Object)val).name = word;
			val.word = word;
			val.isVerb = isVerb;
			val.compatibleNouns = compatibleNouns;
			val.specialKeywordResult = specialKeywordResult;
			val.defaultVerb = defaultVerb;
			val.accessTerminalObjects = accessTerminalObjects;
			return val;
		}
	}
	public enum StoreType
	{
		None,
		ShipUpgrade,
		Decor
	}
	public class Unlockables
	{
		public class RegisteredUnlockable
		{
			public UnlockableItem unlockable;

			public StoreType StoreType;

			public TerminalNode buyNode1;

			public TerminalNode buyNode2;

			public TerminalNode itemInfo;

			public int price;

			public string modName;

			public RegisteredUnlockable(UnlockableItem unlockable, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1)
			{
				this.unlockable = unlockable;
				this.buyNode1 = buyNode1;
				this.buyNode2 = buyNode2;
				this.itemInfo = itemInfo;
				this.price = price;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Awake <0>__StartOfRound_Awake;

			public static hook_Start <1>__Terminal_Start;

			public static hook_TextPostProcess <2>__Terminal_TextPostProcess;
		}

		public static List<RegisteredUnlockable> registeredUnlockables = new List<RegisteredUnlockable>();

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//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_005e: Expected O, but got Unknown
			object obj = <>O.<0>__StartOfRound_Awake;
			if (obj == null)
			{
				hook_Awake val = StartOfRound_Awake;
				<>O.<0>__StartOfRound_Awake = val;
				obj = (object)val;
			}
			StartOfRound.Awake += (hook_Awake)obj;
			object obj2 = <>O.<1>__Terminal_Start;
			if (obj2 == null)
			{
				hook_Start val2 = Terminal_Start;
				<>O.<1>__Terminal_Start = val2;
				obj2 = (object)val2;
			}
			Terminal.Start += (hook_Start)obj2;
			object obj3 = <>O.<2>__Terminal_TextPostProcess;
			if (obj3 == null)
			{
				hook_TextPostProcess val3 = Terminal_TextPostProcess;
				<>O.<2>__Terminal_TextPostProcess = val3;
				obj3 = (object)val3;
			}
			Terminal.TextPostProcess += (hook_TextPostProcess)obj3;
		}

		private static string Terminal_TextPostProcess(orig_TextPostProcess orig, Terminal self, string modifiedDisplayText, TerminalNode node)
		{
			if (modifiedDisplayText.Contains("[buyableItemsList]") && modifiedDisplayText.Contains("[unlockablesSelectionList]"))
			{
				int num = modifiedDisplayText.IndexOf(":");
				foreach (RegisteredUnlockable registeredUnlockable in registeredUnlockables)
				{
					if (registeredUnlockable.StoreType == StoreType.ShipUpgrade)
					{
						string unlockableName = registeredUnlockable.unlockable.unlockableName;
						int price = registeredUnlockable.price;
						string value = $"\n* {unlockableName}    //    Price: ${price}";
						modifiedDisplayText = modifiedDisplayText.Insert(num + 1, value);
					}
				}
			}
			return orig.Invoke(self, modifiedDisplayText, node);
		}

		private static void Terminal_Start(orig_Start orig, Terminal self)
		{
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Expected O, but got Unknown
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Expected O, but got Unknown
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Expected O, but got Unknown
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Expected O, but got Unknown
			TerminalKeyword val = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy");
			TerminalNode result = val.compatibleNouns[0].result.terminalOptions[1].result;
			TerminalKeyword val2 = self.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info");
			List<RegisteredUnlockable> list = registeredUnlockables.FindAll((RegisteredUnlockable unlockable) => unlockable.price != -1).ToList();
			Plugin.logger.LogInfo((object)$"Adding {list.Count} items to terminal");
			foreach (RegisteredUnlockable item in list)
			{
				string unlockableName = item.unlockable.unlockableName;
				TerminalKeyword keyword3 = TerminalUtils.CreateTerminalKeyword(unlockableName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val);
				if (self.terminalNodes.allKeywords.Any((TerminalKeyword kw) => kw.word == keyword3.word))
				{
					Plugin.logger.LogInfo((object)("Keyword " + keyword3.word + " already registed, skipping."));
					continue;
				}
				int shipUnlockableID = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == item.unlockable.unlockableName);
				StartOfRound instance = StartOfRound.Instance;
				if ((Object)(object)instance == (Object)null)
				{
					Debug.Log((object)"STARTOFROUND INSTANCE NOT FOUND");
				}
				if (item.price == -1 && (Object)(object)item.buyNode1 != (Object)null)
				{
					item.price = item.buyNode1.itemCost;
				}
				char c = unlockableName[unlockableName.Length - 1];
				string text = unlockableName;
				TerminalNode val3 = item.buyNode2;
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val3).name = unlockableName.Replace(" ", "-") + "BuyNode2";
					val3.displayText = "Ordered [variableAmount] " + text + ". Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\r\n\r\n";
					val3.clearPreviousText = true;
					val3.maxCharactersToType = 15;
				}
				val3.buyItemIndex = -1;
				val3.shipUnlockableID = shipUnlockableID;
				val3.buyUnlockable = true;
				val3.creatureName = unlockableName;
				val3.isConfirmationNode = false;
				val3.itemCost = item.price;
				val3.playSyncedClip = 0;
				TerminalNode val4 = item.buyNode1;
				if ((Object)(object)val4 == (Object)null)
				{
					val4 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val4).name = unlockableName.Replace(" ", "-") + "BuyNode1";
					val4.displayText = "You have requested to order " + text + ". Amount: [variableAmount].\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\r\n\r\n";
					val4.clearPreviousText = true;
					val4.maxCharactersToType = 35;
				}
				val4.buyItemIndex = -1;
				val4.shipUnlockableID = shipUnlockableID;
				val4.creatureName = unlockableName;
				val4.isConfirmationNode = true;
				val4.overrideOptions = true;
				val4.itemCost = item.price;
				val4.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2]
				{
					new CompatibleNoun
					{
						noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "confirm"),
						result = val3
					},
					new CompatibleNoun
					{
						noun = self.terminalNodes.allKeywords.First((TerminalKeyword keyword2) => keyword2.word == "deny"),
						result = result
					}
				};
				if (item.StoreType == StoreType.Decor)
				{
					item.unlockable.shopSelectionNode = val4;
				}
				else
				{
					item.unlockable.shopSelectionNode = null;
				}
				List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList();
				list2.Add(keyword3);
				self.terminalNodes.allKeywords = list2.ToArray();
				List<CompatibleNoun> list3 = val.compatibleNouns.ToList();
				list3.Add(new CompatibleNoun
				{
					noun = keyword3,
					result = val4
				});
				val.compatibleNouns = list3.ToArray();
				TerminalNode val5 = item.itemInfo;
				if ((Object)(object)val5 == (Object)null)
				{
					val5 = ScriptableObject.CreateInstance<TerminalNode>();
					((Object)val5).name = unlockableName.Replace(" ", "-") + "InfoNode";
					val5.displayText = "[No information about this object was found.]\n\n";
					val5.clearPreviousText = true;
					val5.maxCharactersToType = 25;
				}
				self.terminalNodes.allKeywords = list2.ToArray();
				List<CompatibleNoun> list4 = val2.compatibleNouns.ToList();
				list4.Add(new CompatibleNoun
				{
					noun = keyword3,
					result = val5
				});
				val2.compatibleNouns = list4.ToArray();
				Plugin.logger.LogInfo((object)(item.modName + " registered item: " + item.unlockable.unlockableName));
			}
			orig.Invoke(self);
		}

		private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self)
		{
			orig.Invoke(self);
			Plugin.logger.LogInfo((object)$"Adding {registeredUnlockables.Count} unlockables to unlockables list");
			foreach (RegisteredUnlockable unlockable in registeredUnlockables)
			{
				if (self.unlockablesList.unlockables.Any((UnlockableItem x) => x.unlockableName == unlockable.unlockable.unlockableName))
				{
					Plugin.logger.LogInfo((object)("Unlockable " + unlockable.unlockable.unlockableName + " already exists in unlockables list, skipping"));
					continue;
				}
				if ((Object)(object)unlockable.unlockable.prefabObject != (Object)null)
				{
					PlaceableShipObject componentInChildren = unlockable.unlockable.prefabObject.GetComponentInChildren<PlaceableShipObject>();
					if ((Object)(object)componentInChildren != (Object)null)
					{
						componentInChildren.unlockableID = self.unlockablesList.unlockables.Count;
					}
				}
				self.unlockablesList.unlockables.Add(unlockable.unlockable);
			}
		}

		public static void RegisterUnlockable(UnlockableItemDef unlockable, int price = -1, StoreType storeType = StoreType.None)
		{
			RegisterUnlockable(unlockable.unlockable, storeType, null, null, null, price);
		}

		public static void RegisterUnlockable(UnlockableItem unlockable, int price = -1, StoreType storeType = StoreType.None)
		{
			RegisterUnlockable(unlockable, storeType, null, null, null, price);
		}

		public static void RegisterUnlockable(UnlockableItemDef unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1)
		{
			RegisterUnlockable(unlockable.unlockable, storeType, buyNode1, buyNode2, itemInfo, price);
		}

		public static void RegisterUnlockable(UnlockableItem unlockable, StoreType storeType = StoreType.None, TerminalNode buyNode1 = null, TerminalNode buyNode2 = null, TerminalNode itemInfo = null, int price = -1)
		{
			RegisteredUnlockable registeredUnlockable = new RegisteredUnlockable(unlockable, buyNode1, buyNode2, itemInfo, price);
			Assembly callingAssembly = Assembly.GetCallingAssembly();
			string name = callingAssembly.GetName().Name;
			registeredUnlockable.modName = name;
			registeredUnlockable.StoreType = storeType;
			registeredUnlockables.Add(registeredUnlockable);
		}
	}
}
namespace LethalLib.Extras
{
	[CreateAssetMenu(menuName = "ScriptableObjects/DungeonDef")]
	public class DungeonDef : ScriptableObject
	{
		public DungeonFlow dungeonFlow;

		[Range(0f, 300f)]
		public int rarity;

		public AudioClip firstTimeDungeonAudio;
	}
	[CreateAssetMenu(menuName = "ScriptableObjects/DungeonGraphLine")]
	public class DungeonGraphLineDef : ScriptableObject
	{
		public GraphLine graphLine;
	}
	[CreateAssetMenu(menuName = "ScriptableObjects/GameObjectChance")]
	public class GameObjectChanceDef : ScriptableObject
	{
		public GameObjectChance gameObjectChance;
	}
	[CreateAssetMenu(menuName = "ScriptableObjects/SpawnableMapObject")]
	public class SpawnableMapObjectDef : ScriptableObject
	{
		public SpawnableMapObject spawnableMapObject;
	}
	[CreateAssetMenu(menuName = "ScriptableObjects/SpawnableOutsideObject")]
	public class SpawnableOutsideObjectDef : ScriptableObject
	{
		public SpawnableOutsideObjectWithRarity spawnableMapObject;
	}
	[CreateAssetMenu(menuName = "ScriptableObjects/UnlockableItem")]
	public class UnlockableItemDef : ScriptableObject
	{
		public StoreType storeType = StoreType.None;

		public UnlockableItem unlockable;
	}
}

plugins/Evaisa-LethalThings/LethalThings/LethalThings.dll

Decompiled 10 months 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 System.Threading;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using LethalLib.Extras;
using LethalLib.Modules;
using LethalThings.Extensions;
using LethalThings.MonoBehaviours;
using LethalThings.Patches;
using Microsoft.CodeAnalysis;
using On;
using On.GameNetcodeStuff;
using TMPro;
using Unity.Netcode;
using Unity.Netcode.Components;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalThings")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Mod for Lethal Company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2f1b398a39dfb0aa0eef0fd49c7d27b56f080c41")]
[assembly: AssemblyProduct("LethalThings")]
[assembly: AssemblyTitle("LethalThings")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	static <Module>()
	{
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<HackingTool.HackState>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals<HackingTool.HackState>();
		NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>();
		NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>();
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalThings
{
	public class Config
	{
		public static ConfigEntry<int> arsonSpawnWeight;

		public static ConfigEntry<int> dirtyArsonSpawnWeight;

		public static ConfigEntry<int> toimariSpawnWeight;

		public static ConfigEntry<int> hamisSpawnWeight;

		public static ConfigEntry<int> cookieSpawnWeight;

		public static ConfigEntry<int> maxwellSpawnWeight;

		public static ConfigEntry<float> evilMaxwellChance;

		public static ConfigEntry<bool> maxwellPlayMusicDefault;

		public static ConfigEntry<int> glizzySpawnChance;

		public static ConfigEntry<bool> toyHammerEnabled;

		public static ConfigEntry<int> toyHammerPrice;

		public static ConfigEntry<bool> pouchyBeltEnabled;

		public static ConfigEntry<int> pouchyBeltPrice;

		public static ConfigEntry<bool> remoteRadarEnabled;

		public static ConfigEntry<int> remoteRadarPrice;

		public static ConfigEntry<bool> rocketLauncherEnabled;

		public static ConfigEntry<int> rocketLauncherPrice;

		public static ConfigEntry<bool> hackingToolEnabled;

		public static ConfigEntry<int> hackingToolPrice;

		public static ConfigEntry<int> boombaSpawnWeight;

		public static ConfigEntry<bool> rugsEnabled;

		public static ConfigEntry<int> smallRugPrice;

		public static ConfigEntry<int> largeRugPrice;

		public static ConfigEntry<bool> fatalitiesSignEnabled;

		public static ConfigEntry<int> fatalitiesSignPrice;

		public static ConfigEntry<bool> teleporterTrapsEnabled;

		public static ConfigEntry<bool> enableItemChargerElectrocution;

		public static ConfigEntry<int> itemChargerElectrocutionDamage;

		public static ConfigEntry<bool> disableOverlappingModContent;

		public static ConfigFile VolumeConfig;

		public static void Load()
		{
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: Expected O, but got Unknown
			arsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "Arson", 10, "How much does Arson spawn, higher = more common");
			dirtyArsonSpawnWeight = Plugin.config.Bind<int>("Scrap", "DirtyArson", 10, "How much does Arson (Dirty) spawn, higher = more common");
			toimariSpawnWeight = Plugin.config.Bind<int>("Scrap", "Toimari", 20, "How much does Toimari spawn, higher = more common");
			hamisSpawnWeight = Plugin.config.Bind<int>("Scrap", "Hamis", 20, "How much does Hamis spawn, higher = more common");
			cookieSpawnWeight = Plugin.config.Bind<int>("Scrap", "Cookie", 20, "How much does Cookie spawn, higher = more common");
			maxwellSpawnWeight = Plugin.config.Bind<int>("Scrap", "Maxwell", 3, "How much does Maxwell spawn, higher = more common");
			evilMaxwellChance = Plugin.config.Bind<float>("Scrap", "MaxwellEvilChance", 10f, "Chance for maxwell to be evil, percentage.");
			maxwellPlayMusicDefault = Plugin.config.Bind<bool>("Scrap", "MaxwellPlayMusicDefault", true, "Does Maxwell play music by default?");
			glizzySpawnChance = Plugin.config.Bind<int>("Scrap", "GlizzySpawnChance", 5, "How much do glizzies spawn, higher = more common");
			toyHammerEnabled = Plugin.config.Bind<bool>("Items", "ToyHammer", true, "Is Toy Hammer enabled?");
			toyHammerPrice = Plugin.config.Bind<int>("Items", "ToyHammerPrice", 80, "How much does Toy Hammer cost?");
			pouchyBeltEnabled = Plugin.config.Bind<bool>("Items", "PouchyBelt", true, "Is Pouchy Belt enabled?");
			pouchyBeltPrice = Plugin.config.Bind<int>("Items", "PouchyBeltPrice", 290, "How much does Pouchy Belt cost?");
			remoteRadarEnabled = Plugin.config.Bind<bool>("Items", "RemoteRadar", true, "Is Remote Radar enabled?");
			remoteRadarPrice = Plugin.config.Bind<int>("Items", "RemoteRadarPrice", 240, "How much does Remote Radar cost?");
			rocketLauncherEnabled = Plugin.config.Bind<bool>("Items", "RocketLauncher", true, "Is Rocket Launcher enabled?");
			rocketLauncherPrice = Plugin.config.Bind<int>("Items", "RocketLauncherPrice", 260, "How much does Rocket Launcher cost?");
			hackingToolEnabled = Plugin.config.Bind<bool>("Items", "HackingTool", true, "Is Hacking Tool enabled?");
			hackingToolPrice = Plugin.config.Bind<int>("Items", "HackingToolPrice", 190, "How much does Hacking Tool cost?");
			boombaSpawnWeight = Plugin.config.Bind<int>("Enemies", "Boomba", 20, "How much does Boomba spawn, higher = more common");
			rugsEnabled = Plugin.config.Bind<bool>("Decor", "Rugs", true, "Are rugs enabled?");
			smallRugPrice = Plugin.config.Bind<int>("Decor", "SmallRugPrice", 80, "How much does a small rug cost?");
			largeRugPrice = Plugin.config.Bind<int>("Decor", "LargeRugPrice", 110, "How much does a large rug cost?");
			fatalitiesSignEnabled = Plugin.config.Bind<bool>("Decor", "FatalitiesSign", true, "Is Fatalities Sign enabled?");
			fatalitiesSignPrice = Plugin.config.Bind<int>("Decor", "FatalitiesSignPrice", 100, "How much does Fatalities Sign cost?");
			teleporterTrapsEnabled = Plugin.config.Bind<bool>("Traps", "TeleporterTraps", true, "Are teleporter traps enabled?");
			enableItemChargerElectrocution = Plugin.config.Bind<bool>("Misc", "EnableItemChargerElectrocution", true, "Do players get electrocuted when stuffing conductive objects in the item charger.");
			itemChargerElectrocutionDamage = Plugin.config.Bind<int>("Misc", "ItemChargerElectrocutionDamage", 20, "How much damage does the item charger electrocution do.");
			disableOverlappingModContent = Plugin.config.Bind<bool>("Misc", "DisableOverlappingModContent", true, "Disable content from other mods which exists in this one (e.g. maxwell).");
			VolumeConfig = new ConfigFile(Paths.ConfigPath + "\\LethalThings.AudioVolume.cfg", true);
		}
	}
	public class Content
	{
		public class CustomItem
		{
			public string name = "";

			public string itemPath = "";

			public string infoPath = "";

			public Action<Item> itemAction = delegate
			{
			};

			public bool enabled = true;

			public CustomItem(string name, string itemPath, string infoPath, Action<Item> action = null)
			{
				this.name = name;
				this.itemPath = itemPath;
				this.infoPath = infoPath;
				if (action != null)
				{
					itemAction = action;
				}
			}

			public static CustomItem Add(string name, string itemPath, string infoPath = null, Action<Item> action = null)
			{
				return new CustomItem(name, itemPath, infoPath, action);
			}
		}

		public class CustomUnlockable
		{
			public string name = "";

			public string unlockablePath = "";

			public string infoPath = "";

			public Action<UnlockableItem> unlockableAction = delegate
			{
			};

			public bool enabled = true;

			public int unlockCost = -1;

			public CustomUnlockable(string name, string unlockablePath, string infoPath, Action<UnlockableItem> action = null, int unlockCost = -1)
			{
				this.name = name;
				this.unlockablePath = unlockablePath;
				this.infoPath = infoPath;
				if (action != null)
				{
					unlockableAction = action;
				}
				this.unlockCost = unlockCost;
			}

			public static CustomUnlockable Add(string name, string unlockablePath, string infoPath = null, Action<UnlockableItem> action = null, int unlockCost = -1, bool enabled = true)
			{
				return new CustomUnlockable(name, unlockablePath, infoPath, action, unlockCost)
				{
					enabled = enabled
				};
			}
		}

		public class CustomShopItem : CustomItem
		{
			public int itemPrice;

			public CustomShopItem(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null)
				: base(name, itemPath, infoPath, action)
			{
				this.itemPrice = itemPrice;
			}

			public static CustomShopItem Add(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action<Item> action = null, bool enabled = true)
			{
				return new CustomShopItem(name, itemPath, infoPath, itemPrice, action)
				{
					enabled = enabled
				};
			}
		}

		public class CustomScrap : CustomItem
		{
			public LevelTypes levelType = (LevelTypes)510;

			public int rarity;

			public CustomScrap(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null)
				: base(name, itemPath, null, action)
			{
				//IL_0006: 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_0018: Unknown result type (might be due to invalid IL or missing references)
				this.levelType = levelType;
				this.rarity = rarity;
			}

			public static CustomScrap Add(string name, string itemPath, LevelTypes levelType, int rarity, Action<Item> action = null)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				return new CustomScrap(name, itemPath, levelType, rarity, action);
			}
		}

		public class CustomEnemy
		{
			public string name;

			public string enemyPath;

			public int rarity;

			public LevelTypes levelFlags;

			public SpawnType spawnType;

			public string infoKeyword;

			public string infoNode;

			public bool enabled = true;

			public CustomEnemy(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				this.name = name;
				this.enemyPath = enemyPath;
				this.rarity = rarity;
				this.levelFlags = levelFlags;
				this.spawnType = spawnType;
				this.infoKeyword = infoKeyword;
				this.infoNode = infoNode;
			}

			public static CustomEnemy Add(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode, bool enabled = true)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				return new CustomEnemy(name, enemyPath, rarity, levelFlags, spawnType, infoKeyword, infoNode)
				{
					enabled = enabled
				};
			}
		}

		public class CustomMapObject
		{
			public string name;

			public string objectPath;

			public LevelTypes levelFlags;

			public Func<SelectableLevel, AnimationCurve> spawnRateFunction;

			public bool enabled = true;

			public CustomMapObject(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false)
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				this.name = name;
				this.objectPath = objectPath;
				this.levelFlags = levelFlags;
				this.spawnRateFunction = spawnRateFunction;
				this.enabled = enabled;
			}

			public static CustomMapObject Add(string name, string objectPath, LevelTypes levelFlags, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null, bool enabled = false)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				return new CustomMapObject(name, objectPath, levelFlags, spawnRateFunction, enabled);
			}
		}

		public static AssetBundle MainAssets;

		public static Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>();

		public static List<CustomUnlockable> customUnlockables;

		public static List<CustomItem> customItems;

		public static List<CustomEnemy> customEnemies;

		public static List<CustomMapObject> customMapObjects;

		public static GameObject ConfigManagerPrefab;

		public static void TryLoadAssets()
		{
			if ((Object)(object)MainAssets == (Object)null)
			{
				MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalthings"));
				Plugin.logger.LogInfo((object)"Loaded asset bundle");
			}
		}

		public static void Load()
		{
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			TryLoadAssets();
			customItems = new List<CustomItem>
			{
				CustomScrap.Add("Arson", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlush.asset", (LevelTypes)510, Config.arsonSpawnWeight.Value),
				CustomScrap.Add("Cookie", "Assets/Custom/LethalThings/Scrap/Cookie/CookieFumo.asset", (LevelTypes)510, Config.cookieSpawnWeight.Value),
				CustomScrap.Add("Bilka", "Assets/Custom/LethalThings/Scrap/Toimari/ToimariPlush.asset", (LevelTypes)510, Config.toimariSpawnWeight.Value),
				CustomScrap.Add("Hamis", "Assets/Custom/LethalThings/Scrap/Hamis/HamisPlush.asset", (LevelTypes)510, Config.hamisSpawnWeight.Value),
				CustomScrap.Add("ArsonDirty", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlushDirty.asset", (LevelTypes)510, Config.dirtyArsonSpawnWeight.Value),
				CustomScrap.Add("Maxwell", "Assets/Custom/LethalThings/Scrap/Maxwell/Dingus.asset", (LevelTypes)510, Config.maxwellSpawnWeight.Value),
				CustomScrap.Add("Glizzy", "Assets/Custom/LethalThings/Scrap/glizzy/glizzy.asset", (LevelTypes)510, Config.glizzySpawnChance.Value),
				CustomShopItem.Add("RocketLauncher", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncher.asset", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncherInfo.asset", Config.rocketLauncherPrice.Value, delegate(Item item)
				{
					NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent<RocketLauncher>().missilePrefab);
				}, Config.rocketLauncherEnabled.Value),
				CustomShopItem.Add("ToyHammer", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammerInfo.asset", Config.toyHammerPrice.Value, null, Config.toyHammerEnabled.Value),
				CustomShopItem.Add("RemoteRadar", "Assets/Custom/LethalThings/Items/Radar/HandheldRadar.asset", "Assets/Custom/LethalThings/Items/Radar/HandheldRadarInfo.asset", Config.remoteRadarPrice.Value, null, Config.remoteRadarEnabled.Value),
				CustomShopItem.Add("PouchyBelt", "Assets/Custom/LethalThings/Items/Pouch/Pouch.asset", "Assets/Custom/LethalThings/Items/Pouch/PouchInfo.asset", Config.pouchyBeltPrice.Value, null, Config.pouchyBeltEnabled.Value),
				CustomShopItem.Add("HackingTool", "Assets/Custom/LethalThings/Items/HackingTool/HackingTool.asset", "Assets/Custom/LethalThings/Items/HackingTool/HackingToolInfo.asset", Config.hackingToolPrice.Value, null, Config.hackingToolEnabled.Value)
			};
			customEnemies = new List<CustomEnemy> { CustomEnemy.Add("Boomba", "Assets/Custom/LethalThings/Enemies/Roomba/Boomba.asset", Config.boombaSpawnWeight.Value, (LevelTypes)510, (SpawnType)0, null, "Assets/Custom/LethalThings/Enemies/Roomba/BoombaFile.asset") };
			customUnlockables = new List<CustomUnlockable>
			{
				CustomUnlockable.Add("SmallRug", "Assets/Custom/LethalThings/Unlockables/Rug/SmallRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.smallRugPrice.Value, Config.rugsEnabled.Value),
				CustomUnlockable.Add("LargeRug", "Assets/Custom/LethalThings/Unlockables/Rug/LargeRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.largeRugPrice.Value, Config.rugsEnabled.Value),
				CustomUnlockable.Add("FatalitiesSign", "Assets/Custom/LethalThings/Unlockables/Sign/Sign.asset", "Assets/Custom/LethalThings/Unlockables/Sign/SignInfo.asset", null, Config.fatalitiesSignPrice.Value, Config.fatalitiesSignEnabled.Value)
			};
			customMapObjects = new List<CustomMapObject> { CustomMapObject.Add("TeleporterTrap", "Assets/Custom/LethalThings/hazards/TeleporterTrap/TeleporterTrap.asset", (LevelTypes)510, (SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2]
			{
				new Keyframe(0f, 0f),
				new Keyframe(1f, 4f)
			}), Config.teleporterTrapsEnabled.Value) };
			foreach (CustomItem customItem in customItems)
			{
				if (customItem.enabled)
				{
					Item val = MainAssets.LoadAsset<Item>(customItem.itemPath);
					if ((Object)(object)val.spawnPrefab.GetComponent<NetworkTransform>() == (Object)null)
					{
						val.spawnPrefab.AddComponent<NetworkTransform>();
					}
					Prefabs.Add(customItem.name, val.spawnPrefab);
					NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
					customItem.itemAction(val);
					if (customItem is CustomShopItem)
					{
						TerminalNode val2 = MainAssets.LoadAsset<TerminalNode>(customItem.infoPath);
						Plugin.logger.LogInfo((object)$"Registering shop item {customItem.name} with price {((CustomShopItem)customItem).itemPrice}");
						Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, ((CustomShopItem)customItem).itemPrice);
					}
					else if (customItem is CustomScrap)
					{
						Items.RegisterScrap(val, ((CustomScrap)customItem).rarity, ((CustomScrap)customItem).levelType);
					}
				}
			}
			foreach (CustomUnlockable customUnlockable in customUnlockables)
			{
				if (customUnlockable.enabled)
				{
					UnlockableItem unlockable = MainAssets.LoadAsset<UnlockableItemDef>(customUnlockable.unlockablePath).unlockable;
					if ((Object)(object)unlockable.prefabObject != (Object)null)
					{
						NetworkPrefabs.RegisterNetworkPrefab(unlockable.prefabObject);
					}
					Prefabs.Add(customUnlockable.name, unlockable.prefabObject);
					TerminalNode val3 = null;
					if (customUnlockable.infoPath != null)
					{
						val3 = MainAssets.LoadAsset<TerminalNode>(customUnlockable.infoPath);
					}
					Unlockables.RegisterUnlockable(unlockable, (StoreType)2, (TerminalNode)null, (TerminalNode)null, val3, customUnlockable.unlockCost);
				}
			}
			foreach (CustomEnemy customEnemy in customEnemies)
			{
				if (customEnemy.enabled)
				{
					EnemyType val4 = MainAssets.LoadAsset<EnemyType>(customEnemy.enemyPath);
					TerminalNode val5 = MainAssets.LoadAsset<TerminalNode>(customEnemy.infoNode);
					TerminalKeyword val6 = null;
					if (customEnemy.infoKeyword != null)
					{
						val6 = MainAssets.LoadAsset<TerminalKeyword>(customEnemy.infoKeyword);
					}
					NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab);
					Prefabs.Add(customEnemy.name, val4.enemyPrefab);
					Enemies.RegisterEnemy(val4, customEnemy.rarity, customEnemy.levelFlags, customEnemy.spawnType, val5, val6);
				}
			}
			foreach (CustomMapObject customMapObject in customMapObjects)
			{
				if (customMapObject.enabled)
				{
					SpawnableMapObjectDef val7 = MainAssets.LoadAsset<SpawnableMapObjectDef>(customMapObject.objectPath);
					NetworkPrefabs.RegisterNetworkPrefab(val7.spawnableMapObject.prefabToSpawn);
					Prefabs.Add(customMapObject.name, val7.spawnableMapObject.prefabToSpawn);
					MapObjects.RegisterMapObject(val7, customMapObject.levelFlags, customMapObject.spawnRateFunction);
				}
			}
			foreach (KeyValuePair<string, GameObject> prefab in Prefabs)
			{
				GameObject value = prefab.Value;
				string key = prefab.Key;
				AudioSource[] componentsInChildren = value.GetComponentsInChildren<AudioSource>();
				if (componentsInChildren.Length != 0)
				{
					ConfigEntry<float> val8 = Config.VolumeConfig.Bind<float>("Volume", key ?? "", 100f, "Audio volume for " + key + " (0 - 100)");
					AudioSource[] array = componentsInChildren;
					foreach (AudioSource obj in array)
					{
						obj.volume *= val8.Value / 100f;
					}
				}
			}
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			for (int i = 0; i < types.Length; i++)
			{
				MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			Plugin.logger.LogInfo((object)"Custom content loaded!");
		}
	}
	public class Dingus : GrabbableObject
	{
		public AudioSource noiseAudio;

		public AudioSource noiseAudioFar;

		public AudioSource musicAudio;

		public AudioSource musicAudioFar;

		[Space(3f)]
		public AudioClip[] noiseSFX;

		public AudioClip[] noiseSFXFar;

		public AudioClip evilNoise;

		[Space(3f)]
		public float noiseRange;

		public float maxLoudness;

		public float minLoudness;

		public float minPitch;

		public float maxPitch;

		private Random noisemakerRandom;

		public Animator triggerAnimator;

		private int timesPlayedWithoutTurningOff;

		private RoundManager roundManager;

		private float noiseInterval = 1f;

		public Animator danceAnimator;

		private NetworkVariable<bool> isEvil = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public GameObject evilObject;

		public NetworkVariable<bool> isPlayingMusic = new NetworkVariable<bool>(Config.maxwellPlayMusicDefault.Value, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1);

		public override void Start()
		{
			((GrabbableObject)this).Start();
			roundManager = Object.FindObjectOfType<RoundManager>();
			noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85);
			if (((NetworkBehaviour)this).IsOwner)
			{
				isPlayingMusic.Value = Config.maxwellPlayMusicDefault.Value;
			}
			if (((NetworkBehaviour)this).IsHost)
			{
				isEvil.Value = Random.Range(0f, 100f) <= Config.evilMaxwellChance.Value;
			}
			Debug.Log((object)"Making the dingus dance");
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null))
			{
				int num = noisemakerRandom.Next(0, noiseSFX.Length);
				float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f;
				float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f;
				noiseAudio.pitch = pitch;
				noiseAudio.PlayOneShot(noiseSFX[num], num2);
				if ((Object)(object)noiseAudioFar != (Object)null)
				{
					noiseAudioFar.pitch = pitch;
					noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2);
				}
				if ((Object)(object)triggerAnimator != (Object)null)
				{
					triggerAnimator.SetTrigger("playAnim");
				}
				WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2);
				RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
			}
		}

		public override void DiscardItem()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				base.playerHeldBy.equippedUsableItemQE = false;
			}
			base.isBeingUsed = false;
			((GrabbableObject)this).DiscardItem();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			base.playerHeldBy.equippedUsableItemQE = true;
			danceAnimator.Play("dingusIdle");
			Debug.Log((object)"Making the dingus idle");
			if (((NetworkBehaviour)this).IsOwner)
			{
				HUDManager.Instance.DisplayTip("Maxwell acquired", "Press Q to toggle music.", false, true, "LCTip_UseManual");
			}
		}

		public override void ItemInteractLeftRight(bool right)
		{
			((GrabbableObject)this).ItemInteractLeftRight(right);
			if (!right && ((NetworkBehaviour)this).IsOwner)
			{
				isPlayingMusic.Value = !isPlayingMusic.Value;
			}
		}

		public override void InteractItem()
		{
			((GrabbableObject)this).InteractItem();
			if (isEvil.Value)
			{
				if (((NetworkBehaviour)this).IsOwner)
				{
					isPlayingMusic.Value = false;
				}
				danceAnimator.Play("dingusIdle");
				if (musicAudio.isPlaying)
				{
					musicAudio.Pause();
					musicAudioFar.Pause();
				}
				((MonoBehaviour)this).StartCoroutine(evilMaxwellMoment());
			}
		}

		public IEnumerator evilMaxwellMoment()
		{
			yield return (object)new WaitForSeconds(1f);
			noiseAudio.PlayOneShot(evilNoise, 1f);
			evilObject.SetActive(true);
			((Renderer)base.mainObjectRenderer).enabled = false;
			if ((Object)(object)noiseAudioFar != (Object)null)
			{
				noiseAudioFar.PlayOneShot(evilNoise, 1f);
			}
			if ((Object)(object)triggerAnimator != (Object)null)
			{
				triggerAnimator.SetTrigger("playAnim");
			}
			WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f);
			RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
			yield return (object)new WaitForSeconds(1.5f);
			Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3);
			Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren<Rigidbody>();
			foreach (Rigidbody obj in componentsInChildren)
			{
				obj.isKinematic = false;
				obj.AddExplosionForce(1000f, evilObject.transform.position, 100f);
			}
			yield return (object)new WaitForSeconds(2f);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public override void Update()
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).Update();
			if (isEvil.Value)
			{
				base.grabbable = false;
				base.grabbableToEnemies = false;
			}
			if (isPlayingMusic.Value)
			{
				if (!musicAudio.isPlaying)
				{
					musicAudio.Play();
					musicAudioFar.Play();
				}
				if (!base.isHeld)
				{
					danceAnimator.Play("dingusDance");
				}
				else
				{
					danceAnimator.Play("dingusIdle");
				}
				if (noiseInterval <= 0f)
				{
					noiseInterval = 1f;
					timesPlayedWithoutTurningOff++;
					roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5);
				}
				else
				{
					noiseInterval -= Time.deltaTime;
				}
			}
			else
			{
				timesPlayedWithoutTurningOff = 0;
				danceAnimator.Play("dingusIdle");
				if (musicAudio.isPlaying)
				{
					musicAudio.Pause();
					musicAudioFar.Pause();
				}
			}
		}

		protected override void __initializeVariables()
		{
			if (isEvil == null)
			{
				throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil);
			if (isPlayingMusic == null)
			{
				throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic");
			((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic);
			((GrabbableObject)this).__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "Dingus";
		}
	}
	public class Missile : NetworkBehaviour
	{
		public int damage = 50;

		public float maxDistance = 10f;

		public float minDistance;

		public float gravity = 2.4f;

		public float flightDelay = 0.5f;

		public float flightForce = 150f;

		public float flightTime = 2f;

		public float autoDestroyTime = 3f;

		private float timeAlive;

		public float LobForce = 100f;

		public ParticleSystem particleSystem;

		private void OnCollisionEnter(Collision collision)
		{
			if (((NetworkBehaviour)this).IsHost)
			{
				Boom();
				BoomClientRpc();
			}
			else
			{
				BoomServerRpc();
			}
		}

		private void Start()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).GetComponent<Rigidbody>().useGravity = false;
			if (((NetworkBehaviour)this).IsHost)
			{
				((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1);
			}
		}

		[ClientRpc]
		public void BoomClientRpc()
		{
			//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(3331368301u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3331368301u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Boom();
				}
			}
		}

		[ServerRpc]
		public void BoomServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(452316787u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 452316787u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				Boom();
				BoomClientRpc();
			}
		}

		public void CreateExplosion()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId));
			Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, minDistance, maxDistance, 10, (CauseOfDeath)3, attacker);
		}

		public void Boom()
		{
			//IL_005b: 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_0089: 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_0091: 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)
			if ((Object)(object)particleSystem == (Object)null)
			{
				Debug.LogError((object)"No particle system set on missile, destruction time!!");
				CreateExplosion();
				if (((NetworkBehaviour)this).IsHost)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
				return;
			}
			particleSystem.Stop(true, (ParticleSystemStopBehavior)1);
			((Component)particleSystem).transform.SetParent((Transform)null);
			((Component)particleSystem).transform.localScale = Vector3.one;
			GameObject gameObject = ((Component)particleSystem).gameObject;
			MainModule main = particleSystem.main;
			float duration = ((MainModule)(ref main)).duration;
			main = particleSystem.main;
			MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
			Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant);
			CreateExplosion();
			if (((NetworkBehaviour)this).IsHost)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void FixedUpdate()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (!((NetworkBehaviour)this).IsHost)
			{
				return;
			}
			((Component)this).GetComponent<Rigidbody>().useGravity = false;
			((Component)this).GetComponent<Rigidbody>().AddForce(Vector3.down * gravity);
			if (timeAlive <= flightTime && timeAlive >= flightDelay)
			{
				((Component)this).GetComponent<Rigidbody>().AddForce(((Component)this).transform.forward * flightForce);
			}
			timeAlive += Time.fixedDeltaTime;
			if (timeAlive > autoDestroyTime)
			{
				if (((NetworkBehaviour)this).IsHost)
				{
					Boom();
					BoomClientRpc();
				}
				else
				{
					BoomServerRpc();
				}
			}
			else
			{
				Debug.Log((object)("Time alive: " + timeAlive + " / " + autoDestroyTime));
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Missile()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3331368301u, new RpcReceiveHandler(__rpc_handler_3331368301));
			NetworkManager.__rpc_func_table.Add(452316787u, new RpcReceiveHandler(__rpc_handler_452316787));
		}

		private static void __rpc_handler_3331368301(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;
				((Missile)(object)target).BoomClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_452316787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Missile)(object)target).BoomServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Missile";
		}
	}
	public class PouchyBelt : GrabbableObject
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_SetHoverTipAndCurrentInteractTrigger <0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger;

			public static hook_BeginGrabObject <1>__PlayerControllerB_BeginGrabObject;
		}

		public Transform beltCosmetic;

		public Vector3 beltCosmeticPositionOffset = new Vector3(0f, 0f, 0f);

		public Vector3 beltCosmeticRotationOffset = new Vector3(0f, 0f, 0f);

		public int beltCapacity = 3;

		private PlayerControllerB previousPlayerHeldBy;

		public static void Initialize()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0030: 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_003b: Expected O, but got Unknown
			object obj = <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger;
			if (obj == null)
			{
				hook_SetHoverTipAndCurrentInteractTrigger val = PlayerControllerB_SetHoverTipAndCurrentInteractTrigger;
				<>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger = val;
				obj = (object)val;
			}
			PlayerControllerB.SetHoverTipAndCurrentInteractTrigger += (hook_SetHoverTipAndCurrentInteractTrigger)obj;
			object obj2 = <>O.<1>__PlayerControllerB_BeginGrabObject;
			if (obj2 == null)
			{
				hook_BeginGrabObject val2 = PlayerControllerB_BeginGrabObject;
				<>O.<1>__PlayerControllerB_BeginGrabObject = val2;
				obj2 = (object)val2;
			}
			PlayerControllerB.BeginGrabObject += (hook_BeginGrabObject)obj2;
		}

		private static void PlayerControllerB_BeginGrabObject(orig_BeginGrabObject orig, PlayerControllerB self)
		{
			//IL_000c: 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_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references)
			self.interactRay = new Ray(((Component)self.gameplayCamera).transform.position, ((Component)self.gameplayCamera).transform.forward);
			if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp") || self.twoHanded || self.sinkingValue > 0.73f)
			{
				return;
			}
			self.currentlyGrabbingObject = ((Component)((Component)((RaycastHit)(ref self.hit)).collider).transform).gameObject.GetComponent<GrabbableObject>();
			if ((!GameNetworkManager.Instance.gameHasStarted && !self.currentlyGrabbingObject.itemProperties.canBeGrabbedBeforeGameStart && !StartOfRound.Instance.testRoom.activeSelf) || (Object)(object)self.currentlyGrabbingObject == (Object)null || self.inSpecialInteractAnimation || self.currentlyGrabbingObject.isHeld || self.currentlyGrabbingObject.isPocketed)
			{
				return;
			}
			NetworkObject networkObject = ((NetworkBehaviour)self.currentlyGrabbingObject).NetworkObject;
			if (!((Object)(object)networkObject == (Object)null) && networkObject.IsSpawned)
			{
				if (self.currentlyGrabbingObject is PouchyBelt && self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt))
				{
					self.currentlyGrabbingObject.grabbable = false;
				}
				orig.Invoke(self);
				if (self.currentlyGrabbingObject is PouchyBelt)
				{
					self.currentlyGrabbingObject.grabbable = true;
				}
			}
		}

		private static void PlayerControllerB_SetHoverTipAndCurrentInteractTrigger(orig_SetHoverTipAndCurrentInteractTrigger orig, PlayerControllerB self)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp"))
			{
				return;
			}
			if (self.FirstEmptyItemSlot() == -1)
			{
				((TMP_Text)self.cursorTip).text = "Inventory full!";
			}
			else if (((Component)((RaycastHit)(ref self.hit)).collider).gameObject.GetComponent<GrabbableObject>() is PouchyBelt)
			{
				if (self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt))
				{
					((TMP_Text)self.cursorTip).text = "(Cannot hold more than 1 belt)";
				}
				else
				{
					((TMP_Text)self.cursorTip).text = "Pick up belt";
				}
			}
		}

		public override void LateUpdate()
		{
			//IL_005d: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: 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)
			((GrabbableObject)this).LateUpdate();
			if ((Object)(object)previousPlayerHeldBy != (Object)null)
			{
				((Component)beltCosmetic).gameObject.SetActive(true);
				beltCosmetic.SetParent((Transform)null);
				((Renderer)((Component)beltCosmetic).GetComponent<MeshRenderer>()).enabled = true;
				Transform parent = previousPlayerHeldBy.lowerSpine.parent;
				beltCosmetic.position = parent.position + beltCosmeticPositionOffset;
				Quaternion rotation = parent.rotation;
				Quaternion rotation2 = Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset);
				beltCosmetic.rotation = rotation2;
				((Renderer)base.mainObjectRenderer).enabled = false;
				((Component)this).gameObject.SetActive(true);
			}
			else
			{
				((Component)beltCosmetic).gameObject.SetActive(false);
				((Renderer)base.mainObjectRenderer).enabled = true;
				beltCosmetic.SetParent(((Component)this).transform);
			}
		}

		public void UpdateHUD(bool add)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_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_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			HUDManager instance = HUDManager.Instance;
			if (add)
			{
				int num = 0;
				GrabbableObject[] itemSlots = GameNetworkManager.Instance.localPlayerController.ItemSlots;
				for (int i = 0; i < itemSlots.Length; i++)
				{
					if (itemSlots[i] is PouchyBelt)
					{
						num++;
					}
				}
				Image val = instance.itemSlotIconFrames[0];
				Image val2 = instance.itemSlotIcons[0];
				int num2 = instance.itemSlotIconFrames.Length;
				((Component)val).GetComponentInParent<CanvasScaler>();
				((Component)val).GetComponentInParent<AspectRatioFitter>();
				float x = ((Graphic)val).rectTransform.sizeDelta.x;
				float y = ((Graphic)val).rectTransform.sizeDelta.y;
				float num3 = ((Graphic)val).rectTransform.anchoredPosition.y + 1.125f * y * (float)num;
				Vector3 localEulerAngles = ((Transform)((Graphic)val).rectTransform).localEulerAngles;
				Vector3 localEulerAngles2 = ((Transform)((Graphic)val2).rectTransform).localEulerAngles;
				List<Image> list = instance.itemSlotIconFrames.ToList();
				List<Image> list2 = instance.itemSlotIcons.ToList();
				Debug.Log((object)$"Adding {beltCapacity} item slots! Surely this will go well..");
				for (int j = 0; j < beltCapacity; j++)
				{
					float num4 = ((Graphic)val).rectTransform.anchoredPosition.x + (float)(j + 1) * x;
					Image val3 = Object.Instantiate<Image>(list[num2 - 1], ((Component)val).transform.parent);
					((Object)val3).name = $"Slot{num2 + j}[LethalThingsBelt]";
					((Graphic)val3).rectTransform.anchoredPosition = new Vector2(num4, num3);
					((Transform)((Graphic)val3).rectTransform).eulerAngles = localEulerAngles;
					Image component = ((Component)((Component)val3).transform.GetChild(0)).GetComponent<Image>();
					((Object)component).name = "icon";
					((Behaviour)component).enabled = false;
					((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2;
					((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f));
					list.Add(val3);
					list2.Add(component);
				}
				instance.itemSlotIconFrames = list.ToArray();
				instance.itemSlotIcons = list2.ToArray();
				Debug.Log((object)$"Added {beltCapacity} item slots!");
				return;
			}
			List<Image> list3 = instance.itemSlotIconFrames.ToList();
			List<Image> list4 = instance.itemSlotIcons.ToList();
			int count = list3.Count;
			int num5 = 0;
			for (int num6 = count - 1; num6 >= 0; num6--)
			{
				if (((Object)list3[num6]).name.Contains("[LethalThingsBelt]"))
				{
					num5++;
					Image obj = list3[num6];
					list3.RemoveAt(num6);
					list4.RemoveAt(num6);
					Object.Destroy((Object)(object)((Component)obj).gameObject);
					if (num5 >= beltCapacity)
					{
						break;
					}
				}
			}
			instance.itemSlotIconFrames = list3.ToArray();
			instance.itemSlotIcons = list4.ToArray();
			Debug.Log((object)$"Removed {beltCapacity} item slots!");
		}

		public void AddItemSlots()
		{
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList();
				base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count + beltCapacity];
				for (int i = 0; i < list.Count; i++)
				{
					base.playerHeldBy.ItemSlots[i] = list[i];
				}
				if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
				{
					UpdateHUD(add: true);
				}
			}
		}

		public void RemoveItemSlots()
		{
			if (!((Object)(object)base.playerHeldBy != (Object)null))
			{
				return;
			}
			int num = base.playerHeldBy.ItemSlots.Length - beltCapacity;
			int currentItemSlot = base.playerHeldBy.currentItemSlot;
			for (int i = 0; i < beltCapacity; i++)
			{
				GrabbableObject val = base.playerHeldBy.ItemSlots[num + i];
				if ((Object)(object)val != (Object)null)
				{
					base.playerHeldBy.DropItem(val, num + i);
				}
			}
			int currentItemSlot2 = base.playerHeldBy.currentItemSlot;
			currentItemSlot2 = ((currentItemSlot < base.playerHeldBy.ItemSlots.Length) ? currentItemSlot : 0);
			List<GrabbableObject> list = base.playerHeldBy.ItemSlots.ToList();
			base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count - beltCapacity];
			for (int j = 0; j < base.playerHeldBy.ItemSlots.Length; j++)
			{
				base.playerHeldBy.ItemSlots[j] = list[j];
			}
			if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController)
			{
				UpdateHUD(add: false);
			}
			base.playerHeldBy.SwitchItemSlots(currentItemSlot2);
		}

		public override void DiscardItem()
		{
			RemoveItemSlots();
			previousPlayerHeldBy = null;
			((GrabbableObject)this).DiscardItem();
		}

		public void GrabItemOnClient()
		{
			((GrabbableObject)this).GrabItemOnClient();
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy)
				{
					AddItemSlots();
				}
				previousPlayerHeldBy = base.playerHeldBy;
			}
		}

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

		protected internal override string __getTypeName()
		{
			return "PouchyBelt";
		}
	}
	public class PowerOutletStun : NetworkBehaviour
	{
		private Coroutine electrocutionCoroutine;

		public AudioSource strikeAudio;

		public ParticleSystem strikeParticle;

		private NetworkVariable<int> damage = new NetworkVariable<int>(20, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);

		public void Electrocute(ItemCharger socket)
		{
			Debug.Log((object)"Attempting electrocution");
			if (electrocutionCoroutine != null)
			{
				((MonoBehaviour)this).StopCoroutine(electrocutionCoroutine);
			}
			electrocutionCoroutine = ((MonoBehaviour)this).StartCoroutine(electrocutionDelayed(socket));
		}

		public void Awake()
		{
			//IL_0035: 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)
			StormyWeather val = Object.FindObjectOfType<StormyWeather>(true);
			GameObject gameObject = ((Component)val.targetedStrikeAudio).gameObject;
			strikeAudio = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform).GetComponent<AudioSource>();
			((Component)strikeAudio).transform.localPosition = Vector3.zero;
			((Component)strikeAudio).gameObject.SetActive(true);
			strikeParticle = Object.Instantiate<GameObject>(((Component)val.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent<ParticleSystem>();
			((Component)strikeParticle).transform.localPosition = Vector3.zero;
			((Component)strikeParticle).gameObject.SetActive(true);
			if (((NetworkBehaviour)this).IsHost)
			{
				damage.Value = Config.itemChargerElectrocutionDamage.Value;
			}
		}

		private IEnumerator electrocutionDelayed(ItemCharger socket)
		{
			Debug.Log((object)"Electrocution started");
			socket.zapAudio.Play();
			yield return (object)new WaitForSeconds(0.75f);
			socket.chargeStationAnimator.SetTrigger("zap");
			Debug.Log((object)"Electrocution finished");
			if (((NetworkBehaviour)this).NetworkObject.IsOwner && !((NetworkBehaviour)this).NetworkObject.IsOwnedByServer)
			{
				Debug.Log((object)"Sending stun to server!!");
				ElectrocutedServerRpc(((Component)this).transform.position);
			}
			else if (((NetworkBehaviour)this).NetworkObject.IsOwner && ((NetworkBehaviour)this).NetworkObject.IsOwnedByServer)
			{
				Debug.Log((object)"Sending stun to clients!!");
				ElectrocutedClientRpc(((Component)this).transform.position);
				Electrocuted(((Component)this).transform.position);
			}
		}

		[ClientRpc]
		private void ElectrocutedClientRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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(328188188u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 328188188u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Debug.Log((object)"Stun received!!");
					Electrocuted(position);
				}
			}
		}

		private void Electrocuted(Vector3 position)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			StormyWeather obj = Object.FindObjectOfType<StormyWeather>(true);
			Utilities.CreateExplosion(position, spawnExplosionEffect: false, 20, 0f, 5f, 3, (CauseOfDeath)11);
			strikeParticle.Play();
			obj.PlayThunderEffects(position, strikeAudio);
		}

		[ServerRpc]
		private void ElectrocutedServerRpc(Vector3 position)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Invalid comparison between Unknown and I4
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2844681185u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2844681185u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ElectrocutedClientRpc(position);
			}
		}

		protected override void __initializeVariables()
		{
			if (damage == null)
			{
				throw new Exception("PowerOutletStun.damage cannot be null. All NetworkVariableBase instances must be initialized.");
			}
			((NetworkVariableBase)damage).Initialize((NetworkBehaviour)(object)this);
			((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)damage, "damage");
			base.NetworkVariableFields.Add((NetworkVariableBase)(object)damage);
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_PowerOutletStun()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(328188188u, new RpcReceiveHandler(__rpc_handler_328188188));
			NetworkManager.__rpc_func_table.Add(2844681185u, new RpcReceiveHandler(__rpc_handler_2844681185));
		}

		private static void __rpc_handler_328188188(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((PowerOutletStun)(object)target).ElectrocutedClientRpc(position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2844681185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				Vector3 position = default(Vector3);
				((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((PowerOutletStun)(object)target).ElectrocutedServerRpc(position);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "PowerOutletStun";
		}
	}
	public class RocketLauncher : GrabbableObject
	{
		public Light laserPointer;

		public Transform lightSource;

		public AudioSource mainAudio;

		public AudioClip[] activateClips;

		public AudioClip[] noAmmoSounds;

		public Transform aimDirection;

		public int maxAmmo = 4;

		private int currentAmmo;

		public GameObject missilePrefab;

		private float timeSinceLastShot;

		private PlayerControllerB previousPlayerHeldBy;

		public Material[] ammoLampMaterials;

		public Animator Animator;

		public ParticleSystem particleSystem;

		public override void Start()
		{
			//IL_0056: 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_0026: 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)
			currentAmmo = maxAmmo;
			for (int i = 0; i < ammoLampMaterials.Length; i++)
			{
				if (i >= currentAmmo)
				{
					ammoLampMaterials[i].SetColor("_BaseColor", Color.red);
					ammoLampMaterials[i].SetColor("_EmissiveColorMap", Color.red);
				}
				else
				{
					ammoLampMaterials[i].SetColor("_BaseColor", Color.green);
					ammoLampMaterials[i].SetColor("_EmissiveColorMap", Color.green);
				}
			}
			((GrabbableObject)this).Start();
		}

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

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_0082: 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)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			if (currentAmmo > 0)
			{
				currentAmmo--;
				PlayRandomAudio(mainAudio, activateClips);
				Animator.Play("fire");
				particleSystem.Play();
				for (int i = 0; i < ammoLampMaterials.Length; i++)
				{
					if (i >= currentAmmo)
					{
						ammoLampMaterials[i].SetColor("_BaseColor", Color.red);
					}
					else
					{
						ammoLampMaterials[i].SetColor("_BaseColor", Color.green);
					}
				}
				if (((NetworkBehaviour)this).IsOwner)
				{
					if (((NetworkBehaviour)this).IsHost)
					{
						MissileSpawner();
					}
					else
					{
						SpawnMissileServerRpc();
					}
				}
			}
			else
			{
				PlayRandomAudio(mainAudio, noAmmoSounds);
			}
		}

		[ServerRpc]
		private void SpawnMissileServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(336477477u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 336477477u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				MissileSpawner();
			}
		}

		private void MissileSpawner()
		{
			//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)
			Object.Instantiate<GameObject>(missilePrefab, aimDirection.position, aimDirection.rotation).GetComponent<NetworkObject>().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false);
		}

		private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips)
		{
			if (audioClips.Length != 0)
			{
				audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]);
			}
		}

		public override void LateUpdate()
		{
			//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_0038: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).LateUpdate();
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(lightSource.position, lightSource.forward, ref val, 100f, 8))
			{
				((Component)laserPointer).transform.position = ((RaycastHit)(ref val)).point;
				((Behaviour)laserPointer).enabled = true;
			}
			else
			{
				((Behaviour)laserPointer).enabled = false;
			}
		}

		private void OnEnable()
		{
		}

		private void OnDisable()
		{
		}

		public override void EquipItem()
		{
			((GrabbableObject)this).EquipItem();
			if ((Object)(object)base.playerHeldBy != (Object)null)
			{
				previousPlayerHeldBy = base.playerHeldBy;
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_RocketLauncher()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(336477477u, new RpcReceiveHandler(__rpc_handler_336477477));
		}

		private static void __rpc_handler_336477477(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Invalid comparison between Unknown and I4
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
			{
				if ((int)networkManager.LogLevel <= 1)
				{
					Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
				}
			}
			else
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((RocketLauncher)(object)target).SpawnMissileServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "RocketLauncher";
		}
	}
	public class RoombaAI : EnemyAI
	{
		private float angeredTimer;

		[Header("Behaviors")]
		public AISearchRoutine searchForPlayers;

		public bool investigating;

		public bool hasBegunInvestigating;

		public Vector3 investigatePosition;

		[Header("Landmine")]
		private bool mineActivated = true;

		public bool hasExploded;

		public AudioSource mineAudio;

		public AudioSource mineFarAudio;

		public AudioSource idleSound;

		public AudioClip mineDetonate;

		public AudioClip mineTrigger;

		public AudioClip mineDetonateFar;

		public AudioClip beepNoise;

		public AudioClip minePress;

		private bool sendingExplosionRPC;

		private RaycastHit hit;

		private RoundManager roundManager;

		private bool localPlayerOnMine;

		private MeshRenderer meshRenderer;

		public Rigidbody Rigidbody;

		private List<Light> lights = new List<Light>();

		public float lightInterval = 1f;

		public float lightTimer;

		public float lightOnDuration = 0.1f;

		public override void Start()
		{
			((EnemyAI)this).Start();
			Transform val = ((Component)this).transform.Find("BoombaModel/Roomba/Cube");
			meshRenderer = ((Component)val).GetComponent<MeshRenderer>();
			lights = ((Component)val.parent).GetComponentsInChildren<Light>().ToList();
		}

		public override void DoAIInterval()
		{
			//IL_0021: 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_00ff: 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_00c4: 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)
			((EnemyAI)this).DoAIInterval();
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			Vector3 velocity = Rigidbody.velocity;
			float magnitude = ((Vector3)(ref velocity)).magnitude;
			idleSound.pitch = Mathf.Lerp(0.8f, 1.2f, magnitude / 2f);
			if (((EnemyAI)this).TargetClosestPlayer(4f, true, 70f))
			{
				((EnemyAI)this).StopSearch(searchForPlayers, true);
				base.movingTowardsTargetPlayer = true;
				hasBegunInvestigating = false;
				investigating = false;
			}
			else if (investigating)
			{
				if (!hasBegunInvestigating)
				{
					hasBegunInvestigating = true;
					((EnemyAI)this).StopSearch(base.currentSearch, false);
					((EnemyAI)this).SetDestinationToPosition(investigatePosition, false);
				}
				if (Vector3.Distance(((Component)this).transform.position, investigatePosition) < 5f)
				{
					investigating = false;
					hasBegunInvestigating = false;
				}
			}
			else if (!searchForPlayers.inProgress)
			{
				base.movingTowardsTargetPlayer = false;
				((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers);
			}
		}

		private void FixedUpdate()
		{
			_ = base.ventAnimationFinished;
		}

		public IEnumerator disableLights(float timer)
		{
			yield return (object)new WaitForSeconds(timer);
			foreach (Light light in lights)
			{
				((Behaviour)light).enabled = false;
			}
		}

		public override void Update()
		{
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).Update();
			if (lightTimer > 0f)
			{
				lightTimer -= Time.deltaTime;
				if (lightTimer <= 0f)
				{
					foreach (Light light in lights)
					{
						((Behaviour)light).enabled = true;
					}
					((MonoBehaviour)this).StartCoroutine(disableLights(lightOnDuration));
					mineAudio.PlayOneShot(beepNoise);
					WalkieTalkie.TransmitOneShotAudio(mineAudio, beepNoise, 1f);
				}
			}
			else
			{
				lightTimer = lightInterval;
			}
			if (!base.ventAnimationFinished || !((Object)(object)base.creatureAnimator != (Object)null))
			{
				return;
			}
			((Behaviour)base.creatureAnimator).enabled = false;
			if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead)
			{
				return;
			}
			_ = base.serverPosition;
			if (base.stunNormalizedTimer > 0f)
			{
				base.agent.speed = 0f;
				angeredTimer = 7f;
			}
			else if (angeredTimer > 0f)
			{
				angeredTimer -= Time.deltaTime;
				if (((NetworkBehaviour)this).IsOwner)
				{
					base.agent.stoppingDistance = 0.1f;
					base.agent.speed = 1f;
				}
			}
			else if (((NetworkBehaviour)this).IsOwner)
			{
				base.agent.stoppingDistance = 5f;
				base.agent.speed = 0.8f;
			}
		}

		private IEnumerator StartIdleAnimation()
		{
			roundManager = Object.FindObjectOfType<RoundManager>();
			if (!((Object)(object)roundManager == (Object)null))
			{
				if (roundManager.BreakerBoxRandom != null)
				{
					yield return (object)new WaitForSeconds((float)roundManager.BreakerBoxRandom.NextDouble() + 0.5f);
				}
				mineAudio.pitch = Random.Range(0.9f, 1.1f);
			}
		}

		private void OnTriggerEnter(Collider other)
		{
			if (hasExploded)
			{
				return;
			}
			Plugin.logger.LogInfo((object)("[Boomba] Trigger enter, tag: " + ((Component)other).tag + ", name: " + ((Object)other).name));
			if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player"))
			{
				PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
				if (!((Component)other).CompareTag("Player"))
				{
					component = ((Component)((Component)other).transform.parent).GetComponent<PlayerControllerB>();
				}
				if (!((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) && (Object)(object)component != (Object)null && !component.isPlayerDead)
				{
					localPlayerOnMine = true;
					PressMineServerRpc();
					((MonoBehaviour)this).StartCoroutine(TriggerMine(other));
				}
			}
			else
			{
				if (!((Component)other).CompareTag("PlayerRagdoll"))
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<DeadBodyInfo>()))
				{
					if ((Object)(object)((Component)other).GetComponent<DeadBodyInfo>().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController)
					{
						return;
					}
				}
				else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<GrabbableObject>()) && !((NetworkBehaviour)((Component)other).GetComponent<GrabbableObject>()).NetworkObject.IsOwner)
				{
					return;
				}
				PressMineServerRpc();
				((MonoBehaviour)this).StartCoroutine(TriggerMine(other));
			}
		}

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

		[ClientRpc]
		public void PressMineClientRpc()
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2561781742u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2561781742u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					mineAudio.PlayOneShot(minePress);
					WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f);
				}
			}
		}

		public IEnumerator TriggerMine(Collider other)
		{
			Debug.Log((object)("Object entering mine trigger, gameobject name: " + ((Object)((Component)other).gameObject).name));
			yield return (object)new WaitForSeconds(0.5f);
			MineGoesBoom(other);
		}

		public void MineGoesBoom(Collider other)
		{
			if (hasExploded)
			{
				return;
			}
			Debug.Log((object)("Object leaving mine trigger, gameobject name: " + ((Object)((Component)other).gameObject).name));
			if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player"))
			{
				PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>();
				if (!((Component)other).CompareTag("Player"))
				{
					component = ((Component)((Component)other).transform.parent).GetComponent<PlayerControllerB>();
				}
				if ((Object)(object)component != (Object)null && !component.isPlayerDead && !((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController))
				{
					localPlayerOnMine = false;
					TriggerMineOnLocalClientByExiting();
				}
			}
			else
			{
				if (!((Component)other).CompareTag("PlayerRagdoll"))
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<DeadBodyInfo>()))
				{
					if ((Object)(object)((Component)other).GetComponent<DeadBodyInfo>().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController)
					{
						return;
					}
				}
				else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent<GrabbableObject>()) && !((NetworkBehaviour)((Component)other).GetComponent<GrabbableObject>()).NetworkObject.IsOwner)
				{
					return;
				}
				TriggerMineOnLocalClientByExiting();
			}
		}

		private void TriggerMineOnLocalClientByExiting()
		{
			if (!hasExploded)
			{
				hasExploded = true;
				SetOffMineAnimation();
				sendingExplosionRPC = true;
				ExplodeMineServerRpc();
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ExplodeMineServerRpc()
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2745793768u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2745793768u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					hasExploded = true;
					ExplodeMineClientRpc();
				}
			}
		}

		[ClientRpc]
		public void ExplodeMineClientRpc()
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2242285281u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2242285281u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (sendingExplosionRPC)
				{
					sendingExplosionRPC = false;
				}
				else
				{
					SetOffMineAnimation();
				}
			}
		}

		public void SetOffMineAnimation()
		{
			hasExploded = true;
			mineAudio.PlayOneShot(mineTrigger, 1f);
			((MonoBehaviour)this).StartCoroutine(detonateMineDelayed());
		}

		private IEnumerator detonateMineDelayed()
		{
			yield return (object)new WaitForSeconds(0.5f);
			Detonate();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void Detonate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			mineAudio.pitch = Random.Range(0.93f, 1.07f);
			mineAudio.PlayOneShot(mineDetonate, 1f);
			Utilities.CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, 100, 5.7f, 6.4f, 6, (CauseOfDeath)3);
		}

		public bool MineHasLineOfSight(Vector3 pos)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return !Physics.Linecast(((Component)this).transform.position, pos, ref hit, 256);
		}

		public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false)
		{
			((EnemyAI)this).HitEnemy(force, playerWhoHit, false);
			angeredTimer = 18f;
			SetOffMineAnimation();
			sendingExplosionRPC = true;
			ExplodeMineServerRpc();
		}

		public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID);
			if (!(Vector3.Distance(noisePosition, ((Component)this).transform.position) > 15f) && !base.movingTowardsTargetPlayer)
			{
				investigatePosition = noisePosition;
			}
		}

		public void InvestigatePosition(Vector3 position)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (!hasBegunInvestigating)
			{
				investigatePosition = position;
				investigating = true;
			}
		}

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

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_RoombaAI()
		{
			//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
			NetworkManager.__rpc_func_table.Add(3418551494u, new RpcReceiveHandler(__rpc_handler_3418551494));
			NetworkManager.__rpc_func_table.Add(2561781742u, new RpcReceiveHandler(__rpc_handler_2561781742));
			NetworkManager.__rpc_func_table.Add(2745793768u, new RpcReceiveHandler(__rpc_handler_2745793768));
			NetworkManager.__rpc_func_table.Add(2242285281u, new RpcReceiveHandler(__rpc_handler_2242285281));
		}

		private static void __rpc_handler_3418551494(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;
				((RoombaAI)(object)target).PressMineServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2561781742(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;
				((RoombaAI)(object)target).PressMineClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2745793768(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;
				((RoombaAI)(object)target).ExplodeMineServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2242285281(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;
				((RoombaAI)(object)target).ExplodeMineClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "RoombaAI";
		}
	}
	internal class ToyHammer : GrabbableObject
	{
		public int hammerHitForce = 1;

		public float hammerHitPercentage = 1f;

		public bool reelingUp;

		public bool isHoldingButton;

		private RaycastHit rayHit;

		private Coroutine reelingUpCoroutine;

		private RaycastHit[] objectsHitByHammer;

		private List<RaycastHit> objectsHitByHammerList = new List<RaycastHit>();

		public AudioClip reelUp;

		public AudioClip swing;

		public AudioClip[] hitSFX;

		public AudioSource hammerAudio;

		private PlayerControllerB previousPlayerHeldBy;

		private int hammerMask = 11012424;

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			if ((Object)(object)base.playerHeldBy == (Object)null)
			{
				return;
			}
			isHoldingButton = buttonDown;
			if (!reelingUp && buttonDown)
			{
				reelingUp = true;
				previousPlayerHeldBy = base.playerHeldBy;
				if (reelingUpCoroutine != null)
				{
					((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine);
				}
				reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer());
			}
		}

		private IEnumerator reelUpHammer()
		{
			base.playerHeldBy.activatingItem = true;
			base.playerHeldBy.twoHanded = true;
			base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit");
			base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true);
			hammerAudio.PlayOneShot(reelUp);
			ReelUpSFXServerRpc();
			yield return (object)new WaitForSeconds(0.35f);
			yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld));
			SwingHammer(!base.isHeld);
			yield return (object)new WaitForSeconds(0.13f);
			HitHammer(!base.isHeld);
			yield return (object)new WaitForSeconds(0.3f);
			reelingUp = false;
			reelingUpCoroutine = null;
		}

		[ServerRpc]
		public void ReelUpSFXServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Invalid comparison between Unknown and I4
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Invalid comparison between Unknown and I4
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
				{
					if ((int)networkManager.LogLevel <= 1)
					{
						Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
					}
					return;
				}
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3129286724u, val, (RpcDelivery)0);
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3129286724u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ReelUpSFXClientRpc();
			}
		}

		[ClientRpc]
		public void ReelUpSFXClientRpc()
		{
			//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)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4160876605u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4160876605u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					hammerAudio.PlayOneShot(reelUp);
				}
			}
		}

		public override void DiscardItem()
		{
			base.playerHeldBy.activatingItem = false;
			((GrabbableObject)this).DiscardItem();
		}

		public void SwingHammer(bool cancel = false)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false);
			if (!cancel)
			{
				hammerAudio.PlayOneShot(swing);
				previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false);
			}
		}

		public void HitHammer(bool cancel = false)
		{
			//IL_003f: 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)
			//IL_005e: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: 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_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: 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_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)previousPlayerHeldBy == (Object)null)
			{
				return;
			}
			previousPlayerHeldBy.activatingItem = false;
			bool flag = false;
			if (!cancel)
			{
				previousPlayerHeldBy.twoHanded = false;
				Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f);
				objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2);
				objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList();
				Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
				IHittable val3 = default(IHittable);
				RaycastHit val5 = default(RaycastHit);
				for (int i = 0; i < objectsHitByHammerList.Count; i++)
				{
					RaycastHit val2 = objectsHitByHammerList[i];
					if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8)
					{
						val2 = objectsHitByHammerList[i];
						if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11)
						{
							val2 = objectsHitByHammerList[i];
							if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3))
							{
								continue;
							}
							val2 = objectsHitByHammerList[i];
							if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
							{
								continue;
							}
							val2 = objectsHitByHammerList[i];
							if (!(((RaycastHit)(ref val2)).point == Vector3.zero))
							{
								Vector3 val4 = val;
								val2 = objectsHitByHammerList[i];
								if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRou

plugins/fivetoofive-DetailedScan/DetailedScan.dll

Decompiled 10 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TerminalApi;
using TerminalApi.Events;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("DetailedScan")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DetailedScan")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("68299a3b-4db9-4777-8128-bbc1a40530c5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DetailedScan;

[BepInPlugin("fivetoofive.DetailedScan", "DetailedScan", "1.1.2.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class LSDetailedScan : BaseUnityPlugin
{
	private const string modGUID = "fivetoofive.DetailedScan";

	private const string modName = "DetailedScan";

	private const string modVersion = "1.1.2.0";

	private readonly Harmony harmony = new Harmony("fivetoofive.DetailedScan");

	private void Awake()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		Logger.CreateLogSource("fivetoofive.DetailedScan").LogInfo((object)"DetailedScan is loaded!");
		harmony.PatchAll(typeof(LSDetailedScan));
		Events.TerminalBeginUsing += new TerminalEventHandler(OnBeginUsing);
		Events.TerminalAwake += new TerminalEventHandler(TerminalIsAwake);
	}

	private void TerminalIsAwake(object sender, TerminalEventArgs e)
	{
		TerminalApi.AddCommand("detailed", "Ship is not Landed!\n\n", "ftf0", true);
		TerminalApi.AddCommand("ds", "Ship is not Landed!\n\n", "ftf1", true);
	}

	private void OnBeginUsing(object sender, TerminalEventArgs e)
	{
		List<GrabbableObject> list = new List<GrabbableObject>();
		GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
		int num = 0;
		for (int i = 0; i < array.Length; i++)
		{
			if (array[i].itemProperties.isScrap && !array[i].scrapPersistedThroughRounds && !array[i].isInShipRoom)
			{
				list.Add(array[i]);
				num += array[i].scrapValue;
			}
		}
		string text = string.Join("\n", list.Select((GrabbableObject x) => x.itemProperties.itemName + " : " + x.scrapValue + " Value"));
		TerminalNode val = TerminalApi.CreateTerminalNode(("Scrap not in ship: " + list.Count() + "\n\n" + text + "\n\nWith a total value of: " + num + "\n\n") ?? "", true, "");
		TerminalApi.UpdateKeywordCompatibleNoun("ftf0", "detailed", val);
		TerminalApi.UpdateKeywordCompatibleNoun("ftf1", "ds", val);
	}
}

plugins/FlipMods-CustomTelevisionVideo/CustomTelevisionVideo.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine.Video;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CustomTelevisionVideo")]
[assembly: AssemblyDescription("Mod made by flipf17")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomTelevisionVideo")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bf8ba009-dc9e-4448-a9c0-9ea880f19ee6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CustomTelevisionVideo
{
	public static class ConfigSettings
	{
		public static ConfigEntry<string> videoPath;

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			videoPath = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("CustomTelevisionVideo", "CustomVideoPath", "FlipMods-CustomTelevisionVideo/television_video.mp4", "Absolute or local video path. Use forward slashes in your path. Local paths are local to the BepInEx/plugins folder, and should not begin with a slash.");
		}
	}
	[BepInPlugin("FlipMods.CustomTelevisionVideo", "CustomTelevisionVideo", "1.1.3")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		public static Plugin instance;

		public static string filePath;

		private void Awake()
		{
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			instance = this;
			ConfigSettings.BindConfigSettings();
			filePath = ConfigSettings.videoPath.Value;
			if (filePath.Length <= 0 || Enumerable.Contains(filePath, ' '))
			{
				filePath = ((ConfigEntryBase)ConfigSettings.videoPath).DefaultValue.ToString();
			}
			filePath = filePath.Replace('/', Path.DirectorySeparatorChar);
			if (!Path.IsPathRooted(filePath))
			{
				filePath = Path.Combine(Paths.PluginPath, filePath.TrimStart(new char[1] { '/' }));
			}
			Log("Using path from config: " + filePath);
			_harmony = new Harmony("CustomTelevisionVideo");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"CustomTelevisionVideo mod loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.CustomTelevisionVideo";

		public const string PLUGIN_NAME = "CustomTelevisionVideo";

		public const string PLUGIN_VERSION = "1.1.3";
	}
}
namespace CustomTelevisionVideo.Patches
{
	[HarmonyPatch]
	internal class CustomTelevisionVideoPatcher
	{
		[HarmonyPatch(typeof(TVScript), "TVFinishedClip")]
		[HarmonyPrefix]
		public static bool TVFinishedClip()
		{
			return false;
		}

		[HarmonyPatch(typeof(TVScript), "Update")]
		[HarmonyPrefix]
		public static bool Update()
		{
			return false;
		}

		[HarmonyPatch(typeof(TVScript), "TurnTVOnOff")]
		[HarmonyPrefix]
		public static bool TurnTVOnOff(bool on, TVScript __instance)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			__instance.tvOn = on;
			if ((int)__instance.video.source != 1 || __instance.video.url == "")
			{
				__instance.video.clip = null;
				__instance.tvSFX.clip = null;
				__instance.video.url = $"file://{Plugin.filePath}";
				__instance.video.source = (VideoSource)1;
				__instance.video.controlledAudioTrackCount = 1;
				__instance.video.audioOutputMode = (VideoAudioOutputMode)1;
				__instance.video.SetTargetAudioSource((ushort)0, __instance.tvSFX);
				__instance.video.Prepare();
				__instance.video.Stop();
				__instance.tvSFX.Stop();
			}
			if (on)
			{
				Plugin.Log("Turning on TV");
				SetTVScreenMaterial(__instance, b: true);
				__instance.video.Play();
				__instance.tvSFX.Play();
				__instance.tvSFX.PlayOneShot(__instance.switchTVOn);
				WalkieTalkie.TransmitOneShotAudio(__instance.tvSFX, __instance.switchTVOn, 1f);
			}
			else
			{
				Plugin.Log("Turning off TV");
				SetTVScreenMaterial(__instance, b: false);
				__instance.tvSFX.Stop();
				__instance.tvSFX.PlayOneShot(__instance.switchTVOff);
				__instance.video.Stop();
				WalkieTalkie.TransmitOneShotAudio(__instance.tvSFX, __instance.switchTVOff, 1f);
			}
			return false;
		}

		public static void SetTVScreenMaterial(TVScript instance, bool b)
		{
			MethodInfo method = ((object)instance).GetType().GetMethod("SetTVScreenMaterial", BindingFlags.Instance | BindingFlags.NonPublic);
			method.Invoke(instance, new object[1] { b });
		}
	}
}

plugins/FlipMods-HotbarPlus/HotbarPlus.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using HotbarPlus.Config;
using HotbarPlus.Patches;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HotbarPlus")]
[assembly: AssemblyDescription("Mod made by flipf17.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HotbarPlus")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fab060f0-b006-42ea-ba6f-473f4850c587")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HotbarPlus
{
	[HarmonyPatch]
	internal class Keybinds
	{
		private static InputAction[] quickItemShortcutActions;

		private static PlayerControllerB localPlayerController;

		private static bool setHotbarSize;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			localPlayerController = __instance;
			setHotbarSize = false;
			InputActionAsset actions = IngamePlayerSettings.Instance.playerInput.actions;
			InputAction val = actions.FindAction("Emote1", false);
			InputAction val2 = actions.FindAction("Emote2", false);
			InputActionRebindingExtensions.ApplyBindingOverride(val, "<Keyboard>/f1", (string)null, (string)null);
			InputActionRebindingExtensions.ApplyBindingOverride(val2, "<Keyboard>/f2", (string)null, (string)null);
		}

		public static void OnSetHotbarSize()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			setHotbarSize = true;
			if (ConfigSettings.useHotbarNumberHotkeysConfig.Value)
			{
				quickItemShortcutActions = (InputAction[])(object)new InputAction[PlayerPatcher.newHotbarSize];
				for (int i = 0; i < quickItemShortcutActions.Length; i++)
				{
					quickItemShortcutActions[i] = new InputAction((string)null, (InputActionType)0, $"<Keyboard>/{i + 1}", "Press", (string)null, (string)null);
				}
			}
			if (((Component)localPlayerController).gameObject.activeSelf)
			{
				SubscribeToEvents();
			}
		}

		private static void SubscribeToEvents()
		{
			if (quickItemShortcutActions != null && ConfigSettings.useHotbarNumberHotkeysConfig.Value)
			{
				for (int i = 0; i < quickItemShortcutActions.Length; i++)
				{
					quickItemShortcutActions[i].Enable();
					quickItemShortcutActions[i].performed += OnPressItemSlotHotkeyAction;
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable(PlayerControllerB __instance)
		{
			if ((Object)(object)__instance == (Object)(object)localPlayerController && setHotbarSize)
			{
				SubscribeToEvents();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable(PlayerControllerB __instance)
		{
			if (quickItemShortcutActions != null && setHotbarSize && (!((Object)(object)localPlayerController != (Object)null) || !((Object)(object)__instance != (Object)(object)localPlayerController)))
			{
				for (int i = 0; i < quickItemShortcutActions.Length; i++)
				{
					quickItemShortcutActions[i].performed -= OnPressItemSlotHotkeyAction;
					quickItemShortcutActions[i].Disable();
				}
			}
		}

		private static void OnPressItemSlotHotkeyAction(CallbackContext context)
		{
			if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && localPlayerController.isPlayerControlled && !localPlayerController.inTerminalMenu && !localPlayerController.twoHanded && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject) && ((CallbackContext)(ref context)).performed)
			{
				string name = ((CallbackContext)(ref context)).control.name;
				if (int.TryParse(name, out var result))
				{
					result--;
					HotbarSlotSync.SwapHotbarSlot(result);
				}
			}
		}
	}
	[HarmonyPatch]
	internal static class HotbarSlotSync
	{
		private static PlayerControllerB localPlayerController;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void Init(PlayerControllerB __instance)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance)
			{
				localPlayerController = __instance;
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnHotbarSlotChangeClientRpc", new HandleNamedMessageDelegate(OnHotbarSlotChangeClientRpc));
				if (NetworkManager.Singleton.IsServer)
				{
					NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnHotbarSlotChangeServerRpc", new HandleNamedMessageDelegate(OnHotbarSlotChangeServerRpc));
				}
			}
		}

		private static void SendHotbarSlotChange(int hotbarSlot)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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)
			if (NetworkManager.Singleton.IsClient)
			{
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1);
				try
				{
					Plugin.Log("Sending hotbar swap slot: " + hotbarSlot);
					((FastBufferWriter)(ref val)).WriteValue<int>(ref hotbarSlot, default(ForPrimitives));
					NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("OnHotbarSlotChangeServerRpc", 0uL, val, (NetworkDelivery)3);
					return;
				}
				finally
				{
					((IDisposable)(FastBufferWriter)(ref val)).Dispose();
				}
			}
			Plugin.Log("Failed to send hotbar swap index.");
		}

		private static void OnHotbarSlotChangeServerRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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)
			if (!NetworkManager.Singleton.IsServer)
			{
				return;
			}
			if (((FastBufferReader)(ref reader)).TryBeginRead(4))
			{
				int num = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving request for hotbar swap. Slot: " + num + " ClientId: " + clientId);
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(12, (Allocator)2, -1);
				try
				{
					((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives));
					((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(ref clientId, default(ForPrimitives));
					NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("OnHotbarSlotChangeClientRpc", val, (NetworkDelivery)3);
					return;
				}
				finally
				{
					((IDisposable)(FastBufferWriter)(ref val)).Dispose();
				}
			}
			Plugin.Log("Failed to receive hotbar swap index from Client: " + clientId);
		}

		private static void OnHotbarSlotChangeClientRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkManager.Singleton.IsClient)
			{
				return;
			}
			if (((FastBufferReader)(ref reader)).TryBeginRead(12))
			{
				int hotbarSlot = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref hotbarSlot, default(ForPrimitives));
				ulong num = default(ulong);
				((FastBufferReader)(ref reader)).ReadValue<ulong>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving update for hotbar swap. Slot: " + hotbarSlot + " ClientId: " + num);
				if (num == localPlayerController.actualClientId || UpdateClientHotbarSlot(num, hotbarSlot))
				{
					return;
				}
				Plugin.Log("Failed to receive hotbar swap index from Client: " + num);
			}
			Plugin.Log("Failed to receive hotbar swap index from Client");
		}

		private static bool UpdateClientHotbarSlot(ulong clientId, int hotbarSlot)
		{
			Plugin.Log("Updating hotbar slot: " + hotbarSlot + " ClientId: " + clientId);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (StartOfRound.Instance.allPlayerScripts[i].actualClientId == clientId)
				{
					CallSwitchToItemSlotMethod(StartOfRound.Instance.allPlayerScripts[i], hotbarSlot);
					return true;
				}
			}
			return false;
		}

		public static void SwapHotbarSlot(int hotbarIndex)
		{
			if (hotbarIndex < PlayerPatcher.targetHotbarSize)
			{
				SendHotbarSlotChange(hotbarIndex);
				CallSwitchToItemSlotMethod(localPlayerController, hotbarIndex);
			}
		}

		private static void CallSwitchToItemSlotMethod(PlayerControllerB playerController, int hotbarIndex)
		{
			if (hotbarIndex < PlayerPatcher.targetHotbarSize && playerController.currentItemSlot != hotbarIndex)
			{
				ShipBuildModeManager.Instance.CancelBuildMode(true);
				MethodInfo method = ((object)playerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
				method.Invoke(playerController, new object[2] { hotbarIndex, null });
				if ((Object)(object)playerController.currentlyHeldObjectServer != (Object)null)
				{
					((Component)playerController.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(playerController.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f);
				}
			}
		}
	}
	[BepInPlugin("FlipMods.HotbarPlus", "HotbarPlus", "1.3.2")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		private Harmony _harmony;

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			instance = this;
			_harmony = new Harmony("HotbarPlus");
			ConfigSettings.BindConfigSettings();
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"HotbarPlus loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}

		public static void LogError(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogError((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.HotbarPlus";

		public const string PLUGIN_NAME = "HotbarPlus";

		public const string PLUGIN_VERSION = "1.3.2";
	}
}
namespace HotbarPlus.Patches
{
	[HarmonyPatch]
	internal class HUDPatcher
	{
		public static void ResizeHotbarSlotsHUD()
		{
			//IL_002d: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			List<Image> list = new List<Image>(HUDManager.Instance.itemSlotIconFrames);
			List<Image> list2 = new List<Image>(HUDManager.Instance.itemSlotIcons);
			float num = Mathf.Abs(((Graphic)list[1]).rectTransform.anchoredPosition.x - ((Graphic)list[0]).rectTransform.anchoredPosition.x);
			float y = ((Component)list[0]).GetComponent<RectTransform>().anchoredPosition.y;
			Vector3 eulerAngles = ((Transform)((Graphic)list[0]).rectTransform).eulerAngles;
			Vector3 eulerAngles2 = ((Transform)((Graphic)list2[0]).rectTransform).eulerAngles;
			for (int i = 0; i < Mathf.Max(PlayerPatcher.targetHotbarSize, PlayerPatcher.initialHotbarSize); i++)
			{
				if (i >= PlayerPatcher.targetHotbarSize)
				{
					Object.Destroy((Object)(object)list[PlayerPatcher.targetHotbarSize]);
					Object.Destroy((Object)(object)list2[PlayerPatcher.targetHotbarSize]);
					list.RemoveAt(PlayerPatcher.targetHotbarSize);
					list2.RemoveAt(PlayerPatcher.targetHotbarSize);
					continue;
				}
				if (i >= PlayerPatcher.initialHotbarSize)
				{
					list.Insert(i, Object.Instantiate<Image>(list[i - 1], ((Component)list[0]).transform.parent));
					((Component)list[i]).transform.SetSiblingIndex(((Component)list[i - 1]).transform.GetSiblingIndex() + 1);
					list2.Insert(i, ((Component)((Component)list[i]).transform.GetChild(0)).GetComponent<Image>());
				}
				((Object)list[i]).name = $"Slot{i}";
				((Graphic)list[i]).rectTransform.anchoredPosition = Vector2.up * y;
				((Transform)((Graphic)list[i]).rectTransform).eulerAngles = eulerAngles;
				((Object)list2[i]).name = "Icon";
				((Transform)((Graphic)list2[i]).rectTransform).eulerAngles = eulerAngles2;
			}
			float num2 = num * (float)(PlayerPatcher.targetHotbarSize - 1);
			float num3 = num2 / 2f;
			for (int j = 0; j < PlayerPatcher.targetHotbarSize; j++)
			{
				float num4 = (float)j * num - num3;
				((Graphic)list[j]).rectTransform.anchoredPosition = new Vector2(num4, ((Graphic)list[j]).rectTransform.anchoredPosition.y);
			}
			HUDManager.Instance.itemSlotIconFrames = list.ToArray();
			HUDManager.Instance.itemSlotIcons = list2.ToArray();
		}
	}
	[HarmonyPatch]
	internal class PlayerPatcher
	{
		public static PlayerControllerB localPlayerController;

		public static int initialHotbarSize = -1;

		public static int postInitialHotbarSize = -1;

		public static int targetHotbarSize = -1;

		public static int newHotbarSize = -1;

		private static bool droppingItem = false;

		[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
		[HarmonyPostfix]
		public static void GetInitialHotbarSize(PlayerControllerB __instance)
		{
			if (initialHotbarSize == -1)
			{
				initialHotbarSize = __instance.ItemSlots.Length;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void InitializeLocalPlayer(PlayerControllerB __instance)
		{
			localPlayerController = __instance;
		}

		public static void ResizeInventory()
		{
			postInitialHotbarSize = localPlayerController.ItemSlots.Length;
			targetHotbarSize = Mathf.Clamp(ConfigSync.instance.hotbarSize, 0, 10);
			newHotbarSize = Mathf.Clamp(ConfigSync.instance.hotbarSize + (postInitialHotbarSize - initialHotbarSize), 0, 10);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i];
				val.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[newHotbarSize];
			}
		}

		private static int GetNextItemSlot(PlayerControllerB __instance, bool forward, int index)
		{
			int currentItemSlot = __instance.currentItemSlot;
			__instance.currentItemSlot = index;
			MethodInfo method = ((object)__instance).GetType().GetMethod("NextItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
			index = (int)method.Invoke(__instance, new object[1] { forward });
			__instance.currentItemSlot = currentItemSlot;
			return index;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchSwitchItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.3f)
				{
					list[i].operand = ConfigSettings.minSwapItemInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchActivateItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.075f)
				{
					list[i].operand = ConfigSettings.minActivateItemInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Discard_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchDiscardItemInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.2f)
				{
					list[i].operand = ConfigSettings.minDiscardItemInterval;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Interact_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchInteractInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.2f)
				{
					list[i].operand = ConfigSettings.minInteractInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "PerformEmote")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> PatchPerformEmoteInterval(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldc_R4 && (float)list[i].operand == 0.5f)
				{
					list[i].operand = ConfigSettings.minUseEmoteInterval;
					break;
				}
			}
			return list.AsEnumerable();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> InvertHotbarScrollDirection(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = new List<CodeInstruction>(instructions);
			if (ConfigSettings.invertHotbarScrollDirectionConfig.Value)
			{
				for (int i = 1; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ble_Un && list[i - 1].opcode == OpCodes.Ldc_R4 && (float)list[i - 1].operand == 0f)
					{
						list[i].opcode = OpCodes.Bge_Un;
						break;
					}
				}
			}
			return list.AsEnumerable();
		}
	}
}
namespace HotbarPlus.Config
{
	public static class ConfigSettings
	{
		public static ConfigEntry<int> hotbarSizeConfig;

		public static ConfigEntry<bool> useHotbarNumberHotkeysConfig;

		public static ConfigEntry<bool> invertHotbarScrollDirectionConfig;

		public static ConfigEntry<bool> useItemQuickDropConfig;

		public static ConfigEntry<string> rebindEmote1Config;

		public static ConfigEntry<string> rebindEmote2Config;

		public static string[] currentEntryHeaders = new string[2] { "HotbarPlus - Server", "HotbarPlus - Client" };

		public static string[] currentEntryNames = new string[6] { "HotbarSize", "UseHotbarNumberHotkeys", "InvertHotbarScrollDirection", "UseItemQuickDropConfig", "RebindEmote1", "RebindEmote2" };

		public static float minSwapItemInterval = 0.05f;

		public static float minActivateItemInterval = 0.05f;

		public static float minDiscardItemInterval = 0.05f;

		public static float minInteractInterval = 0.05f;

		public static float minUseEmoteInterval = 0.25f;

		public static List<ConfigEntryBase> configEntries = new List<ConfigEntryBase>();

		public static void RemoveOldConfigs()
		{
			try
			{
				ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config;
				string configFilePath = config.ConfigFilePath;
				if (!File.Exists(configFilePath))
				{
					return;
				}
				List<string> list = File.ReadAllLines(configFilePath).ToList();
				List<string> list2 = new List<string>();
				bool flag = false;
				bool flag2 = false;
				foreach (string item in list)
				{
					if (item.Length <= 0)
					{
						if (list2[list2.Count - 1].Length > 0)
						{
							list2.Add(item);
						}
						flag2 = true;
						continue;
					}
					if (item.StartsWith("["))
					{
						string value = item.Trim(new char[1] { '[' }).Trim(new char[1] { ']' });
						if (currentEntryHeaders.Contains(value))
						{
							list2.Add(item);
						}
					}
					else if (!flag2 || item.StartsWith("#"))
					{
						list2.Add(item);
					}
					flag2 = false;
				}
				File.WriteAllLines(configFilePath, list2);
				config.Reload();
			}
			catch
			{
			}
		}

		public static void BindConfigSettings()
		{
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			Plugin.Log("BindingConfigs");
			hotbarSizeConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("HotbarPlus - Server", "HotbarSize", 4, "The amount of hotbar slots player will have.");
			useHotbarNumberHotkeysConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("HotbarPlus - Client", "UseHotbarNumberHotkeys", true, "Use the quick item selection numerical hotkeys.");
			invertHotbarScrollDirectionConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("HotbarPlus - Client", "InvertHotbarScrollDirection", true, "Inverts the hotbar scroll direction.");
			useItemQuickDropConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("HotbarPlus - Client", "UseItemQuickDropConfig", true, "If enabled, dropping an item will automatically swap to the next item for easier chain dropping.");
			ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config;
			Key val = (Key)94;
			rebindEmote1Config = config.Bind<string>("HotbarPlus - Client", "RebindEmote1", ((object)(Key)(ref val)).ToString(), "Emote 1 hotkey.");
			ConfigFile config2 = ((BaseUnityPlugin)Plugin.instance).Config;
			val = (Key)95;
			rebindEmote2Config = config2.Bind<string>("HotbarPlus - Client", "RebindEmote2", ((object)(Key)(ref val)).ToString(), "Emote 2 hotkey.");
			configEntries.Add((ConfigEntryBase)(object)hotbarSizeConfig);
			configEntries.Add((ConfigEntryBase)(object)useHotbarNumberHotkeysConfig);
			configEntries.Add((ConfigEntryBase)(object)invertHotbarScrollDirectionConfig);
			configEntries.Add((ConfigEntryBase)(object)useItemQuickDropConfig);
			configEntries.Add((ConfigEntryBase)(object)rebindEmote1Config);
			configEntries.Add((ConfigEntryBase)(object)rebindEmote2Config);
			((BaseUnityPlugin)Plugin.instance).Config.Reload();
			RemoveOldConfigs();
			ConfigSync.BuildDefaultConfig();
		}
	}
	[HarmonyPatch]
	public class ConfigSync
	{
		public static ConfigSync defaultConfig;

		public static ConfigSync instance;

		public static PlayerControllerB localPlayerController;

		public static bool isSynced;

		public int hotbarSize = 1;

		public ConfigSync()
		{
			hotbarSize = ConfigSettings.hotbarSizeConfig.Value;
		}

		public static void BuildDefaultConfig()
		{
			defaultConfig = new ConfigSync();
			instance = new ConfigSync();
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void InitializeLocalPlayer(PlayerControllerB __instance)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: 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
			localPlayerController = __instance;
			if (NetworkManager.Singleton.IsServer)
			{
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlusOnRequestConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSyncRequest));
				OnLocalClientConfigSync();
			}
			else
			{
				isSynced = false;
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("HotbarPlusOnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSync));
				RequestConfigSync();
			}
		}

		public static void RequestConfigSync()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsClient)
			{
				Plugin.Log("Sending config sync request to server.");
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(16, (Allocator)2, -1);
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("HotbarPlusOnRequestConfigSync", 0uL, val, (NetworkDelivery)3);
			}
			else
			{
				Plugin.LogError("Failed to send config sync request.");
			}
		}

		public static void OnReceiveConfigSyncRequest(ulong clientId, FastBufferReader reader)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkManager.Singleton.IsServer)
			{
				Plugin.Log("Receiving extra hotbar slots sync request from client with id: " + clientId + ". Sending config sync to client.");
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1);
				((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref instance.hotbarSize, default(ForPrimitives));
				NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("HotbarPlusOnReceiveConfigSync", clientId, val, (NetworkDelivery)3);
			}
		}

		public static void OnReceiveConfigSync(ulong clientId, FastBufferReader reader)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			if (((FastBufferReader)(ref reader)).TryBeginRead(4))
			{
				Plugin.Log("Receiving extra hotbar slots sync from server.");
				int num = default(int);
				((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives));
				instance.hotbarSize = num;
				OnLocalClientConfigSync();
			}
			else
			{
				Plugin.LogError("Error receiving config sync from server.");
			}
		}

		public static void OnLocalClientConfigSync()
		{
			isSynced = true;
			PlayerPatcher.ResizeInventory();
			HUDPatcher.ResizeHotbarSlotsHUD();
			Keybinds.OnSetHotbarSize();
		}
	}
}

plugins/FlipMods-ReservedFlashlightSlot/ReservedFlashlightSlot.dll

Decompiled 10 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using ReservedFlashlightSlot.Patches;
using ReservedItemSlotCore;
using ReservedItemSlotCore.Networking;
using ReservedItemSlotCore.Patches;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ReservedFlashlightSlot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReservedFlashlightSlot")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5b7d6563-4e51-4a69-bcf9-fa1dea6eff75")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ReservedFlashlightSlot
{
	public static class ConfigSettings
	{
		public static ConfigEntry<string> activateFlashlightKey;

		public static ConfigEntry<bool> hideFlashlightMeshShoulder;

		public static string activateFlashlightDisplayName;

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			activateFlashlightKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "ActivateFlashlightKey", "<Keyboard>/f", "Activate flashlight keybind.");
			hideFlashlightMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "HideFlashlightOnShoulder", false, "Hides the flashlight mesh while on your shoulder.");
			activateFlashlightDisplayName = GetDisplayName(activateFlashlightKey.Value);
		}

		public static string GetDisplayName(string key)
		{
			key = key.Replace("<Keyboard>/", "");
			key = key.Replace("<Mouse>/", "");
			string text = key;
			text = text.Replace("leftAlt", "Alt");
			text = text.Replace("rightAlt", "Alt");
			text = text.Replace("leftCtrl", "Ctrl");
			text = text.Replace("rightCtrl", "Ctrl");
			text = text.Replace("leftShift", "Shift");
			text = text.Replace("rightShift", "Shift");
			text = text.Replace("leftButton", "LMB");
			text = text.Replace("rightButton", "RMB");
			return text.Replace("middleButton", "MMB");
		}
	}
	[HarmonyPatch]
	internal static class Keybinds
	{
		public static PlayerControllerB localPlayerController;

		private static InputAction activateFlashlightAction;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			localPlayerController = __instance;
			activateFlashlightAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.activateFlashlightKey.Value, "Press", (string)null, (string)null);
			if (((Component)localPlayerController).gameObject.activeSelf)
			{
				SubscribeToEvents();
			}
		}

		private static void SubscribeToEvents()
		{
			if (activateFlashlightAction != null)
			{
				activateFlashlightAction.Enable();
				activateFlashlightAction.performed += OnActivateFlashlightPerformed;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable(PlayerControllerB __instance)
		{
			if ((Object)(object)__instance == (Object)(object)localPlayerController)
			{
				SubscribeToEvents();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable(PlayerControllerB __instance)
		{
			if (activateFlashlightAction != null && !((Object)(object)__instance != (Object)(object)localPlayerController))
			{
				activateFlashlightAction.performed -= OnActivateFlashlightPerformed;
				activateFlashlightAction.Disable();
			}
		}

		private static void OnActivateFlashlightPerformed(CallbackContext context)
		{
			if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || localPlayerController.inTerminalMenu || (((NetworkBehaviour)localPlayerController).IsServer && !localPlayerController.isHostPlayerObject))
			{
				return;
			}
			FlashlightItem mainFlashlight = ReservedFlashlightSlotPatcher.GetMainFlashlight(localPlayerController);
			if (((CallbackContext)(ref context)).performed && !((Object)(object)mainFlashlight == (Object)null))
			{
				float num = (float)Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").GetValue();
				if (!(num < 0.075f))
				{
					((GrabbableObject)mainFlashlight).UseItemOnClient(!((GrabbableObject)mainFlashlight).isBeingUsed);
					Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0);
				}
			}
		}
	}
	[BepInPlugin("FlipMods.ReservedFlashlightSlot", "ReservedFlashlightSlot", "1.4.5")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		private Harmony _harmony;

		public static ReservedItemInfo proFlashlightInfo = new ReservedItemInfo("Pro-flashlight", 120, true, true, true, true);

		public static ReservedItemInfo flashlightInfo = new ReservedItemInfo("Flashlight", 120, true, true, true, true);

		private void Awake()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			instance = this;
			ConfigSettings.BindConfigSettings();
			_harmony = new Harmony("ReservedFlashlightSlot");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedFlashlightSlot loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.ReservedFlashlightSlot";

		public const string PLUGIN_NAME = "ReservedFlashlightSlot";

		public const string PLUGIN_VERSION = "1.4.5";
	}
}
namespace ReservedFlashlightSlot.Patches
{
	[HarmonyPatch]
	internal static class ReservedFlashlightSlotPatcher
	{
		private static Vector3 playerShoulderPositionOffset = new Vector3(0.2f, 0f, 0f);

		private static Vector3 playerShoulderRotationOffset = new Vector3(90f, 0f, 0f);

		private static string originalControlTooltip = "";

		public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController;

		public static PlayerControllerB GetPreviousPlayerHeldBy(FlashlightItem flashlightItem)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			return (PlayerControllerB)Traverse.Create((object)flashlightItem).Field("previousPlayerHeldBy").GetValue();
		}

		public static FlashlightItem GetMainFlashlight(PlayerControllerB playerController)
		{
			return GetCurrentlySelectedFlashlight(playerController) ?? GetReservedFlashlight(playerController);
		}

		public static FlashlightItem GetReservedFlashlight(PlayerControllerB playerController)
		{
			GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[Plugin.flashlightInfo.indexInInventory] : null);
			return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null);
		}

		public static FlashlightItem GetCurrentlySelectedFlashlight(PlayerControllerB playerController)
		{
			GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[playerController.currentItemSlot] : null);
			return (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null);
		}

		public static bool IsFlashlightOn(PlayerControllerB playerController)
		{
			return ((GrabbableObject)(GetMainFlashlight(playerController)?)).isBeingUsed ?? false;
		}

		[HarmonyPatch(typeof(FlashlightItem), "__initializeVariables")]
		[HarmonyPostfix]
		public static void EditTooltips(FlashlightItem __instance)
		{
			if (originalControlTooltip == "")
			{
				originalControlTooltip = ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1];
			}
			((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1] = $"{originalControlTooltip}[{ConfigSettings.activateFlashlightDisplayName.ToUpper()}]";
		}

		[HarmonyPatch(typeof(MenuManager), "OnEnable")]
		[HarmonyPostfix]
		public static void ResetVariables()
		{
			Keybinds.localPlayerController = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")]
		[HarmonyPrefix]
		public static bool PreventActivatingDuplicateItem(CallbackContext context, PlayerControllerB __instance)
		{
			FlashlightItem currentlySelectedFlashlight = GetCurrentlySelectedFlashlight(__instance);
			if ((Object)(object)__instance != (Object)(object)localPlayerController || (Object)(object)currentlySelectedFlashlight == (Object)null)
			{
				return true;
			}
			if (!((CallbackContext)(ref context)).performed)
			{
				return false;
			}
			FlashlightItem reservedFlashlight = GetReservedFlashlight(__instance);
			if ((Object)(object)currentlySelectedFlashlight != (Object)(object)reservedFlashlight && (!((GrabbableObject)reservedFlashlight).itemProperties.requiresBattery || !((GrabbableObject)reservedFlashlight).insertedBattery.empty))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(FlashlightItem), "SwitchFlashlight")]
		[HarmonyPostfix]
		public static void OnSwitchOnOffFlashlight(bool on, FlashlightItem __instance)
		{
			if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null))
			{
				UpdateAllFlashlightStates(((GrabbableObject)__instance).playerHeldBy, on);
			}
		}

		[HarmonyPatch(typeof(FlashlightItem), "PocketItem")]
		[HarmonyPostfix]
		public static void OnPocketFlashlightLocal(FlashlightItem __instance)
		{
			OnPocketFlashlight(__instance, ((GrabbableObject)__instance).isBeingUsed);
		}

		[HarmonyPatch(typeof(FlashlightItem), "PocketFlashlightClientRpc")]
		[HarmonyPrefix]
		public static bool OnPocketFlashlightClientRpc(bool stillUsingFlashlight, FlashlightItem __instance)
		{
			if (!NetworkHelper.IsValidClientRpcExecStage((NetworkBehaviour)(object)__instance) || ((NetworkBehaviour)__instance).IsOwner || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null || (Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController || !NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance))
			{
				return false;
			}
			((MonoBehaviour)__instance).StartCoroutine(OnPocketFlashlightEndOfFrame(__instance, stillUsingFlashlight));
			return true;
		}

		private static IEnumerator OnPocketFlashlightEndOfFrame(FlashlightItem flashlightItem, bool stillUsingFlashlight)
		{
			yield return (object)new WaitForEndOfFrame();
			OnPocketFlashlight(flashlightItem, stillUsingFlashlight);
		}

		private static void OnPocketFlashlight(FlashlightItem flashlightItem, bool stillUsingFlashlight = false)
		{
			if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null))
			{
				((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)flashlightItem;
				((GrabbableObject)flashlightItem).parentObject = ((GrabbableObject)flashlightItem).playerHeldBy.playerGlobalHead;
				bool flag = (Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)(object)localPlayerController;
			}
		}

		[HarmonyPatch(typeof(FlashlightItem), "EquipItem")]
		[HarmonyPostfix]
		public static void OnEquipFlashlight(FlashlightItem __instance)
		{
			if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null))
			{
				if ((Object)(object)__instance == (Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight)
				{
					((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = null;
				}
				((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder);
			}
		}

		[HarmonyPatch(typeof(GrabbableObject), "LateUpdate")]
		[HarmonyPostfix]
		public static void SetPositionOffset(GrabbableObject __instance)
		{
			//IL_006c: 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_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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && __instance.isPocketed && (Object)(object)__instance.parentObject != (Object)null && (Object)(object)__instance != (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy))
			{
				Transform transform = ((Component)__instance.parentObject).transform;
				((Component)__instance).transform.rotation = ((Component)__instance.parentObject).transform.rotation * Quaternion.Euler(playerShoulderRotationOffset);
				((Component)__instance).transform.position = transform.position + transform.rotation * playerShoulderPositionOffset;
			}
		}

		[HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")]
		[HarmonyPrefix]
		public static void OnEnableItemMeshes(ref bool enable, GrabbableObject __instance)
		{
			if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && ((Object)(object)__instance == (Object)(object)GetCurrentlySelectedFlashlight(__instance.playerHeldBy) || ((Object)(object)__instance == (Object)(object)GetReservedFlashlight(__instance.playerHeldBy) && (Object)(object)__instance.playerHeldBy != (Object)(object)localPlayerController)))
			{
				enable = true;
			}
		}

		private static void UpdateAllFlashlightStates(PlayerControllerB playerController, bool mainFlashlightActive = true)
		{
			FlashlightItem mainFlashlight = GetMainFlashlight(playerController);
			if ((Object)(object)mainFlashlight == (Object)null)
			{
				((Behaviour)playerController.helmetLight).enabled = false;
				mainFlashlightActive = false;
			}
			else
			{
				playerController.ChangeHelmetLight(mainFlashlight.flashlightTypeID, mainFlashlightActive && (Object)(object)playerController == (Object)(object)localPlayerController && (Object)(object)playerController.ItemSlots[playerController.currentItemSlot] != (Object)(object)mainFlashlight);
			}
			for (int i = 0; i < PlayerPatcher.combinedHotbarSize; i++)
			{
				GrabbableObject obj = playerController.ItemSlots[i];
				FlashlightItem val = (FlashlightItem)(object)((obj is FlashlightItem) ? obj : null);
				if ((Object)(object)val != (Object)null)
				{
					UpdateFlashlightState(val, (Object)(object)val == (Object)(object)mainFlashlight && mainFlashlightActive);
				}
			}
		}

		private static void UpdateFlashlightState(FlashlightItem flashlightItem, bool active)
		{
			if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null))
			{
				PlayerControllerB playerHeldBy = ((GrabbableObject)flashlightItem).playerHeldBy;
				((GrabbableObject)flashlightItem).isBeingUsed = active;
				bool flag = (Object)(object)playerHeldBy != (Object)(object)localPlayerController || (Object)(object)playerHeldBy.ItemSlots[playerHeldBy.currentItemSlot] == (Object)(object)flashlightItem;
				((Behaviour)flashlightItem.flashlightBulb).enabled = active && flag;
				((Behaviour)flashlightItem.flashlightBulbGlow).enabled = active && flag;
				flashlightItem.usingPlayerHelmetLight = active && !flag;
			}
		}
	}
}

plugins/FlipMods-ReservedItemSlotCore/ReservedItemSlotCore.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using ReservedItemSlotCore.Networking;
using ReservedItemSlotCore.Patches;
using TMPro;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ReservedItemSlotCore")]
[assembly: AssemblyDescription("Mod made by flipf17")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReservedItemSlotCore")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("238ce080-e339-46b6-9b08-992a950453a1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ReservedItemSlotCore
{
	public static class ConfigSettings
	{
		public static ConfigEntry<string> focusReservedHotbarHotkey;

		public static ConfigEntry<string> specialReservedItemUseHotkey;

		public static string focusReservedHotbarHotkeyDisplayName;

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			focusReservedHotbarHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "FocusReservedItemSlotsHotkey", "<Keyboard>/leftAlt", "Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc.");
			specialReservedItemUseHotkey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "SpecialReservedItemUseHotkey", "<Mouse>/middleButton", "[REMOVED] Which key will focus your reserved item slots hotbar to allow selcting, dropping, charging, etc.");
			focusReservedHotbarHotkeyDisplayName = GetDisplayName(focusReservedHotbarHotkey.Value);
		}

		public static string GetDisplayName(string key)
		{
			key = key.Replace("<Keyboard>/", "");
			key = key.Replace("<Mouse>/", "");
			string text = key;
			text = text.Replace("leftAlt", "Alt");
			text = text.Replace("rightAlt", "Alt");
			text = text.Replace("leftCtrl", "Ctrl");
			text = text.Replace("rightCtrl", "Ctrl");
			text = text.Replace("leftShift", "Shift");
			text = text.Replace("rightShift", "Shift");
			text = text.Replace("leftButton", "LMB");
			text = text.Replace("rightButton", "RMB");
			return text.Replace("middleButton", "MMB");
		}
	}
	[HarmonyPatch]
	internal static class HotbarSlotSync
	{
		public static PlayerControllerB localPlayerController;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void Init(PlayerControllerB __instance)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			localPlayerController = __instance;
			NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarClientRpc", new HandleNamedMessageDelegate(OnSwapHotbarClientRpc));
			if (NetworkManager.Singleton.IsServer)
			{
				NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("OnSwapHotbarServerRpc", new HandleNamedMessageDelegate(OnSwapHotbarServerRpc));
			}
		}

		private static void SendSwapHotbarUpdate(int hotbarSlot)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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)
			if (NetworkManager.Singleton.IsClient)
			{
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(4, (Allocator)2, -1);
				try
				{
					Plugin.Log("Sending hotbar swap slot: " + hotbarSlot);
					((FastBufferWriter)(ref val)).WriteValue<int>(ref hotbarSlot, default(ForPrimitives));
					NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("OnSwapHotbarServerRpc", 0uL, val, (NetworkDelivery)3);
					return;
				}
				finally
				{
					((IDisposable)(FastBufferWriter)(ref val)).Dispose();
				}
			}
			Plugin.Log("Failed to send hotbar swap index.");
		}

		private static void OnSwapHotbarServerRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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)
			if (!NetworkManager.Singleton.IsServer)
			{
				return;
			}
			if (((FastBufferReader)(ref reader)).TryBeginRead(4))
			{
				int num = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving request for hotbar swap. Slot: " + num + " ClientId: " + clientId);
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(12, (Allocator)2, -1);
				try
				{
					((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives));
					((FastBufferWriter)(ref val)).WriteValueSafe<ulong>(ref clientId, default(ForPrimitives));
					NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("OnSwapHotbarClientRpc", val, (NetworkDelivery)3);
					return;
				}
				finally
				{
					((IDisposable)(FastBufferWriter)(ref val)).Dispose();
				}
			}
			Plugin.Log("Failed to receive hotbar swap index from Client: " + clientId);
		}

		private static void OnSwapHotbarClientRpc(ulong clientId, FastBufferReader reader)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkManager.Singleton.IsClient)
			{
				return;
			}
			if (((FastBufferReader)(ref reader)).TryBeginRead(12))
			{
				int hotbarSlot = default(int);
				((FastBufferReader)(ref reader)).ReadValue<int>(ref hotbarSlot, default(ForPrimitives));
				ulong num = default(ulong);
				((FastBufferReader)(ref reader)).ReadValue<ulong>(ref num, default(ForPrimitives));
				Plugin.Log("Receiving update for hotbar swap. Slot: " + hotbarSlot + " ClientId: " + num);
				if (num == localPlayerController.actualClientId || UpdateClientHotbarSlot(num, hotbarSlot))
				{
					return;
				}
				Plugin.Log("Failed to receive hotbar swap index from Client: " + num);
			}
			Plugin.Log("Failed to receive hotbar swap index from Client");
		}

		private static bool UpdateClientHotbarSlot(ulong clientId, int hotbarSlot)
		{
			Plugin.Log("Updating hotbar slot: " + hotbarSlot + " ClientId: " + clientId);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (StartOfRound.Instance.allPlayerScripts[i].actualClientId == clientId)
				{
					CallSwitchToItemSlotMethod(StartOfRound.Instance.allPlayerScripts[i], hotbarSlot);
					return true;
				}
			}
			return false;
		}

		public static void SwapHotbarSlot(int hotbarIndex)
		{
			SendSwapHotbarUpdate(hotbarIndex);
			CallSwitchToItemSlotMethod(localPlayerController, hotbarIndex);
			Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0);
		}

		private static void CallSwitchToItemSlotMethod(PlayerControllerB playerController, int hotbarIndex)
		{
			ShipBuildModeManager.Instance.CancelBuildMode(true);
			MethodInfo method = ((object)playerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic);
			method.Invoke(playerController, new object[2] { hotbarIndex, null });
			if ((Object)(object)playerController.currentlyHeldObjectServer != (Object)null)
			{
				((Component)playerController.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(playerController.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f);
			}
		}
	}
	[HarmonyPatch]
	internal static class Keybinds
	{
		public static PlayerControllerB localPlayerController;

		public static InputAction focusReservedHotbarAction;

		public static bool holdingModifierKey;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			localPlayerController = __instance;
			focusReservedHotbarAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.focusReservedHotbarHotkey.Value, (string)null, (string)null, (string)null);
			if (((Component)localPlayerController).gameObject.activeSelf)
			{
				SubscribeToEvents();
			}
		}

		private static void SubscribeToEvents()
		{
			if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0)
			{
				focusReservedHotbarAction.performed += FocusReservedHotbarSlotsAction;
				focusReservedHotbarAction.canceled += UnfocusReservedHotbarSlotsPerformed;
				focusReservedHotbarAction.Enable();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable(PlayerControllerB __instance)
		{
			if ((Object)(object)__instance == (Object)(object)localPlayerController)
			{
				SubscribeToEvents();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable(PlayerControllerB __instance)
		{
			if (focusReservedHotbarAction != null && Plugin.numReservedItemSlots > 0 && !((Object)(object)__instance != (Object)(object)localPlayerController))
			{
				focusReservedHotbarAction.performed -= FocusReservedHotbarSlotsAction;
				focusReservedHotbarAction.canceled -= UnfocusReservedHotbarSlotsPerformed;
				focusReservedHotbarAction.Disable();
			}
		}

		private static void FocusReservedHotbarSlotsAction(CallbackContext context)
		{
			if (!((Object)(object)localPlayerController == (Object)null) && !((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject))
			{
				holdingModifierKey = true;
				bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue();
				if (!(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem && ((CallbackContext)(ref context)).performed)
				{
					ReservedItemPatcher.SetFocusReservedHotbarSlots(active: true);
				}
			}
		}

		private static void UnfocusReservedHotbarSlotsPerformed(CallbackContext context)
		{
			if (!((Object)(object)localPlayerController == (Object)null) && ((NetworkBehaviour)localPlayerController).IsOwner && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject))
			{
				holdingModifierKey = false;
				if (ReservedItemPatcher.CanSwapToReservedHotbarSlot() && ((CallbackContext)(ref context)).canceled)
				{
					ReservedItemPatcher.SetFocusReservedHotbarSlots(active: false);
				}
			}
		}
	}
	[BepInPlugin("FlipMods.ReservedItemSlotCore", "ReservedItemSlotCore", "1.4.4")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		public static Plugin instance;

		public static Dictionary<string, ReservedItemInfo> reservedItemsDict => ReservedItemInfo.reservedItemsDict;

		public static List<ReservedItemInfo> reservedItemsList => ReservedItemInfo.reservedItemsList;

		public static List<ReservedItemInfo> reservedItemSlotReps => ReservedItemInfo.reservedItemSlotReps;

		public static int numReservedItemSlots => ReservedItemInfo.numReservedItemSlots;

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			instance = this;
			_harmony = new Harmony("ReservedItemSlotCore");
			ConfigSettings.BindConfigSettings();
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedItemSlotCore loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}

		public static bool IsReservedItem(string itemName)
		{
			return reservedItemsDict.ContainsKey(itemName);
		}

		public static ReservedItemInfo GetReservedItemInfo(string itemName)
		{
			return IsReservedItem(itemName) ? reservedItemsDict[itemName] : null;
		}

		public static ReservedItemInfo GetReservedItemInfo(GrabbableObject item)
		{
			return ((Object)(object)item != (Object)null) ? GetReservedItemInfo(item.itemProperties.itemName) : null;
		}

		public static int GetReservedItemHotbarIndex(string itemName)
		{
			return IsReservedItem(itemName) ? reservedItemsDict[itemName].indexInInventory : (-1);
		}
	}
	public class ReservedItemInfo
	{
		public static Dictionary<string, ReservedItemInfo> reservedItemsDict = new Dictionary<string, ReservedItemInfo>();

		public static List<ReservedItemInfo> reservedItemsList = new List<ReservedItemInfo>();

		public static List<ReservedItemInfo> reservedItemSlotReps = new List<ReservedItemInfo>();

		public static int defaultHotbarSlotPriority = 10;

		public static int currentUndefinedHotbarSlotPriority = 0;

		public string itemName;

		public int hotbarSlotPriority;

		private int undefinedHotbarSlotPriority = -1;

		public int reservedItemIndex;

		public bool forceUpdateCanBeGrabbedBeforeGameStart = false;

		public bool canBeGrabbedBeforeGameStart = false;

		public bool forceUpdateRequiresBattery = false;

		public bool requiresBattery = false;

		public static int numReservedItemSlots => reservedItemSlotReps.Count;

		public int indexInInventory => ((Object)(object)PlayerPatcher.localPlayerController != (Object)null) ? (PlayerPatcher.localPlayerController.ItemSlots.Length - (numReservedItemSlots - reservedItemIndex)) : (-1);

		public ReservedItemInfo(string itemName, int hotbarSlotPriority = -1, bool forceUpdateCanBeGrabbedBeforeGameStart = false, bool canBeGrabbedBeforeGameStart = false, bool forceUpdateRequiresBattery = false, bool requiresBattery = false)
		{
			this.itemName = itemName;
			this.forceUpdateCanBeGrabbedBeforeGameStart = forceUpdateCanBeGrabbedBeforeGameStart;
			this.canBeGrabbedBeforeGameStart = canBeGrabbedBeforeGameStart;
			this.forceUpdateRequiresBattery = forceUpdateRequiresBattery;
			this.requiresBattery = requiresBattery;
			if (hotbarSlotPriority != -1)
			{
				this.hotbarSlotPriority = hotbarSlotPriority;
			}
			else
			{
				this.hotbarSlotPriority = defaultHotbarSlotPriority;
				undefinedHotbarSlotPriority = ++currentUndefinedHotbarSlotPriority;
			}
			if (!reservedItemsDict.ContainsKey(this.itemName))
			{
				reservedItemsDict.Add(this.itemName, this);
				reservedItemsList.Add(this);
				int i;
				for (i = 0; i < reservedItemSlotReps.Count; i++)
				{
					ReservedItemInfo reservedItemInfo = reservedItemSlotReps[i];
					if (this.hotbarSlotPriority == reservedItemInfo.hotbarSlotPriority)
					{
						if (undefinedHotbarSlotPriority == reservedItemInfo.undefinedHotbarSlotPriority)
						{
							i = -1;
						}
						break;
					}
					if (this.hotbarSlotPriority > reservedItemInfo.hotbarSlotPriority)
					{
						break;
					}
				}
				if (i >= 0)
				{
					reservedItemIndex = i;
					reservedItemSlotReps.Insert(i, this);
					for (int j = i + 1; j < reservedItemSlotReps.Count; j++)
					{
						reservedItemSlotReps[j].reservedItemIndex = j;
					}
				}
			}
			else
			{
				Plugin.Log($"Tried to add duplicate item name to the ReservedItems list: {this.itemName}");
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.ReservedItemSlotCore";

		public const string PLUGIN_NAME = "ReservedItemSlotCore";

		public const string PLUGIN_VERSION = "1.4.4";
	}
}
namespace ReservedItemSlotCore.Networking
{
	public static class NetworkHelper
	{
		private static int NONE_EXEC_STAGE = 0;

		private static int SERVER_EXEC_STAGE = 1;

		private static int CLIENT_EXEC_STAGE = 2;

		public static int GetExecStage(NetworkBehaviour __instance)
		{
			return (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue();
		}

		public static bool IsClientExecStage(NetworkBehaviour __instance)
		{
			return GetExecStage(__instance) == CLIENT_EXEC_STAGE;
		}

		public static bool IsServerExecStage(NetworkBehaviour __instance)
		{
			return GetExecStage(__instance) == SERVER_EXEC_STAGE;
		}

		public static bool IsValidClientRpcExecStage(NetworkBehaviour __instance)
		{
			NetworkManager singleton = NetworkManager.Singleton;
			if ((Object)(object)singleton == (Object)null || !singleton.IsListening)
			{
				return false;
			}
			int num = (int)Traverse.Create((object)__instance).Field("__rpc_exec_stage").GetValue();
			if ((singleton.IsServer || singleton.IsHost) && num != 2)
			{
				return false;
			}
			return true;
		}
	}
}
namespace ReservedItemSlotCore.Patches
{
	[HarmonyPatch]
	public static class HUDPatcher
	{
		private static CanvasScaler canvasScaler;

		private static AspectRatioFitter aspectRatioFitter;

		private static float iconWidth;

		private static float xPos;

		[HarmonyPatch(typeof(HUDManager), "Awake")]
		[HarmonyPrefix]
		public static void Initialize(HUDManager __instance)
		{
			//IL_0032: 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)
			canvasScaler = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<CanvasScaler>();
			aspectRatioFitter = ((Component)__instance.itemSlotIconFrames[0]).GetComponentInParent<AspectRatioFitter>();
			iconWidth = ((Component)__instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.x;
			xPos = canvasScaler.referenceResolution.x / 2f / aspectRatioFitter.aspectRatio - iconWidth / 4f;
		}

		[HarmonyPatch(typeof(HUDManager), "Start")]
		[HarmonyPostfix]
		public static void AddNewHotbarSlotsHud(HUDManager __instance)
		{
			//IL_0040: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: 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_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			if (PlayerPatcher.reservedHotbarSize > 0)
			{
				List<Image> list = new List<Image>(__instance.itemSlotIconFrames);
				List<Image> list2 = new List<Image>(__instance.itemSlotIcons);
				float y = ((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>().sizeDelta.y;
				Vector3 eulerAngles = ((Transform)((Component)HUDManager.Instance.itemSlotIconFrames[0]).GetComponent<RectTransform>()).eulerAngles;
				Vector3 eulerAngles2 = ((Transform)((Component)HUDManager.Instance.itemSlotIcons[0]).GetComponent<RectTransform>()).eulerAngles;
				Plugin.Log($"Adding {ReservedItemInfo.reservedItemsList.Count} Reserved Item slots to the inventory HUD. Previous inventory HUD size: {PlayerPatcher.unreservedHotbarSize}");
				for (int i = 0; i < Plugin.reservedItemSlotReps.Count; i++)
				{
					ReservedItemInfo reservedItemInfo = Plugin.reservedItemSlotReps[i];
					Plugin.Log($"Adding Reserved Item slot for item types [{reservedItemInfo.itemName}]. Inventory index: {list.Count}");
					float num = ((Graphic)HUDManager.Instance.itemSlotIconFrames[0]).rectTransform.anchoredPosition.y + 1.125f * y * (float)i;
					Image val = Object.Instantiate<Image>(HUDManager.Instance.itemSlotIconFrames[PlayerPatcher.unreservedHotbarSize - 1], ((Component)HUDManager.Instance.itemSlotIconFrames[0]).transform.parent);
					((Object)val).name = $"ReservedItemSlot{i} [{reservedItemInfo.itemName}]";
					((Graphic)val).rectTransform.anchoredPosition = new Vector2(xPos, num);
					((Transform)((Graphic)val).rectTransform).eulerAngles = eulerAngles;
					CanvasGroup val2 = ((Component)val).gameObject.AddComponent<CanvasGroup>();
					val2.ignoreParentGroups = true;
					val2.alpha = 1f;
					Image component = ((Component)((Component)val).transform.GetChild(0)).GetComponent<Image>();
					((Object)component).name = "Icon";
					((Transform)((Graphic)component).rectTransform).eulerAngles = eulerAngles2;
					list.Add(val);
					list2.Add(component);
				}
				if (Plugin.numReservedItemSlots > 0)
				{
					TextMeshProUGUI component2 = new GameObject("ReservedItemSlotTooltip", new Type[2]
					{
						typeof(RectTransform),
						typeof(TextMeshProUGUI)
					}).GetComponent<TextMeshProUGUI>();
					RectTransform rectTransform = ((TMP_Text)component2).rectTransform;
					((Component)rectTransform).transform.parent = ((Component)list[PlayerPatcher.unreservedHotbarSize]).transform;
					((Transform)rectTransform).localScale = Vector3.one;
					rectTransform.sizeDelta = new Vector2(((Graphic)list[0]).rectTransform.sizeDelta.x * 2f, 10f);
					rectTransform.pivot = Vector2.one / 2f;
					rectTransform.anchoredPosition3D = new Vector3(0f, (0f - rectTransform.sizeDelta.x / 2f) * 1.2f, 0f);
					((TMP_Text)component2).font = ((TMP_Text)__instance.controlTipLines[0]).font;
					((TMP_Text)component2).fontSize = 7f;
					((TMP_Text)component2).alignment = (TextAlignmentOptions)514;
					((TMP_Text)component2).text = string.Format($"Hold: [{ConfigSettings.GetDisplayName(ConfigSettings.focusReservedHotbarHotkey.Value)}]");
				}
				__instance.itemSlotIconFrames = list.ToArray();
				__instance.itemSlotIcons = list2.ToArray();
				Plugin.Log($"Finished adding {PlayerPatcher.reservedHotbarSize} Reserved Item slots in the inventory HUD.");
			}
		}
	}
	[HarmonyPatch]
	public static class ReservedItemPatcher
	{
		public static bool isReservedHotbarFocused;

		public static int indexUnfocusedReservedHotbar;

		public static int indexFocusedReservedHotbar;

		public static Dictionary<PlayerControllerB, ReservedItemInfo> grabbingReservedItemInfoDict;

		private static GrabbableObject previouslyHeldObjectServer;

		public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController;

		public static int unreservedHotbarSize => PlayerPatcher.unreservedHotbarSize;

		public static int reservedHotbarSize => Plugin.numReservedItemSlots;

		public static int combinedHotbarSize => PlayerPatcher.combinedHotbarSize;

		public static ReservedItemInfo grabbingReservedItemInfoLocal
		{
			get
			{
				return ((Object)(object)localPlayerController != (Object)null) ? grabbingReservedItemInfoDict[localPlayerController] : null;
			}
			set
			{
				if (!((Object)(object)localPlayerController == (Object)null))
				{
					grabbingReservedItemInfoDict[localPlayerController] = value;
				}
			}
		}

		[HarmonyPatch(typeof(MenuManager), "OnEnable")]
		[HarmonyPrefix]
		public static void ResetVariables(MenuManager __instance)
		{
			if (grabbingReservedItemInfoDict == null)
			{
				grabbingReservedItemInfoDict = new Dictionary<PlayerControllerB, ReservedItemInfo>();
			}
			if (grabbingReservedItemInfoDict.Count > 0)
			{
				grabbingReservedItemInfoDict.Clear();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPrefix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			grabbingReservedItemInfoDict[__instance] = null;
		}

		private static GrabbableObject GetCurrentlyGrabbingObject(PlayerControllerB playerController)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			return (GrabbableObject)Traverse.Create((object)playerController).Field("currentlyGrabbingObject").GetValue();
		}

		private static void SetCurrentlyGrabbingObject(PlayerControllerB playerController, GrabbableObject grabbable)
		{
			Traverse.Create((object)playerController).Field("currentlyGrabbingObject").SetValue((object)grabbable);
		}

		[HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")]
		[HarmonyPrefix]
		public static bool GrabReservedItemPrefix(PlayerControllerB __instance)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Expected O, but got Unknown
			if (isReservedHotbarFocused)
			{
				return false;
			}
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward);
			RaycastHit val2 = default(RaycastHit);
			if (!Physics.Raycast(val, ref val2, __instance.grabDistance, PlayerPatcher.INTERACTABLE_OBJECT_MASK) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref val2)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f)
			{
				grabbingReservedItemInfoLocal = null;
				return true;
			}
			GrabbableObject component = ((Component)((Component)((RaycastHit)(ref val2)).collider).transform).gameObject.GetComponent<GrabbableObject>();
			grabbingReservedItemInfoLocal = Plugin.GetReservedItemInfo(component);
			if (grabbingReservedItemInfoLocal == null)
			{
				return true;
			}
			if (!GameNetworkManager.Instance.gameHasStarted && !component.itemProperties.canBeGrabbedBeforeGameStart && !StartOfRound.Instance.testRoom.activeSelf)
			{
				return false;
			}
			Traverse.Create((object)__instance).Field("grabInvalidated").SetValue((object)false);
			SetCurrentlyGrabbingObject(__instance, component);
			if (__instance.inSpecialInteractAnimation || component.isHeld || component.isPocketed)
			{
				return false;
			}
			NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject;
			if ((Object)(object)networkObject == (Object)null || !networkObject.IsSpawned)
			{
				return false;
			}
			if (grabbingReservedItemInfoLocal == null || !IsItemSlotEmpty(grabbingReservedItemInfoLocal))
			{
				return true;
			}
			((Behaviour)__instance.cursorIcon).enabled = false;
			((TMP_Text)__instance.cursorTip).text = "";
			__instance.twoHanded = component.itemProperties.twoHanded;
			__instance.carryWeight += Mathf.Clamp(component.itemProperties.weight - 1f, 0f, 10f);
			__instance.grabObjectAnimationTime = 0f;
			MethodInfo method = ((object)__instance).GetType().GetMethod("GrabObjectServerRpc", BindingFlags.Instance | BindingFlags.NonPublic);
			method.Invoke(__instance, new object[1] { NetworkObjectReference.op_Implicit(networkObject) });
			Coroutine val3 = (Coroutine)Traverse.Create((object)__instance).Field("grabObjectCoroutine").GetValue();
			if (val3 != null)
			{
				((MonoBehaviour)__instance).StopCoroutine(val3);
			}
			MethodInfo method2 = ((object)__instance).GetType().GetMethod("GrabObject", BindingFlags.Instance | BindingFlags.NonPublic);
			val3 = ((MonoBehaviour)__instance).StartCoroutine((IEnumerator)method2.Invoke(__instance, new object[0]));
			Traverse.Create((object)__instance).Field("grabObjectCoroutine").SetValue((object)val3);
			return false;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")]
		[HarmonyPrefix]
		public static bool GrabReservedItemClientRpcPrefix(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB __instance)
		{
			if (!NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance))
			{
				return true;
			}
			if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening)
			{
				if (grabValidated)
				{
					NetworkObject val = default(NetworkObject);
					if (((NetworkObjectReference)(ref grabbedObject)).TryGet(ref val, (NetworkManager)null))
					{
						GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>();
						ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(component);
						if (reservedItemInfo != null && IsItemSlotEmpty(reservedItemInfo, __instance))
						{
							__instance.ItemSlots[reservedItemInfo.indexInInventory] = component;
							component.playerHeldBy = __instance;
							component.isHeld = true;
							component.EnablePhysics(false);
							component.hasHitGround = false;
							component.isInFactory = __instance.isInsideFactory;
							component.EnableItemMeshes(false);
							Traverse.Create((object)component).Field("previousPlayerHeldBy").SetValue((object)__instance);
							component.PocketItem();
							if ((Object)(object)__instance != (Object)(object)localPlayerController)
							{
								Plugin.Log("Grab object completed on player: " + ((Object)__instance).name);
								if ((Object)(object)component.itemProperties.grabSFX != (Object)null)
								{
									__instance.itemAudio.PlayOneShot(component.itemProperties.grabSFX, 1f);
								}
								grabbingReservedItemInfoDict[__instance] = null;
							}
							else
							{
								HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory].sprite = component.itemProperties.itemIcon;
								((Behaviour)HUDManager.Instance.itemSlotIcons[reservedItemInfo.indexInInventory]).enabled = true;
								HUDManager.Instance.PingHUDElement(HUDManager.Instance.Inventory, 1.5f, 1f, 0.13f);
								previouslyHeldObjectServer = localPlayerController.currentlyHeldObjectServer;
								localPlayerController.currentlyHeldObjectServer = component;
							}
							return false;
						}
					}
				}
				else if ((Object)(object)__instance == (Object)(object)localPlayerController)
				{
					Plugin.Log("Failed to validate ReservedItemGrab by the local player. Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + ".");
					Traverse.Create((object)localPlayerController).Field("grabInvalidated").SetValue((object)true);
				}
				else
				{
					Plugin.Log("Failed to validate ReservedItemGrab by player with id: " + ((Object)__instance).name + ". Object id: " + ((NetworkObjectReference)(ref grabbedObject)).NetworkObjectId + ".");
				}
			}
			grabbingReservedItemInfoDict[__instance] = null;
			return true;
		}

		[HarmonyPatch(typeof(GrabbableObject), "GrabItemOnClient")]
		[HarmonyPrefix]
		public static void OnReservedItemGrabbed(GrabbableObject __instance)
		{
			if (grabbingReservedItemInfoLocal != null && !((Object)(object)__instance != (Object)(object)GetCurrentlyGrabbingObject(localPlayerController)))
			{
				OnLocalPlayerGrabbedReservedItem();
				__instance.PocketItem();
			}
		}

		private static void OnLocalPlayerGrabbedReservedItem()
		{
			localPlayerController.currentlyHeldObjectServer = previouslyHeldObjectServer;
			previouslyHeldObjectServer = null;
			grabbingReservedItemInfoLocal = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "FirstEmptyItemSlot")]
		[HarmonyPostfix]
		public static void GetReservedItemSlotPlacementIndex(ref int __result, PlayerControllerB __instance)
		{
			ReservedItemInfo reservedItemInfo = grabbingReservedItemInfoDict[__instance];
			if (reservedItemInfo != null)
			{
				if (__result == reservedItemInfo.indexInInventory && IsItemSlotEmpty(reservedItemInfo, __instance))
				{
					return;
				}
				grabbingReservedItemInfoDict[__instance] = null;
			}
			if (__result < unreservedHotbarSize)
			{
				return;
			}
			__result = -1;
			for (int i = 0; i < unreservedHotbarSize; i++)
			{
				if ((Object)(object)__instance.ItemSlots[i] == (Object)null)
				{
					__result = i;
					break;
				}
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "NextItemSlot")]
		[HarmonyPrefix]
		public static bool PreventScrollingOtherHotbar(ref int __result, bool forward, PlayerControllerB __instance)
		{
			__result = __instance.currentItemSlot;
			bool flag = __instance.currentItemSlot >= unreservedHotbarSize;
			int num = (forward ? 1 : (-1));
			if (!flag)
			{
				__result = Mathf.Clamp(__result, 0, unreservedHotbarSize - 1) + num;
				if (__result < 0)
				{
					__result = unreservedHotbarSize - 1;
				}
				else if (__result >= unreservedHotbarSize)
				{
					__result = 0;
				}
			}
			else
			{
				__result = Mathf.Clamp(__result, unreservedHotbarSize, combinedHotbarSize - 1) + num;
				if (__result < unreservedHotbarSize)
				{
					__result = combinedHotbarSize - 1;
				}
				else if (__result >= combinedHotbarSize)
				{
					__result = unreservedHotbarSize;
				}
			}
			return false;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
		[HarmonyPrefix]
		public static void RefocusReservedHotbarAfterAnimation(PlayerControllerB __instance)
		{
			if (!((Object)(object)__instance != (Object)(object)localPlayerController) && Keybinds.holdingModifierKey != isReservedHotbarFocused && CanSwapToReservedHotbarSlot())
			{
				SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey);
			}
		}

		public static bool CanSwapToReservedHotbarSlot()
		{
			bool flag = (bool)Traverse.Create((object)localPlayerController).Field("throwingObject").GetValue();
			return !(localPlayerController.inTerminalMenu || localPlayerController.isPlayerDead || localPlayerController.isGrabbingObjectAnimation || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "UpdateSpecialAnimationValue")]
		[HarmonyPostfix]
		public static void OnSpecialAnimationUpdate(bool specialAnimation, PlayerControllerB __instance, short yVal = 0, float timed = 0f, bool climbingLadder = false)
		{
			if (!((Object)(object)__instance != (Object)(object)localPlayerController))
			{
				if (specialAnimation && isReservedHotbarFocused)
				{
					SetFocusReservedHotbarSlots(active: false);
				}
				if (!specialAnimation && isReservedHotbarFocused != Keybinds.holdingModifierKey)
				{
					SetFocusReservedHotbarSlots(Keybinds.holdingModifierKey);
				}
			}
		}

		public static void SetFocusReservedHotbarSlots(bool active)
		{
			if (reservedHotbarSize <= 0 || isReservedHotbarFocused == active)
			{
				return;
			}
			Plugin.Log("SettingFocusReservedHotbar to: " + active);
			isReservedHotbarFocused = active;
			int num = localPlayerController.currentItemSlot;
			if (isReservedHotbarFocused && num < unreservedHotbarSize)
			{
				if (indexFocusedReservedHotbar == -1)
				{
					indexFocusedReservedHotbar = unreservedHotbarSize;
				}
				indexUnfocusedReservedHotbar = num;
				num = Mathf.Max(indexFocusedReservedHotbar, unreservedHotbarSize);
				if ((Object)(object)localPlayerController.ItemSlots[num] == (Object)null)
				{
					for (int i = 0; i < reservedHotbarSize; i++)
					{
						int num2 = unreservedHotbarSize + i;
						if ((Object)(object)localPlayerController.ItemSlots[num2] != (Object)null)
						{
							num = num2;
							break;
						}
					}
				}
			}
			else if (!isReservedHotbarFocused && num >= unreservedHotbarSize)
			{
				indexFocusedReservedHotbar = num;
				num = Mathf.Min(indexUnfocusedReservedHotbar, unreservedHotbarSize - 1);
			}
			HotbarSlotSync.SwapHotbarSlot(num);
		}

		public static bool IsItemSlotEmpty(string itemName, PlayerControllerB player = null)
		{
			return IsItemSlotEmpty(Plugin.GetReservedItemInfo(itemName), player);
		}

		public static bool IsItemSlotEmpty(ReservedItemInfo itemInfo, PlayerControllerB player = null)
		{
			if ((Object)(object)player == (Object)null)
			{
				player = localPlayerController;
			}
			if ((Object)(object)player == (Object)null)
			{
				return false;
			}
			return itemInfo != null && itemInfo.indexInInventory < player.ItemSlots.Length && (Object)(object)player.ItemSlots[itemInfo.indexInInventory] == (Object)null;
		}

		public static GrabbableObject GetHeldReservedObject(string itemName, PlayerControllerB player = null)
		{
			if ((Object)(object)player == (Object)null)
			{
				player = localPlayerController;
			}
			if ((Object)(object)player == (Object)null)
			{
				return null;
			}
			int reservedItemHotbarIndex = Plugin.GetReservedItemHotbarIndex(itemName);
			return (reservedItemHotbarIndex >= 0 && reservedItemHotbarIndex < player.ItemSlots.Length && (Object)(object)player.ItemSlots[reservedItemHotbarIndex] != (Object)null) ? player.ItemSlots[reservedItemHotbarIndex] : null;
		}

		[HarmonyPatch(typeof(GrabbableObject), "Start")]
		[HarmonyPostfix]
		public static void InitializeReservedItemProperties(GrabbableObject __instance)
		{
			ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(__instance.itemProperties.itemName);
			if (reservedItemInfo != null)
			{
				if (reservedItemInfo.forceUpdateCanBeGrabbedBeforeGameStart)
				{
					__instance.itemProperties.canBeGrabbedBeforeGameStart = reservedItemInfo.canBeGrabbedBeforeGameStart;
				}
				if (reservedItemInfo.forceUpdateRequiresBattery)
				{
					__instance.itemProperties.requiresBattery = reservedItemInfo.requiresBattery;
				}
			}
		}
	}
	[HarmonyPatch]
	public static class PlayerPatcher
	{
		public static PlayerControllerB localPlayerController;

		public static int vanillaHotbarSize = -1;

		public static int INTERACTABLE_OBJECT_MASK { get; private set; }

		public static int unreservedHotbarSize => ((Object)(object)localPlayerController != (Object)null) ? (localPlayerController.ItemSlots.Length - reservedHotbarSize) : vanillaHotbarSize;

		public static int reservedHotbarSize => Plugin.numReservedItemSlots;

		public static int combinedHotbarSize => unreservedHotbarSize + reservedHotbarSize;

		[HarmonyPatch(typeof(MenuManager), "OnEnable")]
		[HarmonyPrefix]
		public static void ResetVariables(MenuManager __instance)
		{
			localPlayerController = null;
			vanillaHotbarSize = -1;
			ReservedItemPatcher.isReservedHotbarFocused = false;
			ReservedItemPatcher.indexUnfocusedReservedHotbar = 0;
			ReservedItemPatcher.indexFocusedReservedHotbar = -1;
			Keybinds.localPlayerController = null;
			Keybinds.focusReservedHotbarAction = null;
			Keybinds.holdingModifierKey = false;
			HotbarSlotSync.localPlayerController = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
		[HarmonyPostfix]
		public static void InitializePlayerController(PlayerControllerB __instance)
		{
			if (vanillaHotbarSize == -1)
			{
				vanillaHotbarSize = __instance.ItemSlots.Length;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Start")]
		[HarmonyPostfix]
		public static void InitializePlayerControllerLate(PlayerControllerB __instance)
		{
			__instance.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[__instance.ItemSlots.Length + reservedHotbarSize];
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPrefix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			localPlayerController = __instance;
			INTERACTABLE_OBJECT_MASK = (int)Traverse.Create((object)__instance).Field("interactableObjectsMask").GetValue();
		}
	}
}

plugins/FlipMods-ReservedWalkieSlot/ReservedWalkieSlot.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using ReservedItemSlotCore;
using ReservedItemSlotCore.Patches;
using ReservedWalkieSlot.Patches;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ReservedWalkieSlot")]
[assembly: AssemblyDescription("Mod made by flipf17")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReservedWalkieSlot")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c15c320f-d8fc-4f1c-be3c-f2d2ffc41edd")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ReservedWalkieSlot
{
	public static class ConfigSettings
	{
		public static ConfigEntry<string> activateWalkieKey;

		public static string activateWalkieDisplayName;

		public static void BindConfigSettings()
		{
			Plugin.Log("BindingConfigs");
			activateWalkieKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedWalkieSlot", "ActivateWalkieKey", "<Keyboard>/x", "Activate walkie keybind.");
			activateWalkieDisplayName = GetDisplayName(activateWalkieKey.Value);
		}

		public static string GetDisplayName(string key)
		{
			key = key.Replace("<Keyboard>/", "");
			key = key.Replace("<Mouse>/", "");
			string text = key;
			text = text.Replace("leftAlt", "Alt");
			text = text.Replace("rightAlt", "Alt");
			text = text.Replace("leftCtrl", "Ctrl");
			text = text.Replace("rightCtrl", "Ctrl");
			text = text.Replace("leftShift", "Shift");
			text = text.Replace("rightShift", "Shift");
			text = text.Replace("leftButton", "LMB");
			text = text.Replace("rightButton", "RMB");
			return text.Replace("middleButton", "MMB");
		}
	}
	[HarmonyPatch]
	internal static class Keybinds
	{
		public static PlayerControllerB localPlayerController;

		private static InputAction activateWalkieAction;

		[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void OnLocalPlayerConnect(PlayerControllerB __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			localPlayerController = __instance;
			activateWalkieAction = new InputAction((string)null, (InputActionType)0, ConfigSettings.activateWalkieKey.Value, (string)null, (string)null, (string)null);
			if (((Component)localPlayerController).gameObject.activeSelf)
			{
				SubscribeToEvents();
			}
		}

		private static void SubscribeToEvents()
		{
			if (activateWalkieAction != null)
			{
				activateWalkieAction.performed += OnPressWalkieButtonPerformed;
				activateWalkieAction.canceled += OnReleaseWalkieButtonPerformed;
				activateWalkieAction.Enable();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnEnable")]
		[HarmonyPostfix]
		public static void OnEnable(PlayerControllerB __instance)
		{
			if ((Object)(object)__instance == (Object)(object)localPlayerController)
			{
				SubscribeToEvents();
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "OnDisable")]
		[HarmonyPostfix]
		public static void OnDisable(PlayerControllerB __instance)
		{
			if (activateWalkieAction != null && !((Object)(object)__instance != (Object)(object)localPlayerController))
			{
				activateWalkieAction.performed -= OnPressWalkieButtonPerformed;
				activateWalkieAction.canceled -= OnReleaseWalkieButtonPerformed;
				activateWalkieAction.Disable();
			}
		}

		private static void OnPressWalkieButtonPerformed(CallbackContext context)
		{
			if ((Object)(object)localPlayerController == (Object)null || !localPlayerController.isPlayerControlled || (((NetworkBehaviour)localPlayerController).IsServer && !localPlayerController.isHostPlayerObject))
			{
				return;
			}
			WalkieTalkie mainWalkie = ReservedWalkieSlotPatcher.GetMainWalkie(localPlayerController);
			if (((CallbackContext)(ref context)).performed && !((Object)(object)mainWalkie == (Object)null) && ((GrabbableObject)mainWalkie).isBeingUsed)
			{
				float num = (float)Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").GetValue();
				if (!(num < 0.075f))
				{
					Plugin.Log("Talking into walkie");
					ShipBuildModeManager.Instance.CancelBuildMode(true);
					((GrabbableObject)mainWalkie).UseItemOnClient(true);
					Traverse.Create((object)localPlayerController).Field("timeSinceSwitchingSlots").SetValue((object)0);
				}
			}
		}

		private static void OnReleaseWalkieButtonPerformed(CallbackContext context)
		{
			if (!((Object)(object)localPlayerController == (Object)null) && localPlayerController.isPlayerControlled && (!((NetworkBehaviour)localPlayerController).IsServer || localPlayerController.isHostPlayerObject))
			{
				WalkieTalkie mainWalkie = ReservedWalkieSlotPatcher.GetMainWalkie(localPlayerController);
				if (((CallbackContext)(ref context)).canceled && !((Object)(object)mainWalkie == (Object)null))
				{
					Plugin.Log("Not talking into walkie");
					ShipBuildModeManager.Instance.CancelBuildMode(true);
					((GrabbableObject)mainWalkie).UseItemOnClient(false);
				}
			}
		}
	}
	[BepInPlugin("FlipMods.ReservedWalkieSlot", "ReservedWalkieSlot", "1.4.6")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		private Harmony _harmony;

		public static ReservedItemInfo walkieInfo = new ReservedItemInfo("Walkie-talkie", 100, true, true, true, true);

		private void Awake()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			instance = this;
			ConfigSettings.BindConfigSettings();
			_harmony = new Harmony("ReservedWalkieSlot");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedWalkieSlot loaded");
		}

		public static void Log(string message)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo((object)message);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "FlipMods.ReservedWalkieSlot";

		public const string PLUGIN_NAME = "ReservedWalkieSlot";

		public const string PLUGIN_VERSION = "1.4.6";
	}
}
namespace ReservedWalkieSlot.Patches
{
	[HarmonyPatch]
	internal static class ReservedWalkieSlotPatcher
	{
		private static Vector3 localPlayerShoulderPositionOffset = new Vector3(0.125f, 0.4f, 0.125f);

		private static Vector3 playerShoulderPositionOffset = new Vector3(0.15f, -0.05f, 0.25f);

		private static Vector3 playerShoulderRotationOffset = new Vector3(0f, 270f, 100f);

		private static string originalControlTooltip = "";

		public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController;

		public static WalkieTalkie GetMainWalkie(PlayerControllerB playerController)
		{
			return GetCurrentlySelectedWalkie(playerController) ?? GetReservedWalkie(playerController);
		}

		public static WalkieTalkie GetReservedWalkie(PlayerControllerB playerController)
		{
			GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[Plugin.walkieInfo.indexInInventory] : null);
			return (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null);
		}

		public static WalkieTalkie GetCurrentlySelectedWalkie(PlayerControllerB playerController)
		{
			GrabbableObject obj = ((playerController != null) ? playerController.ItemSlots[playerController.currentItemSlot] : null);
			return (WalkieTalkie)(object)((obj is WalkieTalkie) ? obj : null);
		}

		[HarmonyPatch(typeof(WalkieTalkie), "__initializeVariables")]
		[HarmonyPostfix]
		public static void EditTooltips(WalkieTalkie __instance)
		{
			if (originalControlTooltip == "")
			{
				originalControlTooltip = ((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1];
			}
			((GrabbableObject)__instance).itemProperties.toolTips[((GrabbableObject)__instance).itemProperties.toolTips.Length - 1] = $"{originalControlTooltip}[{ConfigSettings.activateWalkieDisplayName.ToUpper()}]";
		}

		[HarmonyPatch(typeof(MenuManager), "OnEnable")]
		[HarmonyPostfix]
		public static void ResetVariables()
		{
			Keybinds.localPlayerController = null;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")]
		[HarmonyPrefix]
		public static bool PreventActivatingDuplicateItem(CallbackContext context, PlayerControllerB __instance)
		{
			WalkieTalkie currentlySelectedWalkie = GetCurrentlySelectedWalkie(__instance);
			if ((Object)(object)__instance != (Object)(object)localPlayerController || (Object)(object)currentlySelectedWalkie == (Object)null)
			{
				return true;
			}
			if (!((CallbackContext)(ref context)).performed)
			{
				return false;
			}
			WalkieTalkie reservedWalkie = GetReservedWalkie(__instance);
			if ((Object)(object)currentlySelectedWalkie != (Object)(object)reservedWalkie && (!((GrabbableObject)reservedWalkie).itemProperties.requiresBattery || !((GrabbableObject)reservedWalkie).insertedBattery.empty))
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(WalkieTalkie), "PocketItem")]
		[HarmonyPostfix]
		public static void OnPocketWalkie(WalkieTalkie __instance)
		{
			if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null))
			{
				((GrabbableObject)__instance).parentObject = ((Component)((GrabbableObject)__instance).playerHeldBy.playerBadgeMesh).transform.parent;
			}
		}

		[HarmonyPatch(typeof(WalkieTalkie), "EquipItem")]
		[HarmonyPostfix]
		public static void OnEquipWalkie(WalkieTalkie __instance)
		{
			if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null))
			{
				((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder);
			}
		}

		[HarmonyPatch(typeof(GrabbableObject), "LateUpdate")]
		[HarmonyPostfix]
		public static void SetPositionOffset(GrabbableObject __instance)
		{
			//IL_006c: 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_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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (__instance is WalkieTalkie && (Object)(object)__instance.playerHeldBy != (Object)null && __instance.isPocketed && (Object)(object)__instance.parentObject != (Object)null && (Object)(object)__instance != (Object)(object)GetCurrentlySelectedWalkie(__instance.playerHeldBy))
			{
				Transform transform = ((Component)__instance.parentObject).transform;
				((Component)__instance).transform.rotation = ((Component)__instance.parentObject).transform.rotation * Quaternion.Euler(playerShoulderRotationOffset);
				((Component)__instance).transform.position = transform.position + transform.rotation * playerShoulderPositionOffset;
			}
		}

		[HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")]
		[HarmonyPrefix]
		public static void OnEnableItemMeshes(ref bool enable, GrabbableObject __instance)
		{
			if (__instance is WalkieTalkie && (Object)(object)__instance.playerHeldBy != (Object)null && ((Object)(object)__instance == (Object)(object)GetCurrentlySelectedWalkie(__instance.playerHeldBy) || ((Object)(object)__instance == (Object)(object)GetReservedWalkie(__instance.playerHeldBy) && (Object)(object)__instance.playerHeldBy != (Object)(object)localPlayerController)))
			{
				enable = true;
			}
		}
	}
}

plugins/gamendegamer-Lethal_Admin/LethalAdmin.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using LethalAdmin.Logging;
using LethalAdmin.Patches;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalAdmin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("An admin tool for lethal company")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b6c5a2eb84a8461e687ff5e62aea6f55e723f85e")]
[assembly: AssemblyProduct("LethalAdmin")]
[assembly: AssemblyTitle("LethalAdmin")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalAdmin
{
	public static class KickBanTools
	{
		public class PlayerInfo
		{
			public string Username;

			public ulong SteamID;

			public bool UsingWalkie;

			public bool Connected;

			public override string ToString()
			{
				return $"{Username} ({SteamID}@steam)";
			}
		}

		private static readonly List<PlayerInfo> BannedUsers = new List<PlayerInfo>();

		public static PlayerInfo[] GetBannedUsers()
		{
			return BannedUsers.ToArray();
		}

		public static List<PlayerInfo> GetPlayers()
		{
			return StartOfRound.Instance.allPlayerScripts.Select((PlayerControllerB player, int i) => new PlayerInfo
			{
				Username = player.playerUsername,
				SteamID = player.playerSteamId,
				UsingWalkie = player.speakingToWalkieTalkie,
				Connected = StartOfRound.Instance.fullyLoadedPlayers.Contains((ulong)i)
			}).ToList();
		}

		internal static void SetBannedPLayers(List<PlayerInfo> bans)
		{
			BannedUsers.Clear();
			BannedUsers.AddRange(bans);
		}

		public static void BanPlayer(PlayerInfo playerInfo)
		{
			if (playerInfo.SteamID == 0L)
			{
				LethalLogger.AddLog(new Log($"[Ban] {playerInfo} is not a player or steam is disabled, when not using steam bans are not possible!", "Error"));
				return;
			}
			if (BannedUsers.Any((PlayerInfo bannedPlayer) => bannedPlayer.SteamID == playerInfo.SteamID))
			{
				LethalLogger.AddLog(new Log($"[Ban] Could not ban {playerInfo} as this user is already banned", "Warning"));
				KickPlayer(playerInfo);
				return;
			}
			Plugin.Instance.AddConfigBan(playerInfo.SteamID);
			BannedUsers.Add(playerInfo);
			LethalLogger.AddLog(new Log($"[Ban] {playerInfo} has been banned"));
			KickPlayer(playerInfo);
		}

		public static void UnbanPlayer(PlayerInfo player)
		{
			StartOfRound.Instance.KickedClientIds.Remove(player.SteamID);
			BannedUsers.Remove(player);
			Plugin.Instance.RemoveConfigBan(player.SteamID);
		}

		public static void KickPlayer(PlayerInfo playerInfo)
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			for (int i = 0; i < allPlayerScripts.Length; i++)
			{
				PlayerControllerB val = allPlayerScripts[i];
				if (!(val.playerUsername != playerInfo.Username) && val.playerSteamId == playerInfo.SteamID)
				{
					StartOfRound.Instance.KickPlayer(i);
					LethalLogger.AddLog(new Log($"[Kick] {val.playerUsername} ({val.playerSteamId}@steam) has been kicked (id={i})"));
				}
			}
		}
	}
	[BepInPlugin("gamendegamer.lethaladmin", "Lethal Admin", "1.0.6")]
	public class Plugin : BaseUnityPlugin
	{
		private readonly Harmony _harmony = new Harmony("LethalAdmin");

		public static Plugin Instance;

		private const string ConfigSection = "Lethal Admin";

		private ConfigEntry<string> _bans;

		private ConfigEntry<int> _minVotesConfig;

		public int MinVotes
		{
			get
			{
				return _minVotesConfig.Value;
			}
			set
			{
				_minVotesConfig.Value = value;
				((BaseUnityPlugin)this).Config.Save();
			}
		}

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Starting Lethal Admin");
			_harmony.PatchAll(typeof(RoundPatch));
			_harmony.PatchAll(typeof(MenuPatch));
			_harmony.PatchAll(typeof(ControllerPatch));
			_harmony.PatchAll(typeof(VotingPatch));
			Instance = this;
			_bans = ((BaseUnityPlugin)this).Config.Bind<string>("Lethal Admin", "bans", "", "The steam IDs of all banned players, comma seperated.");
			_minVotesConfig = ((BaseUnityPlugin)this).Config.Bind<int>("Lethal Admin", "minVotes", 1, "The minimum amount of votes before the autopilot starts. Use a value of 1 to disable.");
			LoadConfigBans();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Finished starting Lethal Admin");
		}

		private void LoadConfigBans()
		{
			string[] array = _bans.Value.Split(",");
			List<KickBanTools.PlayerInfo> list = new List<KickBanTools.PlayerInfo>();
			string[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				if (ulong.TryParse(array2[i], out var result))
				{
					list.Add(new KickBanTools.PlayerInfo
					{
						SteamID = result,
						Username = "UNKNOWN"
					});
				}
			}
			KickBanTools.SetBannedPLayers(list);
		}

		internal void AddConfigBan(ulong value)
		{
			if (_bans.Value.Length != 0)
			{
				ConfigEntry<string> bans = _bans;
				bans.Value += ",";
			}
			ConfigEntry<string> bans2 = _bans;
			bans2.Value += value;
			((BaseUnityPlugin)this).Config.Save();
		}

		internal void RemoveConfigBan(ulong value)
		{
			string[] array = _bans.Value.Split(",");
			StringBuilder stringBuilder = new StringBuilder();
			string[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				if (ulong.TryParse(array2[i], out var result) && result != value)
				{
					if (stringBuilder.Length != 0)
					{
						stringBuilder.Append(",");
					}
					stringBuilder.Append(result);
				}
			}
			_bans.Value = stringBuilder.ToString();
			((BaseUnityPlugin)this).Config.Save();
		}

		internal void LogInfo(string message)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)message);
		}
	}
	public class UI : MonoBehaviour
	{
		private enum ViewMode
		{
			Users,
			Settings,
			Bans
		}

		private static readonly List<UI> Instances = new List<UI>();

		private bool _menuOpen;

		private Rect _windowRect;

		private readonly GUILayoutOption[] _options = (GUILayoutOption[])(object)new GUILayoutOption[2]
		{
			GUILayout.Width(800f),
			GUILayout.Height(400f)
		};

		private readonly GUILayoutOption[] _labelOptions = (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(300f) };

		private readonly GUIStyle _yellowText = new GUIStyle();

		private Vector2 _scrollPosition;

		private ViewMode _currentViewMode;

		private bool _menuAlwaysOpen;

		private string _minVotes = Plugin.Instance.MinVotes.ToString();

		private string _settingsErrorMessage = "";

		private void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Instances.Add(this);
			_yellowText.normal.textColor = Color.yellow;
		}

		private void OnDestroy()
		{
			Instances.Remove(this);
		}

		public static void SetMenuForAll(bool value)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (Instances.Count == 0 && value)
			{
				new GameObject("Lethal Admin UI").AddComponent<UI>();
				Plugin.Instance.LogInfo("Creating Admin UI instance");
			}
			foreach (UI instance in Instances)
			{
				instance.SetMenu(value);
			}
		}

		private void SetMenu(bool value)
		{
			_menuOpen = value;
		}

		private void OnGUI()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if (((NetworkBehaviour)StartOfRound.Instance).IsServer && (_menuOpen || _menuAlwaysOpen))
			{
				int controlID = GUIUtility.GetControlID((FocusType)2);
				_windowRect = GUILayout.Window(controlID, _windowRect, new WindowFunction(DrawUI), "Lethal Admin Menu", _options);
			}
		}

		private void DrawUI(int windowID)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			_scrollPosition = GUILayout.BeginScrollView(_scrollPosition, false, true, Array.Empty<GUILayoutOption>());
			switch (_currentViewMode)
			{
			case ViewMode.Users:
				DrawUsers();
				break;
			case ViewMode.Bans:
				DrawBans();
				break;
			case ViewMode.Settings:
				DrawSettings();
				break;
			default:
				DrawUsers();
				break;
			}
			GUILayout.EndScrollView();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("Users", Array.Empty<GUILayoutOption>()))
			{
				_currentViewMode = ViewMode.Users;
			}
			if (GUILayout.Button("Settings & Logs", Array.Empty<GUILayoutOption>()))
			{
				_currentViewMode = ViewMode.Settings;
			}
			if (GUILayout.Button("Bans", Array.Empty<GUILayoutOption>()))
			{
				_currentViewMode = ViewMode.Bans;
			}
			GUILayout.EndHorizontal();
			if (GUILayout.Button("Toggle ship lights", Array.Empty<GUILayoutOption>()))
			{
				StartOfRound.Instance.shipRoomLights.ToggleShipLights();
			}
			if (StartOfRound.Instance.connectedPlayersAmount + 1 - StartOfRound.Instance.livingPlayers >= 1 && !TimeOfDay.Instance.shipLeavingAlertCalled && GUILayout.Button("Override vote (will trigger auto pilot) [Experimental]", Array.Empty<GUILayoutOption>()))
			{
				TimeOfDay instance = TimeOfDay.Instance;
				instance.votesForShipToLeaveEarly = Math.Max(StartOfRound.Instance.connectedPlayersAmount, Plugin.Instance.MinVotes);
				instance.votedShipToLeaveEarlyThisRound = false;
				instance.VoteShipToLeaveEarly();
			}
			_menuAlwaysOpen = GUILayout.Toggle(_menuAlwaysOpen, "Always show menu", Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 500f));
		}

		private void DrawUsers()
		{
			GUILayout.Label("Players that are not connected are shown in yellow!", Array.Empty<GUILayoutOption>());
			List<KickBanTools.PlayerInfo> players = KickBanTools.GetPlayers();
			int num = 0;
			foreach (KickBanTools.PlayerInfo item in players)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				if (item.Connected)
				{
					GUILayout.Label($"({num}) {item}", _labelOptions);
				}
				else
				{
					GUILayout.Label($"({num}) {item}", _yellowText, _labelOptions);
				}
				if (num != 0)
				{
					if (GUILayout.Button("Kick", Array.Empty<GUILayoutOption>()))
					{
						KickBanTools.KickPlayer(item);
					}
					if (GUILayout.Button("Ban", Array.Empty<GUILayoutOption>()))
					{
						KickBanTools.BanPlayer(item);
					}
				}
				GUILayout.Toggle(item.UsingWalkie, "Using walkie", Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				num++;
			}
		}

		private void DrawSettings()
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Minimum departure votes: ", Array.Empty<GUILayoutOption>());
			_minVotes = GUILayout.TextField(_minVotes, Array.Empty<GUILayoutOption>());
			GUILayout.EndHorizontal();
			if (GUILayout.Button("Apply settings", Array.Empty<GUILayoutOption>()))
			{
				try
				{
					int num = int.Parse(_minVotes);
					if (num < 1)
					{
						_minVotes = Plugin.Instance.MinVotes.ToString();
						_settingsErrorMessage = "Minimum departure votes can not be negative.";
					}
					else
					{
						Plugin.Instance.MinVotes = num;
						_settingsErrorMessage = "";
					}
				}
				catch (FormatException)
				{
					_minVotes = Plugin.Instance.MinVotes.ToString();
					_settingsErrorMessage = "New minimum departure votes is not a valid integer.";
				}
			}
			GUILayout.Label(_settingsErrorMessage, _yellowText, Array.Empty<GUILayoutOption>());
			IEnumerable<Log> logs = LethalLogger.GetLogs();
			GUILayout.Label("Logs:", Array.Empty<GUILayoutOption>());
			foreach (Log item in logs)
			{
				GUILayout.Label(item.GetTimeFormattedString(), Array.Empty<GUILayoutOption>());
			}
		}

		private void DrawBans()
		{
			KickBanTools.PlayerInfo[] bannedUsers = KickBanTools.GetBannedUsers();
			foreach (KickBanTools.PlayerInfo playerInfo in bannedUsers)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label(playerInfo.ToString(), _labelOptions);
				if (GUILayout.Button("Unban", Array.Empty<GUILayoutOption>()))
				{
					KickBanTools.UnbanPlayer(playerInfo);
				}
				GUILayout.EndHorizontal();
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalAdmin";

		public const string PLUGIN_NAME = "LethalAdmin";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LethalAdmin.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	public class ControllerPatch
	{
		[HarmonyPatch("ConnectClientToPlayerObject")]
		[HarmonyPostfix]
		public static void OnPlayerJoin(PlayerControllerB __instance)
		{
			LethalLogger.AddLog(new Log($"[Connect] {__instance.playerUsername} ({__instance.playerSteamId}@steam) has joined"));
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager))]
	public class MenuPatch
	{
		[HarmonyPatch("OpenQuickMenu")]
		[HarmonyPostfix]
		public static void OnOpenMenu()
		{
			UI.SetMenuForAll(value: true);
		}

		[HarmonyPatch("CloseQuickMenu")]
		[HarmonyPostfix]
		public static void OnCloseMenu()
		{
			UI.SetMenuForAll(value: false);
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	public class RoundPatch
	{
		[HarmonyPatch("KickPlayer")]
		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void OnKick(StartOfRound __instance)
		{
			__instance.KickedClientIds.Clear();
			KickBanTools.PlayerInfo[] bannedUsers = KickBanTools.GetBannedUsers();
			foreach (KickBanTools.PlayerInfo playerInfo in bannedUsers)
			{
				__instance.KickedClientIds.Add(playerInfo.SteamID);
			}
		}

		[HarmonyPatch("EndGameClientRpc")]
		[HarmonyPostfix]
		public static void OnShipLeave(StartOfRound __instance, object[] __args)
		{
			int num = (int)__args[0];
			if (num < __instance.allPlayerScripts.Length)
			{
				PlayerControllerB val = __instance.allPlayerScripts[num];
				LethalLogger.AddLog(new Log($"[Departure] {val.playerUsername} ({val.playerSteamId}@steam) has started the ship"));
			}
		}
	}
	[HarmonyPatch(typeof(TimeOfDay))]
	public class VotingPatch
	{
		[HarmonyPatch("SetShipLeaveEarlyServerRpc")]
		[HarmonyPrefix]
		public static bool OnServerVote(TimeOfDay __instance)
		{
			if (Plugin.Instance.MinVotes <= 1 || !((NetworkBehaviour)__instance).IsServer)
			{
				return true;
			}
			if (__instance.votesForShipToLeaveEarly + 1 >= Plugin.Instance.MinVotes)
			{
				return true;
			}
			__instance.votesForShipToLeaveEarly++;
			return false;
		}
	}
}
namespace LethalAdmin.Logging
{
	public static class LethalLogger
	{
		private const int MaxLogCount = 50;

		private static readonly List<Log> Logs = new List<Log>();

		public static void AddLog(Log log)
		{
			Logs.Add(log);
			while (Logs.Count > 50)
			{
				Logs.RemoveAt(0);
			}
		}

		public static IEnumerable<Log> GetLogs()
		{
			return Logs.ToArray();
		}
	}
	public class Log
	{
		internal readonly string Prefix;

		private readonly float _time = Time.realtimeSinceStartup;

		private readonly string _message;

		public Log(string message, string prefix = "Info")
		{
			_message = message;
			Prefix = prefix;
		}

		public string GetTimeFormattedString()
		{
			TimeSpan timeSpan = TimeSpan.FromSeconds(_time);
			return $"[{timeSpan:hh':'mm':'ss}] [{Prefix}] {_message}";
		}
	}
}

plugins/Giltong-LethalCompanyDRP/LethalCompanyDRP.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Discord;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[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("LethalCompanyDRP")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Discord Rich Presence for Lethal Company")]
[assembly: AssemblyFileVersion("1.3.5.0")]
[assembly: AssemblyInformationalVersion("1.3.5")]
[assembly: AssemblyProduct("LethalCompanyDRP")]
[assembly: AssemblyTitle("LethalCompanyDRP")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Discord
{
	public class ActivityManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityJoinHandler(IntPtr ptr, [MarshalAs(UnmanagedType.LPStr)] string secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivitySpectateHandler(IntPtr ptr, [MarshalAs(UnmanagedType.LPStr)] string secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityJoinRequestHandler(IntPtr ptr, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityInviteHandler(IntPtr ptr, ActivityActionType type, ref User user, ref Activity activity);

			internal ActivityJoinHandler OnActivityJoin;

			internal ActivitySpectateHandler OnActivitySpectate;

			internal ActivityJoinRequestHandler OnActivityJoinRequest;

			internal ActivityInviteHandler OnActivityInvite;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RegisterCommandMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string command);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RegisterSteamMethod(IntPtr methodsPtr, uint steamId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateActivityCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateActivityMethod(IntPtr methodsPtr, ref Activity activity, IntPtr callbackData, UpdateActivityCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ClearActivityCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ClearActivityMethod(IntPtr methodsPtr, IntPtr callbackData, ClearActivityCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendRequestReplyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendRequestReplyMethod(IntPtr methodsPtr, long userId, ActivityJoinRequestReply reply, IntPtr callbackData, SendRequestReplyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendInviteMethod(IntPtr methodsPtr, long userId, ActivityActionType type, [MarshalAs(UnmanagedType.LPStr)] string content, IntPtr callbackData, SendInviteCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void AcceptInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void AcceptInviteMethod(IntPtr methodsPtr, long userId, IntPtr callbackData, AcceptInviteCallback callback);

			internal RegisterCommandMethod RegisterCommand;

			internal RegisterSteamMethod RegisterSteam;

			internal UpdateActivityMethod UpdateActivity;

			internal ClearActivityMethod ClearActivity;

			internal SendRequestReplyMethod SendRequestReply;

			internal SendInviteMethod SendInvite;

			internal AcceptInviteMethod AcceptInvite;
		}

		public delegate void UpdateActivityHandler(Result result);

		public delegate void ClearActivityHandler(Result result);

		public delegate void SendRequestReplyHandler(Result result);

		public delegate void SendInviteHandler(Result result);

		public delegate void AcceptInviteHandler(Result result);

		public delegate void ActivityJoinHandler(string secret);

		public delegate void ActivitySpectateHandler(string secret);

		public delegate void ActivityJoinRequestHandler(ref User user);

		public delegate void ActivityInviteHandler(ActivityActionType type, ref User user, ref Activity activity);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event ActivityJoinHandler OnActivityJoin;

		public event ActivitySpectateHandler OnActivitySpectate;

		public event ActivityJoinRequestHandler OnActivityJoinRequest;

		public event ActivityInviteHandler OnActivityInvite;

		public void RegisterCommand()
		{
			RegisterCommand(null);
		}

		internal ActivityManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnActivityJoin = OnActivityJoinImpl;
			events.OnActivitySpectate = OnActivitySpectateImpl;
			events.OnActivityJoinRequest = OnActivityJoinRequestImpl;
			events.OnActivityInvite = OnActivityInviteImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public void RegisterCommand(string command)
		{
			Result result = Methods.RegisterCommand(MethodsPtr, command);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void RegisterSteam(uint steamId)
		{
			Result result = Methods.RegisterSteam(MethodsPtr, steamId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void UpdateActivityCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			UpdateActivityHandler updateActivityHandler = (UpdateActivityHandler)gCHandle.Target;
			gCHandle.Free();
			updateActivityHandler(result);
		}

		public void UpdateActivity(Activity activity, UpdateActivityHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.UpdateActivity(MethodsPtr, ref activity, GCHandle.ToIntPtr(value), UpdateActivityCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void ClearActivityCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ClearActivityHandler clearActivityHandler = (ClearActivityHandler)gCHandle.Target;
			gCHandle.Free();
			clearActivityHandler(result);
		}

		public void ClearActivity(ClearActivityHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ClearActivity(MethodsPtr, GCHandle.ToIntPtr(value), ClearActivityCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void SendRequestReplyCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SendRequestReplyHandler sendRequestReplyHandler = (SendRequestReplyHandler)gCHandle.Target;
			gCHandle.Free();
			sendRequestReplyHandler(result);
		}

		public void SendRequestReply(long userId, ActivityJoinRequestReply reply, SendRequestReplyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SendRequestReply(MethodsPtr, userId, reply, GCHandle.ToIntPtr(value), SendRequestReplyCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void SendInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SendInviteHandler sendInviteHandler = (SendInviteHandler)gCHandle.Target;
			gCHandle.Free();
			sendInviteHandler(result);
		}

		public void SendInvite(long userId, ActivityActionType type, string content, SendInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SendInvite(MethodsPtr, userId, type, content, GCHandle.ToIntPtr(value), SendInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void AcceptInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			AcceptInviteHandler acceptInviteHandler = (AcceptInviteHandler)gCHandle.Target;
			gCHandle.Free();
			acceptInviteHandler(result);
		}

		public void AcceptInvite(long userId, AcceptInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.AcceptInvite(MethodsPtr, userId, GCHandle.ToIntPtr(value), AcceptInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void OnActivityJoinImpl(IntPtr ptr, string secret)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityJoin != null)
			{
				discord.ActivityManagerInstance.OnActivityJoin(secret);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivitySpectateImpl(IntPtr ptr, string secret)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivitySpectate != null)
			{
				discord.ActivityManagerInstance.OnActivitySpectate(secret);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivityJoinRequestImpl(IntPtr ptr, ref User user)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityJoinRequest != null)
			{
				discord.ActivityManagerInstance.OnActivityJoinRequest(ref user);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivityInviteImpl(IntPtr ptr, ActivityActionType type, ref User user, ref Activity activity)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityInvite != null)
			{
				discord.ActivityManagerInstance.OnActivityInvite(type, ref user, ref activity);
			}
		}
	}
	internal static class Constants
	{
		public const string DllName = "discord_game_sdk";
	}
	public enum Result
	{
		Ok,
		ServiceUnavailable,
		InvalidVersion,
		LockFailed,
		InternalError,
		InvalidPayload,
		InvalidCommand,
		InvalidPermissions,
		NotFetched,
		NotFound,
		Conflict,
		InvalidSecret,
		InvalidJoinSecret,
		NoEligibleActivity,
		InvalidInvite,
		NotAuthenticated,
		InvalidAccessToken,
		ApplicationMismatch,
		InvalidDataUrl,
		InvalidBase64,
		NotFiltered,
		LobbyFull,
		InvalidLobbySecret,
		InvalidFilename,
		InvalidFileSize,
		InvalidEntitlement,
		NotInstalled,
		NotRunning,
		InsufficientBuffer,
		PurchaseCanceled,
		InvalidGuild,
		InvalidEvent,
		InvalidChannel,
		InvalidOrigin,
		RateLimited,
		OAuth2Error,
		SelectChannelTimeout,
		GetGuildTimeout,
		SelectVoiceForceRequired,
		CaptureShortcutAlreadyListening,
		UnauthorizedForAchievement,
		InvalidGiftCode,
		PurchaseError,
		TransactionAborted,
		DrawingInitFailed
	}
	public enum CreateFlags
	{
		Default,
		NoRequireDiscord
	}
	public enum LogLevel
	{
		Error = 1,
		Warn,
		Info,
		Debug
	}
	public enum UserFlag
	{
		Partner = 2,
		HypeSquadEvents = 4,
		HypeSquadHouse1 = 0x40,
		HypeSquadHouse2 = 0x80,
		HypeSquadHouse3 = 0x100
	}
	public enum PremiumType
	{
		None,
		Tier1,
		Tier2
	}
	public enum ImageType
	{
		User
	}
	public enum ActivityPartyPrivacy
	{
		Private,
		Public
	}
	public enum ActivityType
	{
		Playing,
		Streaming,
		Listening,
		Watching
	}
	public enum ActivityActionType
	{
		Join = 1,
		Spectate
	}
	public enum ActivitySupportedPlatformFlags
	{
		Desktop = 1,
		Android = 2,
		iOS = 4
	}
	public enum ActivityJoinRequestReply
	{
		No,
		Yes,
		Ignore
	}
	public enum Status
	{
		Offline,
		Online,
		Idle,
		DoNotDisturb
	}
	public enum RelationshipType
	{
		None,
		Friend,
		Blocked,
		PendingIncoming,
		PendingOutgoing,
		Implicit
	}
	public enum LobbyType
	{
		Private = 1,
		Public
	}
	public enum LobbySearchComparison
	{
		LessThanOrEqual = -2,
		LessThan,
		Equal,
		GreaterThan,
		GreaterThanOrEqual,
		NotEqual
	}
	public enum LobbySearchCast
	{
		String = 1,
		Number
	}
	public enum LobbySearchDistance
	{
		Local,
		Default,
		Extended,
		Global
	}
	public enum KeyVariant
	{
		Normal,
		Right,
		Left
	}
	public enum MouseButton
	{
		Left,
		Middle,
		Right
	}
	public enum EntitlementType
	{
		Purchase = 1,
		PremiumSubscription,
		DeveloperGift,
		TestModePurchase,
		FreePurchase,
		UserGift,
		PremiumPurchase
	}
	public enum SkuType
	{
		Application = 1,
		DLC,
		Consumable,
		Bundle
	}
	public enum InputModeType
	{
		VoiceActivity,
		PushToTalk
	}
	public struct User
	{
		public long Id;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Username;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
		public string Discriminator;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Avatar;

		public bool Bot;
	}
	public struct OAuth2Token
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string AccessToken;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
		public string Scopes;

		public long Expires;
	}
	public struct ImageHandle
	{
		public ImageType Type;

		public long Id;

		public uint Size;

		public static ImageHandle User(long id)
		{
			return User(id, 128u);
		}

		public static ImageHandle User(long id, uint size)
		{
			ImageHandle result = default(ImageHandle);
			result.Type = ImageType.User;
			result.Id = id;
			result.Size = size;
			return result;
		}
	}
	public struct ImageDimensions
	{
		public uint Width;

		public uint Height;
	}
	public struct ActivityTimestamps
	{
		public long Start;

		public long End;
	}
	public struct ActivityAssets
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string LargeImage;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string LargeText;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string SmallImage;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string SmallText;
	}
	public struct PartySize
	{
		public int CurrentSize;

		public int MaxSize;
	}
	public struct ActivityParty
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Id;

		public PartySize Size;

		public ActivityPartyPrivacy Privacy;
	}
	public struct ActivitySecrets
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Match;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Join;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Spectate;
	}
	public struct Activity
	{
		public ActivityType Type;

		public long ApplicationId;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Name;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string State;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Details;

		public ActivityTimestamps Timestamps;

		public ActivityAssets Assets;

		public ActivityParty Party;

		public ActivitySecrets Secrets;

		public bool Instance;

		public uint SupportedPlatforms;
	}
	public struct Presence
	{
		public Status Status;

		public Activity Activity;
	}
	public struct Relationship
	{
		public RelationshipType Type;

		public User User;

		public Presence Presence;
	}
	public struct Lobby
	{
		public long Id;

		public LobbyType Type;

		public long OwnerId;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Secret;

		public uint Capacity;

		public bool Locked;
	}
	public struct ImeUnderline
	{
		public int From;

		public int To;

		public uint Color;

		public uint BackgroundColor;

		public bool Thick;
	}
	public struct Rect
	{
		public int Left;

		public int Top;

		public int Right;

		public int Bottom;
	}
	public struct FileStat
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
		public string Filename;

		public ulong Size;

		public ulong LastModified;
	}
	public struct Entitlement
	{
		public long Id;

		public EntitlementType Type;

		public long SkuId;
	}
	public struct SkuPrice
	{
		public uint Amount;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
		public string Currency;
	}
	public struct Sku
	{
		public long Id;

		public SkuType Type;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Name;

		public SkuPrice Price;
	}
	public struct InputMode
	{
		public InputModeType Type;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Shortcut;
	}
	public struct UserAchievement
	{
		public long UserId;

		public long AchievementId;

		public byte PercentComplete;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
		public string UnlockedAt;
	}
	public struct LobbyTransaction
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetTypeMethod(IntPtr methodsPtr, LobbyType type);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetOwnerMethod(IntPtr methodsPtr, long ownerId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetCapacityMethod(IntPtr methodsPtr, uint capacity);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DeleteMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetLockedMethod(IntPtr methodsPtr, bool locked);

			internal SetTypeMethod SetType;

			internal SetOwnerMethod SetOwner;

			internal SetCapacityMethod SetCapacity;

			internal SetMetadataMethod SetMetadata;

			internal DeleteMetadataMethod DeleteMetadata;

			internal SetLockedMethod SetLocked;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void SetType(LobbyType type)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetType(MethodsPtr, type);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetOwner(long ownerId)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetOwner(MethodsPtr, ownerId);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetCapacity(uint capacity)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetCapacity(MethodsPtr, capacity);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetMetadata(string key, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetMetadata(MethodsPtr, key, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void DeleteMetadata(string key)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.DeleteMetadata(MethodsPtr, key);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetLocked(bool locked)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetLocked(MethodsPtr, locked);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public struct LobbyMemberTransaction
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DeleteMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key);

			internal SetMetadataMethod SetMetadata;

			internal DeleteMetadataMethod DeleteMetadata;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void SetMetadata(string key, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetMetadata(MethodsPtr, key, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void DeleteMetadata(string key)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.DeleteMetadata(MethodsPtr, key);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public struct LobbySearchQuery
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result FilterMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, LobbySearchComparison comparison, LobbySearchCast cast, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SortMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, LobbySearchCast cast, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result LimitMethod(IntPtr methodsPtr, uint limit);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DistanceMethod(IntPtr methodsPtr, LobbySearchDistance distance);

			internal FilterMethod Filter;

			internal SortMethod Sort;

			internal LimitMethod Limit;

			internal DistanceMethod Distance;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void Filter(string key, LobbySearchComparison comparison, LobbySearchCast cast, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Filter(MethodsPtr, key, comparison, cast, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Sort(string key, LobbySearchCast cast, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Sort(MethodsPtr, key, cast, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Limit(uint limit)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Limit(MethodsPtr, limit);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Distance(LobbySearchDistance distance)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Distance(MethodsPtr, distance);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public class ResultException : Exception
	{
		public readonly Result Result;

		public ResultException(Result result)
			: base(result.ToString())
		{
		}
	}
	public class Discord : IDisposable
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DestroyHandler(IntPtr MethodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RunCallbacksMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLogHookCallback(IntPtr ptr, LogLevel level, [MarshalAs(UnmanagedType.LPStr)] string message);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLogHookMethod(IntPtr methodsPtr, LogLevel minLevel, IntPtr callbackData, SetLogHookCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetApplicationManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetUserManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetImageManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetActivityManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetRelationshipManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetLobbyManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetNetworkManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetOverlayManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetStorageManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetStoreManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetVoiceManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetAchievementManagerMethod(IntPtr discordPtr);

			internal DestroyHandler Destroy;

			internal RunCallbacksMethod RunCallbacks;

			internal SetLogHookMethod SetLogHook;

			internal GetApplicationManagerMethod GetApplicationManager;

			internal GetUserManagerMethod GetUserManager;

			internal GetImageManagerMethod GetImageManager;

			internal GetActivityManagerMethod GetActivityManager;

			internal GetRelationshipManagerMethod GetRelationshipManager;

			internal GetLobbyManagerMethod GetLobbyManager;

			internal GetNetworkManagerMethod GetNetworkManager;

			internal GetOverlayManagerMethod GetOverlayManager;

			internal GetStorageManagerMethod GetStorageManager;

			internal GetStoreManagerMethod GetStoreManager;

			internal GetVoiceManagerMethod GetVoiceManager;

			internal GetAchievementManagerMethod GetAchievementManager;
		}

		internal struct FFICreateParams
		{
			internal long ClientId;

			internal ulong Flags;

			internal IntPtr Events;

			internal IntPtr EventData;

			internal IntPtr ApplicationEvents;

			internal uint ApplicationVersion;

			internal IntPtr UserEvents;

			internal uint UserVersion;

			internal IntPtr ImageEvents;

			internal uint ImageVersion;

			internal IntPtr ActivityEvents;

			internal uint ActivityVersion;

			internal IntPtr RelationshipEvents;

			internal uint RelationshipVersion;

			internal IntPtr LobbyEvents;

			internal uint LobbyVersion;

			internal IntPtr NetworkEvents;

			internal uint NetworkVersion;

			internal IntPtr OverlayEvents;

			internal uint OverlayVersion;

			internal IntPtr StorageEvents;

			internal uint StorageVersion;

			internal IntPtr StoreEvents;

			internal uint StoreVersion;

			internal IntPtr VoiceEvents;

			internal uint VoiceVersion;

			internal IntPtr AchievementEvents;

			internal uint AchievementVersion;
		}

		public delegate void SetLogHookHandler(LogLevel level, string message);

		private GCHandle SelfHandle;

		private IntPtr EventsPtr;

		private FFIEvents Events;

		private IntPtr ApplicationEventsPtr;

		private ApplicationManager.FFIEvents ApplicationEvents;

		internal ApplicationManager ApplicationManagerInstance;

		private IntPtr UserEventsPtr;

		private UserManager.FFIEvents UserEvents;

		internal UserManager UserManagerInstance;

		private IntPtr ImageEventsPtr;

		private ImageManager.FFIEvents ImageEvents;

		internal ImageManager ImageManagerInstance;

		private IntPtr ActivityEventsPtr;

		private ActivityManager.FFIEvents ActivityEvents;

		internal ActivityManager ActivityManagerInstance;

		private IntPtr RelationshipEventsPtr;

		private RelationshipManager.FFIEvents RelationshipEvents;

		internal RelationshipManager RelationshipManagerInstance;

		private IntPtr LobbyEventsPtr;

		private LobbyManager.FFIEvents LobbyEvents;

		internal LobbyManager LobbyManagerInstance;

		private IntPtr NetworkEventsPtr;

		private NetworkManager.FFIEvents NetworkEvents;

		internal NetworkManager NetworkManagerInstance;

		private IntPtr OverlayEventsPtr;

		private OverlayManager.FFIEvents OverlayEvents;

		internal OverlayManager OverlayManagerInstance;

		private IntPtr StorageEventsPtr;

		private StorageManager.FFIEvents StorageEvents;

		internal StorageManager StorageManagerInstance;

		private IntPtr StoreEventsPtr;

		private StoreManager.FFIEvents StoreEvents;

		internal StoreManager StoreManagerInstance;

		private IntPtr VoiceEventsPtr;

		private VoiceManager.FFIEvents VoiceEvents;

		internal VoiceManager VoiceManagerInstance;

		private IntPtr AchievementEventsPtr;

		private AchievementManager.FFIEvents AchievementEvents;

		internal AchievementManager AchievementManagerInstance;

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private GCHandle? setLogHook;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		[DllImport("discord_game_sdk", ExactSpelling = true)]
		private static extern Result DiscordCreate(uint version, ref FFICreateParams createParams, out IntPtr manager);

		public Discord(long clientId, ulong flags)
		{
			FFICreateParams createParams = default(FFICreateParams);
			createParams.ClientId = clientId;
			createParams.Flags = flags;
			Events = default(FFIEvents);
			EventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(Events));
			createParams.Events = EventsPtr;
			SelfHandle = GCHandle.Alloc(this);
			createParams.EventData = GCHandle.ToIntPtr(SelfHandle);
			ApplicationEvents = default(ApplicationManager.FFIEvents);
			ApplicationEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ApplicationEvents));
			createParams.ApplicationEvents = ApplicationEventsPtr;
			createParams.ApplicationVersion = 1u;
			UserEvents = default(UserManager.FFIEvents);
			UserEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(UserEvents));
			createParams.UserEvents = UserEventsPtr;
			createParams.UserVersion = 1u;
			ImageEvents = default(ImageManager.FFIEvents);
			ImageEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ImageEvents));
			createParams.ImageEvents = ImageEventsPtr;
			createParams.ImageVersion = 1u;
			ActivityEvents = default(ActivityManager.FFIEvents);
			ActivityEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ActivityEvents));
			createParams.ActivityEvents = ActivityEventsPtr;
			createParams.ActivityVersion = 1u;
			RelationshipEvents = default(RelationshipManager.FFIEvents);
			RelationshipEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(RelationshipEvents));
			createParams.RelationshipEvents = RelationshipEventsPtr;
			createParams.RelationshipVersion = 1u;
			LobbyEvents = default(LobbyManager.FFIEvents);
			LobbyEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(LobbyEvents));
			createParams.LobbyEvents = LobbyEventsPtr;
			createParams.LobbyVersion = 1u;
			NetworkEvents = default(NetworkManager.FFIEvents);
			NetworkEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(NetworkEvents));
			createParams.NetworkEvents = NetworkEventsPtr;
			createParams.NetworkVersion = 1u;
			OverlayEvents = default(OverlayManager.FFIEvents);
			OverlayEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(OverlayEvents));
			createParams.OverlayEvents = OverlayEventsPtr;
			createParams.OverlayVersion = 2u;
			StorageEvents = default(StorageManager.FFIEvents);
			StorageEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(StorageEvents));
			createParams.StorageEvents = StorageEventsPtr;
			createParams.StorageVersion = 1u;
			StoreEvents = default(StoreManager.FFIEvents);
			StoreEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(StoreEvents));
			createParams.StoreEvents = StoreEventsPtr;
			createParams.StoreVersion = 1u;
			VoiceEvents = default(VoiceManager.FFIEvents);
			VoiceEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(VoiceEvents));
			createParams.VoiceEvents = VoiceEventsPtr;
			createParams.VoiceVersion = 1u;
			AchievementEvents = default(AchievementManager.FFIEvents);
			AchievementEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(AchievementEvents));
			createParams.AchievementEvents = AchievementEventsPtr;
			createParams.AchievementVersion = 1u;
			InitEvents(EventsPtr, ref Events);
			Result result = DiscordCreate(3u, ref createParams, out MethodsPtr);
			if (result != 0)
			{
				Dispose();
				throw new ResultException(result);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public void Dispose()
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Methods.Destroy(MethodsPtr);
			}
			SelfHandle.Free();
			Marshal.FreeHGlobal(EventsPtr);
			Marshal.FreeHGlobal(ApplicationEventsPtr);
			Marshal.FreeHGlobal(UserEventsPtr);
			Marshal.FreeHGlobal(ImageEventsPtr);
			Marshal.FreeHGlobal(ActivityEventsPtr);
			Marshal.FreeHGlobal(RelationshipEventsPtr);
			Marshal.FreeHGlobal(LobbyEventsPtr);
			Marshal.FreeHGlobal(NetworkEventsPtr);
			Marshal.FreeHGlobal(OverlayEventsPtr);
			Marshal.FreeHGlobal(StorageEventsPtr);
			Marshal.FreeHGlobal(StoreEventsPtr);
			Marshal.FreeHGlobal(VoiceEventsPtr);
			Marshal.FreeHGlobal(AchievementEventsPtr);
			if (setLogHook.HasValue)
			{
				setLogHook.Value.Free();
			}
		}

		public void RunCallbacks()
		{
			Result result = Methods.RunCallbacks(MethodsPtr);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void SetLogHookCallbackImpl(IntPtr ptr, LogLevel level, string message)
		{
			SetLogHookHandler setLogHookHandler = (SetLogHookHandler)GCHandle.FromIntPtr(ptr).Target;
			setLogHookHandler(level, message);
		}

		public void SetLogHook(LogLevel minLevel, SetLogHookHandler callback)
		{
			if (setLogHook.HasValue)
			{
				setLogHook.Value.Free();
			}
			setLogHook = GCHandle.Alloc(callback);
			Methods.SetLogHook(MethodsPtr, minLevel, GCHandle.ToIntPtr(setLogHook.Value), SetLogHookCallbackImpl);
		}

		public ApplicationManager GetApplicationManager()
		{
			if (ApplicationManagerInstance == null)
			{
				ApplicationManagerInstance = new ApplicationManager(Methods.GetApplicationManager(MethodsPtr), ApplicationEventsPtr, ref ApplicationEvents);
			}
			return ApplicationManagerInstance;
		}

		public UserManager GetUserManager()
		{
			if (UserManagerInstance == null)
			{
				UserManagerInstance = new UserManager(Methods.GetUserManager(MethodsPtr), UserEventsPtr, ref UserEvents);
			}
			return UserManagerInstance;
		}

		public ImageManager GetImageManager()
		{
			if (ImageManagerInstance == null)
			{
				ImageManagerInstance = new ImageManager(Methods.GetImageManager(MethodsPtr), ImageEventsPtr, ref ImageEvents);
			}
			return ImageManagerInstance;
		}

		public ActivityManager GetActivityManager()
		{
			if (ActivityManagerInstance == null)
			{
				ActivityManagerInstance = new ActivityManager(Methods.GetActivityManager(MethodsPtr), ActivityEventsPtr, ref ActivityEvents);
			}
			return ActivityManagerInstance;
		}

		public RelationshipManager GetRelationshipManager()
		{
			if (RelationshipManagerInstance == null)
			{
				RelationshipManagerInstance = new RelationshipManager(Methods.GetRelationshipManager(MethodsPtr), RelationshipEventsPtr, ref RelationshipEvents);
			}
			return RelationshipManagerInstance;
		}

		public LobbyManager GetLobbyManager()
		{
			if (LobbyManagerInstance == null)
			{
				LobbyManagerInstance = new LobbyManager(Methods.GetLobbyManager(MethodsPtr), LobbyEventsPtr, ref LobbyEvents);
			}
			return LobbyManagerInstance;
		}

		public NetworkManager GetNetworkManager()
		{
			if (NetworkManagerInstance == null)
			{
				NetworkManagerInstance = new NetworkManager(Methods.GetNetworkManager(MethodsPtr), NetworkEventsPtr, ref NetworkEvents);
			}
			return NetworkManagerInstance;
		}

		public OverlayManager GetOverlayManager()
		{
			if (OverlayManagerInstance == null)
			{
				OverlayManagerInstance = new OverlayManager(Methods.GetOverlayManager(MethodsPtr), OverlayEventsPtr, ref OverlayEvents);
			}
			return OverlayManagerInstance;
		}

		public StorageManager GetStorageManager()
		{
			if (StorageManagerInstance == null)
			{
				StorageManagerInstance = new StorageManager(Methods.GetStorageManager(MethodsPtr), StorageEventsPtr, ref StorageEvents);
			}
			return StorageManagerInstance;
		}

		public StoreManager GetStoreManager()
		{
			if (StoreManagerInstance == null)
			{
				StoreManagerInstance = new StoreManager(Methods.GetStoreManager(MethodsPtr), StoreEventsPtr, ref StoreEvents);
			}
			return StoreManagerInstance;
		}

		public VoiceManager GetVoiceManager()
		{
			if (VoiceManagerInstance == null)
			{
				VoiceManagerInstance = new VoiceManager(Methods.GetVoiceManager(MethodsPtr), VoiceEventsPtr, ref VoiceEvents);
			}
			return VoiceManagerInstance;
		}

		public AchievementManager GetAchievementManager()
		{
			if (AchievementManagerInstance == null)
			{
				AchievementManagerInstance = new AchievementManager(Methods.GetAchievementManager(MethodsPtr), AchievementEventsPtr, ref AchievementEvents);
			}
			return AchievementManagerInstance;
		}
	}
	internal class MonoPInvokeCallbackAttribute : Attribute
	{
	}
	public class ApplicationManager
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ValidateOrExitCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ValidateOrExitMethod(IntPtr methodsPtr, IntPtr callbackData, ValidateOrExitCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetCurrentLocaleMethod(IntPtr methodsPtr, StringBuilder locale);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetCurrentBranchMethod(IntPtr methodsPtr, StringBuilder branch);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetOAuth2TokenCallback(IntPtr ptr, Result result, ref OAuth2Token oauth2Token);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetOAuth2TokenMethod(IntPtr methodsPtr, IntPtr callbackData, GetOAuth2TokenCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetTicketCallback(IntPtr ptr, Result result, [MarshalAs(UnmanagedType.LPStr)] ref string data);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetTicketMethod(IntPtr methodsPtr, IntPtr callbackData, GetTicketCallback callback);

			internal ValidateOrExitMethod ValidateOrExit;

			internal GetCurrentLocaleMethod GetCurrentLocale;

			internal GetCurrentBranchMethod GetCurrentBranch;

			internal GetOAuth2TokenMethod GetOAuth2Token;

			internal GetTicketMethod GetTicket;
		}

		public delegate void ValidateOrExitHandler(Result result);

		public delegate void GetOAuth2TokenHandler(Result result, ref OAuth2Token oauth2Token);

		public delegate void GetTicketHandler(Result result, ref string data);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		internal ApplicationManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static void ValidateOrExitCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ValidateOrExitHandler validateOrExitHandler = (ValidateOrExitHandler)gCHandle.Target;
			gCHandle.Free();
			validateOrExitHandler(result);
		}

		public void ValidateOrExit(ValidateOrExitHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ValidateOrExit(MethodsPtr, GCHandle.ToIntPtr(value), ValidateOrExitCallbackImpl);
		}

		public string GetCurrentLocale()
		{
			StringBuilder stringBuilder = new StringBuilder(128);
			Methods.GetCurrentLocale(MethodsPtr, stringBuilder);
			return stringBuilder.ToString();
		}

		public string GetCurrentBranch()
		{
			StringBuilder stringBuilder = new StringBuilder(4096);
			Methods.GetCurrentBranch(MethodsPtr, stringBuilder);
			return stringBuilder.ToString();
		}

		[MonoPInvokeCallback]
		private static void GetOAuth2TokenCallbackImpl(IntPtr ptr, Result result, ref OAuth2Token oauth2Token)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetOAuth2TokenHandler getOAuth2TokenHandler = (GetOAuth2TokenHandler)gCHandle.Target;
			gCHandle.Free();
			getOAuth2TokenHandler(result, ref oauth2Token);
		}

		public void GetOAuth2Token(GetOAuth2TokenHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetOAuth2Token(MethodsPtr, GCHandle.ToIntPtr(value), GetOAuth2TokenCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void GetTicketCallbackImpl(IntPtr ptr, Result result, ref string data)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetTicketHandler getTicketHandler = (GetTicketHandler)gCHandle.Target;
			gCHandle.Free();
			getTicketHandler(result, ref data);
		}

		public void GetTicket(GetTicketHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetTicket(MethodsPtr, GCHandle.ToIntPtr(value), GetTicketCallbackImpl);
		}
	}
	public class UserManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CurrentUserUpdateHandler(IntPtr ptr);

			internal CurrentUserUpdateHandler OnCurrentUserUpdate;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetCurrentUserMethod(IntPtr methodsPtr, ref User currentUser);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetUserCallback(IntPtr ptr, Result result, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetUserMethod(IntPtr methodsPtr, long userId, IntPtr callbackData, GetUserCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetCurrentUserPremiumTypeMethod(IntPtr methodsPtr, ref PremiumType premiumType);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result CurrentUserHasFlagMethod(IntPtr methodsPtr, UserFlag flag, ref bool hasFlag);

			internal GetCurrentUserMethod GetCurrentUser;

			internal GetUserMethod GetUser;

			internal GetCurrentUserPremiumTypeMethod GetCurrentUserPremiumType;

			internal CurrentUserHasFlagMethod CurrentUserHasFlag;
		}

		public delegate void GetUserHandler(Result result, ref User user);

		public delegate void CurrentUserUpdateHandler();

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event CurrentUserUpdateHandler OnCurrentUserUpdate;

		internal UserManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnCurrentUserUpdate = OnCurrentUserUpdateImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public User GetCurrentUser()
		{
			User currentUser = default(User);
			Result result = Methods.GetCurrentUser(MethodsPtr, ref currentUser);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return currentUser;
		}

		[MonoPInvokeCallback]
		private static void GetUserCallbackImpl(IntPtr ptr, Result result, ref User user)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetUserHandler getUserHandler = (GetUserHandler)gCHandle.Target;
			gCHandle.Free();
			getUserHandler(result, ref user);
		}

		public void GetUser(long userId, GetUserHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetUser(MethodsPtr, userId, GCHandle.ToIntPtr(value), GetUserCallbackImpl);
		}

		public PremiumType GetCurrentUserPremiumType()
		{
			PremiumType premiumType = PremiumType.None;
			Result result = Methods.GetCurrentUserPremiumType(MethodsPtr, ref premiumType);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return premiumType;
		}

		public bool CurrentUserHasFlag(UserFlag flag)
		{
			bool hasFlag = false;
			Result result = Methods.CurrentUserHasFlag(MethodsPtr, flag, ref hasFlag);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return hasFlag;
		}

		[MonoPInvokeCallback]
		private static void OnCurrentUserUpdateImpl(IntPtr ptr)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.UserManagerInstance.OnCurrentUserUpdate != null)
			{
				discord.UserManagerInstance.OnCurrentUserUpdate();
			}
		}
	}
	public class ImageManager
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FetchCallback(IntPtr ptr, Result result, ImageHandle handleResult);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FetchMethod(IntPtr methodsPtr, ImageHandle handle, bool refresh, IntPtr callbackData, FetchCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetDimensionsMethod(IntPtr methodsPtr, ImageHandle handle, ref ImageDimensions dimensions);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetDataMethod(IntPtr methodsPtr, ImageHandle handle, byte[] data, int dataLen);

			internal FetchMethod Fetch;

			internal GetDimensionsMethod GetDimensions;

			internal GetDataMethod GetData;
		}

		public delegate void FetchHandler(Result result, ImageHandle handleResult);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		internal ImageManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static void FetchCallbackImpl(IntPtr ptr, Result result, ImageHandle handleResult)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			FetchHandler fetchHandler = (FetchHandler)gCHandle.Target;
			gCHandle.Free();
			fetchHandler(result, handleResult);
		}

		public void Fetch(ImageHandle handle, bool refresh, FetchHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.Fetch(MethodsPtr, handle, refresh, GCHandle.ToIntPtr(value), FetchCallbackImpl);
		}

		public ImageDimensions GetDimensions(ImageHandle handle)
		{
			ImageDimensions dimensions = default(ImageDimensions);
			Result result = Methods.GetDimensions(MethodsPtr, handle, ref dimensions);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return dimensions;
		}

		public void GetData(ImageHandle handle, byte[] data)
		{
			Result result = Methods.GetData(MethodsPtr, handle, data, data.Length);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void Fetch(ImageHandle handle, FetchHandler callback)
		{
			Fetch(handle, refresh: false, callback);
		}

		public byte[] GetData(ImageHandle handle)
		{
			ImageDimensions dimensions = GetDimensions(handle);
			byte[] array = new byte[dimensions.Width * dimensions.Height * 4];
			GetData(handle, array);
			return array;
		}
	}
	public class RelationshipManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void RefreshHandler(IntPtr ptr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void RelationshipUpdateHandler(IntPtr ptr, ref Relationship relationship);

			internal RefreshHandler OnRefresh;

			internal RelationshipUpdateHandler OnRelationshipUpdate;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate bool FilterCallback(IntPtr ptr, ref Relationship relationship);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FilterMethod(IntPtr methodsPtr, IntPtr callbackData, FilterCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result CountMethod(IntPtr methodsPtr, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMethod(IntPtr methodsPtr, long userId, ref Relationship relationship);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetAtMethod(IntPtr methodsPtr, uint index, ref Relationship relationship);

			internal FilterMethod Filter;

			internal CountMethod Count;

			internal GetMethod Get;

			internal GetAtMethod GetAt;
		}

		public delegate bool FilterHandler(ref Relationship relationship);

		public delegate void RefreshHandler();

		public delegate void RelationshipUpdateHandler(ref Relationship relationship);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event RefreshHandler OnRefresh;

		public event RelationshipUpdateHandler OnRelationshipUpdate;

		internal RelationshipManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnRefresh = OnRefreshImpl;
			events.OnRelationshipUpdate = OnRelationshipUpdateImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static bool FilterCallbackImpl(IntPtr ptr, ref Relationship relationship)
		{
			FilterHandler filterHandler = (FilterHandler)GCHandle.FromIntPtr(ptr).Target;
			return filterHandler(ref relationship);
		}

		public void Filter(FilterHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.Filter(MethodsPtr, GCHandle.ToIntPtr(value), FilterCallbackImpl);
			value.Free();
		}

		public int Count()
		{
			int count = 0;
			Result result = Methods.Count(MethodsPtr, ref count);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return count;
		}

		public Relationship Get(long userId)
		{
			Relationship relationship = default(Relationship);
			Result result = Methods.Get(MethodsPtr, userId, ref relationship);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return relationship;
		}

		public Relationship GetAt(uint index)
		{
			Relationship relationship = default(Relationship);
			Result result = Methods.GetAt(MethodsPtr, index, ref relationship);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return relationship;
		}

		[MonoPInvokeCallback]
		private static void OnRefreshImpl(IntPtr ptr)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.RelationshipManagerInstance.OnRefresh != null)
			{
				discord.RelationshipManagerInstance.OnRefresh();
			}
		}

		[MonoPInvokeCallback]
		private static void OnRelationshipUpdateImpl(IntPtr ptr, ref Relationship relationship)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.RelationshipManagerInstance.OnRelationshipUpdate != null)
			{
				discord.RelationshipManagerInstance.OnRelationshipUpdate(ref relationship);
			}
		}
	}
	public class LobbyManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyUpdateHandler(IntPtr ptr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyDeleteHandler(IntPtr ptr, long lobbyId, uint reason);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberConnectHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberUpdateHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberDisconnectHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyMessageHandler(IntPtr ptr, long lobbyId, long userId, IntPtr dataPtr, int dataLen);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SpeakingHandler(IntPtr ptr, long lobbyId, long userId, bool speaking);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void NetworkMessageHandler(IntPtr ptr, long lobbyId, long userId, byte channelId, IntPtr dataPtr, int dataLen);

			internal LobbyUpdateHandler OnLobbyUpdate;

			internal LobbyDeleteHandler OnLobbyDelete;

			internal MemberConnectHandler OnMemberConnect;

			internal MemberUpdateHandler OnMemberUpdate;

			internal MemberDisconnectHandler OnMemberDisconnect;

			internal LobbyMessageHandler OnLobbyMessage;

			internal SpeakingHandler OnSpeaking;

			internal NetworkMessageHandler OnNetworkMessage;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyCreateTransactionMethod(IntPtr methodsPtr, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyUpdateTransactionMethod(IntPtr methodsPtr, long lobbyId, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUpdateTransactionMethod(IntPtr methodsPtr, long lobbyId, long userId, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CreateLobbyCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CreateLobbyMethod(IntPtr methodsPtr, IntPtr transaction, IntPtr callbackData, CreateLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr transaction, IntPtr callbackData, UpdateLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DeleteLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DeleteLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DeleteLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyMethod(IntPtr methodsPtr, long lobbyId, [MarshalAs(UnmanagedType.LPStr)] string secret, IntPtr callbackData, ConnectLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyWithActivitySecretCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyWithActivitySecretMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string activitySecret, IntPtr callbackData, ConnectLobbyWithActivitySecretCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DisconnectLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMethod(IntPtr methodsPtr, long lobbyId, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyActivitySecretMethod(IntPtr methodsPtr, long lobbyId, StringBuilder secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMetadataValueMethod(IntPtr methodsPtr, long lobbyId, [MarshalAs(UnmanagedType.LPStr)] string key, StringBuilder value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMetadataKeyMethod(IntPtr methodsPtr, long lobbyId, int index, StringBuilder key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result LobbyMetadataCountMethod(IntPtr methodsPtr, long lobbyId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result MemberCountMethod(IntPtr methodsPtr, long lobbyId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUserIdMethod(IntPtr methodsPtr, long lobbyId, int index, ref long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUserMethod(IntPtr methodsPtr, long lobbyId, long userId, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberMetadataValueMethod(IntPtr methodsPtr, long lobbyId, long userId, [MarshalAs(UnmanagedType.LPStr)] string key, StringBuilder value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberMetadataKeyMethod(IntPtr methodsPtr, long lobbyId, long userId, int index, StringBuilder key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result MemberMetadataCountMethod(IntPtr methodsPtr, long lobbyId, long userId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateMemberCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateMemberMethod(IntPtr methodsPtr, long lobbyId, long userId, IntPtr transaction, IntPtr callbackData, UpdateMemberCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendLobbyMessageCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendLobbyMessageMethod(IntPtr methodsPtr, long lobbyId, byte[] data, int dataLen, IntPtr callbackData, SendLobbyMessageCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetSearchQueryMethod(IntPtr methodsPtr, ref IntPtr query);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SearchCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SearchMethod(IntPtr methodsPtr, IntPtr query, IntPtr callbackData, SearchCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyCountMethod(IntPtr methodsPtr, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyIdMethod(IntPtr methodsPtr, int index, ref long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectVoiceCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectVoiceMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, ConnectVoiceCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectVoiceCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectVoiceMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DisconnectVoiceCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result ConnectNetworkMethod(IntPtr methodsPtr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DisconnectNetworkMethod(IntPtr methodsPtr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result FlushNetworkMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result OpenNetworkChannelMethod(IntPtr methodsPtr, long lobbyId, byte channelId, bool reliable);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SendNetworkMessageMethod(IntPtr methodsPtr, long lobbyId, long userId, byte channelId, byte[] data, int dataLen);

			internal GetLobbyCreateTransactionMethod GetLobbyCreateTransaction;

			internal GetLobbyUpdateTransactionMethod GetLobbyUpdateTransaction;

			internal GetMemberUpdateTransactionMethod GetMemberUpdateTransaction;

			internal CreateLobbyMethod CreateLobby;

			internal UpdateLobbyMethod UpdateLobby;

			internal DeleteLobbyMethod DeleteLobby;

			internal ConnectLobbyMethod ConnectLobby;

			internal ConnectLobbyWithActivitySecretMethod ConnectLobbyWithActivitySecret;

			internal DisconnectLobbyMethod DisconnectLobby;

			internal GetLobbyMethod GetLobby;

			internal GetLobbyActivitySecretMethod GetLobbyActivitySecret;

			internal GetLobbyMetadataValueMethod GetLobbyMetadataValue;

			internal GetLobbyMetadataKeyMethod GetLobbyMetadataKey;

			internal LobbyMetadataCountMethod LobbyMetadataCount;

			internal MemberCountMethod MemberCount;

			internal GetMemberUserIdMethod GetMemberUserId;

			internal GetMemberUserMethod GetMemberUser;

			internal GetMemberMetadataValueMethod GetMemberMetadataValue;

			internal GetMemberMetadataKeyMethod GetMemberMetadataKey;

			internal MemberMetadataCountMethod MemberMetadataCount;

			internal UpdateMemberMethod UpdateMember;

			internal SendLobbyMessageMethod SendLobbyMessage;

			internal GetSearchQueryMethod GetSearchQuery;

			internal SearchMethod Search;

			internal LobbyCountMethod LobbyCount;

			internal GetLobbyIdMethod GetLobbyId;

			internal ConnectVoiceMethod ConnectVoice;

			internal DisconnectVoiceMethod DisconnectVoice;

			internal ConnectNetworkMethod ConnectNetwork;

			internal DisconnectNetworkMethod DisconnectNetwork;

			internal FlushNetworkMethod FlushNetwork;

			internal OpenNetworkChannelMethod OpenNetworkChannel;

			internal SendNetworkMessageMethod SendNetworkMessage;
		}

		public delegate void CreateLobbyHandler(Result result, ref Lobby lobby);

		public delegate void UpdateLobbyHandler(Result result);

		public delegate void DeleteLobbyHandler(Result result);

		public delegate void ConnectLobbyHandler(Result result, ref Lobby lobby);

		public delegate void ConnectLobbyWithActivitySecretHandler(Result result, ref Lobby lobby);

		public delegate void DisconnectLobbyHandler(Result result);

		public delegate void UpdateMemberHandler(Result result);

		public delegate void SendLobbyMessageHandler(Result result);

		public delegate void SearchHandler(Result result);

		public delegate void ConnectVoiceHandler(Result result);

		public delegate void DisconnectVoiceHandler(Result result);

		public delegate void LobbyUpdateHandler(long lobbyId);

		public delegate void LobbyDeleteHandler(long lobbyId, uint reason);

		public delegate void MemberConnectHandler(long lobbyId, long userId);

		public delegate void MemberUpdateHandler(long lobbyId, long userId);

		public delegate void MemberDisconnectHandler(long lobbyId, long userId);

		public delegate void LobbyMessageHandler(long lobbyId, long userId, byte[] data);

		public delegate void SpeakingHandler(long lobbyId, long userId, bool speaking);

		public delegate void NetworkMessageHandler(long lobbyId, long userId, byte channelId, byte[] data);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event LobbyUpdateHandler OnLobbyUpdate;

		public event LobbyDeleteHandler OnLobbyDelete;

		public event MemberConnectHandler OnMemberConnect;

		public event MemberUpdateHandler OnMemberUpdate;

		public event MemberDisconnectHandler OnMemberDisconnect;

		public event LobbyMessageHandler OnLobbyMessage;

		public event SpeakingHandler OnSpeaking;

		public event NetworkMessageHandler OnNetworkMessage;

		internal LobbyManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnLobbyUpdate = OnLobbyUpdateImpl;
			events.OnLobbyDelete = OnLobbyDeleteImpl;
			events.OnMemberConnect = OnMemberConnectImpl;
			events.OnMemberUpdate = OnMemberUpdateImpl;
			events.OnMemberDisconnect = OnMemberDisconnectImpl;
			events.OnLobbyMessage = OnLobbyMessageImpl;
			events.OnSpeaking = OnSpeakingImpl;
			events.OnNetworkMessage = OnNetworkMessageImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public LobbyTransaction GetLobbyCreateTransaction()
		{
			LobbyTransaction result = default(LobbyTransaction);
			Result result2 = Methods.GetLobbyCreateTransaction(MethodsPtr, ref result.MethodsPtr);
			if (result2 != 0)
			{
				throw new ResultException(result2);
			}
			return result;
		}

		public LobbyTransaction GetLobbyUpdateTransaction(long lobbyId)
		{
			LobbyTransaction result = default(LobbyTransaction);
			Result result2 = Methods.GetLobbyUpdateTransaction(MethodsPtr, lobbyId, ref result.MethodsPtr);
			if (result2 != 0)
			{
				throw new ResultException(result2);
			}
			return result;
		}

		public LobbyMemberTransaction GetMemberUpdateTransaction(long lobbyId, long userId)
		{
			LobbyMemberTransaction result = default(LobbyMemberTransaction);
			Result result2 = Methods.GetMemberUpdateTransaction(MethodsPtr, lobbyId, userId, ref result.MethodsPtr);
			if (result2 != 0)
			{
				throw new ResultException(result2);
			}
			return result;
		}

		[MonoPInvokeCallback]
		private static void CreateLobbyCallbackImpl(IntPtr ptr, Result result, ref Lobby lobby)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			CreateLobbyHandler createLobbyHandler = (CreateLobbyHandler)gCHandle.Target;
			gCHandle.Free();
			createLobbyHandler(result, ref lobby);
		}

		public void CreateLobby(LobbyTransaction transaction, CreateLobbyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.CreateLobby(MethodsPtr, transaction.MethodsPtr, GCHandle.ToIntPtr(value), CreateLobbyCallbackImpl);
			transaction.MethodsPtr = IntPtr.Zero;
		}

		[MonoPInvokeCallback]
		private static void UpdateLobbyCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			UpdateLobbyHandler updateLobbyHandler = (UpdateLobbyHandler)gCHandle.Target;
			gCHandle.Free();
			updateLobbyHandler(result);
		}

		public void UpdateLobby(long lobbyId, LobbyTransaction transaction, UpdateLobbyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.UpdateLobby(MethodsPtr, lobbyId, transaction.MethodsPtr, GCHandle.ToIntPtr(value), UpdateLobbyCallbackImpl);
			transaction.MethodsPtr = IntPtr.Zero;
		}

		[MonoPInvokeCallback]
		private static void DeleteLobbyCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			DeleteLobbyHandler deleteLobbyHandler = (DeleteLobbyHandler)gCHandle.Target;
			gCHandle.Free();
			deleteLobbyHandler(result);
		}

		public void DeleteLobby(long lobbyId, DeleteLobbyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.DeleteLobby(MethodsPtr, lobbyId, GCHandle.ToIntPtr(value), DeleteLobbyCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void ConnectLobbyCallbackImpl(IntPtr ptr, Result result, ref Lobby lobby)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ConnectLobbyHandler connectLobbyHandler = (ConnectLobbyHandler)gCHandle.Target;
			gCHandle.Free();
			connectLobbyHandler(result, ref lobby);
		}

		public void ConnectLobby(long lobbyId, string secret, ConnectLobbyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ConnectLobby(MethodsPtr, lobbyId, secret, GCHandle.ToIntPtr(value), ConnectLobbyCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void ConnectLobbyWithActivitySecretCallbackImpl(IntPtr ptr, Result result, ref Lobby lobby)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ConnectLobbyWithActivitySecretHandler connectLobbyWithActivitySecretHandler = (ConnectLobbyWithActivitySecretHandler)gCHandle.Target;
			gCHandle.Free();
			connectLobbyWithActivitySecretHandler(result, ref lobby);
		}

		public void ConnectLobbyWithActivitySecret(string activitySecret, ConnectLobbyWithActivitySecretHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ConnectLobbyWithActivitySecret(MethodsPtr, activitySecret, GCHandle.ToIntPtr(value), ConnectLobbyWithActivitySecretCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void DisconnectLobbyCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			DisconnectLobbyHandler disconnectLobbyHandler = (DisconnectLobbyHandler)gCHandle.Target;
			gCHandle.Free();
			disconnectLobbyHandler(result);
		}

		public void DisconnectLobby(long lobbyId, DisconnectLobbyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.DisconnectLobby(MethodsPtr, lobbyId, GCHandle.ToIntPtr(value), DisconnectLobbyCallbackImpl);
		}

		public Lobby GetLobby(long lobbyId)
		{
			Lobby lobby = default(Lobby);
			Result result = Methods.GetLobby(MethodsPtr, lobbyId, ref lobby);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return lobby;
		}

		public string GetLobbyActivitySecret(long lobbyId)
		{
			StringBuilder stringBuilder = new StringBuilder(128);
			Result result = Methods.GetLobbyActivitySecret(MethodsPtr, lobbyId, stringBuilder);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return stringBuilder.ToString();
		}

		public string GetLobbyMetadataValue(long lobbyId, string key)
		{
			StringBuilder stringBuilder = new StringBuilder(4096);
			Result result = Methods.GetLobbyMetadataValue(MethodsPtr, lobbyId, key, stringBuilder);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return stringBuilder.ToString();
		}

		public string GetLobbyMetadataKey(long lobbyId, int index)
		{
			StringBuilder stringBuilder = new StringBuilder(256);
			Result result = Methods.GetLobbyMetadataKey(MethodsPtr, lobbyId, index, stringBuilder);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return stringBuilder.ToString();
		}

		public int LobbyMetadataCount(long lobbyId)
		{
			int count = 0;
			Result result = Methods.LobbyMetadataCount(MethodsPtr, lobbyId, ref count);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return count;
		}

		public int MemberCount(long lobbyId)
		{
			int count = 0;
			Result result = Methods.MemberCount(MethodsPtr, lobbyId, ref count);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return count;
		}

		public long GetMemberUserId(long lobbyId, int index)
		{
			long userId = 0L;
			Result result = Methods.GetMemberUserId(MethodsPtr, lobbyId, index, ref userId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return userId;
		}

		public User GetMemberUser(long lobbyId, long userId)
		{
			User user = default(User);
			Result result = Methods.GetMemberUser(MethodsPtr, lobbyId, userId, ref user);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return user;
		}

		public string GetMemberMetadataValue(long lobbyId, long userId, string key)
		{
			StringBuilder stringBuilder = new StringBuilder(4096);
			Result result = Methods.GetMemberMetadataValue(MethodsPtr, lobbyId, userId, key, stringBuilder);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return stringBuilder.ToString();
		}

		public string GetMemberMetadataKey(long lobbyId, long userId, int index)
		{
			StringBuilder stringBuilder = new StringBuilder(256);
			Result result = Methods.GetMemberMetadataKey(MethodsPtr, lobbyId, userId, index, stringBuilder);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return stringBuilder.ToString();
		}

		public int MemberMetadataCount(long lobbyId, long userId)
		{
			int count = 0;
			Result result = Methods.MemberMetadataCount(MethodsPtr, lobbyId, userId, ref count);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return count;
		}

		[MonoPInvokeCallback]
		private static void UpdateMemberCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			UpdateMemberHandler updateMemberHandler = (UpdateMemberHandler)gCHandle.Target;
			gCHandle.Free();
			updateMemberHandler(result);
		}

		public void UpdateMember(long lobbyId, long userId, LobbyMemberTransaction transaction, UpdateMemberHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.UpdateMember(MethodsPtr, lobbyId, userId, transaction.MethodsPtr, GCHandle.ToIntPtr(value), UpdateMemberCallbackImpl);
			transaction.MethodsPtr = IntPtr.Zero;
		}

		[MonoPInvokeCallback]
		private static void SendLobbyMessageCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SendLobbyMessageHandler sendLobbyMessageHandler = (SendLobbyMessageHandler)gCHandle.Target;
			gCHandle.Free();
			sendLobbyMessageHandler(result);
		}

		public void SendLobbyMessage(long lobbyId, byte[] data, SendLobbyMessageHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SendLobbyMessage(MethodsPtr, lobbyId, data, data.Length, GCHandle.ToIntPtr(value), SendLobbyMessageCallbackImpl);
		}

		public LobbySearchQuery GetSearchQuery()
		{
			LobbySearchQuery result = default(LobbySearchQuery);
			Result result2 = Methods.GetSearchQuery(MethodsPtr, ref result.MethodsPtr);
			if (result2 != 0)
			{
				throw new ResultException(result2);
			}
			return result;
		}

		[MonoPInvokeCallback]
		private static void SearchCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SearchHandler searchHandler = (SearchHandler)gCHandle.Target;
			gCHandle.Free();
			searchHandler(result);
		}

		public void Search(LobbySearchQuery query, SearchHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.Search(MethodsPtr, query.MethodsPtr, GCHandle.ToIntPtr(value), SearchCallbackImpl);
			query.MethodsPtr = IntPtr.Zero;
		}

		public int LobbyCount()
		{
			int count = 0;
			Methods.LobbyCount(MethodsPtr, ref count);
			return count;
		}

		public long GetLobbyId(int index)
		{
			long lobbyId = 0L;
			Result result = Methods.GetLobbyId(MethodsPtr, index, ref lobbyId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return lobbyId;
		}

		[MonoPInvokeCallback]
		private static void ConnectVoiceCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ConnectVoiceHandler connectVoiceHandler = (ConnectVoiceHandler)gCHandle.Target;
			gCHandle.Free();
			connectVoiceHandler(result);
		}

		public void ConnectVoice(long lobbyId, ConnectVoiceHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ConnectVoice(MethodsPtr, lobbyId, GCHandle.ToIntPtr(value), ConnectVoiceCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void DisconnectVoiceCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			DisconnectVoiceHandler disconnectVoiceHandler = (DisconnectVoiceHandler)gCHandle.Target;
			gCHandle.Free();
			disconnectVoiceHandler(result);
		}

		public void DisconnectVoice(long lobbyId, DisconnectVoiceHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.DisconnectVoice(MethodsPtr, lobbyId, GCHandle.ToIntPtr(value), DisconnectVoiceCallbackImpl);
		}

		public void ConnectNetwork(long lobbyId)
		{
			Result result = Methods.ConnectNetwork(MethodsPtr, lobbyId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void DisconnectNetwork(long lobbyId)
		{
			Result result = Methods.DisconnectNetwork(MethodsPtr, lobbyId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void FlushNetwork()
		{
			Result result = Methods.FlushNetwork(MethodsPtr);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void OpenNetworkChannel(long lobbyId, byte channelId, bool reliable)
		{
			Result result = Methods.OpenNetworkChannel(MethodsPtr, lobbyId, channelId, reliable);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void SendNetworkMessage(long lobbyId, long userId, byte channelId, byte[] data)
		{
			Result result = Methods.SendNetworkMessage(MethodsPtr, lobbyId, userId, channelId, data, data.Length);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void OnLobbyUpdateImpl(IntPtr ptr, long lobbyId)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnLobbyUpdate != null)
			{
				discord.LobbyManagerInstance.OnLobbyUpdate(lobbyId);
			}
		}

		[MonoPInvokeCallback]
		private static void OnLobbyDeleteImpl(IntPtr ptr, long lobbyId, uint reason)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnLobbyDelete != null)
			{
				discord.LobbyManagerInstance.OnLobbyDelete(lobbyId, reason);
			}
		}

		[MonoPInvokeCallback]
		private static void OnMemberConnectImpl(IntPtr ptr, long lobbyId, long userId)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnMemberConnect != null)
			{
				discord.LobbyManagerInstance.OnMemberConnect(lobbyId, userId);
			}
		}

		[MonoPInvokeCallback]
		private static void OnMemberUpdateImpl(IntPtr ptr, long lobbyId, long userId)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnMemberUpdate != null)
			{
				discord.LobbyManagerInstance.OnMemberUpdate(lobbyId, userId);
			}
		}

		[MonoPInvokeCallback]
		private static void OnMemberDisconnectImpl(IntPtr ptr, long lobbyId, long userId)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnMemberDisconnect != null)
			{
				discord.LobbyManagerInstance.OnMemberDisconnect(lobbyId, userId);
			}
		}

		[MonoPInvokeCallback]
		private static void OnLobbyMessageImpl(IntPtr ptr, long lobbyId, long userId, IntPtr dataPtr, int dataLen)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnLobbyMessage != null)
			{
				byte[] array = new byte[dataLen];
				Marshal.Copy(dataPtr, array, 0, dataLen);
				discord.LobbyManagerInstance.OnLobbyMessage(lobbyId, userId, array);
			}
		}

		[MonoPInvokeCallback]
		private static void OnSpeakingImpl(IntPtr ptr, long lobbyId, long userId, bool speaking)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnSpeaking != null)
			{
				discord.LobbyManagerInstance.OnSpeaking(lobbyId, userId, speaking);
			}
		}

		[MonoPInvokeCallback]
		private static void OnNetworkMessageImpl(IntPtr ptr, long lobbyId, long userId, byte channelId, IntPtr dataPtr, int dataLen)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.LobbyManagerInstance.OnNetworkMessage != null)
			{
				byte[] array = new byte[dataLen];
				Marshal.Copy(dataPtr, array, 0, dataLen);
				discord.LobbyManagerInstance.OnNetworkMessage(lobbyId, userId, channelId, array);
			}
		}

		public IEnumerable<User> GetMemberUsers(long lobbyID)
		{
			int num = MemberCount(lobbyID);
			List<User> list = new List<User>();
			for (int i = 0; i < num; i++)
			{
				list.Add(GetMemberUser(lobbyID, GetMemberUserId(lobbyID, i)));
			}
			return list;
		}

		public void SendLobbyMessage(long lobbyID, string data, SendLobbyMessageHandler handler)
		{
			SendLobbyMessage(lobbyID, Encoding.UTF8.GetBytes(data), handler);
		}
	}
	public class NetworkManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MessageHandler(IntPtr ptr, ulong peerId, byte channelId, IntPtr dataPtr, int dataLen);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void RouteUpdateHandler(IntPtr ptr, [MarshalAs(UnmanagedType.LPStr)] string routeData);

			internal MessageHandler OnMessage;

			internal RouteUpdateHandler OnRouteUpdate;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetPeerIdMethod(IntPtr methodsPtr, ref ulong peerId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result FlushMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result OpenPeerMethod(IntPtr methodsPtr, ulong peerId, [MarshalAs(UnmanagedType.LPStr)] string routeData);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result UpdatePeerMethod(IntPtr methodsPtr, ulong peerId, [MarshalAs(UnmanagedType.LPStr)] string routeData);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result ClosePeerMethod(IntPtr methodsPtr, ulong peerId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result OpenChannelMethod(IntPtr methodsPtr, ulong peerId, byte channelId, bool reliable);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result CloseChannelMethod(IntPtr methodsPtr, ulong peerId, byte channelId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SendMessageMethod(IntPtr methodsPtr, ulong peerId, byte channelId, byte[] data, int dataLen);

			internal GetPeerIdMethod GetPeerId;

			internal FlushMethod Flush;

			internal OpenPeerMethod OpenPeer;

			internal UpdatePeerMethod UpdatePeer;

			internal ClosePeerMethod ClosePeer;

			internal OpenChannelMethod OpenChannel;

			internal CloseChannelMethod CloseChannel;

			internal SendMessageMethod SendMessage;
		}

		public delegate void MessageHandler(ulong peerId, byte channelId, byte[] data);

		public delegate void RouteUpdateHandler(string routeData);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event MessageHandler OnMessage;

		public event RouteUpdateHandler OnRouteUpdate;

		internal NetworkManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnMessage = OnMessageImpl;
			events.OnRouteUpdate = OnRouteUpdateImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public ulong GetPeerId()
		{
			ulong peerId = 0uL;
			Methods.GetPeerId(MethodsPtr, ref peerId);
			return peerId;
		}

		public void Flush()
		{
			Result result = Methods.Flush(MethodsPtr);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void OpenPeer(ulong peerId, string routeData)
		{
			Result result = Methods.OpenPeer(MethodsPtr, peerId, routeData);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void UpdatePeer(ulong peerId, string routeData)
		{
			Result result = Methods.UpdatePeer(MethodsPtr, peerId, routeData);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void ClosePeer(ulong peerId)
		{
			Result result = Methods.ClosePeer(MethodsPtr, peerId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void OpenChannel(ulong peerId, byte channelId, bool reliable)
		{
			Result result = Methods.OpenChannel(MethodsPtr, peerId, channelId, reliable);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void CloseChannel(ulong peerId, byte channelId)
		{
			Result result = Methods.CloseChannel(MethodsPtr, peerId, channelId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void SendMessage(ulong peerId, byte channelId, byte[] data)
		{
			Result result = Methods.SendMessage(MethodsPtr, peerId, channelId, data, data.Length);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void OnMessageImpl(IntPtr ptr, ulong peerId, byte channelId, IntPtr dataPtr, int dataLen)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.NetworkManagerInstance.OnMessage != null)
			{
				byte[] array = new byte[dataLen];
				Marshal.Copy(dataPtr, array, 0, dataLen);
				discord.NetworkManagerInstance.OnMessage(peerId, channelId, array);
			}
		}

		[MonoPInvokeCallback]
		private static void OnRouteUpdateImpl(IntPtr ptr, string routeData)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.NetworkManagerInstance.OnRouteUpdate != null)
			{
				discord.NetworkManagerInstance.OnRouteUpdate(routeData);
			}
		}
	}
	public class OverlayManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ToggleHandler(IntPtr ptr, bool locked);

			internal ToggleHandler OnToggle;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void IsEnabledMethod(IntPtr methodsPtr, ref bool enabled);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void IsLockedMethod(IntPtr methodsPtr, ref bool locked);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLockedCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLockedMethod(IntPtr methodsPtr, bool locked, IntPtr callbackData, SetLockedCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenActivityInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenActivityInviteMethod(IntPtr methodsPtr, ActivityActionType type, IntPtr callbackData, OpenActivityInviteCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenGuildInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenGuildInviteMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string code, IntPtr callbackData, OpenGuildInviteCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenVoiceSettingsCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OpenVoiceSettingsMethod(IntPtr methodsPtr, IntPtr callbackData, OpenVoiceSettingsCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result InitDrawingDxgiMethod(IntPtr methodsPtr, IntPtr swapchain, bool useMessageForwarding);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void OnPresentMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ForwardMessageMethod(IntPtr methodsPtr, IntPtr message);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void KeyEventMethod(IntPtr methodsPtr, bool down, [MarshalAs(UnmanagedType.LPStr)] string keyCode, KeyVariant variant);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CharEventMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string character);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MouseButtonEventMethod(IntPtr methodsPtr, byte down, int clickCount, MouseButton which, int x, int y);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MouseMotionEventMethod(IntPtr methodsPtr, int x, int y);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ImeCommitTextMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string text);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ImeSetCompositionMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string text, ref ImeUnderline underlines, int from, int to);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ImeCancelCompositionMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetImeCompositionRangeCallbackCallback(IntPtr ptr, int from, int to, ref Rect bounds);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetImeCompositionRangeCallbackMethod(IntPtr methodsPtr, IntPtr callbackData, SetImeCompositionRangeCallbackCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetImeSelectionBoundsCallbackCallback(IntPtr ptr, Rect anchor, Rect focus, bool isAnchorFirst);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetImeSelectionBoundsCallbackMethod(IntPtr methodsPtr, IntPtr callbackData, SetImeSelectionBoundsCallbackCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate bool IsPointInsideClickZoneMethod(IntPtr methodsPtr, int x, int y);

			internal IsEnabledMethod IsEnabled;

			internal IsLockedMethod IsLocked;

			internal SetLockedMethod SetLocked;

			internal OpenActivityInviteMethod OpenActivityInvite;

			internal OpenGuildInviteMethod OpenGuildInvite;

			internal OpenVoiceSettingsMethod OpenVoiceSettings;

			internal InitDrawingDxgiMethod InitDrawingDxgi;

			internal OnPresentMethod OnPresent;

			internal ForwardMessageMethod ForwardMessage;

			internal KeyEventMethod KeyEvent;

			internal CharEventMethod CharEvent;

			internal MouseButtonEventMethod MouseButtonEvent;

			internal MouseMotionEventMethod MouseMotionEvent;

			internal ImeCommitTextMethod ImeCommitText;

			internal ImeSetCompositionMethod ImeSetComposition;

			internal ImeCancelCompositionMethod ImeCancelComposition;

			internal SetImeCompositionRangeCallbackMethod SetImeCompositionRangeCallback;

			internal SetImeSelectionBoundsCallbackMethod SetImeSelectionBoundsCallback;

			internal IsPointInsideClickZoneMethod IsPointInsideClickZone;
		}

		public delegate void SetLockedHandler(Result result);

		public delegate void OpenActivityInviteHandler(Result result);

		public delegate void OpenGuildInviteHandler(Result result);

		public delegate void OpenVoiceSettingsHandler(Result result);

		public delegate void SetImeCompositionRangeCallbackHandler(int from, int to, ref Rect bounds);

		public delegate void SetImeSelectionBoundsCallbackHandler(Rect anchor, Rect focus, bool isAnchorFirst);

		public delegate void ToggleHandler(bool locked);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event ToggleHandler OnToggle;

		internal OverlayManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnToggle = OnToggleImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public bool IsEnabled()
		{
			bool enabled = false;
			Methods.IsEnabled(MethodsPtr, ref enabled);
			return enabled;
		}

		public bool IsLocked()
		{
			bool locked = false;
			Methods.IsLocked(MethodsPtr, ref locked);
			return locked;
		}

		[MonoPInvokeCallback]
		private static void SetLockedCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SetLockedHandler setLockedHandler = (SetLockedHandler)gCHandle.Target;
			gCHandle.Free();
			setLockedHandler(result);
		}

		public void SetLocked(bool locked, SetLockedHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SetLocked(MethodsPtr, locked, GCHandle.ToIntPtr(value), SetLockedCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void OpenActivityInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			OpenActivityInviteHandler openActivityInviteHandler = (OpenActivityInviteHandler)gCHandle.Target;
			gCHandle.Free();
			openActivityInviteHandler(result);
		}

		public void OpenActivityInvite(ActivityActionType type, OpenActivityInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.OpenActivityInvite(MethodsPtr, type, GCHandle.ToIntPtr(value), OpenActivityInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void OpenGuildInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			OpenGuildInviteHandler openGuildInviteHandler = (OpenGuildInviteHandler)gCHandle.Target;
			gCHandle.Free();
			openGuildInviteHandler(result);
		}

		public void OpenGuildInvite(string code, OpenGuildInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.OpenGuildInvite(MethodsPtr, code, GCHandle.ToIntPtr(value), OpenGuildInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void OpenVoiceSettingsCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			OpenVoiceSettingsHandler openVoiceSettingsHandler = (OpenVoiceSettingsHandler)gCHandle.Target;
			gCHandle.Free();
			openVoiceSettingsHandler(result);
		}

		public void OpenVoiceSettings(OpenVoiceSettingsHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.OpenVoiceSettings(MethodsPtr, GCHandle.ToIntPtr(value), OpenVoiceSettingsCallbackImpl);
		}

		public void InitDrawingDxgi(IntPtr swapchain, bool useMessageForwarding)
		{
			Result result = Methods.InitDrawingDxgi(MethodsPtr, swapchain, useMessageForwarding);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void OnPresent()
		{
			Methods.OnPresent(MethodsPtr);
		}

		public void ForwardMessage(IntPtr message)
		{
			Methods.ForwardMessage(MethodsPtr, message);
		}

		public void KeyEvent(bool down, string keyCode, KeyVariant variant)
		{
			Methods.KeyEvent(MethodsPtr, down, keyCode, variant);
		}

		public void CharEvent(string character)
		{
			Methods.CharEvent(MethodsPtr, character);
		}

		public void MouseButtonEvent(byte down, int clickCount, MouseButton which, int x, int y)
		{
			Methods.MouseButtonEvent(MethodsPtr, down, clickCount, which, x, y);
		}

		public void MouseMotionEvent(int x, int y)
		{
			Methods.MouseMotionEvent(MethodsPtr, x, y);
		}

		public void ImeCommitText(string text)
		{
			Methods.ImeCommitText(MethodsPtr, text);
		}

		public void ImeSetComposition(string text, ImeUnderline underlines, int from, int to)
		{
			Methods.ImeSetComposition(MethodsPtr, text, ref underlines, from, to);
		}

		public void ImeCancelComposition()
		{
			Methods.ImeCancelComposition(MethodsPtr);
		}

		[MonoPInvokeCallback]
		private static void SetImeCompositionRangeCallbackCallbackImpl(IntPtr ptr, int from, int to, ref Rect bounds)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SetImeCompositionRangeCallbackHandler setImeCompositionRangeCallbackHandler = (SetImeCompositionRangeCallbackHandler)gCHandle.Target;
			gCHandle.Free();
			setImeCompositionRangeCallbackHandler(from, to, ref bounds);
		}

		public void SetImeCompositionRangeCallback(SetImeCompositionRangeCallbackHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SetImeCompositionRangeCallback(MethodsPtr, GCHandle.ToIntPtr(value), SetImeCompositionRangeCallbackCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void SetImeSelectionBoundsCallbackCallbackImpl(IntPtr ptr, Rect anchor, Rect focus, bool isAnchorFirst)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SetImeSelectionBoundsCallbackHandler setImeSelectionBoundsCallbackHandler = (SetImeSelectionBoundsCallbackHandler)gCHandle.Target;
			gCHandle.Free();
			setImeSelectionBoundsCallbackHandler(anchor, focus, isAnchorFirst);
		}

		public void SetImeSelectionBoundsCallback(SetImeSelectionBoundsCallbackHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SetImeSelectionBoundsCallback(MethodsPtr, GCHandle.ToIntPtr(value), SetImeSelectionBoundsCallbackCallbackImpl);
		}

		public bool IsPointInsideClickZone(int x, int y)
		{
			return Methods.IsPointInsideClickZone(MethodsPtr, x, y);
		}

		[MonoPInvokeCallback]
		private static void OnToggleImpl(IntPtr ptr, bool locked)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.OverlayManagerInstance.OnToggle != null)
			{
				discord.OverlayManagerInstance.OnToggle(locked);
			}
		}
	}
	public class StorageManager
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result ReadMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string nam

plugins/itsmeowdev-DoorFix/DoorFix.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DunGen;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DoorFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Fixes the hitbox of doors so items can be picked up through open doors more easily.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("DoorFix")]
[assembly: AssemblyTitle("DoorFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace DoorFix
{
	[BepInPlugin("DoorFix", "DoorFix", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(DungeonUtil))]
		[HarmonyPatch("AddAndSetupDoorComponent")]
		public class DungeonUtilPatch
		{
			private static void Postfix(Dungeon dungeon, GameObject doorPrefab, Doorway doorway)
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Expected O, but got Unknown
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Expected O, but got Unknown
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Expected O, but got Unknown
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)doorPrefab).name.StartsWith("SteelDoorMapSpawn"))
				{
					return;
				}
				foreach (Transform item in doorPrefab.GetComponent<SpawnSyncedObject>().spawnPrefab.transform)
				{
					Transform val = item;
					if (!((Object)val).name.StartsWith("SteelDoor"))
					{
						continue;
					}
					foreach (Transform item2 in ((Component)val).transform)
					{
						Transform val2 = item2;
						if (!((Object)val2).name.StartsWith("DoorMesh"))
						{
							continue;
						}
						LOGGER.LogInfo((object)((object)val2).ToString());
						foreach (Transform item3 in ((Component)val2).transform)
						{
							Transform val3 = item3;
							if (((Component)val3).tag != "InteractTrigger")
							{
								continue;
							}
							LOGGER.LogInfo((object)((object)val3).ToString());
							BoxCollider[] components = ((Component)val3).gameObject.GetComponents<BoxCollider>();
							foreach (BoxCollider val4 in components)
							{
								if (((Collider)val4).isTrigger)
								{
									LOGGER.LogDebug((object)"Patching door size");
									val4.size = new Vector3(0.64f, 1f, 1f);
								}
							}
						}
					}
				}
			}
		}

		private static readonly ManualLogSource LOGGER = Logger.CreateLogSource("DoorFix");

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("DoorFix").PatchAll();
			LOGGER.LogInfo((object)"Plugin DoorFix is loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "DoorFix";

		public const string PLUGIN_NAME = "DoorFix";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}

plugins/klepticat-IncreaseShipCap/IncreaseShipCap.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;

[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 = "")]
[assembly: AssemblyCompany("IncreaseShipCap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A Lethal Company mod that increases the item cap on the ship.")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("IncreaseShipCap")]
[assembly: AssemblyTitle("IncreaseShipCap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
namespace IncreaseShipCap;

[BepInPlugin("IncreaseShipCap", "IncreaseShipCap", "1.1.0")]
public class IncreaseShipCapPlugin : BaseUnityPlugin
{
	private static Harmony _harmony;

	public static ConfigEntry<int> configMaxItemCount;

	private void Awake()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Expected O, but got Unknown
		configMaxItemCount = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MaxItemCount", 200, "Number of max items on the ship.");
		_harmony = new Harmony("IncreaseShipCap");
		_harmony.PatchAll(typeof(Patches));
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin IncreaseShipCap is loaded!");
		((BaseUnityPlugin)this).Logger.LogInfo((object)$"Ship Item Cap set to {configMaxItemCount.Value}");
	}
}
public class Patches
{
	[HarmonyPatch(typeof(StartOfRound), "Awake")]
	private static void Postfix(ref int ___maxShipItemCapacity)
	{
		___maxShipItemCapacity = IncreaseShipCapPlugin.configMaxItemCount.Value - 1;
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "IncreaseShipCap";

	public const string PLUGIN_NAME = "IncreaseShipCap";

	public const string PLUGIN_VERSION = "1.1.0";
}

plugins/klepticat-JetpackWarning/JetpackWarning.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("klepticat")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A Lethal Company Mod that adds a visual and audio indicator for when your jetpack is about to explode.")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: AssemblyProduct("JetpackWarning")]
[assembly: AssemblyTitle("JetpackWarning")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.0.0")]
[module: UnverifiableCode]
namespace JetpackWarning;

public static class Assets
{
	public static string mainAssetBundleName = "jetpackAssets";

	public static AssetBundle MainAssetBundle = null;

	private static string GetAssemblyName()
	{
		return Assembly.GetExecutingAssembly().FullName.Split(',')[0];
	}

	public static void PopulateAssets()
	{
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetAssemblyName() + "." + mainAssetBundleName))
			{
				MainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
		}
	}
}
[BepInPlugin("JetpackWarning", "JetpackWarning", "2.0.0")]
public class JetpackWarningPlugin : BaseUnityPlugin
{
	public static Harmony _harmony;

	public static AudioClip jetpackCriticalBeep;

	public static GameObject meterContainer;

	public static GameObject meter;

	public static GameObject frame;

	public static GameObject warning;

	private void Awake()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin JetpackWarning is loaded!");
		Assets.PopulateAssets();
		_harmony = new Harmony("JetpackWarning");
		_harmony.PatchAll(typeof(Patches));
		SceneManager.sceneLoaded += OnSceneRelayLoaded;
		jetpackCriticalBeep = Assets.MainAssetBundle.LoadAsset<AudioClip>("JetpackCriticalBeep");
	}

	private void OnSceneRelayLoaded(Scene scene, LoadSceneMode loadMode)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: 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)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		if (((Scene)(ref scene)).name == "SampleSceneRelay")
		{
			GameObject val = GameObject.Find("IngamePlayerHUD");
			meterContainer = new GameObject("jetpackMeterContainer");
			meterContainer.AddComponent<CanvasGroup>();
			RectTransform obj = meterContainer.AddComponent<RectTransform>();
			((Transform)obj).parent = val.transform;
			((Transform)obj).localScale = Vector3.one;
			obj.anchoredPosition = Vector2.zero;
			((Transform)obj).localPosition = Vector2.op_Implicit(new Vector2(50f, 0f));
			obj.sizeDelta = Vector2.one;
			meter = AddImageToHUD("jetpackMeter", scene);
			frame = AddImageToHUD("jetpackMeterFrame", scene);
			warning = AddImageToHUD("jetpackMeterWarning", scene);
			GameObject[] array = (GameObject[])(object)new GameObject[3] { meter, frame, warning };
			foreach (GameObject obj2 in array)
			{
				obj2.transform.parent = meterContainer.transform;
				obj2.transform.localPosition = Vector2.op_Implicit(Vector2.zero);
			}
			meter.GetComponent<Image>().type = (Type)3;
			meter.GetComponent<Image>().fillMethod = (FillMethod)1;
			Transform transform = warning.transform;
			transform.localPosition += new Vector3(30f, 0f);
		}
	}

	private GameObject AddImageToHUD(string imageName, Scene scene)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: 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_0047: 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_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: 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_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Expected O, but got Unknown
		Sprite val = Assets.MainAssetBundle.LoadAsset<Sprite>(imageName);
		GameObject val2 = new GameObject(imageName);
		SceneManager.MoveGameObjectToScene(val2, scene);
		GameObject val3 = GameObject.Find("IngamePlayerHUD");
		RectTransform obj = val2.AddComponent<RectTransform>();
		((Transform)obj).parent = val3.transform;
		((Transform)obj).localScale = Vector2.op_Implicit(Vector2.one);
		obj.anchoredPosition = Vector2.zero;
		((Transform)obj).localPosition = Vector2.op_Implicit(Vector2.zero);
		Rect rect = val.rect;
		float num = ((Rect)(ref rect)).width / 2f;
		rect = val.rect;
		obj.sizeDelta = new Vector2(num, ((Rect)(ref rect)).height / 2f);
		val2.AddComponent<Image>().sprite = val;
		val2.AddComponent<CanvasRenderer>();
		return val2;
	}
}
internal class Patches
{
	private static bool playJetpackCritical = false;

	private static bool playingJetpackCritical = false;

	private static float currentFill = 0f;

	private static float fillVelocity = 0f;

	private static float criticalFill = 0.75f;

	private static float fillTime = 0.1f;

	[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
	[HarmonyPostfix]
	private static void PlayerControllerB_LateUpdate_Postfix(ref PlayerControllerB __instance)
	{
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: 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_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: 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_027b: Unknown result type (might be due to invalid IL or missing references)
		if (!((NetworkBehaviour)__instance).IsOwner || (((NetworkBehaviour)__instance).IsServer && !__instance.isHostPlayerObject) || !__instance.isPlayerControlled || __instance.isPlayerDead)
		{
			return;
		}
		if (__instance.isHoldingObject && __instance.currentlyHeldObjectServer is JetpackItem)
		{
			JetpackItem val = (JetpackItem)__instance.currentlyHeldObjectServer;
			JetpackWarningPlugin.meterContainer.SetActive(true);
			Vector3 val2 = (Vector3)typeof(JetpackItem).GetField("forces", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(val);
			float num = (float)typeof(JetpackItem).GetField("jetpackPower", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(val);
			RaycastHit val3 = default(RaycastHit);
			Physics.Raycast(((Component)__instance).transform.position, val2, ref val3, 25f, StartOfRound.Instance.allPlayersCollideWithMask);
			float num2 = ((!(num < 80f)) ? (0.5f - Mathf.Clamp(num / 20f - 4f, 0f, 1f) / 2f) : (Mathf.Clamp(num / 25f - 2.2f, 0f, 1f) / 2f));
			float num3 = ((((Vector3)(ref val2)).magnitude - ((RaycastHit)(ref val3)).distance >= 0f) ? ((((Vector3)(ref val2)).magnitude - ((RaycastHit)(ref val3)).distance) / 50f) : 0f);
			float num4 = Mathf.Lerp((((Vector3)(ref val2)).magnitude / 2f + num / 2.2f - ((RaycastHit)(ref val3)).distance >= 0f) ? ((((Vector3)(ref val2)).magnitude / 2f + num / 2.2f - ((RaycastHit)(ref val3)).distance) / 50f) : 0f, num3, num2);
			JetpackWarningPlugin.meter.GetComponent<Image>().fillAmount = currentFill;
			JetpackWarningPlugin.warning.SetActive(currentFill > criticalFill);
			currentFill = Mathf.SmoothDamp(currentFill, num4, ref fillVelocity, fillTime);
			playJetpackCritical = currentFill > criticalFill;
			Color color = Color.Lerp(new Color(1f, 0.82f, 0.405f, 1f), new Color(0.769f, 0.243f, 0.243f, 1f), currentFill);
			((Graphic)JetpackWarningPlugin.meter.GetComponent<Image>()).color = color;
			((Graphic)JetpackWarningPlugin.frame.GetComponent<Image>()).color = color;
			((Graphic)JetpackWarningPlugin.warning.GetComponent<Image>()).color = color;
			if (playJetpackCritical)
			{
				if (!playingJetpackCritical)
				{
					playingJetpackCritical = true;
					val.jetpackBeepsAudio.clip = JetpackWarningPlugin.jetpackCriticalBeep;
					val.jetpackBeepsAudio.Play();
				}
			}
			else
			{
				playingJetpackCritical = false;
			}
		}
		else
		{
			JetpackWarningPlugin.meterContainer.SetActive(false);
		}
	}

	[HarmonyPatch(typeof(JetpackItem), "SetJetpackAudios")]
	[HarmonyPrefix]
	private static bool JetpackItem_SetJetpackAudios_Prefix(ref bool ___jetpackActivated, ref AudioSource ___jetpackBeepsAudio)
	{
		return !playingJetpackCritical;
	}

	[HarmonyPatch(typeof(JetpackItem), "JetpackEffect")]
	[HarmonyPostfix]
	private static void JetpackItem_JetpackEffect_Postfix(ref bool __0, JetpackItem __instance)
	{
		if (__0 && playJetpackCritical)
		{
			playingJetpackCritical = true;
			__instance.jetpackBeepsAudio.clip = JetpackWarningPlugin.jetpackCriticalBeep;
			__instance.jetpackBeepsAudio.Play();
		}
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "JetpackWarning";

	public const string PLUGIN_NAME = "JetpackWarning";

	public const string PLUGIN_VERSION = "2.0.0";
}

plugins/kRYstall9-FastSwitchPlayerViewInRadar/LethalCompanyMonitorMod.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalCompanyMonitorMod.ConfigModel;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalCompanyMonitorMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A plugin that let's you fast switch to a player's cam while using the radar built in the in-game Terminal")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyInformationalVersion("1.3.1+669f32eefe44abf3aaa76ab120fc6f705c6684ec")]
[assembly: AssemblyProduct("LethalCompanyMonitorMod")]
[assembly: AssemblyTitle("LethalCompanyMonitorMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LethalCompanyMonitorMod
{
	public class Configs
	{
		public static readonly ConfigModel<Key> PreviousPlayerCam = new ConfigModel<Key>((Key)61, "Get previous player's cam", "PrevPCam", "HotKeys");

		public static readonly ConfigModel<Key> NextPlayerCam = new ConfigModel<Key>((Key)62, "Get next player's cam", "NextPCam", "HotKeys");

		public static readonly ConfigModel<Key>[] AllBinds = new ConfigModel<Key>[2] { PreviousPlayerCam, NextPlayerCam };
	}
	[BepInPlugin("krystall9.FastSwitchPlayerViewInRadar", "FastSwitchPlayerViewInRadar", "1.3.1")]
	[BepInProcess("Lethal Company.exe")]
	public class Plugin : BaseUnityPlugin
	{
		internal static InputActionAsset Asset;

		internal static string keyMappingPath = Application.persistentDataPath + "/switch_radar_cam.txt";

		internal static Dictionary<string, string> defaultKeys = new Dictionary<string, string>();

		internal static Plugin Instance { get; private set; }

		internal static ManualLogSource Log { get; private set; }

		internal static bool ViewMonitorSubmitted { get; set; } = false;


		internal static int CurrentlyViewingPlayer { get; set; } = 0;


		private void Awake()
		{
			Instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			defaultKeys.Add("Previous Cam", "/Keyboard/LeftArrow");
			defaultKeys.Add("Next Cam", "/Keyboard/RightArrow");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"krystall9.FastSwitchPlayerViewInRadar plugin has been loaded!");
		}

		public static void SetAsset(string previousCam, string nextCam)
		{
			Asset = InputActionAsset.FromJson("\r\n                {\r\n                    \"maps\" : [\r\n                        {\r\n                            \"name\" : \"FastSwitchPlayerViewInRadar\",\r\n                            \"actions\": [\r\n                                {\"name\": \"Previous Cam\", \"type\" : \"button\"},\r\n                            {\"name\": \"Next Cam\", \"type\" : \"button\"}\r\n                            ],\r\n                            \"bindings\" : [\r\n                                {\"path\" : \"" + previousCam + "\", \"action\": \"Previous Cam\"},\r\n                            {\"path\" : \"" + nextCam + "\", \"action\": \"Next Cam\"}\r\n                            ]\r\n                        }\r\n                    ]\r\n                }");
		}
	}
	public static class PluginStaticInfo
	{
		public const string PLUGIN_GUID = "krystall9.FastSwitchPlayerViewInRadar";

		public const string PLUGIN_NAME = "FastSwitchPlayerViewInRadar";

		public const string PLUGIN_VERSION = "1.3.1";
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalCompanyMonitorMod";

		public const string PLUGIN_NAME = "LethalCompanyMonitorMod";

		public const string PLUGIN_VERSION = "1.3.1";
	}
}
namespace LethalCompanyMonitorMod.Patch
{
	[HarmonyPatch(typeof(IngamePlayerSettings))]
	public class IngamePlayerSettingsPatch
	{
		[HarmonyPatch("CompleteRebind")]
		[HarmonyPrefix]
		public static void Rebind(IngamePlayerSettings __instance)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			string name = __instance.rebindingOperation.action.name;
			Plugin.Log.LogInfo((object)("Method - Rebind | Rebinding " + name));
			if (!(name == "Previous Cam"))
			{
				if (name == "Next Cam")
				{
					string text = File.ReadAllText(Plugin.keyMappingPath);
					string contents = text.Trim().Split('\n')[0] + "\n" + __instance.rebindingOperation.action.controls[0].path;
					File.WriteAllText(Plugin.keyMappingPath, contents);
				}
			}
			else
			{
				string text = File.ReadAllText(Plugin.keyMappingPath);
				string contents = __instance.rebindingOperation.action.controls[0].path + "\n" + text.Trim().Split('\n')[1];
				File.WriteAllText(Plugin.keyMappingPath, contents);
			}
			if (File.Exists(Plugin.keyMappingPath))
			{
				string text = File.ReadAllText(Plugin.keyMappingPath);
				string previousCam = text.Trim().Split('\n')[0];
				string nextCam = text.Trim().Split('\n')[1];
				Plugin.SetAsset(previousCam, nextCam);
			}
			else
			{
				Plugin.SetAsset(Plugin.defaultKeys["Previous Cam"], Plugin.defaultKeys["Next Cam"]);
			}
		}
	}
	[HarmonyPatch(typeof(KepRemapPanel))]
	public class KeyRemapPanelPatch
	{
		[HarmonyPatch("LoadKeybindsUI")]
		[HarmonyPrefix]
		public static void LoadBindings(ref KepRemapPanel __instance)
		{
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			List<string> list = new List<string>();
			if (!File.Exists(Plugin.keyMappingPath))
			{
				string contents = Plugin.defaultKeys["Previous Cam"] + "\n" + Plugin.defaultKeys["Next Cam"];
				File.WriteAllText(Plugin.keyMappingPath, contents);
			}
			else
			{
				string contents = File.ReadAllText(Plugin.keyMappingPath);
				list = contents.Trim().Split('\n').ToList();
			}
			foreach (RemappableKey remappableKey in __instance.remappableKeys)
			{
				if (remappableKey.ControlName == "Radar Previous Cam" || remappableKey.ControlName == "Radar Next Cam")
				{
					return;
				}
			}
			if (list.Count > 0)
			{
				Plugin.SetAsset(list[0], list[1]);
			}
			else
			{
				Plugin.SetAsset(Plugin.defaultKeys["Previous Cam"], Plugin.defaultKeys["Next Cam"]);
			}
			foreach (KeyValuePair<string, string> defaultKey in Plugin.defaultKeys)
			{
				RemappableKey val = new RemappableKey();
				Plugin.Log.LogInfo((object)("Method - LoadBindings | Loading Keybindings for " + defaultKey.Key));
				string key = defaultKey.Key;
				if (!(key == "Previous Cam"))
				{
					if (key == "Next Cam")
					{
						InputActionReference currentInput = InputActionReference.Create(Plugin.Asset.FindAction(defaultKey.Key, false));
						val.ControlName = "Radar Next Cam";
						val.currentInput = currentInput;
					}
				}
				else
				{
					InputActionReference currentInput = InputActionReference.Create(Plugin.Asset.FindAction(defaultKey.Key, false));
					val.ControlName = "Radar Previous Cam";
					val.currentInput = currentInput;
				}
				__instance.remappableKeys.Add(val);
			}
		}
	}
	[HarmonyPatch(typeof(RadarBoosterItem))]
	public class RadarBoosterPatch
	{
		[HarmonyPatch("RemoveBoosterFromRadar")]
		[HarmonyPostfix]
		public static void RemovingUnusedRadar(ref RadarBoosterItem __instance)
		{
			ManualCameraRenderer mapScreen = Object.FindObjectOfType<StartOfRound>().mapScreen;
			Plugin.Log.LogInfo((object)("Method - RemovingUnusedRadar | Current cam target name: " + __instance.radarBoosterName));
			Plugin.Log.LogInfo((object)("Method - RemovingUnusedRadar | " + __instance.radarBoosterName + " removed"));
			Plugin.Log.LogInfo((object)"Method - RemovingUnusedRadar | Updating camera target");
			for (int i = 0; i < mapScreen.radarTargets.Count; i++)
			{
				if (mapScreen.radarTargets.Count <= Plugin.CurrentlyViewingPlayer || mapScreen.radarTargets[Plugin.CurrentlyViewingPlayer] == null)
				{
					Plugin.CurrentlyViewingPlayer = i;
					continue;
				}
				mapScreen.SwitchRadarTargetAndSync(Plugin.CurrentlyViewingPlayer);
				Plugin.Log.LogInfo((object)("Method - RemovingUnusedRadar | Currently targeting " + mapScreen.radarTargets[Plugin.CurrentlyViewingPlayer].name));
				break;
			}
		}
	}
	[HarmonyPatch(typeof(Terminal))]
	public class TerminalPatch
	{
		[HarmonyPatch("ParsePlayerSentence")]
		[HarmonyPostfix]
		private static void HandleSentence(Terminal __instance, TerminalNode __result)
		{
			if (__instance.terminalInUse && !Plugin.ViewMonitorSubmitted && string.Compare(((Object)__result).name, "ViewInsideShipCam 1", ignoreCase: true) == 0)
			{
				Plugin.ViewMonitorSubmitted = true;
			}
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void HandleTerminalCameraNode(Terminal __instance)
		{
			if (!__instance.terminalInUse)
			{
				return;
			}
			List<string> list = new List<string>();
			if (File.Exists(Plugin.keyMappingPath))
			{
				list = File.ReadAllText(Plugin.keyMappingPath).Trim().Split('\n')
					.ToList();
			}
			if ((Object)(object)Plugin.Asset == (Object)null || !Plugin.Asset.enabled)
			{
				if ((Object)(object)Plugin.Asset == (Object)null)
				{
					Plugin.Log.LogInfo((object)"Method - HandleTerminalCameraNode | InputActionAsset not yet created");
					if (File.Exists(Plugin.keyMappingPath))
					{
						Plugin.SetAsset(list[0], list[1]);
					}
					else
					{
						Plugin.SetAsset(Plugin.defaultKeys["Previous Cam"], Plugin.defaultKeys["Next Cam"]);
					}
					Plugin.Log.LogInfo((object)"Method - HandleTerminalCameraNode | InputActionAsset created successfully");
				}
				if ((Object)(object)Plugin.Asset != (Object)null)
				{
					Plugin.Log.LogInfo((object)"Method - HandleTerminalCameraNode | InputActionAsset not yet enabled");
					Plugin.Asset.Enable();
					Plugin.Log.LogInfo((object)"Method - HandleTerminalCameraNode | InputActionAsset enabled successfully");
				}
			}
			if (!Plugin.ViewMonitorSubmitted)
			{
				return;
			}
			try
			{
				InputAction val = ((IEnumerable<InputAction>)Plugin.Asset).Where((InputAction x) => x.WasPressedThisFrame()).FirstOrDefault();
				if (val == null && val == null)
				{
					return;
				}
				int num = Plugin.CurrentlyViewingPlayer;
				ManualCameraRenderer mapScreen = Object.FindObjectOfType<StartOfRound>().mapScreen;
				int count = mapScreen.radarTargets.Count;
				Plugin.Log.LogInfo((object)$"Method - HandleTerminalCameraNode | Currently Max Spectable Players: {count}");
				PlayerControllerB val2 = null;
				RadarBoosterItem val3 = null;
				for (int i = 0; i < mapScreen.radarTargets.Count; i++)
				{
					string name = val.name;
					if (!(name == "Previous Cam"))
					{
						if (name == "Next Cam")
						{
							num = GetRadarTargetIndex(num, mapScreen.radarTargets.Count, isIndexPlusOne: true);
							Plugin.Log.LogInfo((object)$"Method - HandleTerminalCameraNode | Current Index: {num}");
						}
					}
					else
					{
						num = GetRadarTargetIndex(num, mapScreen.radarTargets.Count);
						Plugin.Log.LogInfo((object)$"Method - HandleTerminalCameraNode | Current Index: {num}");
					}
					if (mapScreen.radarTargets[num] == null)
					{
						Plugin.Log.LogInfo((object)$"Method - HandleTerminalCameraNode | The player at the Index: {num} cannot be spectated. Getting the next player");
						continue;
					}
					GameObject gameObject = ((Component)mapScreen.radarTargets[num].transform).gameObject;
					gameObject.TryGetComponent<PlayerControllerB>(ref val2);
					if ((Object)(object)val2 != (Object)null && (val2.isPlayerControlled || val2.isPlayerDead))
					{
						break;
					}
					if ((Object)(object)val2 == (Object)null || !val2.isPlayerControlled)
					{
						gameObject.TryGetComponent<RadarBoosterItem>(ref val3);
						if ((Object)(object)val3 != (Object)null && val3.radarEnabled)
						{
							break;
						}
					}
				}
				if (count > num && mapScreen.radarTargets[num] != null)
				{
					string text = "";
					text = ((!((Object)(object)val3 != (Object)null)) ? val2.playerUsername : val3.radarBoosterName);
					Plugin.Log.LogInfo((object)("Method - HandleTerminalCameraNode | Switching cam to " + text));
					mapScreen.SwitchRadarTargetAndSync(num);
				}
				Plugin.CurrentlyViewingPlayer = num;
				val2 = null;
				val3 = null;
			}
			catch (Exception ex)
			{
				Plugin.Log.LogInfo((object)("Method - HandleTerminalCameraNode| Error: " + ex.Message));
			}
		}

		public static int GetRadarTargetIndex(int index, int loopableItemsCount, bool isIndexPlusOne = false)
		{
			if (isIndexPlusOne)
			{
				return (index < loopableItemsCount - 1) ? (index + 1) : 0;
			}
			return (index > 0) ? (index - 1) : (loopableItemsCount - 1);
		}
	}
}
namespace LethalCompanyMonitorMod.ConfigModel
{
	public class ConfigModel<T>
	{
		public T DefaultValue { get; set; }

		public string Description { get; set; }

		public string Key { get; set; }

		public string Section { get; set; }

		public ConfigEntry<T> ConfigEntry { get; set; }

		public ConfigModel(T defaultValue, string description, string key, string section)
		{
			DefaultValue = defaultValue;
			Description = description;
			Key = key;
			Section = section;
		}
	}
}

plugins/LoadingSomething-Sort_by_Player_Count/SortByPlayersButton.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SortByPlayersButton")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SortByPlayersButton")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("63810973-dffb-4a49-bd2e-b339991e9181")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SortByPlayersButton
{
	[BepInPlugin("loadingsomething.SortByPlayersButton", "SortByPlayersButton", "1.0.1")]
	public class SortByPlayersButtonPlugin : BaseUnityPlugin
	{
		private const string modGUID = "loadingsomething.SortByPlayersButton";

		private const string modName = "SortByPlayersButton";

		private const string modVer = "1.0.1";

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("loadingsomething.SortByPlayersButton");
			val.PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace SortByPlayersButton.Patches
{
	[HarmonyPatch]
	internal class MenuManagerPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<LobbySlot, int> <>9__0_1;

			public static UnityAction <>9__0_0;

			internal void <AddSortButton>b__0_0()
			{
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				LobbySlot[] source = Object.FindObjectsOfType<LobbySlot>();
				source = source.OrderByDescending((LobbySlot lobby) => int.Parse(((TMP_Text)lobby.playerCount).text.Split(new char[1] { ' ' })[0])).ToArray();
				float num = 0f;
				for (int i = 0; i < source.Length; i++)
				{
					((Component)source[i]).gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, num);
					num -= 42f;
				}
			}

			internal int <AddSortButton>b__0_1(LobbySlot lobby)
			{
				return int.Parse(((TMP_Text)lobby.playerCount).text.Split(new char[1] { ' ' })[0]);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(MenuManager), "Start")]
		private static void AddSortButton()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//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_00a1: Expected O, but got Unknown
			GameObject val = GameObject.Find("/Canvas/MenuContainer/LobbyList/ListPanel/RefreshButton");
			if (!((Object)(object)val != (Object)null))
			{
				return;
			}
			GameObject val2 = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent);
			RectTransform component = val2.GetComponent<RectTransform>();
			component.anchoredPosition += new Vector2(0f, 18f);
			((TMP_Text)val2.GetComponentInChildren<TextMeshProUGUI>()).text = "[ Sort ]";
			Button component2 = val2.GetComponent<Button>();
			component2.onClick = new ButtonClickedEvent();
			ButtonClickedEvent onClick = component2.onClick;
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				UnityAction val3 = delegate
				{
					//IL_0050: Unknown result type (might be due to invalid IL or missing references)
					LobbySlot[] source = Object.FindObjectsOfType<LobbySlot>();
					source = source.OrderByDescending((LobbySlot lobby) => int.Parse(((TMP_Text)lobby.playerCount).text.Split(new char[1] { ' ' })[0])).ToArray();
					float num = 0f;
					for (int i = 0; i < source.Length; i++)
					{
						((Component)source[i]).gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, num);
						num -= 42f;
					}
				};
				<>c.<>9__0_0 = val3;
				obj = (object)val3;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
		}
	}
}

plugins/MassiveNewCoilers-FixCentipedeLag/LC_Optim.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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 HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("LC_Optim")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Source moment")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LC_Optim")]
[assembly: AssemblyTitle("LC_Optim")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LC_Optim;

[BepInPlugin("mnc.fixcentipedelag", "FixCentipedeLag", "2023.12.7")]
public class Plugin : BaseUnityPlugin
{
	private Harmony thisHarmony;

	private static Dictionary<int, ulong> instanceMap = new Dictionary<int, ulong>();

	private static ulong deadtimer = 100uL;

	private static ManualLogSource Log;

	private static ConfigEntry<bool> configShowDebug;

	private static void Debug(object data, LogLevel logLevel = 16)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		if (configShowDebug.Value)
		{
			Log.Log(logLevel, data);
		}
	}

	private void Awake()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		configShowDebug = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enable debug printing", true, "Enabling this will show debug info in console, e.g. when a new centipede gets tracked or removed.");
		thisHarmony = new Harmony("mnc.fixcentipedelag");
		thisHarmony.Patch((MethodBase)typeof(CentipedeAI).GetMethod("DoAIInterval"), new HarmonyMethod(typeof(Plugin), "RemoveLagCentipede", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		Debug("Registered the patch method", (LogLevel)4);
		Log = ((BaseUnityPlugin)this).Logger;
	}

	public static void RemoveLagCentipede(CentipedeAI __instance)
	{
		if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f))
		{
			return;
		}
		int instanceID = ((Object)__instance).GetInstanceID();
		ulong num = (ulong)Time.frameCount;
		if (!instanceMap.ContainsKey(instanceID))
		{
			instanceMap.Add(instanceID, num);
			Debug($"Tracked {instanceID}", (LogLevel)16);
			return;
		}
		ulong num2 = instanceMap[instanceID];
		if (num - num2 <= deadtimer)
		{
			((EnemyAI)__instance).KillEnemy(true);
			instanceMap.Remove(instanceID);
			Debug($"Removed centipede at {instanceID}", (LogLevel)16);
		}
		else
		{
			instanceMap[instanceID] = num;
		}
	}

	public void OnDestroy()
	{
		thisHarmony.UnpatchSelf();
	}
}
internal class PluginMetadata
{
	public const string PLUGIN_GUID = "mnc.fixcentipedelag";

	public const string PLUGIN_NAME = "FixCentipedeLag";

	public const string PLUGIN_VERSION = "2023.12.7";
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "LC_Optim";

	public const string PLUGIN_NAME = "LC_Optim";

	public const string PLUGIN_VERSION = "1.0.0";
}

plugins/MegaPiggy-BuyableShotgun/BuyableShotgun.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("BuyableShotgun")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright © 2023 MegaPiggy")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BuyableShotgun")]
[assembly: AssemblyTitle("BuyableShotgun")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BuyableShotgun
{
	[BepInPlugin("MegaPiggy.BuyableShotgun", "BuyableShotgun", "1.0.0")]
	public class BuyableShotgun : BaseUnityPlugin
	{
		private const string modGUID = "MegaPiggy.BuyableShotgun";

		private const string modName = "BuyableShotgun";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("MegaPiggy.BuyableShotgun");

		private static BuyableShotgun Instance;

		public int ShotgunPrice;

		public bool added;

		private static ManualLogSource LoggerInstance => ((BaseUnityPlugin)Instance).Logger;

		public List<Item> AllItems => Resources.FindObjectsOfTypeAll<Item>().Concat(Object.FindObjectsByType<Item>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToList();

		public Item Shotgun => ((IEnumerable<Item>)AllItems).FirstOrDefault((Func<Item, bool>)((Item item) => ((Object)item).name == "Shotgun"));

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll();
			ShotgunPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Prices", "ShotgunPrice", 700, "Credits needed to buy shotgun").Value;
			SceneManager.sceneLoaded += OnSceneLoaded;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin BuyableShotgun is loaded with version 1.0.0!");
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (!added && ((Scene)(ref scene)).name == "MainMenu")
			{
				added = true;
				Items.RegisterShopItem(Shotgun, ShotgunPrice);
			}
		}
	}
}

plugins/MegaPiggy-BuyableShotgunShells/BuyableShotgunShells.dll.old

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("BuyableShotgunShells")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright © 2023 MegaPiggy")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BuyableShotgunShells")]
[assembly: AssemblyTitle("BuyableShotgunShells")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BuyableShotgunShells
{
	[BepInPlugin("MegaPiggy.BuyableShotgunShells", "Buyable Shotgun Shells", "1.0.1")]
	public class BuyableShotgunShells : BaseUnityPlugin
	{
		private const string modGUID = "MegaPiggy.BuyableShotgunShells";

		private const string modName = "Buyable Shotgun Shells";

		private const string modVersion = "1.0.1";

		private readonly Harmony harmony = new Harmony("MegaPiggy.BuyableShotgunShells");

		private static BuyableShotgunShells Instance;

		public int ShellPrice;

		public bool added;

		private static ManualLogSource LoggerInstance => ((BaseUnityPlugin)Instance).Logger;

		public List<Item> AllItems => Resources.FindObjectsOfTypeAll<Item>().Concat(Object.FindObjectsByType<Item>((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToList();

		public Item ShotgunShell => ((IEnumerable<Item>)AllItems).FirstOrDefault((Func<Item, bool>)((Item item) => ((Object)item).name == "GunAmmo"));

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll();
			ShellPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Prices", "ShotgunShellPrice", 20, "Credits needed to buy shotgun shells").Value;
			SceneManager.sceneLoaded += OnSceneLoaded;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Buyable Shotgun Shells is loaded with version 1.0.1!");
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (!added && ((Scene)(ref scene)).name == "MainMenu")
			{
				added = true;
				ShotgunShell.itemName = "Shells";
				Items.RegisterShopItem(ShotgunShell, ShellPrice);
			}
		}
	}
}

plugins/MMHOOK/MMHOOK_AmazingAssets.TerrainToMesh.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text;
using AmazingAssets.TerrainToMesh;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On;
using On.AmazingAssets.TerrainToMesh;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On
{
	public static class \u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate object orig_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e(TerrainData P_0, bool P_1, bool P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate object hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e(orig_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e orig, TerrainData P_1, bool P_2, bool P_3);

		public static event hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e \u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e
		{
			add
			{
				HookEndpointManager.Add<hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class \u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e
	{
		public static event Manipulator \u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e
		{
			add
			{
				HookEndpointManager.Modify<On.\u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e.hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.\u200f\u202b\u202b\u202c\u206d\u206e\u206e\u202b\u200d\u202b\u202d\u200e\u206f\u200b\u206a\u202d\u206e\u206d\u200b\u202b\u200d\u206f\u202e\u202b\u200c\u206c\u200b\u202c\u206e\u202d\u206e\u202d\u202a\u200e\u206c\u202d\u206c\u200b\u202c\u200f\u202e.hook_\u206f\u202b\u200f\u206e\u206e\u202c\u202c\u206d\u206b\u206d\u206c\u206f\u202d\u200d\u206b\u200d\u202a\u206c\u200c\u206c\u206b\u200c\u200f\u202a\u202b\u200f\u202c\u206d\u200b\u202e\u202d\u206b\u206a\u200b\u200f\u206a\u200e\u200e\u200e\u202e>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class \u200f\u202c\u202d\u202a\u206a\u200b\u200b\u202c\u200e\u200c\u200f\u206f\u200d\u200c\u206c\u206e\u200e\u206f\u206b\u206b\u202c\u200f\u206b\u200f\u200c\u206f\u200d\u202d\u206e\u206c\u202c\u200f\u202b\u202a\u200c\u202a\u202a\u206c\u200d\u206f\u202e
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self, TerrainData P_1, bool P_2, bool P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self, TerrainData P_2, bool P_3, bool P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e(Texture P_0, RenderTexture P_1, bool P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e(orig_\u202a\u200c\u206b\u206f\u202d\u200d\u200b\u200d\u206e\u202a\u202c\u206e\u200c\u200e\u206a\u202e\u202c\u200e\u206d\u200c\u200e\u200c\u202d\u200f\u206b\u202b\u206b\u206c\u206b\u206f\u202c\u202a\u200b\u202a\u200b\u206e\u202a\u202b\u206e\u206b\u202e orig, Texture P_1, RenderTexture P_2, bool P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e(Texture P_0, RenderTexture P_1, Material P_2, bool P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e(orig_\u200c\u200b\u200b\u200e\u200b\u206d\u202e\u202c\u200b\u200e\u206b\u202b\u200e\u202e\u200b\u200f\u200f\u202e\u206f\u200e\u200c\u200f\u202c\u200f\u206a\u206a\u200c\u206d\u206b\u206d\u206c\u200f\u202a\u202a\u200c\u206d\u206e\u200f\u202b\u202a\u202e orig, Texture P_1, RenderTexture P_2, Material P_3, bool P_4, int P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e(Color P_0, TextureFormat P_1, bool P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e(orig_\u206a\u202b\u202b\u200b\u200d\u200e\u202e\u206e\u206b\u206e\u202d\u200d\u202c\u206c\u202b\u200b\u200c\u202b\u202c\u202a\u206f\u206c\u206d\u200e\u206b\u202b\u200f\u200d\u200d\u206c\u206e\u206c\u200d\u206e\u206d\u206f\u206f\u200d\u206c\u202e orig, Color P_1, TextureFormat P_2, bool P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e(int P_0, int P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e(orig_\u206f\u206f\u206b\u200e\u202c\u206b\u202c\u200c\u200f\u200c\u202e\u206e\u200c\u202c\u206c\u202c\u202b\u206b\u200f\u202c\u202b\u206a\u200f\u206c\u206f\u200c\u200b\u202e\u206d\u202a\u206a\u206c\u206f\u206b\u206a\u206c\u206d\u202b\u206a\u202b\u202e orig, int P_1, int P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e(RenderTexture P_0, TextureFormat P_1, ref Texture2D P_2, bool P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e(orig_\u200c\u206a\u206e\u206f\u200f\u206f\u202a\u200e\u206c\u202e\u202a\u200f\u206e\u202b\u206f\u200e\u200d\u200b\u202c\u202b\u202c\u206b\u200c\u202c\u200d\u202d\u200d\u200e\u202b\u206f\u200f\u206e\u200f\u200b\u206e\u200b\u202b\u202b\u202a\u206d\u202e orig, RenderTexture P_1, TextureFormat P_2, ref Texture2D P_3, bool P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e(Texture2D P_0, bool P_1, int P_2, int P_3, int P_4, int P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e(orig_\u202d\u200d\u202e\u200b\u202e\u200e\u206b\u206d\u200b\u200f\u206e\u200d\u200e\u200f\u202e\u202a\u202d\u202c\u200e\u200b\u206a\u206e\u202b\u206c\u206f\u206c\u206c\u202c\u202d\u202d\u202c\u200d\u200b\u200e\u200b\u200c\u202d\u200c\u200c\u206c\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4, int P_5, int P_6);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] orig_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e(Texture2D[] P_0, bool P_1, int P_2, int P_3, int P_4, int P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] hook_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e(orig_\u206f\u202e\u202b\u202b\u200e\u202b\u206e\u202e\u202d\u200e\u206c\u202c\u206c\u206f\u200b\u200b\u200d\u206a\u206f\u206b\u202e\u206e\u202a\u202b\u206b\u206e\u206c\u206f\u202c\u200d\u202d\u202c\u202d\u206b\u200c\u202a\u200e\u206b\u200e\u206e\u202e orig, Texture2D[] P_1, bool P_2, int P_3, int P_4, int P_5, int P_6);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] orig_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e(Texture2D P_0, bool P_1, int P_2, int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] hook_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e(orig_\u206f\u206a\u206d\u202c\u202c\u206f\u206f\u200f\u206b\u202a\u206a\u200c\u202a\u202d\u206c\u206d\u206d\u200e\u206d\u200b\u200e\u200b\u202a\u200c\u202d\u200f\u202b\u200e\u206b\u202d\u200d\u202b\u200f\u200b\u200f\u206e\u206f\u206c\u206b\u206d\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] orig_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e(Texture2D[] P_0, bool P_1, int P_2, int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D[] hook_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e(orig_\u206a\u206a\u202b\u202b\u200d\u200b\u206f\u200d\u200c\u206a\u206b\u200f\u206c\u202a\u206b\u202a\u200d\u206d\u200f\u206e\u202a\u200e\u206a\u206d\u206b\u200c\u202a\u206c\u206d\u200e\u200f\u206a\u202d\u200d\u202e\u200c\u206d\u202b\u200b\u206d\u202e orig, Texture2D[] P_1, bool P_2, int P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e(Texture2D P_0, bool P_1, int P_2, int P_3, int P_4, int P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e(orig_\u206c\u202c\u206e\u200d\u206e\u200c\u202e\u200f\u200e\u200f\u202b\u200c\u200d\u206f\u202b\u206d\u206d\u206c\u200f\u206f\u202e\u200b\u206b\u200f\u202a\u200e\u202c\u202d\u202b\u206d\u206d\u200b\u202e\u202e\u202d\u202a\u206f\u202a\u202e\u200e\u202e orig, Texture2D P_1, bool P_2, int P_3, int P_4, int P_5, int P_6);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e(TerrainData P_0, int P_1, out int P_2, out int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e(orig_\u206f\u206b\u206c\u200b\u200b\u200e\u200f\u200c\u206a\u200d\u200d\u206e\u206b\u202c\u202d\u206a\u200c\u202e\u200d\u202d\u200b\u202b\u200c\u206a\u200d\u200c\u206f\u206e\u206e\u200d\u206e\u206b\u206f\u206a\u202a\u206e\u206c\u206c\u200f\u200c\u202e orig, TerrainData P_1, int P_2, out int P_3, out int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e(int P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e(orig_\u206a\u200e\u206a\u202a\u200d\u206f\u202b\u206d\u200f\u202b\u206c\u200b\u200e\u202d\u206e\u206e\u206a\u206e\u200d\u202a\u206e\u206b\u200f\u206c\u200b\u200e\u200d\u200b\u202d\u202d\u200c\u206e\u200d\u200e\u206d\u200d\u202e\u202d\u200f\u206b\u202e orig, int P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_cctor();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_cctor(orig_cctor orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ColorSpace orig_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ColorSpace hook_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e(orig_\u206e\u202a\u200f\u206c\u206a\u206c\u200d\u200e\u206b\u200b\u200d\u206c\u202c\u202a\u202c\u200d\u202b\u206b\u200e\u206f\u206b\u200b\u200e\u202b\u206e\u200c\u200d\u206e\u202e\u200e\u202c\u200d\u206d\u200c\u200c\u202c\u200e\u202d\u202c\u206c\u202e orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e(bool P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e(orig_\u206c\u202d\u206f\u206f\u200d\u202c\u206a\u202b\u202c\u206e\u206b\u206d\u200f\u206b\u202d\u206b\u202e\u202b\u200b\u200f\u206c\u206c\u200f\u202e\u202c\u200c\u206c\u202c\u200b\u206a\u200b\u200e\u202b\u206f\u200d\u200b\u200e\u202c\u206c\u202b\u202e orig, bool P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e(Object P_0, Object P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e(orig_\u206c\u200b\u206c\u200b\u202d\u206a\u200e\u200b\u200f\u206e\u202b\u200e\u202a\u202a\u206c\u202c\u206f\u206b\u206c\u206a\u206c\u202a\u206a\u200b\u200b\u202e\u202c\u206e\u206d\u202c\u200c\u202a\u206a\u202d\u200d\u202b\u202c\u200d\u200c\u202b\u202e orig, Object P_1, Object P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e(Texture P_0, RenderTexture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e(orig_\u206c\u200e\u202a\u206a\u200e\u206d\u206c\u202a\u206e\u200d\u200f\u206e\u200b\u200f\u202d\u206c\u200c\u206f\u206c\u202d\u206b\u200f\u200f\u202b\u206f\u200d\u206c\u202e\u206b\u202c\u202b\u200e\u200b\u202c\u206b\u200c\u202c\u200e\u206d\u202e orig, Texture P_1, RenderTexture P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e(Texture P_0, RenderTexture P_1, Material P_2, int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e(orig_\u200f\u206f\u206c\u200d\u200f\u200c\u206c\u200e\u202a\u202a\u206e\u206a\u200b\u202b\u206d\u206f\u206c\u202c\u206f\u200c\u202b\u200f\u206e\u206b\u202c\u206b\u206b\u200f\u206b\u202b\u200f\u200d\u200e\u206e\u206d\u206e\u200b\u200f\u206b\u206d\u202e orig, Texture P_1, RenderTexture P_2, Material P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e(int P_0, int P_1, TextureFormat P_2, bool P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e(orig_\u202b\u206b\u200d\u202e\u200e\u202c\u206f\u200b\u206e\u200f\u200f\u202d\u206a\u200e\u206f\u200e\u206c\u206d\u202a\u206a\u206e\u200e\u206d\u202a\u202c\u202e\u206b\u202a\u202e\u206e\u200b\u200d\u202b\u206b\u200b\u206f\u202c\u202b\u206d\u202d\u202e orig, int P_1, int P_2, TextureFormat P_3, bool P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e(Texture2D P_0, Color[] P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e(orig_\u202b\u202a\u202e\u206a\u202b\u202e\u200b\u206b\u200d\u200c\u206f\u200b\u202d\u206b\u200e\u202d\u206b\u200b\u206e\u206b\u202c\u202d\u206b\u206e\u206b\u202b\u202e\u202a\u200c\u200f\u202c\u206d\u202b\u202a\u200f\u202a\u202a\u206d\u202d\u206c\u202e orig, Texture2D P_1, Color[] P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e(Texture2D P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e(orig_\u202e\u202d\u206b\u206b\u206e\u200d\u200e\u200d\u202d\u202a\u206c\u206f\u206d\u202c\u200d\u206c\u202e\u200d\u202c\u206b\u202a\u206f\u206d\u202b\u200e\u202d\u200e\u202d\u206a\u200c\u202e\u206c\u202b\u200d\u200b\u206c\u200d\u206f\u206f\u202c\u202e orig, Texture2D P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RenderTexture orig_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e(int P_0, int P_1, int P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RenderTexture hook_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e(orig_\u202c\u206a\u202e\u202d\u200c\u202e\u206a\u202c\u206b\u206e\u200b\u206c\u200d\u206a\u200e\u206a\u206b\u206a\u202d\u206a\u206e\u206b\u202a\u202a\u206b\u202d\u206f\u202b\u202b\u202d\u206c\u206d\u206c\u202d\u206c\u202a\u206b\u202c\u206c\u202b\u202e orig, int P_1, int P_2, int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e(RenderTexture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e(orig_\u202a\u202d\u206c\u200b\u200e\u202c\u200d\u206d\u200e\u202c\u206a\u200c\u206f\u202d\u206e\u200d\u202a\u206f\u200b\u200c\u206b\u202c\u206f\u206b\u202d\u200f\u200f\u206b\u206d\u200f\u202e\u200f\u206d\u206d\u206e\u206f\u206f\u206b\u206c\u200e\u202e orig, RenderTexture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e(RenderTexture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e(orig_\u202a\u200c\u206a\u202c\u200f\u202e\u202b\u200c\u206d\u202d\u200f\u200c\u206d\u206f\u206d\u200e\u206d\u202a\u200c\u202e\u202a\u206e\u206b\u206f\u206e\u202a\u206d\u202a\u200e\u206f\u206f\u202a\u206e\u202e\u200b\u202a\u202a\u202c\u202a\u206f\u202e orig, RenderTexture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e(orig_\u202b\u200d\u202a\u202d\u206b\u202c\u202d\u202c\u200e\u206b\u206a\u206a\u202e\u206e\u206b\u200d\u202e\u200e\u206e\u200f\u206a\u202e\u202a\u200f\u200c\u200e\u202e\u206e\u206e\u202a\u200c\u200b\u206c\u202e\u206d\u206f\u202c\u206f\u206e\u202a\u202e orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e(Object P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e(orig_\u202c\u206f\u202b\u202b\u206b\u200c\u206d\u206d\u202e\u206c\u202c\u202d\u206e\u200b\u202c\u206f\u206c\u200e\u200e\u202b\u200f\u200d\u200c\u206b\u200b\u200d\u202e\u200c\u202a\u206a\u206e\u206e\u202a\u206e\u202e\u206c\u202d\u206e\u200b\u202e\u202e orig, Object P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e(Object P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e(orig_\u202b\u206b\u202a\u202a\u200f\u200f\u200c\u200f\u202c\u202d\u202a\u202c\u200c\u202a\u206f\u206b\u200f\u200e\u200f\u202a\u202b\u200b\u200c\u202c\u206e\u200f\u206e\u202a\u200c\u200e\u202c\u202a\u200b\u202d\u206d\u200e\u206f\u202c\u206e\u202e orig, Object P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RenderTexture orig_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RenderTexture hook_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e(orig_\u202c\u206c\u200e\u200c\u200e\u206e\u206d\u206c\u206b\u202b\u200b\u206c\u206b\u206f\u202c\u202b\u202b\u200b\u202c\u200e\u206a\u202a\u202e\u202d\u206d\u202b\u202a\u206e\u202a\u206d\u202b\u206a\u206e\u200f\u206b\u202b\u200d\u206b\u200b\u206d\u202e orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e(RenderTexture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e(orig_\u206a\u206d\u200e\u206d\u202d\u206c\u202e\u202e\u200b\u200f\u202b\u206c\u206a\u206f\u206f\u200c\u200e\u200f\u200f\u200e\u206f\u202a\u202d\u200e\u202d\u200f\u206d\u206e\u202a\u206f\u200d\u202e\u206e\u202a\u206e\u200d\u200f\u206a\u200f\u206b\u202e orig, RenderTexture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e(Texture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e(orig_\u206b\u200f\u206e\u200b\u206e\u200f\u206e\u206a\u200b\u200f\u206b\u206b\u206b\u202a\u200c\u206f\u200d\u200e\u202d\u202c\u206d\u206b\u202c\u202a\u200d\u206d\u206c\u202d\u202c\u202d\u202c\u206e\u200c\u202c\u202a\u200e\u206c\u206c\u200b\u202a\u202e orig, Texture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e(Texture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e(orig_\u206c\u202c\u202c\u206c\u200f\u202d\u200d\u200d\u206c\u206f\u202e\u206f\u202e\u206e\u206c\u202d\u202d\u206c\u200d\u202b\u200f\u200e\u200f\u202e\u206c\u200f\u200c\u202e\u202a\u200d\u206d\u206a\u202a\u206c\u206c\u206e\u202e\u200d\u206c\u206a\u202e orig, Texture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D orig_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e(int P_0, int P_1, TextureFormat P_2, bool P_3, bool P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Texture2D hook_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e(orig_\u200e\u200e\u206a\u202b\u200f\u202c\u206d\u206f\u202e\u206d\u200d\u206d\u206c\u206c\u206b\u206d\u202d\u202e\u200c\u202e\u200b\u206c\u200d\u206d\u202d\u200c\u206e\u206c\u200c\u206a\u202e\u202c\u202b\u206d\u202c\u206f\u200e\u202e\u202b\u202e\u202e orig, int P_1, int P_2, TextureFormat P_3, bool P_4, bool P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e(Texture2D P_0, int P_1, int P_2, TextureFormat P_3, bool P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e(orig_\u200f\u202a\u200b\u200f\u202c\u200c\u200e\u206a\u206a\u202e\u202c\u202b\u206d\u206a\u202c\u200b\u202c\u200f\u202c\u200d\u200f\u202e\u206e\u200c\u202d\u206f\u206c\u200b\u206a\u200b\u202a\u200c\u200c\u202b\u206f\u200c\u206c\u206e\u206d\u206f\u202e orig, Texture2D P_1, int P_2, int P_3, TextureFormat P_4, bool P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e(Texture2D P_0, Rect P_1, int P_2, int P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e(orig_\u202e\u202c\u206f\u202e\u202c\u206d\u200b\u202b\u206b\u200f\u202e\u206e\u200e\u200c\u202c\u206d\u206b\u206a\u206b\u200b\u200b\u206a\u206e\u206e\u202c\u200d\u206c\u206d\u200e\u200b\u200c\u202b\u206b\u206c\u200d\u206d\u206f\u200d\u206d\u206b\u202e orig, Texture2D P_1, Rect P_2, int P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e(orig_\u202c\u206c\u206b\u202c\u200d\u206e\u206f\u200c\u202b\u200e\u202a\u206e\u200e\u200e\u202a\u200e\u202c\u206a\u202e\u200d\u200c\u200d\u202b\u206a\u200d\u200e\u206d\u200d\u200f\u202c\u202a\u202e\u202c\u206c\u206b\u206f\u206b\u206b\u206f\u206f\u202e orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e(string P_0, object P_1, object P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e(orig_\u200f\u206c\u202e\u206a\u206a\u202d\u200e\u200d\u200c\u206c\u202d\u200e\u200c\u206d\u206a\u202a\u202c\u202a\u200e\u200b\u206a\u202a\u202d\u200e\u200c\u206e\u202a\u206b\u206e\u200c\u202d\u206c\u206d\u202c\u202e\u202b\u202e\u202b\u200f\u202b\u202e orig, string P_1, object P_2, object P_3);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Color[] orig_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e(Texture2D P_0, int P_1, int P_2, int P_3, int P_4);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Color[] hook_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e(orig_\u200d\u200e\u202c\u202c\u206b\u202a\u200b\u206f\u206d\u202c\u206b\u206f\u206f\u202e\u202e\u200d\u206c\u202a\u202a\u206f\u200d\u206c\u200d\u206d\u206a\u206e\u202d\u202a\u206d\u206d\u202c\u202a\u206f\u200d\u206f\u202e\u202a\u200b\u200e\u206f\u202e orig, Texture2D P_1, int P_2, int P_3, int P_4, int P_5);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate TextureFormat orig_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e(Texture2D P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate TextureFormat hook_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e(orig_\u200b\u206f\u206e\u200d\u206a\u202a\u206a\u206d\u206f\u200f\u200e\u202b\u202e\u200d\u202d\u200e\u202c\u206e\u200f\u200b\u202d\u202c\u202b\u200c\u202d\u206c\u200d\u202b\u206a\u200f\u206e\u202b\u202a\u200c\u206f\u206a\u200e\u202e\u202a\u200d\u202e orig, Texture2D P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e(Texture P_0, TextureWrapMode P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e(orig_\u206d\u200d\u206b\u200c\u200e\u206b\u202e\u202e\u206d\u202e\u206c\u202d\u206d\u200e\u206b\u206a\u206f\u202b\u202a\u202c\u206a\u202e\u206a\u202c\u206a\u200e\u202b\u200c\u200c\u200e\u202a\u206f\u200b\u200b\u206f\u200f\u200c\u206a\u202c\u200d\u202e orig, Texture P_1, TextureWrapMode P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate FilterMode orig_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e(Texture P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate FilterMode hook_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e(orig_\u200e\u200e\u206f\u200c\u206d\u202c\u202d\u202b\u202e\u206c\u200d\u200e\u206a\u202e\u206c\u202c\u206e\u200b\u206d\u200b\u202d\u200f\u206a\u202d\u206e\u202b\u202c\u202c\u206f\u206e\u200d\u206d\u200d\u202d\u200d\u202c\u206a\u206f\u200d\u202a\u202e orig, Texture P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e(Texture P_0, FilterMode P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e(orig_\u202c\u206d\u200f\u200c\u206e\u202c\u200b\u202b\u206f\u206a\u200c\u202e\u206a\u202b\u202a\u200b\u206f\u202b\u206b\u202a\u206c\u202b\u202e\u202b\u202e\u206b\u202d\u202b\u206c\u202d\u206c\u202a\u200f\u200e\u202d\u206a\u206f\u202b\u206d\u206a\u202e orig, Texture P_1, FilterMode P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e(Object P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e(orig_\u206e\u202e\u200f\u206b\u200e\u200c\u206d\u202a\u206b\u200d\u202e\u206a\u200c\u206e\u206f\u200e\u206e\u200d\u200d\u202d\u200c\u206f\u200c\u200b\u202d\u202a\u206f\u202b\u206e\u206c\u200b\u206b\u202d\u206b\u200f\u200b\u206b\u206b\u200e\u206d\u202e orig, Object P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e(string P_0, string P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e(orig_\u200c\u200f\u206d\u206b\u200d\u202e\u202c\u200f\u202b\u200f\u200f\u206b\u202a\u202a\u202d\u202b\u206e\u202e\u202d\u200e\u200f\u200d\u206b\u200f\u200c\u202e\u200b\u202c\u202c\u200e\u206f\u206e\u200d\u200b\u206e\u202c\u206d\u200e\u206a\u202e\u202e orig, string P_1, string P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e(Object P_0, string P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e(orig_\u206e\u206b\u206b\u206b\u206c\u200b\u202e\u200e\u202b\u200d\u206b\u200c\u202b\u202c\u202c\u206f\u202a\u200e\u202e\u206c\u202c\u206b\u202c\u202c\u200b\u202a\u200b\u202c\u200d\u206c\u200b\u206d\u202e\u200e\u202d\u206d\u202b\u200d\u200c\u206b\u202e orig, Object P_1, string P_2);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Vector3 orig_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e(TerrainData P_0);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate Vector3 hook_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e(orig_\u202d\u200e\u200e\u200e\u200d\u206c\u200c\u206b\u200c\u200c\u202a\u202d\u202a\u200d\u206b\u200e\u206f\u202a\u206f\u206c\u202c\u206b\u206f\u206a\u202e\u200b\u206b\u202a\u202a\u206d\u202b\u206f\u206b\u200f\u200e\u200d\u202d\u200d\u202e\u200f\u202e orig, TerrainData P_1);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e(orig_\u206e\u200c\u206b\u202e\u202b\u200f\u206c\u202a\u200b\u206b\u202b\u206c\u206b\u206e\u206e\u206e\u206c\u206c\u206b\u202b\u200c\u202a\u206a\u206d\u206a\u206b\u206d\u200e\u206c\u202e\u206e\u200e\u206a\u200e\u200c\u200b\u206b\u206f\u200d\u206e\u202e orig);

		public static class \u206b\u206a\u200c\u206b\u206a\u202a\u200d\u202a\u200f\u202b\u200b\u206b\u200d\u202c\u206c\u206c\u202a\u206e\u200c\u206d\u202a\u206b\u206c\u200e\u200c\u202b\u206e\u206e\u200b\u206f\u200f\u200e\u202e\u206b\u202d\u200f\u200b\u202a\u206d\u202c\u202e
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_ctor(object self, TerrainData P_1, bool P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_ctor(orig_ctor orig, object self, TerrainData P_2, bool P_3, bool P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e(object self, int P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e(orig_\u200d\u202d\u206a\u202d\u206e\u206e\u206e\u200f\u206c\u206c\u202a\u200f\u200f\u202a\u206a\u202e\u206f\u206f\u206c\u202e\u206c\u200c\u206b\u202e\u206a\u200f\u206b\u200c\u200f\u200d\u200e\u202b\u200f\u200c\u206c\u206d\u202c\u206f\u202a\u200e\u202e orig, object self, int P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e(object self, int P_1, int P_2, int P_3, int P_4, int P_5);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e(orig_\u202b\u200f\u206d\u202b\u202e\u206b\u206c\u202d\u206d\u200e\u202c\u206d\u206f\u202b\u200f\u202a\u200c\u206c\u206e\u206b\u202c\u202c\u200b\u200c\u202c\u200f\u206c\u202a\u202b\u206c\u200d\u202c\u202b\u200c\u206b\u202b\u200f\u200b\u206c\u206e\u202e orig, object self, int P_2, int P_3, int P_4, int P_5, int P_6);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e(object self, int P_1, int P_2, int P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e(orig_\u206e\u202e\u206d\u206f\u200c\u202d\u206d\u202d\u200b\u200b\u200c\u206c\u206f\u202d\u200b\u206e\u202d\u200c\u202a\u206b\u202e\u202c\u202a\u202e\u206c\u200b\u202c\u200d\u202b\u200e\u206a\u202e\u206f\u202e\u202b\u202d\u206e\u206d\u200c\u200d\u202e orig, object self, int P_2, int P_3, int P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e(object self, int P_1, bool P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e(orig_\u206e\u206e\u200e\u206d\u200d\u200d\u200b\u206f\u206f\u200b\u206b\u206c\u206c\u202a\u206e\u206e\u206d\u202e\u206f\u202d\u206c\u206b\u206f\u202d\u202a\u202b\u206d\u206d\u202d\u200d\u200f\u202e\u202e\u206b\u200d\u206c\u200e\u206a\u200f\u202a\u202e orig, object self, int P_2, bool P_3, bool P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e(object self, int P_1, bool P_2, bool P_3, int P_4, int P_5, int P_6, int P_7);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e(orig_\u206d\u200c\u200d\u206c\u202a\u206c\u200e\u202b\u200d\u206e\u202b\u200d\u202a\u202d\u206b\u202b\u200b\u206a\u200f\u206d\u200f\u200f\u206a\u206b\u202a\u206c\u202a\u200e\u200e\u200e\u202c\u202b\u206e\u200c\u202d\u206b\u202e\u200b\u200b\u206f\u202e orig, object self, int P_2, bool P_3, bool P_4, int P_5, int P_6, int P_7, int P_8);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e(object self, int P_1, bool P_2, bool P_3, int P_4, int P_5);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e(orig_\u206c\u202d\u200c\u206d\u202d\u202c\u206a\u206a\u202e\u206d\u206c\u206e\u200b\u206d\u202c\u202b\u202d\u206a\u200c\u206f\u206a\u202e\u202d\u206f\u200f\u206b\u200f\u202e\u202d\u200c\u202a\u200f\u200b\u202d\u202a\u206c\u202c\u206c\u206b\u202a\u202e orig, object self, int P_2, bool P_3, bool P_4, int P_5, int P_6);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e(object self, int P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e(orig_\u200f\u202a\u206e\u206e\u202d\u202c\u206d\u200d\u202b\u202b\u200c\u202b\u200e\u200b\u202b\u206b\u206e\u202d\u202c\u206e\u206f\u202a\u202c\u206f\u200b\u202e\u206c\u200e\u206c\u202a\u200c\u206c\u200e\u202d\u206d\u206e\u202c\u200c\u202d\u206c\u202e orig, object self, int P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e(object self, int P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e(orig_\u200d\u200b\u206a\u202b\u200f\u202b\u202c\u200c\u200e\u206d\u206c\u206d\u206b\u202a\u202d\u202b\u202d\u200d\u202a\u206c\u200d\u206d\u206a\u202d\u202e\u202b\u206c\u200b\u206f\u202e\u206e\u202e\u200d\u206a\u202b\u202a\u202d\u206a\u202e\u206a\u202e orig, object self, int P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e(object self, int P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e(orig_\u202e\u202e\u202c\u206e\u206c\u202d\u200e\u206e\u200c\u202c\u206b\u206a\u202a\u200f\u200d\u202c\u206c\u206c\u202d\u200e\u200e\u200f\u206a\u202c\u200f\u200b\u206b\u200d\u202d\u200c\u206d\u202e\u200c\u200d\u206a\u200e\u206b\u202d\u200d\u200e\u202e orig, object self, int P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e(object self, int P_1, bool P_2, int P_3, int P_4, int P_5, int P_6);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e(orig_\u202e\u206e\u202d\u206e\u200b\u200e\u202b\u206c\u206f\u200c\u202c\u200d\u200c\u200f\u202a\u200c\u200c\u200f\u200b\u202e\u206e\u206e\u202e\u202b\u200d\u200c\u206e\u206a\u206a\u200c\u202c\u200b\u200b\u206f\u206f\u206b\u206c\u202b\u206e\u206c\u202e orig, object self, int P_2, bool P_3, int P_4, int P_5, int P_6, int P_7);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e(object self, int P_1, bool P_2, int P_3, int P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e(orig_\u200f\u200c\u202e\u202c\u202c\u206c\u202c\u206e\u202e\u200d\u200b\u200d\u200f\u200f\u202b\u200e\u202e\u200e\u200f\u202d\u202d\u200f\u202a\u206d\u202a\u200b\u206c\u200b\u206c\u206c\u206e\u200e\u202e\u206a\u202d\u200b\u202c\u206a\u200f\u200d\u202e orig, object self, int P_2, bool P_3, int P_4, int P_5);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e(object self, int P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e(orig_\u206b\u206e\u200b\u202c\u202a\u202b\u202d\u202a\u200d\u200f\u206b\u200f\u206b\u200f\u202b\u202d\u202a\u200f\u200e\u206a\u202c\u202e\u202a\u206c\u200d\u202a\u202a\u200f\u200d\u200f\u200c\u206a\u206e\u206e\u202b\u206e\u206b\u200f\u206d\u200c\u202e orig, object self, int P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e(object self, int P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e(orig_\u200c\u206e\u200e\u200d\u200b\u202e\u200f\u206e\u202c\u206a\u206f\u206c\u202b\u206d\u202c\u202e\u206e\u206e\u206a\u202d\u200f\u202d\u200f\u202d\u202a\u200d\u202d\u200e\u200b\u206a\u202c\u206d\u200c\u206d\u206e\u200c\u200d\u200c\u202d\u200f\u202e orig, object self, int P_2, bool P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e(object self, int P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e(orig_\u200d\u202c\u206b\u200e\u202b\u200b\u202d\u206c\u206f\u202c\u202d\u206a\u202e\u200b\u202b\u202e\u202a\u200f\u206a\u202a\u200c\u206a\u202d\u200c\u206b\u202b\u206c\u206c\u200b\u206c\u200f\u202e\u200f\u200e\u200f\u206e\u200e\u206d\u200f\u200e\u202e orig, object self, int P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D orig_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e(object self, int P_1, int P_2, int P_3, int P_4, int P_5);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D hook_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e(orig_\u200c\u202c\u206d\u200e\u206f\u206a\u202d\u206a\u206e\u202c\u202b\u206d\u200c\u206f\u202c\u200c\u200f\u200c\u202d\u200f\u200b\u206b\u200f\u206b\u202a\u200d\u200e\u202c\u202b\u200e\u200e\u202b\u206e\u200b\u200e\u206c\u202a\u200f\u200d\u206a\u202e orig, object self, int P_2, int P_3, int P_4, int P_5, int P_6);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e(object self, int P_1, int P_2, int P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e(orig_\u200e\u200f\u206f\u202d\u202e\u200d\u202b\u202d\u206d\u206b\u200b\u202d\u200e\u202a\u200b\u200b\u206d\u200e\u200b\u200c\u202e\u202c\u202d\u202a\u202c\u202e\u200e\u206a\u206d\u202e\u206f\u200d\u200e\u206c\u200c\u202c\u202b\u202c\u202c\u202b\u202e orig, object self, int P_2, int P_3, int P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Vector2 orig_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e(object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Vector2 hook_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e(orig_\u200b\u206a\u206b\u206c\u206b\u200d\u200f\u206d\u206d\u202a\u206f\u200b\u206c\u206f\u202b\u200c\u200b\u200c\u206e\u206a\u202d\u206d\u200d\u200c\u202a\u202b\u200b\u206e\u200d\u202d\u202c\u206a\u200d\u202e\u202b\u206f\u206d\u200b\u206c\u202e\u202e orig, object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e(Object P_0, Object P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e(orig_\u200c\u202a\u206b\u200d\u200f\u206e\u200c\u200c\u206e\u202a\u200b\u206b\u206a\u206d\u200c\u200c\u200b\u202b\u202e\u200f\u200f\u206f\u206b\u200d\u200b\u202d\u206c\u206d\u200f\u206a\u206f\u200f\u206b\u200c\u206f\u202e\u200d\u206f\u206d\u206d\u202e orig, Object P_1, Object P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] orig_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e(TerrainData P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture2D[] hook_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e(orig_\u202c\u206c\u200c\u206f\u206f\u206e\u200b\u200d\u206b\u202b\u206c\u200c\u202b\u206b\u206e\u202b\u202d\u206c\u206a\u206d\u206b\u202b\u200d\u206d\u202d\u206c\u200f\u206f\u202c\u202d\u206d\u202a\u206e\u200e\u200b\u202e\u202b\u200b\u200b\u206c\u202e orig, TerrainData P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string orig_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e(Object P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string hook_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e(orig_\u200d\u202d\u206b\u206f\u206d\u200b\u202b\u202e\u206f\u200f\u200f\u202e\u200d\u200b\u200f\u202d\u206f\u206f\u206f\u206c\u206f\u206e\u200b\u202a\u200f\u206f\u206e\u206c\u200f\u206a\u200d\u202c\u202d\u202b\u206a\u200e\u200b\u206e\u206c\u202e\u202e orig, Object P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e(string P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e(orig_\u206b\u202c\u206e\u206c\u206f\u206d\u200d\u202c\u200e\u206b\u202a\u202d\u206b\u202c\u206d\u206b\u206a\u206a\u206a\u202b\u202c\u206a\u206a\u206d\u206d\u202c\u202d\u206f\u202c\u200b\u206c\u200f\u206a\u200e\u202b\u200c\u200e\u202c\u202c\u206e\u202e orig, string P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string orig_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e(string P_0, string P_1, string P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string hook_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e(orig_\u200e\u206c\u202d\u202a\u206a\u202a\u202e\u206c\u202e\u206d\u200c\u206a\u200f\u206a\u206c\u202e\u200b\u202e\u200f\u200f\u200b\u202e\u200b\u202e\u202a\u200e\u200c\u202a\u200d\u202d\u206f\u206c\u200b\u200f\u200f\u206e\u206d\u200e\u206b\u206d\u202e orig, string P_1, string P_2, string P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Shader orig_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e(string P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Shader hook_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e(orig_\u202b\u202b\u202e\u202c\u206e\u202c\u206e\u200e\u202b\u200c\u206d\u206d\u200c\u206d\u200b\u206a\u200f\u202a\u200f\u200e\u200e\u206e\u200e\u206d\u206a\u200d\u200e\u202d\u206f\u202a\u202e\u200b\u200e\u200e\u206c\u206b\u200e\u202b\u200f\u202d\u202e orig, string P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Material orig_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e(Shader P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Material hook_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e(orig_\u206d\u206f\u202b\u206d\u202e\u206d\u202d\u202a\u200f\u202c\u200e\u206d\u200d\u202e\u200f\u206f\u200c\u202b\u202d\u206e\u202c\u206d\u200d\u206d\u202d\u200f\u202c\u206f\u202c\u202a\u206b\u206b\u206b\u202b\u202a\u206c\u200f\u206a\u206b\u206e\u202e orig, Shader P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e(Material P_0, string P_1, float P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e(orig_\u200f\u202c\u202c\u200b\u200f\u202b\u202c\u202c\u202b\u200d\u202c\u202d\u206b\u202e\u206e\u200f\u202c\u200e\u200f\u206d\u206e\u202b\u200c\u202d\u200c\u206b\u202d\u202d\u202b\u206f\u206f\u202c\u206b\u202d\u202b\u200c\u206d\u206b\u206f\u206c\u202e orig, Material P_1, string P_2, float P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate int orig_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e(TerrainData P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate int hook_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e(orig_\u206a\u206b\u202e\u206a\u200d\u200e\u200b\u202a\u206a\u206c\u202c\u200f\u202d\u206d\u202e\u202c\u202a\u202b\u200f\u202d\u206e\u206a\u206c\u206e\u206e\u202c\u202e\u206c\u200d\u200b\u202e\u202c\u206a\u202d\u200b\u200c\u206c\u206a\u202d\u202e orig, TerrainData P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture orig_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e(int P_0, int P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture hook_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e(orig_\u202b\u200c\u202c\u206c\u206a\u202a\u206c\u202b\u202d\u200c\u206d\u206f\u206b\u200e\u200b\u202b\u206e\u206b\u200d\u200c\u200f\u200b\u206d\u202d\u200d\u202a\u202d\u200f\u206c\u206b\u200d\u202b\u202a\u206d\u200d\u206b\u206d\u200f\u202a\u206b\u202e orig, int P_1, int P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e(RenderTexture P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e(orig_\u200c\u200b\u202e\u202c\u202c\u206e\u202c\u200c\u202e\u202a\u202d\u200d\u206e\u206a\u200e\u206b\u202b\u202a\u206b\u202c\u202e\u206d\u200d\u200c\u200d\u200f\u206c\u200c\u206d\u200b\u200c\u202e\u206b\u206b\u206f\u200e\u202c\u202a\u200e\u202e\u202e orig, RenderTexture P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate TextureFormat orig_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e(Texture2D P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate TextureFormat hook_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e(orig_\u206e\u202e\u206c\u206a\u202e\u206f\u206f\u206a\u206e\u200c\u206b\u206b\u206c\u202a\u200f\u202e\u206f\u200f\u200d\u200e\u206e\u202c\u206d\u206f\u200d\u200e\u206c\u202c\u206b\u206a\u206d\u202e\u202e\u200f\u202b\u206c\u202a\u206f\u200b\u206e\u202e orig, Texture2D P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e(Texture P_0, TextureWrapMode P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e(orig_\u206a\u200f\u200f\u202a\u206e\u202d\u202e\u206f\u200e\u200b\u200d\u200f\u206c\u202d\u206e\u206c\u202a\u202e\u206b\u200c\u206b\u206d\u202b\u202c\u206b\u200b\u202d\u206c\u200f\u202d\u202c\u202c\u202a\u206f\u200f\u206f\u202a\u200c\u202b\u200d\u202e orig, Texture P_1, TextureWrapMode P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string orig_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e(string P_0, string P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate string hook_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e(orig_\u200b\u206e\u202c\u200d\u200d\u200b\u206d\u200d\u202b\u200f\u202a\u200e\u206b\u206d\u206b\u202b\u200e\u206a\u200b\u200c\u202e\u202c\u206a\u200f\u200d\u206c\u200d\u206d\u202b\u200d\u202d\u206a\u202e\u206a\u206d\u206b\u200f\u200e\u200f\u206c\u202e orig, string P_1, string P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e(Object P_0, string P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e(orig_\u202d\u206e\u200d\u200f\u202c\u200e\u206e\u200f\u206b\u202d\u200e\u202a\u200f\u202a\u202c\u202c\u206c\u200b\u200f\u206f\u206a\u206a\u206a\u202b\u206b\u206e\u206d\u200c\u202c\u200b\u200d\u206e\u202c\u200c\u200e\u200b\u202b\u200d\u206f\u200c\u202e orig, Object P_1, string P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e(RenderTexture P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e(orig_\u200b\u206b\u202a\u206c\u206e\u202c\u200c\u202d\u206e\u206c\u200e\u200f\u200d\u202d\u200e\u206a\u202b\u206a\u202b\u202b\u206c\u200d\u206c\u206a\u200b\u202a\u202c\u206b\u206b\u200e\u200d\u206e\u206e\u206d\u202b\u206e\u206c\u206f\u200b\u202d\u202e orig, RenderTexture P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e(orig_\u202e\u202d\u200e\u202e\u200b\u202b\u202a\u200c\u202b\u202a\u206d\u206a\u206b\u206d\u206a\u206a\u202c\u202c\u206d\u206b\u206e\u206e\u206f\u200d\u206a\u200d\u206c\u202c\u206a\u206f\u206c\u206a\u200e\u206d\u200f\u206f\u206a\u202a\u200f\u200e\u202e orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e(Object P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e(orig_\u206b\u206f\u200e\u206e\u202c\u200d\u206a\u206d\u206c\u206e\u206e\u206d\u206a\u206f\u202a\u202c\u200f\u206a\u200d\u206f\u206e\u202a\u200d\u206d\u206b\u200e\u200d\u206b\u202c\u202e\u200e\u200d\u206f\u200e\u202d\u200e\u206f\u200c\u206d\u202d\u202e orig, Object P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e(Object P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e(orig_\u206b\u206e\u200e\u202a\u206f\u202e\u206f\u200e\u200f\u206c\u202e\u206d\u206c\u206c\u202b\u200c\u202b\u202e\u206b\u202d\u206a\u202a\u202b\u200b\u202d\u200d\u206e\u206f\u206b\u200f\u202e\u206d\u202e\u200f\u200b\u206e\u202c\u202c\u202a\u202c\u202e orig, Object P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ColorSpace orig_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ColorSpace hook_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e(orig_\u206a\u202b\u202c\u200b\u206f\u202e\u200c\u206b\u200f\u202b\u206e\u206e\u200b\u202b\u202a\u206f\u202a\u202c\u206f\u200b\u206c\u200d\u206e\u200c\u202b\u202a\u206f\u206e\u200b\u200d\u202e\u200e\u202c\u206b\u200e\u206e\u202d\u206a\u202b\u200e\u202e orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture orig_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e(TerrainData P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture hook_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e(orig_\u202d\u206b\u202d\u202d\u202c\u200f\u200c\u200e\u202d\u200b\u202c\u200b\u206e\u206c\u206d\u206c\u202e\u206b\u206a\u206e\u206a\u200d\u202c\u202b\u200d\u206d\u206f\u206c\u206b\u202b\u206c\u202e\u206e\u200b\u206a\u200f\u200f\u206f\u206a\u202a\u202e orig, TerrainData P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e(Material P_0, string P_1, Vector4 P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e(orig_\u206f\u200f\u206f\u200b\u206e\u202b\u202c\u206a\u200e\u200b\u200f\u206d\u206b\u200e\u200f\u200e\u206c\u202d\u206a\u206f\u200b\u200d\u206a\u206b\u206d\u202a\u202d\u206c\u206b\u206f\u202d\u200b\u200c\u202d\u202a\u206d\u206e\u206c\u202b\u202d\u202e orig, Material P_1, string P_2, Vector4 P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate int orig_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e(Texture P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate int hook_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e(orig_\u206b\u206a\u200e\u202d\u206b\u202d\u200b\u202a\u206f\u200e\u200d\u202e\u206d\u200b\u206a\u202a\u200f\u202d\u206f\u202b\u202a\u200b\u206b\u200b\u200d\u200b\u202e\u202d\u206c\u206e\u202b\u202e\u202a\u200e\u202b\u200c\u202a\u200b\u200c\u206b\u202e orig, Texture P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTextureFormat orig_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e(RenderTexture P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTextureFormat hook_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e(orig_\u206c\u206c\u200e\u202a\u202d\u202b\u206d\u202b\u202b\u200b\u200e\u202b\u202e\u200d\u200d\u202e\u206b\u206a\u206d\u206d\u206e\u200b\u200d\u206b\u202c\u200c\u202b\u202e\u202d\u202d\u206c\u200d\u200c\u202c\u202b\u200c\u200b\u206a\u202d\u202a\u202e orig, RenderTexture P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e(RenderTextureFormat P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e(orig_\u202e\u206b\u206b\u206c\u202c\u206b\u206e\u200f\u206f\u200c\u206b\u206a\u202d\u206c\u200c\u200f\u200f\u200f\u202a\u200b\u202c\u206f\u206d\u200d\u202a\u200f\u206a\u202e\u202e\u200f\u206b\u202e\u206a\u202d\u206d\u202b\u200e\u206a\u206d\u202b\u202e orig, RenderTextureFormat P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e(TextureFormat P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e(orig_\u200b\u202d\u200c\u206c\u202e\u200f\u200e\u200d\u202b\u202d\u206c\u200f\u206b\u202c\u200d\u200f\u202c\u206f\u202c\u200d\u202a\u206f\u202b\u202d\u200e\u202e\u206e\u202c\u206f\u200d\u200f\u206e\u206c\u206d\u202d\u206a\u206f\u206e\u202c\u202d\u202e orig, TextureFormat P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture orig_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e(int P_0, int P_1, int P_2, RenderTextureFormat P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture hook_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e(orig_\u206b\u200b\u202c\u206a\u200b\u200d\u200e\u206c\u206c\u202c\u200e\u206d\u202a\u202c\u202a\u206a\u202d\u206b\u202d\u202c\u206b\u206d\u206c\u202d\u202c\u200e\u206e\u206b\u206e\u206b\u202a\u202a\u202a\u202e\u202d\u202c\u206f\u206f\u206f\u200d\u202e orig, int P_1, int P_2, int P_3, RenderTextureFormat P_4);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture orig_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e(TerrainData P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Texture hook_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e(orig_\u200b\u206a\u200e\u206d\u206f\u200f\u200c\u202c\u206a\u206f\u206c\u206f\u200f\u206e\u206c\u200d\u200c\u202c\u202b\u200d\u202a\u206c\u206c\u200c\u206c\u206c\u200b\u200f\u202a\u202d\u206c\u200d\u202e\u200e\u200d\u206e\u202c\u200d\u206b\u202e orig, TerrainData P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e(TerrainData P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e(orig_\u202c\u202d\u202c\u200f\u200e\u206f\u206c\u200f\u206d\u200d\u200d\u202b\u202d\u206d\u200f\u200d\u200d\u202e\u200b\u206d\u200c\u202c\u200e\u200c\u200d\u200e\u200e\u206d\u200f\u200d\u200d\u206c\u206d\u206c\u200c\u206e\u206e\u200f\u202c\u202a\u202e orig, TerrainData P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e(TerrainData P_0, bool P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e(orig_\u200f\u206a\u200c\u206b\u200c\u202d\u200f\u206c\u200d\u200b\u206d\u200f\u202c\u200c\u200b\u202c\u206b\u206a\u206a\u202d\u202a\u200d\u206e\u202b\u206c\u206b\u202e\u206a\u202b\u206d\u200d\u200d\u206d\u206e\u206c\u200f\u202e\u200f\u200d\u206e\u202e orig, TerrainData P_1, bool P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture orig_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e(int P_0, int P_1, int P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate RenderTexture hook_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e(orig_\u206b\u206d\u206b\u206d\u206c\u206d\u206d\u206d\u206e\u202a\u202b\u200b\u202d\u206e\u206e\u202e\u202c\u206e\u200b\u206f\u200b\u202d\u206a\u200f\u206b\u200c\u200c\u200e\u202c\u206f\u202e\u202d\u202c\u206d\u206a\u206a\u206e\u202e\u200c\u200f\u202e orig, int P_1, int P_2, int P_3);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e(Texture P_0, RenderTexture P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e(orig_\u202a\u200f\u202c\u206a\u206a\u200d\u206b\u200c\u202b\u206c\u206c\u200b\u200c\u206a\u200b\u202a\u202e\u202e\u200d\u206b\u202e\u206e\u202a\u202a\u202e\u200f\u202e\u200d\u206e\u202e\u200d\u202c\u200d\u202c\u202a\u200c\u202a\u202e\u200e\u200c\u202e orig, Texture P_1, RenderTexture P_2);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Color[] orig_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e(Texture2D P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate Color[] hook_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e(orig_\u200f\u206a\u206e\u202c\u202b\u206e\u200d\u206a\u200e\u202a\u206e\u200c\u206c\u206e\u200b\u200b\u200e\u202d\u206e\u200c\u206d\u202d\u200e\u200b\u202b\u200d\u202a\u200b\u202c\u202a\u200f\u206e\u202d\u206b\u200f\u206e\u206b\u202b\u202b\u206c\u202e orig, Texture2D P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate float orig_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e(IEnumerable<float> P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate float hook_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e(orig_\u202e\u206d\u206c\u206a\u200c\u202b\u206c\u202a\u200f\u202c\u206c\u202b\u200b\u202e\u206f\u202d\u200b\u200f\u202a\u202b\u200f\u206c\u206c\u202c\u200b\u202d\u200c\u202d\u206d\u206b\u202d\u200c\u200b\u202c\u202d\u200e\u202e\u206e\u200e\u202d\u202e orig, IEnumerable<float> P_1);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate float orig_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e(IEnumerable<float> P_0);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate float hook_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e(orig_\u206c\u206b\u206c\u202a\u206e\u206a\u202e\u200f\u202d\u202e\u202b\u202e\u200c\u202e\u206d\u206c\u200d\u202b\u206a\u200b\u202a\u206b\u206a\u206c\u202c\u202d\u200d\u206b\u206d\u206f\u200d\u206b\u202e\u200c\u206f\u200f\u200f\u202d\u206d\u206e\u202e orig, IEnumerable<float> P_1);

			public static class \u206f\u202d\u200c\u206d\u200c\u200f\u206d\u206e\u202b\u200b\u202d\u206f\u206e\u200e\u206d\u206d\u206b\u206c\u206d\u200d\u202d\u202c\u200b\u206f\u200e\u202e\u206c\u206f\u202b\u202d\u206a\u200c\u202a\u200b\u200e\u206a\u200f\u200b\u200c\u202c\u202e
			{
				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate void orig_cctor();

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate void hook_cctor(orig_cctor orig);

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate void orig_ctor(object self);

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate void hook_ctor(orig_ctor orig, object self);

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate float orig_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e(object self, Color P_1);

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate float hook_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e(orig_\u206b\u200e\u200d\u206f\u206e\u206f\u206a\u202a\u200b\u200d\u200e\u206f\u202c\u202e\u202e\u206d\u202e\u200e\u200c\u202a\u200c\u200d\u202d\u200f\u202d\u200b\u202d\u202d\u202e\u206b\u206f\u206d\u200d\u202a\u202d\u200f\u202d\u202c\u202d\u206b\u202e orig, object self, Color P_2);

				[EditorBrowsable(EditorBrowsableState.Never)]
				public delegate float orig_\u206d\u202d\u200c\u202e\u200c\u206b\u202d\u200c\u202a\u206b\u202d\u206c\u200e\u206b\u200b\u206c\u200e\u200c\u200f\u206c\u200d\u200d\u200b\u206a\u202d\u202d\u202

plugins/MMHOOK/MMHOOK_Assembly-CSharp.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
using DigitalRuby.ThunderAndLightning;
using Discord;
using Dissonance;
using Dissonance.Integrations.Unity_NFGO;
using DunGen;
using DunGen.Adapters;
using DunGen.Analysis;
using DunGen.Editor;
using DunGen.Graph;
using DunGen.Tags;
using GameNetcodeStuff;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On;
using On.DigitalRuby.ThunderAndLightning;
using On.Dissonance.Integrations.Unity_NFGO;
using On.DunGen;
using On.DunGen.Adapters;
using On.DunGen.Analysis;
using On.DunGen.Editor;
using On.DunGen.Graph;
using On.DunGen.Tags;
using On.GameNetcodeStuff;
using On.__GEN;
using Steamworks;
using Steamworks.Data;
using TMPro;
using Unity.AI.Navigation;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Video;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On
{
	public static class AlarmButton
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_PushAlarmButton(AlarmButton self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_PushAlarmButton(orig_PushAlarmButton orig, AlarmButton self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(AlarmButton self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, AlarmButton self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AlarmButton self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AlarmButton self);

		public static event hook_PushAlarmButton PushAlarmButton
		{
			add
			{
				HookEndpointManager.Add<hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AlarmButton
	{
		public static event Manipulator PushAlarmButton
		{
			add
			{
				HookEndpointManager.Modify<On.AlarmButton.hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AlarmButton.hook_PushAlarmButton>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Update
		{
			add
			{
				HookEndpointManager.Modify<On.AlarmButton.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AlarmButton.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AlarmButton.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AlarmButton.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class AnimatedItem
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Start(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Start(orig_Start orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EquipItem(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EquipItem(orig_EquipItem orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DiscardItem(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DiscardItem(orig_DiscardItem orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_PocketItem(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_PocketItem(orig_PocketItem orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___initializeVariables(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___initializeVariables(orig___initializeVariables orig, AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig___getTypeName(AnimatedItem self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook___getTypeName(orig___getTypeName orig, AnimatedItem self);

		public static event hook_Start Start
		{
			add
			{
				HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EquipItem EquipItem
		{
			add
			{
				HookEndpointManager.Add<hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DiscardItem DiscardItem
		{
			add
			{
				HookEndpointManager.Add<hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_PocketItem PocketItem
		{
			add
			{
				HookEndpointManager.Add<hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___initializeVariables __initializeVariables
		{
			add
			{
				HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___getTypeName __getTypeName
		{
			add
			{
				HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AnimatedItem
	{
		public static event Manipulator Start
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator EquipItem
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_EquipItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator DiscardItem
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_DiscardItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator PocketItem
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_PocketItem>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Update
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __initializeVariables
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __getTypeName
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedItem.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedItem.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class AnimatedTextureUV
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnEnable(AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnEnable(orig_OnEnable orig, AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnDisable(AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnDisable(orig_OnDisable orig, AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator orig_AnimateUV(AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator hook_AnimateUV(orig_AnimateUV orig, AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AnimatedTextureUV self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AnimatedTextureUV self);

		public static event hook_OnEnable OnEnable
		{
			add
			{
				HookEndpointManager.Add<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnDisable OnDisable
		{
			add
			{
				HookEndpointManager.Add<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_AnimateUV AnimateUV
		{
			add
			{
				HookEndpointManager.Add<hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AnimatedTextureUV
	{
		public static event Manipulator OnEnable
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedTextureUV.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnDisable
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedTextureUV.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator AnimateUV
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedTextureUV.hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_AnimateUV>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AnimatedTextureUV.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimatedTextureUV.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class AnimationStopPoints
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAnimationStopPosition1(AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAnimationStopPosition1(orig_SetAnimationStopPosition1 orig, AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAnimationGo(AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAnimationGo(orig_SetAnimationGo orig, AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAnimationStopPosition2(AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAnimationStopPosition2(orig_SetAnimationStopPosition2 orig, AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AnimationStopPoints self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AnimationStopPoints self);

		public static event hook_SetAnimationStopPosition1 SetAnimationStopPosition1
		{
			add
			{
				HookEndpointManager.Add<hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetAnimationGo SetAnimationGo
		{
			add
			{
				HookEndpointManager.Add<hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetAnimationStopPosition2 SetAnimationStopPosition2
		{
			add
			{
				HookEndpointManager.Add<hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AnimationStopPoints
	{
		public static event Manipulator SetAnimationStopPosition1
		{
			add
			{
				HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationStopPosition1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetAnimationGo
		{
			add
			{
				HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationGo>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetAnimationStopPosition2
		{
			add
			{
				HookEndpointManager.Modify<On.AnimationStopPoints.hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_SetAnimationStopPosition2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AnimationStopPoints.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AnimationStopPoints.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class AudioReverbPresets
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AudioReverbPresets self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AudioReverbPresets self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AudioReverbPresets
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AudioReverbPresets.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AudioReverbPresets.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class AutoParentToShip
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Awake(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Awake(orig_Awake orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LateUpdate(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LateUpdate(orig_LateUpdate orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartSuckingOutOfShip(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartSuckingOutOfShip(orig_StartSuckingOutOfShip orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator orig_SuckObjectOutOfShip(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator hook_SuckObjectOutOfShip(orig_SuckObjectOutOfShip orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_MoveToOffset(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_MoveToOffset(orig_MoveToOffset orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___initializeVariables(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___initializeVariables(orig___initializeVariables orig, AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig___getTypeName(AutoParentToShip self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook___getTypeName(orig___getTypeName orig, AutoParentToShip self);

		public static event hook_Awake Awake
		{
			add
			{
				HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LateUpdate LateUpdate
		{
			add
			{
				HookEndpointManager.Add<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartSuckingOutOfShip StartSuckingOutOfShip
		{
			add
			{
				HookEndpointManager.Add<hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SuckObjectOutOfShip SuckObjectOutOfShip
		{
			add
			{
				HookEndpointManager.Add<hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_MoveToOffset MoveToOffset
		{
			add
			{
				HookEndpointManager.Add<hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___initializeVariables __initializeVariables
		{
			add
			{
				HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___getTypeName __getTypeName
		{
			add
			{
				HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class AutoParentToShip
	{
		public static event Manipulator Awake
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator LateUpdate
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator StartSuckingOutOfShip
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_StartSuckingOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SuckObjectOutOfShip
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_SuckObjectOutOfShip>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator MoveToOffset
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_MoveToOffset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __initializeVariables
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __getTypeName
		{
			add
			{
				HookEndpointManager.Modify<On.AutoParentToShip.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.AutoParentToShip.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On
{
	public static class BaboonBirdAI
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Start(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Start(orig_Start orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SyncInitialValuesServerRpc(BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SyncInitialValuesServerRpc(orig_SyncInitialValuesServerRpc orig, BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SyncInitialValuesClientRpc(BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SyncInitialValuesClientRpc(orig_SyncInitialValuesClientRpc orig, BaboonBirdAI self, int syncLeadershipLevel, Vector3 campPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LateUpdate(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LateUpdate(orig_LateUpdate orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnCollideWithPlayer(BaboonBirdAI self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnCollideWithPlayer(orig_OnCollideWithPlayer orig, BaboonBirdAI self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnCollideWithEnemy(BaboonBirdAI self, Collider other, EnemyAI enemyScript);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnCollideWithEnemy(orig_OnCollideWithEnemy orig, BaboonBirdAI self, Collider other, EnemyAI enemyScript);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_HitEnemy(BaboonBirdAI self, int force, PlayerControllerB playerWhoHit, bool playHitSFX);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_HitEnemy(orig_HitEnemy orig, BaboonBirdAI self, int force, PlayerControllerB playerWhoHit, bool playHitSFX);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_KillEnemy(BaboonBirdAI self, bool destroy);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_KillEnemy(orig_KillEnemy orig, BaboonBirdAI self, bool destroy);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StopKillAnimation(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StopKillAnimation(orig_StopKillAnimation orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StabPlayerDeathAnimServerRpc(BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StabPlayerDeathAnimServerRpc(orig_StabPlayerDeathAnimServerRpc orig, BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StabPlayerDeathAnimClientRpc(BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StabPlayerDeathAnimClientRpc(orig_StabPlayerDeathAnimClientRpc orig, BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator orig_killPlayerAnimation(BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator hook_killPlayerAnimation(orig_killPlayerAnimation orig, BaboonBirdAI self, int playerObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_InteractWithScrap(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_InteractWithScrap(orig_InteractWithScrap orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_CanGrabScrap(BaboonBirdAI self, GrabbableObject scrap);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_CanGrabScrap(orig_CanGrabScrap orig, BaboonBirdAI self, GrabbableObject scrap);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DropHeldItemAndSync(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DropHeldItemAndSync(orig_DropHeldItemAndSync orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DropScrapServerRpc(BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DropScrapServerRpc(orig_DropScrapServerRpc orig, BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DropScrapClientRpc(BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DropScrapClientRpc(orig_DropScrapClientRpc orig, BaboonBirdAI self, NetworkObjectReference item, Vector3 targetFloorPosition, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DropScrap(BaboonBirdAI self, NetworkObject item, Vector3 targetFloorPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DropScrap(orig_DropScrap orig, BaboonBirdAI self, NetworkObject item, Vector3 targetFloorPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_GrabItemAndSync(BaboonBirdAI self, NetworkObject item);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_GrabItemAndSync(orig_GrabItemAndSync orig, BaboonBirdAI self, NetworkObject item);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_GrabScrapServerRpc(BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_GrabScrapServerRpc(orig_GrabScrapServerRpc orig, BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_GrabScrapClientRpc(BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_GrabScrapClientRpc(orig_GrabScrapClientRpc orig, BaboonBirdAI self, NetworkObjectReference item, int clientWhoSentRPC);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_GrabScrap(BaboonBirdAI self, NetworkObject item);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_GrabScrap(orig_GrabScrap orig, BaboonBirdAI self, NetworkObject item);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ReachedNodeInSearch(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ReachedNodeInSearch(orig_ReachedNodeInSearch orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DoAIInterval(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DoAIInterval(orig_DoAIInterval orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StopFocusingThreat(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StopFocusingThreat(orig_StopFocusingThreat orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StopFocusingThreatServerRpc(BaboonBirdAI self, bool enterScoutingMode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StopFocusingThreatServerRpc(orig_StopFocusingThreatServerRpc orig, BaboonBirdAI self, bool enterScoutingMode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StopFocusingThreatClientRpc(BaboonBirdAI self, bool enterScoutingMode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StopFocusingThreatClientRpc(orig_StopFocusingThreatClientRpc orig, BaboonBirdAI self, bool enterScoutingMode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAggressiveMode(BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAggressiveMode(orig_SetAggressiveMode orig, BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAggressiveModeServerRpc(BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAggressiveModeServerRpc(orig_SetAggressiveModeServerRpc orig, BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetAggressiveModeClientRpc(BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetAggressiveModeClientRpc(orig_SetAggressiveModeClientRpc orig, BaboonBirdAI self, int mode);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetThreatInView(BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetThreatInView(orig_SetThreatInView orig, BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetThreatInViewServerRpc(BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetThreatInViewServerRpc(orig_SetThreatInViewServerRpc orig, BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetThreatInViewClientRpc(BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetThreatInViewClientRpc(orig_SetThreatInViewClientRpc orig, BaboonBirdAI self, bool inView);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EnemyEnterRestModeServerRpc(BaboonBirdAI self, bool sleep, bool atCamp);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EnemyEnterRestModeServerRpc(orig_EnemyEnterRestModeServerRpc orig, BaboonBirdAI self, bool sleep, bool atCamp);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EnemyEnterRestModeClientRpc(BaboonBirdAI self, bool sleep, bool atCamp);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EnemyEnterRestModeClientRpc(orig_EnemyEnterRestModeClientRpc orig, BaboonBirdAI self, bool sleep, bool atCamp);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EnemyGetUpServerRpc(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EnemyGetUpServerRpc(orig_EnemyGetUpServerRpc orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EnemyGetUpClientRpc(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EnemyGetUpClientRpc(orig_EnemyGetUpClientRpc orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnDrawGizmos(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnDrawGizmos(orig_OnDrawGizmos orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DetectNoise(BaboonBirdAI self, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DetectNoise(orig_DetectNoise orig, BaboonBirdAI self, Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_AnimateLooking(BaboonBirdAI self, Vector3 lookAtPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_AnimateLooking(orig_AnimateLooking orig, BaboonBirdAI self, Vector3 lookAtPosition);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate float orig_GetComfortableDistanceToThreat(BaboonBirdAI self, Threat focusedThreat);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate float hook_GetComfortableDistanceToThreat(orig_GetComfortableDistanceToThreat orig, BaboonBirdAI self, Threat focusedThreat);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ReactToThreat(BaboonBirdAI self, Threat closestThreat);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ReactToThreat(orig_ReactToThreat orig, BaboonBirdAI self, Threat closestThreat);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartFocusOnThreatServerRpc(BaboonBirdAI self, NetworkObjectReference netObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartFocusOnThreatServerRpc(orig_StartFocusOnThreatServerRpc orig, BaboonBirdAI self, NetworkObjectReference netObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartFocusOnThreatClientRpc(BaboonBirdAI self, NetworkObjectReference netObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartFocusOnThreatClientRpc(orig_StartFocusOnThreatClientRpc orig, BaboonBirdAI self, NetworkObjectReference netObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate float orig_ReactToOtherBaboonSighted(BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate float hook_ReactToOtherBaboonSighted(orig_ReactToOtherBaboonSighted orig, BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DoLOSCheck(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DoLOSCheck(orig_DoLOSCheck orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_PingBaboonInterest(BaboonBirdAI self, Vector3 interestPosition, int pingImportance);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_PingBaboonInterest(orig_PingBaboonInterest orig, BaboonBirdAI self, Vector3 interestPosition, int pingImportance);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_PingBirdInterestServerRpc(BaboonBirdAI self, Vector3 lookPosition, float timeToPeek);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_PingBirdInterestServerRpc(orig_PingBirdInterestServerRpc orig, BaboonBirdAI self, Vector3 lookPosition, float timeToPeek);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_PingBirdInterestClientRpc(BaboonBirdAI self, Vector3 lookPosition, float timeToPeek);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_PingBirdInterestClientRpc(orig_PingBirdInterestClientRpc orig, BaboonBirdAI self, Vector3 lookPosition, float timeToPeek);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_JoinScoutingGroup(BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_JoinScoutingGroup(orig_JoinScoutingGroup orig, BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartScoutingGroup(BaboonBirdAI self, BaboonBirdAI firstMember, bool syncWithClients);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartScoutingGroup(orig_StartScoutingGroup orig, BaboonBirdAI self, BaboonBirdAI firstMember, bool syncWithClients);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LeaveCurrentScoutingGroup(BaboonBirdAI self, bool sync);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LeaveCurrentScoutingGroup(orig_LeaveCurrentScoutingGroup orig, BaboonBirdAI self, bool sync);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LeaveScoutingGroupServerRpc(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LeaveScoutingGroupServerRpc(orig_LeaveScoutingGroupServerRpc orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LeaveScoutingGroupClientRpc(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LeaveScoutingGroupClientRpc(orig_LeaveScoutingGroupClientRpc orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartScoutingGroupServerRpc(BaboonBirdAI self, NetworkObjectReference leaderNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartScoutingGroupServerRpc(orig_StartScoutingGroupServerRpc orig, BaboonBirdAI self, NetworkObjectReference leaderNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartScoutingGroupClientRpc(BaboonBirdAI self, NetworkObjectReference leaderNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartScoutingGroupClientRpc(orig_StartScoutingGroupClientRpc orig, BaboonBirdAI self, NetworkObjectReference leaderNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_JoinScoutingGroupServerRpc(BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_JoinScoutingGroupServerRpc(orig_JoinScoutingGroupServerRpc orig, BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_JoinScoutingGroupClientRpc(BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_JoinScoutingGroupClientRpc(orig_JoinScoutingGroupClientRpc orig, BaboonBirdAI self, NetworkObjectReference otherBaboonNetworkObject);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_CallToOtherBaboon(BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_CallToOtherBaboon(orig_CallToOtherBaboon orig, BaboonBirdAI self, BaboonBirdAI otherBaboon);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartMiscAnimation(BaboonBirdAI self, int anim);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartMiscAnimation(orig_StartMiscAnimation orig, BaboonBirdAI self, int anim);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartMiscAnimationServerRpc(BaboonBirdAI self, int miscAnimationId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartMiscAnimationServerRpc(orig_StartMiscAnimationServerRpc orig, BaboonBirdAI self, int miscAnimationId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_StartMiscAnimationClientRpc(BaboonBirdAI self, int miscAnimationId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_StartMiscAnimationClientRpc(orig_StartMiscAnimationClientRpc orig, BaboonBirdAI self, int miscAnimationId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_CalculateAnimationDirection(BaboonBirdAI self, float maxSpeed);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_CalculateAnimationDirection(orig_CalculateAnimationDirection orig, BaboonBirdAI self, float maxSpeed);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___initializeVariables(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___initializeVariables(orig___initializeVariables orig, BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_InitializeRPCS_BaboonBirdAI();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_InitializeRPCS_BaboonBirdAI(orig_InitializeRPCS_BaboonBirdAI orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3452382367(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3452382367(orig___rpc_handler_3452382367 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3856685904(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3856685904(orig___rpc_handler_3856685904 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_2476579270(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_2476579270(orig___rpc_handler_2476579270 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3749667856(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3749667856(orig___rpc_handler_3749667856 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1418775270(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1418775270(orig___rpc_handler_1418775270 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1865475504(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1865475504(orig___rpc_handler_1865475504 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_869682226(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_869682226(orig___rpc_handler_869682226 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1564051222(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1564051222(orig___rpc_handler_1564051222 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1546030380(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1546030380(orig___rpc_handler_1546030380 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3360048400(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3360048400(orig___rpc_handler_3360048400 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_443869275(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_443869275(orig___rpc_handler_443869275 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1782649174(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1782649174(orig___rpc_handler_1782649174 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3428942850(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3428942850(orig___rpc_handler_3428942850 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_2073937320(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_2073937320(orig___rpc_handler_2073937320 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1806580287(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1806580287(orig___rpc_handler_1806580287 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1567928363(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1567928363(orig___rpc_handler_1567928363 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3614203845(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3614203845(orig___rpc_handler_3614203845 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1155909339(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1155909339(orig___rpc_handler_1155909339 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3933590138(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3933590138(orig___rpc_handler_3933590138 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_991811456(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_991811456(orig___rpc_handler_991811456 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1670979535(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1670979535(orig___rpc_handler_1670979535 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_2348332192(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_2348332192(orig___rpc_handler_2348332192 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_2459653399(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_2459653399(orig___rpc_handler_2459653399 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_696889160(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_696889160(orig___rpc_handler_696889160 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3367846835(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3367846835(orig___rpc_handler_3367846835 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1737299197(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1737299197(orig___rpc_handler_1737299197 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1775372234(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1775372234(orig___rpc_handler_1775372234 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1078565091(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1078565091(orig___rpc_handler_1078565091 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_1580405641(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_1580405641(orig___rpc_handler_1580405641 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___rpc_handler_3995026000(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___rpc_handler_3995026000(orig___rpc_handler_3995026000 orig, NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig___getTypeName(BaboonBirdAI self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook___getTypeName(orig___getTypeName orig, BaboonBirdAI self);

		public static event hook_Start Start
		{
			add
			{
				HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SyncInitialValuesServerRpc SyncInitialValuesServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SyncInitialValuesServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SyncInitialValuesServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SyncInitialValuesClientRpc SyncInitialValuesClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SyncInitialValuesClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SyncInitialValuesClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LateUpdate LateUpdate
		{
			add
			{
				HookEndpointManager.Add<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LateUpdate>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnCollideWithPlayer OnCollideWithPlayer
		{
			add
			{
				HookEndpointManager.Add<hook_OnCollideWithPlayer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnCollideWithPlayer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnCollideWithEnemy OnCollideWithEnemy
		{
			add
			{
				HookEndpointManager.Add<hook_OnCollideWithEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnCollideWithEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_HitEnemy HitEnemy
		{
			add
			{
				HookEndpointManager.Add<hook_HitEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_HitEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_KillEnemy KillEnemy
		{
			add
			{
				HookEndpointManager.Add<hook_KillEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_KillEnemy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StopKillAnimation StopKillAnimation
		{
			add
			{
				HookEndpointManager.Add<hook_StopKillAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StopKillAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StabPlayerDeathAnimServerRpc StabPlayerDeathAnimServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StabPlayerDeathAnimServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StabPlayerDeathAnimServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StabPlayerDeathAnimClientRpc StabPlayerDeathAnimClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StabPlayerDeathAnimClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StabPlayerDeathAnimClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_killPlayerAnimation killPlayerAnimation
		{
			add
			{
				HookEndpointManager.Add<hook_killPlayerAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_killPlayerAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_InteractWithScrap InteractWithScrap
		{
			add
			{
				HookEndpointManager.Add<hook_InteractWithScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InteractWithScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CanGrabScrap CanGrabScrap
		{
			add
			{
				HookEndpointManager.Add<hook_CanGrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CanGrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DropHeldItemAndSync DropHeldItemAndSync
		{
			add
			{
				HookEndpointManager.Add<hook_DropHeldItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DropHeldItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DropScrapServerRpc DropScrapServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_DropScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DropScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DropScrapClientRpc DropScrapClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_DropScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DropScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DropScrap DropScrap
		{
			add
			{
				HookEndpointManager.Add<hook_DropScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DropScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GrabItemAndSync GrabItemAndSync
		{
			add
			{
				HookEndpointManager.Add<hook_GrabItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GrabItemAndSync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GrabScrapServerRpc GrabScrapServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_GrabScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GrabScrapServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GrabScrapClientRpc GrabScrapClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_GrabScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GrabScrapClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GrabScrap GrabScrap
		{
			add
			{
				HookEndpointManager.Add<hook_GrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GrabScrap>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ReachedNodeInSearch ReachedNodeInSearch
		{
			add
			{
				HookEndpointManager.Add<hook_ReachedNodeInSearch>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ReachedNodeInSearch>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DoAIInterval DoAIInterval
		{
			add
			{
				HookEndpointManager.Add<hook_DoAIInterval>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DoAIInterval>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StopFocusingThreat StopFocusingThreat
		{
			add
			{
				HookEndpointManager.Add<hook_StopFocusingThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StopFocusingThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StopFocusingThreatServerRpc StopFocusingThreatServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StopFocusingThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StopFocusingThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StopFocusingThreatClientRpc StopFocusingThreatClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StopFocusingThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StopFocusingThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetAggressiveMode SetAggressiveMode
		{
			add
			{
				HookEndpointManager.Add<hook_SetAggressiveMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAggressiveMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetAggressiveModeServerRpc SetAggressiveModeServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SetAggressiveModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAggressiveModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetAggressiveModeClientRpc SetAggressiveModeClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SetAggressiveModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetAggressiveModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetThreatInView SetThreatInView
		{
			add
			{
				HookEndpointManager.Add<hook_SetThreatInView>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetThreatInView>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetThreatInViewServerRpc SetThreatInViewServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SetThreatInViewServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetThreatInViewServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetThreatInViewClientRpc SetThreatInViewClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_SetThreatInViewClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetThreatInViewClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EnemyEnterRestModeServerRpc EnemyEnterRestModeServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_EnemyEnterRestModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EnemyEnterRestModeServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EnemyEnterRestModeClientRpc EnemyEnterRestModeClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_EnemyEnterRestModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EnemyEnterRestModeClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EnemyGetUpServerRpc EnemyGetUpServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_EnemyGetUpServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EnemyGetUpServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EnemyGetUpClientRpc EnemyGetUpClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_EnemyGetUpClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EnemyGetUpClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnDrawGizmos OnDrawGizmos
		{
			add
			{
				HookEndpointManager.Add<hook_OnDrawGizmos>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnDrawGizmos>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DetectNoise DetectNoise
		{
			add
			{
				HookEndpointManager.Add<hook_DetectNoise>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DetectNoise>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_AnimateLooking AnimateLooking
		{
			add
			{
				HookEndpointManager.Add<hook_AnimateLooking>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_AnimateLooking>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetComfortableDistanceToThreat GetComfortableDistanceToThreat
		{
			add
			{
				HookEndpointManager.Add<hook_GetComfortableDistanceToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetComfortableDistanceToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ReactToThreat ReactToThreat
		{
			add
			{
				HookEndpointManager.Add<hook_ReactToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ReactToThreat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartFocusOnThreatServerRpc StartFocusOnThreatServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartFocusOnThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartFocusOnThreatServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartFocusOnThreatClientRpc StartFocusOnThreatClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartFocusOnThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartFocusOnThreatClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ReactToOtherBaboonSighted ReactToOtherBaboonSighted
		{
			add
			{
				HookEndpointManager.Add<hook_ReactToOtherBaboonSighted>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ReactToOtherBaboonSighted>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DoLOSCheck DoLOSCheck
		{
			add
			{
				HookEndpointManager.Add<hook_DoLOSCheck>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DoLOSCheck>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_PingBaboonInterest PingBaboonInterest
		{
			add
			{
				HookEndpointManager.Add<hook_PingBaboonInterest>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PingBaboonInterest>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_PingBirdInterestServerRpc PingBirdInterestServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_PingBirdInterestServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PingBirdInterestServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_PingBirdInterestClientRpc PingBirdInterestClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_PingBirdInterestClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PingBirdInterestClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_JoinScoutingGroup JoinScoutingGroup
		{
			add
			{
				HookEndpointManager.Add<hook_JoinScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_JoinScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartScoutingGroup StartScoutingGroup
		{
			add
			{
				HookEndpointManager.Add<hook_StartScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LeaveCurrentScoutingGroup LeaveCurrentScoutingGroup
		{
			add
			{
				HookEndpointManager.Add<hook_LeaveCurrentScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LeaveCurrentScoutingGroup>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LeaveScoutingGroupServerRpc LeaveScoutingGroupServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_LeaveScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LeaveScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LeaveScoutingGroupClientRpc LeaveScoutingGroupClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_LeaveScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LeaveScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartScoutingGroupServerRpc StartScoutingGroupServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartScoutingGroupClientRpc StartScoutingGroupClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_JoinScoutingGroupServerRpc JoinScoutingGroupServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_JoinScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_JoinScoutingGroupServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_JoinScoutingGroupClientRpc JoinScoutingGroupClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_JoinScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_JoinScoutingGroupClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CallToOtherBaboon CallToOtherBaboon
		{
			add
			{
				HookEndpointManager.Add<hook_CallToOtherBaboon>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CallToOtherBaboon>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartMiscAnimation StartMiscAnimation
		{
			add
			{
				HookEndpointManager.Add<hook_StartMiscAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartMiscAnimation>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartMiscAnimationServerRpc StartMiscAnimationServerRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartMiscAnimationServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartMiscAnimationServerRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartMiscAnimationClientRpc StartMiscAnimationClientRpc
		{
			add
			{
				HookEndpointManager.Add<hook_StartMiscAnimationClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartMiscAnimationClientRpc>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CalculateAnimationDirection CalculateAnimationDirection
		{
			add
			{
				HookEndpointManager.Add<hook_CalculateAnimationDirection>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CalculateAnimationDirection>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___initializeVariables __initializeVariables
		{
			add
			{
				HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_InitializeRPCS_BaboonBirdAI InitializeRPCS_BaboonBirdAI
		{
			add
			{
				HookEndpointManager.Add<hook_InitializeRPCS_BaboonBirdAI>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InitializeRPCS_BaboonBirdAI>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_3452382367 __rpc_handler_3452382367
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_3452382367>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_3452382367>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_3856685904 __rpc_handler_3856685904
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_3856685904>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_3856685904>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_2476579270 __rpc_handler_2476579270
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_2476579270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_2476579270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_3749667856 __rpc_handler_3749667856
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_3749667856>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_3749667856>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_1418775270 __rpc_handler_1418775270
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_1418775270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_1418775270>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_1865475504 __rpc_handler_1865475504
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_1865475504>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_1865475504>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_869682226 __rpc_handler_869682226
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_869682226>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_869682226>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_1564051222 __rpc_handler_1564051222
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_1564051222>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_1564051222>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_1546030380 __rpc_handler_1546030380
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_1546030380>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_1546030380>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_3360048400 __rpc_handler_3360048400
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_3360048400>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_3360048400>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_443869275 __rpc_handler_443869275
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_443869275>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_443869275>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_1782649174 __rpc_handler_1782649174
		{
			add
			{
				HookEndpointManager.Add<hook___rpc_handler_1782649174>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___rpc_handler_1782649174>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___rpc_handler_3428942850 __rpc_handler_3428942850

plugins/MMHOOK/MMHOOK_ClientNetworkTransform.dll

Decompiled 10 months ago
using System;
using System.ComponentModel;
using System.Reflection;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On;
using On.Unity.Netcode.Samples;
using On.__GEN;
using Unity.Netcode.Samples;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_Get();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_Get(orig_Get orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self);

		public static event hook_Get Get
		{
			add
			{
				HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		public static event Manipulator Get
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Unity.Netcode.Samples
{
	public static class ClientNetworkTransform
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnNetworkSpawn(ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnNetworkSpawn(orig_OnNetworkSpawn orig, ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig___initializeVariables(ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook___initializeVariables(orig___initializeVariables orig, ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig___getTypeName(ClientNetworkTransform self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook___getTypeName(orig___getTypeName orig, ClientNetworkTransform self);

		public static event hook_OnNetworkSpawn OnNetworkSpawn
		{
			add
			{
				HookEndpointManager.Add<hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___initializeVariables __initializeVariables
		{
			add
			{
				HookEndpointManager.Add<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook___getTypeName __getTypeName
		{
			add
			{
				HookEndpointManager.Add<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Unity.Netcode.Samples
{
	public static class ClientNetworkTransform
	{
		public static event Manipulator OnNetworkSpawn
		{
			add
			{
				HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_OnNetworkSpawn>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Update
		{
			add
			{
				HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __initializeVariables
		{
			add
			{
				HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___initializeVariables>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator __getTypeName
		{
			add
			{
				HookEndpointManager.Modify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Unity.Netcode.Samples.ClientNetworkTransform.hook___getTypeName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.__GEN
{
	public static class NetworkVariableSerializationHelper
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_InitializeSerialization();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_InitializeSerialization(orig_InitializeSerialization orig);

		public static event hook_InitializeSerialization InitializeSerialization
		{
			add
			{
				HookEndpointManager.Add<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.__GEN
{
	public static class NetworkVariableSerializationHelper
	{
		public static event Manipulator InitializeSerialization
		{
			add
			{
				HookEndpointManager.Modify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace BepHookGen
{
	public class size6144
	{
	}
}

plugins/MMHOOK/MMHOOK_DissonanceVoip.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using Dissonance;
using Dissonance.Audio;
using Dissonance.Audio.Capture;
using Dissonance.Audio.Codecs;
using Dissonance.Audio.Playback;
using Dissonance.Config;
using Dissonance.Datastructures;
using Dissonance.Networking;
using Dissonance.VAD;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using NAudio.Wave;
using On;
using On.Dissonance;
using On.Dissonance.Audio;
using On.Dissonance.Audio.Capture;
using On.Dissonance.Audio.Codecs;
using On.Dissonance.Audio.Codecs.Identity;
using On.Dissonance.Audio.Codecs.Opus;
using On.Dissonance.Audio.Codecs.Silence;
using On.Dissonance.Audio.Playback;
using On.Dissonance.Config;
using On.Dissonance.Datastructures;
using On.Dissonance.Extensions;
using On.Dissonance.Networking;
using On.Dissonance.Networking.Client;
using On.Dissonance.Threading;
using On.NAudio.Dsp;
using On.NAudio.Wave;
using UnityEngine;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_Get();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_Get(orig_Get orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self);

		public static event hook_Get Get
		{
			add
			{
				HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		public static event Manipulator Get
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.NAudio.Dsp
{
	public static class WdlResampler
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetMode(object self, bool interp, int filtercnt, bool sinc, int sinc_size, int sinc_interpsize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetMode(orig_SetMode orig, object self, bool interp, int filtercnt, bool sinc, int sinc_size, int sinc_interpsize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetFilterParms(object self, float filterpos, float filterq);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetFilterParms(orig_SetFilterParms orig, object self, float filterpos, float filterq);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetFeedMode(object self, bool wantInputDriven);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetFeedMode(orig_SetFeedMode orig, object self, bool wantInputDriven);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Reset(object self, double fracpos);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Reset(orig_Reset orig, object self, double fracpos);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetRates(object self, double rate_in, double rate_out);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetRates(orig_SetRates orig, object self, double rate_in, double rate_out);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate double orig_GetCurrentLatency(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate double hook_GetCurrentLatency(orig_GetCurrentLatency orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_ResamplePrepare(object self, int out_samples, int nch, out float[] inbuffer, out int inbufferOffset);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_ResamplePrepare(orig_ResamplePrepare orig, object self, int out_samples, int nch, out float[] inbuffer, out int inbufferOffset);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_ResampleOut(object self, float[] outBuffer, int outBufferIndex, int nsamples_in, int nsamples_out, int nch);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_ResampleOut(orig_ResampleOut orig, object self, float[] outBuffer, int outBufferIndex, int nsamples_in, int nsamples_out, int nch);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_BuildLowPass(object self, double filtpos);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_BuildLowPass(orig_BuildLowPass orig, object self, double filtpos);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SincSample(object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, int nch, float[] filter, int filterIndex, int filtsz);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SincSample(orig_SincSample orig, object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, int nch, float[] filter, int filterIndex, int filtsz);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SincSample1(object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SincSample1(orig_SincSample1 orig, object self, float[] outBuffer, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SincSample2(object self, float[] outptr, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SincSample2(orig_SincSample2 orig, object self, float[] outptr, int outBufferIndex, float[] inBuffer, int inBufferIndex, double fracpos, float[] filter, int filterIndex, int filtsz);

		public static class WDL_Resampler_IIRFilter
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_ctor(object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_ctor(orig_ctor orig, object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_Reset(object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_Reset(orig_Reset orig, object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_setParms(object self, double fpos, double Q);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_setParms(orig_setParms orig, object self, double fpos, double Q);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_Apply(object self, float[] inBuffer, int inIndex, float[] outBuffer, int outIndex, int ns, int span, int w);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_Apply(orig_Apply orig, object self, float[] inBuffer, int inIndex, float[] outBuffer, int outIndex, int ns, int span, int w);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate double orig_denormal_filter_float(object self, float x);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate double hook_denormal_filter_float(orig_denormal_filter_float orig, object self, float x);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate double orig_denormal_filter_double(object self, double x);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate double hook_denormal_filter_double(orig_denormal_filter_double orig, object self, double x);

			public static event hook_ctor ctor
			{
				add
				{
					HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_Reset Reset
			{
				add
				{
					HookEndpointManager.Add<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_setParms setParms
			{
				add
				{
					HookEndpointManager.Add<hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_Apply Apply
			{
				add
				{
					HookEndpointManager.Add<hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_denormal_filter_float denormal_filter_float
			{
				add
				{
					HookEndpointManager.Add<hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_denormal_filter_double denormal_filter_double
			{
				add
				{
					HookEndpointManager.Add<hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetMode SetMode
		{
			add
			{
				HookEndpointManager.Add<hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetFilterParms SetFilterParms
		{
			add
			{
				HookEndpointManager.Add<hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetFeedMode SetFeedMode
		{
			add
			{
				HookEndpointManager.Add<hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Reset Reset
		{
			add
			{
				HookEndpointManager.Add<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetRates SetRates
		{
			add
			{
				HookEndpointManager.Add<hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetCurrentLatency GetCurrentLatency
		{
			add
			{
				HookEndpointManager.Add<hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ResamplePrepare ResamplePrepare
		{
			add
			{
				HookEndpointManager.Add<hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ResampleOut ResampleOut
		{
			add
			{
				HookEndpointManager.Add<hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BuildLowPass BuildLowPass
		{
			add
			{
				HookEndpointManager.Add<hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SincSample SincSample
		{
			add
			{
				HookEndpointManager.Add<hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SincSample1 SincSample1
		{
			add
			{
				HookEndpointManager.Add<hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SincSample2 SincSample2
		{
			add
			{
				HookEndpointManager.Add<hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.NAudio.Dsp
{
	public static class WdlResampler
	{
		public static class WDL_Resampler_IIRFilter
		{
			public static event Manipulator ctor
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator Reset
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator setParms
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_setParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator Apply
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_Apply>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator denormal_filter_float
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_float>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator denormal_filter_double
			{
				add
				{
					HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.WDL_Resampler_IIRFilter.hook_denormal_filter_double>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetMode
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetFilterParms
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetFilterParms>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetFeedMode
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetFeedMode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Reset
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_Reset>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetRates
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SetRates>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetCurrentLatency
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_GetCurrentLatency>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ResamplePrepare
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ResamplePrepare>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ResampleOut
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_ResampleOut>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator BuildLowPass
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_BuildLowPass>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SincSample
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SincSample1
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample1>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SincSample2
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Dsp.WdlResampler.hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Dsp.WdlResampler.hook_SincSample2>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.NAudio.Wave
{
	public static class WaveFileWriter
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor_Stream_WaveFormat(Stream self, Stream outStream, WaveFormat format);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor_Stream_WaveFormat(orig_ctor_Stream_WaveFormat orig, Stream self, Stream outStream, WaveFormat format);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor_string_WaveFormat(Stream self, string filename, WaveFormat format);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor_string_WaveFormat(orig_ctor_string_WaveFormat orig, Stream self, string filename, WaveFormat format);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_WriteDataChunkHeader(Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_WriteDataChunkHeader(orig_WriteDataChunkHeader orig, Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_CreateFactChunk(Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_CreateFactChunk(orig_CreateFactChunk orig, Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_HasFactChunk(Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_HasFactChunk(orig_HasFactChunk orig, Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_Read(Stream self, byte[] buffer, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_Read(orig_Read orig, Stream self, byte[] buffer, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate long orig_Seek(Stream self, long offset, SeekOrigin origin);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate long hook_Seek(orig_Seek orig, Stream self, long offset, SeekOrigin origin);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SetLength(Stream self, long value);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SetLength(orig_SetLength orig, Stream self, long value);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Write(Stream self, byte[] data, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Write(orig_Write orig, Stream self, byte[] data, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_WriteSample(Stream self, float sample);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_WriteSample(orig_WriteSample orig, Stream self, float sample);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_WriteSamples(Stream self, float[] samples, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_WriteSamples(orig_WriteSamples orig, Stream self, float[] samples, int offset, int count);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Flush(Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Flush(orig_Flush orig, Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Dispose(Stream self, bool disposing);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Dispose(orig_Dispose orig, Stream self, bool disposing);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_UpdateHeader(Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_UpdateHeader(orig_UpdateHeader orig, Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_UpdateDataChunk(Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_UpdateDataChunk(orig_UpdateDataChunk orig, Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_UpdateRiffChunk(Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_UpdateRiffChunk(orig_UpdateRiffChunk orig, Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_UpdateFactChunk(Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_UpdateFactChunk(orig_UpdateFactChunk orig, Stream self, BinaryWriter writer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Finalize(Stream self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Finalize(orig_Finalize orig, Stream self);

		public static event hook_ctor_Stream_WaveFormat ctor_Stream_WaveFormat
		{
			add
			{
				HookEndpointManager.Add<hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor_string_WaveFormat ctor_string_WaveFormat
		{
			add
			{
				HookEndpointManager.Add<hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_WriteDataChunkHeader WriteDataChunkHeader
		{
			add
			{
				HookEndpointManager.Add<hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CreateFactChunk CreateFactChunk
		{
			add
			{
				HookEndpointManager.Add<hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_HasFactChunk HasFactChunk
		{
			add
			{
				HookEndpointManager.Add<hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Read Read
		{
			add
			{
				HookEndpointManager.Add<hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Seek Seek
		{
			add
			{
				HookEndpointManager.Add<hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SetLength SetLength
		{
			add
			{
				HookEndpointManager.Add<hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Write Write
		{
			add
			{
				HookEndpointManager.Add<hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_WriteSample WriteSample
		{
			add
			{
				HookEndpointManager.Add<hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_WriteSamples WriteSamples
		{
			add
			{
				HookEndpointManager.Add<hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Flush Flush
		{
			add
			{
				HookEndpointManager.Add<hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Dispose Dispose
		{
			add
			{
				HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_UpdateHeader UpdateHeader
		{
			add
			{
				HookEndpointManager.Add<hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_UpdateDataChunk UpdateDataChunk
		{
			add
			{
				HookEndpointManager.Add<hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_UpdateRiffChunk UpdateRiffChunk
		{
			add
			{
				HookEndpointManager.Add<hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_UpdateFactChunk UpdateFactChunk
		{
			add
			{
				HookEndpointManager.Add<hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_Finalize Finalize
		{
			add
			{
				HookEndpointManager.Add<hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.NAudio.Wave
{
	public static class WaveFileWriter
	{
		public static event Manipulator ctor_Stream_WaveFormat
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_ctor_Stream_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor_string_WaveFormat
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_ctor_string_WaveFormat>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator WriteDataChunkHeader
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteDataChunkHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CreateFactChunk
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_CreateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator HasFactChunk
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_HasFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Read
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Read>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Seek
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Seek>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SetLength
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_SetLength>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Write
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Write>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator WriteSample
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteSample>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator WriteSamples
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_WriteSamples>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Flush
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Flush>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Dispose
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator UpdateHeader
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateHeader>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator UpdateDataChunk
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateDataChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator UpdateRiffChunk
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateRiffChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator UpdateFactChunk
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_UpdateFactChunk>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator Finalize
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFileWriter.hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFileWriter.hook_Finalize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.NAudio.Wave
{
	public static class WaveFormat
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(WaveFormat self, int sampleRate, int channels);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, WaveFormat self, int sampleRate, int channels);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Equals(WaveFormat self, WaveFormat other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Equals(orig_Equals orig, WaveFormat self, WaveFormat other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetHashCode(WaveFormat self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetHashCode(orig_GetHashCode orig, WaveFormat self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_ToString(WaveFormat self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_ToString(orig_ToString orig, WaveFormat self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_Equals Equals
		{
			add
			{
				HookEndpointManager.Add<hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_GetHashCode GetHashCode
		{
			add
			{
				HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_ToString ToString
		{
			add
			{
				HookEndpointManager.Add<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.NAudio.Wave
{
	public static class WaveFormat
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator Equals
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_Equals>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator GetHashCode
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator ToString
		{
			add
			{
				HookEndpointManager.Modify<On.NAudio.Wave.WaveFormat.hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.NAudio.Wave.WaveFormat.hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class BaseCommsTrigger
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Awake(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Awake(orig_Awake orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Start(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Start(orig_Start orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnEnable(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnEnable(orig_OnEnable orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnDisable(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnDisable(orig_OnDisable orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnDestroy(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnDestroy(orig_OnDestroy orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_TokensModified(BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_TokensModified(orig_TokensModified orig, BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_ContainsToken(BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_ContainsToken(orig_ContainsToken orig, BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_AddToken(BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_AddToken(orig_AddToken orig, BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_RemoveToken(BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_RemoveToken(orig_RemoveToken orig, BaseCommsTrigger self, string token);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ColliderTriggerChanged(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ColliderTriggerChanged(orig_ColliderTriggerChanged orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnTriggerEnter2D(BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnTriggerEnter2D(orig_OnTriggerEnter2D orig, BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnTriggerExit2D(BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnTriggerExit2D(orig_OnTriggerExit2D orig, BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnTriggerEnter(BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnTriggerEnter(orig_OnTriggerEnter orig, BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnTriggerExit(BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnTriggerExit(orig_OnTriggerExit orig, BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_ColliderTriggerFilter(BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_ColliderTriggerFilter(orig_ColliderTriggerFilter orig, BaseCommsTrigger self, Collider other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_ColliderTriggerFilter2D(BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_ColliderTriggerFilter2D(orig_ColliderTriggerFilter2D orig, BaseCommsTrigger self, Collider2D other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate DissonanceComms orig_FindLocalVoiceComm(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate DissonanceComms hook_FindLocalVoiceComm(orig_FindLocalVoiceComm orig, BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_CheckVoiceComm(BaseCommsTrigger self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_CheckVoiceComm(orig_CheckVoiceComm orig, BaseCommsTrigger self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Awake Awake
		{
			add
			{
				HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Start Start
		{
			add
			{
				HookEndpointManager.Add<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnEnable OnEnable
		{
			add
			{
				HookEndpointManager.Add<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnDisable OnDisable
		{
			add
			{
				HookEndpointManager.Add<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnDestroy OnDestroy
		{
			add
			{
				HookEndpointManager.Add<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_TokensModified TokensModified
		{
			add
			{
				HookEndpointManager.Add<hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ContainsToken ContainsToken
		{
			add
			{
				HookEndpointManager.Add<hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_AddToken AddToken
		{
			add
			{
				HookEndpointManager.Add<hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_RemoveToken RemoveToken
		{
			add
			{
				HookEndpointManager.Add<hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ColliderTriggerChanged ColliderTriggerChanged
		{
			add
			{
				HookEndpointManager.Add<hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnTriggerEnter2D OnTriggerEnter2D
		{
			add
			{
				HookEndpointManager.Add<hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnTriggerExit2D OnTriggerExit2D
		{
			add
			{
				HookEndpointManager.Add<hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnTriggerEnter OnTriggerEnter
		{
			add
			{
				HookEndpointManager.Add<hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnTriggerExit OnTriggerExit
		{
			add
			{
				HookEndpointManager.Add<hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ColliderTriggerFilter ColliderTriggerFilter
		{
			add
			{
				HookEndpointManager.Add<hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ColliderTriggerFilter2D ColliderTriggerFilter2D
		{
			add
			{
				HookEndpointManager.Add<hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_FindLocalVoiceComm FindLocalVoiceComm
		{
			add
			{
				HookEndpointManager.Add<hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CheckVoiceComm CheckVoiceComm
		{
			add
			{
				HookEndpointManager.Add<hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class BaseCommsTrigger
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Awake
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Start
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Start>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnEnable
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnEnable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Update
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnDisable
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnDisable>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnDestroy
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator TokensModified
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_TokensModified>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ContainsToken
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ContainsToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator AddToken
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_AddToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator RemoveToken
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_RemoveToken>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ColliderTriggerChanged
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerChanged>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnTriggerEnter2D
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnTriggerExit2D
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnTriggerEnter
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerEnter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnTriggerExit
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_OnTriggerExit>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ColliderTriggerFilter
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ColliderTriggerFilter2D
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_ColliderTriggerFilter2D>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator FindLocalVoiceComm
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_FindLocalVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CheckVoiceComm
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.BaseCommsTrigger.hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.BaseCommsTrigger.hook_CheckVoiceComm>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class ChannelProperties
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ChannelProperties self, object defaultPriority);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ChannelProperties self, object defaultPriority);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class ChannelProperties
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.ChannelProperties.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.ChannelProperties.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class PlayerChannel
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ref PlayerChannel self, ushort subscriptionId, string playerId, PlayerChannels channels, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ref PlayerChannel self, ushort subscriptionId, string playerId, PlayerChannels channels, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Dispose(ref PlayerChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Dispose(orig_Dispose orig, ref PlayerChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_CheckValidProperties(ref PlayerChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_CheckValidProperties(orig_CheckValidProperties orig, ref PlayerChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Equals_PlayerChannel(ref PlayerChannel self, PlayerChannel other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Equals_PlayerChannel(orig_Equals_PlayerChannel orig, ref PlayerChannel self, PlayerChannel other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Equals_object(ref PlayerChannel self, object obj);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Equals_object(orig_Equals_object orig, ref PlayerChannel self, object obj);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetHashCode(ref PlayerChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetHashCode(orig_GetHashCode orig, ref PlayerChannel self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Dispose Dispose
		{
			add
			{
				HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CheckValidProperties CheckValidProperties
		{
			add
			{
				HookEndpointManager.Add<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Equals_PlayerChannel Equals_PlayerChannel
		{
			add
			{
				HookEndpointManager.Add<hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Equals_object Equals_object
		{
			add
			{
				HookEndpointManager.Add<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_GetHashCode GetHashCode
		{
			add
			{
				HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class PlayerChannel
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Dispose
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CheckValidProperties
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Equals_PlayerChannel
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Equals_PlayerChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Equals_object
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator GetHashCode
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class PlayerChannels
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(PlayerChannels self, object priorityProvider);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, PlayerChannels self, object priorityProvider);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate PlayerChannel orig_CreateChannel(PlayerChannels self, ushort subscriptionId, string channelId, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate PlayerChannel hook_CreateChannel(orig_CreateChannel orig, PlayerChannels self, ushort subscriptionId, string channelId, ChannelProperties properties);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CreateChannel CreateChannel
		{
			add
			{
				HookEndpointManager.Add<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class PlayerChannels
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CreateChannel
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.PlayerChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.PlayerChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class RemoteChannel
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ref RemoteChannel self, string targetName, ChannelType type, PlaybackOptions options);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ref RemoteChannel self, string targetName, ChannelType type, PlaybackOptions options);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class RemoteChannel
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RemoteChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RemoteChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class RoomChannel
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ref RoomChannel self, ushort subscriptionId, string roomId, RoomChannels channels, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ref RoomChannel self, ushort subscriptionId, string roomId, RoomChannels channels, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Dispose(ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Dispose(orig_Dispose orig, ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_CheckValidProperties(ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_CheckValidProperties(orig_CheckValidProperties orig, ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Equals_RoomChannel(ref RoomChannel self, RoomChannel other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Equals_RoomChannel(orig_Equals_RoomChannel orig, ref RoomChannel self, RoomChannel other);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Equals_object(ref RoomChannel self, object obj);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Equals_object(orig_Equals_object orig, ref RoomChannel self, object obj);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetHashCode(ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetHashCode(orig_GetHashCode orig, ref RoomChannel self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_cctor();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_cctor(orig_cctor orig);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Dispose Dispose
		{
			add
			{
				HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CheckValidProperties CheckValidProperties
		{
			add
			{
				HookEndpointManager.Add<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Equals_RoomChannel Equals_RoomChannel
		{
			add
			{
				HookEndpointManager.Add<hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Equals_object Equals_object
		{
			add
			{
				HookEndpointManager.Add<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_GetHashCode GetHashCode
		{
			add
			{
				HookEndpointManager.Add<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_cctor cctor
		{
			add
			{
				HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class RoomChannel
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Dispose
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CheckValidProperties
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_CheckValidProperties>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Equals_RoomChannel
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Equals_RoomChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Equals_object
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_Equals_object>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public new static event Manipulator GetHashCode
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_GetHashCode>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator cctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannel.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannel.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class RoomChannels
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(RoomChannels self, object priorityProvider);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, RoomChannels self, object priorityProvider);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RoomChannel orig_CreateChannel(RoomChannels self, ushort subscriptionId, string channelId, ChannelProperties properties);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate RoomChannel hook_CreateChannel(orig_CreateChannel orig, RoomChannels self, ushort subscriptionId, string channelId, ChannelProperties properties);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CreateChannel CreateChannel
		{
			add
			{
				HookEndpointManager.Add<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Dissonance
{
	public static class RoomChannels
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannels.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CreateChannel
		{
			add
			{
				HookEndpointManager.Modify<On.Dissonance.RoomChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Dissonance.RoomChannels.hook_CreateChannel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Dissonance
{
	public static class CodecSettings
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ref CodecSettings self, Codec codec, uint frameSize, int sampleRate);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ref CodecSettings self, Codec codec, uint frameSize, int sampleRate);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_ToString(ref CodecSettings self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_ToString(orig_ToString orig, ref CodecSettings self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public new static event hook_ToString ToString
		{
			add
			{
				HookEndpointManager.Add<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)

plugins/MMHOOK/MMHOOK_Facepunch Transport for Netcode for GameObjects.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using Netcode.Transports.Facepunch;
using On;
using On.Netcode.Transports.Facepunch;
using On.__GEN;
using Steamworks.Data;
using Unity.Netcode;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_Get();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_Get(orig_Get orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self);

		public static event hook_Get Get
		{
			add
			{
				HookEndpointManager.Add<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL
{
	public static class UnitySourceGeneratedAssemblyMonoScriptTypes_v1
	{
		public static event Manipulator Get
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_Get>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.UnitySourceGeneratedAssemblyMonoScriptTypes_v1.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Netcode.Transports.Facepunch
{
	public static class FacepunchTransport
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Awake(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Awake(orig_Awake orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Update(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Update(orig_Update orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_OnDestroy(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_OnDestroy(orig_OnDestroy orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DisconnectLocalClient(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DisconnectLocalClient(orig_DisconnectLocalClient orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_DisconnectRemoteClient(FacepunchTransport self, ulong clientId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_DisconnectRemoteClient(orig_DisconnectRemoteClient orig, FacepunchTransport self, ulong clientId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ulong orig_GetCurrentRtt(FacepunchTransport self, ulong clientId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ulong hook_GetCurrentRtt(orig_GetCurrentRtt orig, FacepunchTransport self, ulong clientId);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Initialize(FacepunchTransport self, NetworkManager networkManager);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Initialize(orig_Initialize orig, FacepunchTransport self, NetworkManager networkManager);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SendType orig_NetworkDeliveryToSendType(FacepunchTransport self, NetworkDelivery delivery);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SendType hook_NetworkDeliveryToSendType(orig_NetworkDeliveryToSendType orig, FacepunchTransport self, NetworkDelivery delivery);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Shutdown(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Shutdown(orig_Shutdown orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Send(FacepunchTransport self, ulong clientId, ArraySegment<byte> data, NetworkDelivery delivery);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Send(orig_Send orig, FacepunchTransport self, ulong clientId, ArraySegment<byte> data, NetworkDelivery delivery);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate NetworkEvent orig_PollEvent(FacepunchTransport self, out ulong clientId, out ArraySegment<byte> payload, out float receiveTime);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate NetworkEvent hook_PollEvent(orig_PollEvent orig, FacepunchTransport self, out ulong clientId, out ArraySegment<byte> payload, out float receiveTime);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_StartClient(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_StartClient(orig_StartClient orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_StartServer(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_StartServer(orig_StartServer orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_EnsurePayloadCapacity(FacepunchTransport self, int size);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_EnsurePayloadCapacity(orig_EnsurePayloadCapacity orig, FacepunchTransport self, int size);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_IConnectionManager_OnConnecting(FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_IConnectionManager_OnConnecting(orig_Steamworks_IConnectionManager_OnConnecting orig, FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_IConnectionManager_OnConnected(FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_IConnectionManager_OnConnected(orig_Steamworks_IConnectionManager_OnConnected orig, FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_IConnectionManager_OnDisconnected(FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_IConnectionManager_OnDisconnected(orig_Steamworks_IConnectionManager_OnDisconnected orig, FacepunchTransport self, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_IConnectionManager_OnMessage(FacepunchTransport self, IntPtr data, int size, long messageNum, long recvTime, int channel);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_IConnectionManager_OnMessage(orig_Steamworks_IConnectionManager_OnMessage orig, FacepunchTransport self, IntPtr data, int size, long messageNum, long recvTime, int channel);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_ISocketManager_OnConnecting(FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_ISocketManager_OnConnecting(orig_Steamworks_ISocketManager_OnConnecting orig, FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_ISocketManager_OnConnected(FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_ISocketManager_OnConnected(orig_Steamworks_ISocketManager_OnConnected orig, FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_ISocketManager_OnDisconnected(FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_ISocketManager_OnDisconnected(orig_Steamworks_ISocketManager_OnDisconnected orig, FacepunchTransport self, Connection connection, ConnectionInfo info);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Steamworks_ISocketManager_OnMessage(FacepunchTransport self, Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Steamworks_ISocketManager_OnMessage(orig_Steamworks_ISocketManager_OnMessage orig, FacepunchTransport self, Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator orig_InitSteamworks(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IEnumerator hook_InitSteamworks(orig_InitSteamworks orig, FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(FacepunchTransport self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, FacepunchTransport self);

		public static class Client
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_ctor(object self);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_ctor(orig_ctor orig, object self);

			public static event hook_ctor ctor
			{
				add
				{
					HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}
		}

		public static event hook_Awake Awake
		{
			add
			{
				HookEndpointManager.Add<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Update Update
		{
			add
			{
				HookEndpointManager.Add<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_OnDestroy OnDestroy
		{
			add
			{
				HookEndpointManager.Add<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DisconnectLocalClient DisconnectLocalClient
		{
			add
			{
				HookEndpointManager.Add<hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_DisconnectRemoteClient DisconnectRemoteClient
		{
			add
			{
				HookEndpointManager.Add<hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetCurrentRtt GetCurrentRtt
		{
			add
			{
				HookEndpointManager.Add<hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Initialize Initialize
		{
			add
			{
				HookEndpointManager.Add<hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_NetworkDeliveryToSendType NetworkDeliveryToSendType
		{
			add
			{
				HookEndpointManager.Add<hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Shutdown Shutdown
		{
			add
			{
				HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Send Send
		{
			add
			{
				HookEndpointManager.Add<hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_PollEvent PollEvent
		{
			add
			{
				HookEndpointManager.Add<hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartClient StartClient
		{
			add
			{
				HookEndpointManager.Add<hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_StartServer StartServer
		{
			add
			{
				HookEndpointManager.Add<hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_EnsurePayloadCapacity EnsurePayloadCapacity
		{
			add
			{
				HookEndpointManager.Add<hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_IConnectionManager_OnConnecting Steamworks_IConnectionManager_OnConnecting
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_IConnectionManager_OnConnected Steamworks_IConnectionManager_OnConnected
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_IConnectionManager_OnDisconnected Steamworks_IConnectionManager_OnDisconnected
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_IConnectionManager_OnMessage Steamworks_IConnectionManager_OnMessage
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_ISocketManager_OnConnecting Steamworks_ISocketManager_OnConnecting
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_ISocketManager_OnConnected Steamworks_ISocketManager_OnConnected
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_ISocketManager_OnDisconnected Steamworks_ISocketManager_OnDisconnected
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Steamworks_ISocketManager_OnMessage Steamworks_ISocketManager_OnMessage
		{
			add
			{
				HookEndpointManager.Add<hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_InitSteamworks InitSteamworks
		{
			add
			{
				HookEndpointManager.Add<hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Netcode.Transports.Facepunch
{
	public static class FacepunchTransport
	{
		public static class Client
		{
			public static event Manipulator ctor
			{
				add
				{
					HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.Client.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.Client.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}
		}

		public static event Manipulator Awake
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Awake>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Update
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Update>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator OnDestroy
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_OnDestroy>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator DisconnectLocalClient
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectLocalClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator DisconnectRemoteClient
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_DisconnectRemoteClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetCurrentRtt
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_GetCurrentRtt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Initialize
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Initialize>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator NetworkDeliveryToSendType
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_NetworkDeliveryToSendType>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Shutdown
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Send
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Send>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator PollEvent
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_PollEvent>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator StartClient
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator StartServer
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_StartServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator EnsurePayloadCapacity
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_EnsurePayloadCapacity>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_IConnectionManager_OnConnecting
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_IConnectionManager_OnConnected
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_IConnectionManager_OnDisconnected
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_IConnectionManager_OnMessage
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_IConnectionManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_ISocketManager_OnConnecting
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnecting>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_ISocketManager_OnConnected
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnConnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_ISocketManager_OnDisconnected
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnDisconnected>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Steamworks_ISocketManager_OnMessage
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_Steamworks_ISocketManager_OnMessage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator InitSteamworks
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_InitSteamworks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.FacepunchTransport.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Netcode.Transports.Facepunch
{
	public static class ReadOnlyAttribute
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(ReadOnlyAttribute self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, ReadOnlyAttribute self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Netcode.Transports.Facepunch
{
	public static class ReadOnlyAttribute
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Netcode.Transports.Facepunch.ReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Netcode.Transports.Facepunch.ReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.__GEN
{
	public static class NetworkVariableSerializationHelper
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_InitializeSerialization();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_InitializeSerialization(orig_InitializeSerialization orig);

		public static event hook_InitializeSerialization InitializeSerialization
		{
			add
			{
				HookEndpointManager.Add<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.__GEN
{
	public static class NetworkVariableSerializationHelper
	{
		public static event Manipulator InitializeSerialization
		{
			add
			{
				HookEndpointManager.Modify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.__GEN.NetworkVariableSerializationHelper.hook_InitializeSerialization>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace BepHookGen
{
	public class size14336
	{
	}
}

plugins/MMHOOK/MMHOOK_Facepunch.Steamworks.Win64.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On.Microsoft.CodeAnalysis;
using On.Steamworks;
using On.Steamworks.Data;
using On.Steamworks.ServerList;
using On.Steamworks.Ugc;
using On.System.Runtime.CompilerServices;
using Steamworks;
using Steamworks.Data;
using Steamworks.ServerList;
using Steamworks.Ugc;

[assembly: AssemblyVersion("0.0.0.0")]
namespace On.Microsoft.CodeAnalysis
{
	public static class EmbeddedAttribute
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(Attribute self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, Attribute self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Microsoft.CodeAnalysis
{
	public static class EmbeddedAttribute
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Microsoft.CodeAnalysis.EmbeddedAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Microsoft.CodeAnalysis.EmbeddedAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.System.Runtime.CompilerServices
{
	public static class IsReadOnlyAttribute
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(Attribute self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, Attribute self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.System.Runtime.CompilerServices
{
	public static class IsReadOnlyAttribute
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.System.Runtime.CompilerServices.IsReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.System.Runtime.CompilerServices.IsReadOnlyAttribute.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class AuthTicket
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Cancel(AuthTicket self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Cancel(orig_Cancel orig, AuthTicket self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Dispose(AuthTicket self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Dispose(orig_Dispose orig, AuthTicket self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(AuthTicket self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, AuthTicket self);

		public static event hook_Cancel Cancel
		{
			add
			{
				HookEndpointManager.Add<hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Dispose Dispose
		{
			add
			{
				HookEndpointManager.Add<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class AuthTicket
	{
		public static event Manipulator Cancel
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_Cancel>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Dispose
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_Dispose>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.AuthTicket.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.AuthTicket.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class Dispatch
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SteamAPI_ManualDispatch_Init();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SteamAPI_ManualDispatch_Init(orig_SteamAPI_ManualDispatch_Init orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_SteamAPI_ManualDispatch_RunFrame(ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_SteamAPI_ManualDispatch_RunFrame(orig_SteamAPI_ManualDispatch_RunFrame orig, ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_SteamAPI_ManualDispatch_GetNextCallback(ValueType pipe, [In][Out] ValueType msg);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_SteamAPI_ManualDispatch_GetNextCallback(orig_SteamAPI_ManualDispatch_GetNextCallback orig, ValueType pipe, [In][Out] ValueType msg);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_SteamAPI_ManualDispatch_FreeLastCallback(ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_SteamAPI_ManualDispatch_FreeLastCallback(orig_SteamAPI_ManualDispatch_FreeLastCallback orig, ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Init();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Init(orig_Init orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Frame(ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Frame(orig_Frame orig, ValueType pipe);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ProcessCallback(ValueType msg, bool isServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ProcessCallback(orig_ProcessCallback orig, ValueType msg, bool isServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_CallbackToString(CallbackType type, IntPtr data, int expectedsize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_CallbackToString(orig_CallbackToString orig, CallbackType type, IntPtr data, int expectedsize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ProcessResult(ValueType msg);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ProcessResult(orig_ProcessResult orig, ValueType msg);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LoopClientAsync();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LoopClientAsync(orig_LoopClientAsync orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_LoopServerAsync();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_LoopServerAsync(orig_LoopServerAsync orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ShutdownServer();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ShutdownServer(orig_ShutdownServer orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ShutdownClient();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ShutdownClient(orig_ShutdownClient orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_cctor();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_cctor(orig_cctor orig);

		public static event hook_SteamAPI_ManualDispatch_Init SteamAPI_ManualDispatch_Init
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_ManualDispatch_RunFrame SteamAPI_ManualDispatch_RunFrame
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_ManualDispatch_GetNextCallback SteamAPI_ManualDispatch_GetNextCallback
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_ManualDispatch_FreeLastCallback SteamAPI_ManualDispatch_FreeLastCallback
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Init Init
		{
			add
			{
				HookEndpointManager.Add<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Frame Frame
		{
			add
			{
				HookEndpointManager.Add<hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ProcessCallback ProcessCallback
		{
			add
			{
				HookEndpointManager.Add<hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_CallbackToString CallbackToString
		{
			add
			{
				HookEndpointManager.Add<hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ProcessResult ProcessResult
		{
			add
			{
				HookEndpointManager.Add<hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LoopClientAsync LoopClientAsync
		{
			add
			{
				HookEndpointManager.Add<hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_LoopServerAsync LoopServerAsync
		{
			add
			{
				HookEndpointManager.Add<hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ShutdownServer ShutdownServer
		{
			add
			{
				HookEndpointManager.Add<hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_ShutdownClient ShutdownClient
		{
			add
			{
				HookEndpointManager.Add<hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_cctor cctor
		{
			add
			{
				HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class Dispatch
	{
		public static event Manipulator SteamAPI_ManualDispatch_Init
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SteamAPI_ManualDispatch_RunFrame
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_RunFrame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SteamAPI_ManualDispatch_GetNextCallback
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_GetNextCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SteamAPI_ManualDispatch_FreeLastCallback
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_SteamAPI_ManualDispatch_FreeLastCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Init
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Frame
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_Frame>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ProcessCallback
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ProcessCallback>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator CallbackToString
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_CallbackToString>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ProcessResult
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ProcessResult>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator LoopClientAsync
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_LoopClientAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator LoopServerAsync
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_LoopServerAsync>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ShutdownServer
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ShutdownServer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator ShutdownClient
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_ShutdownClient>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator cctor
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.Dispatch.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.Dispatch.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class SteamAPI
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_Init();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_Init(orig_Init orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Shutdown();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Shutdown(orig_Shutdown orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_GetHSteamPipe();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_GetHSteamPipe(orig_GetHSteamPipe orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_RestartAppIfNecessary(uint unOwnAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_RestartAppIfNecessary(orig_RestartAppIfNecessary orig, uint unOwnAppID);

		public static class Native
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_SteamAPI_Init();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_SteamAPI_Init(orig_SteamAPI_Init orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_SteamAPI_Shutdown();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_SteamAPI_Shutdown(orig_SteamAPI_Shutdown orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ValueType orig_SteamAPI_GetHSteamPipe();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ValueType hook_SteamAPI_GetHSteamPipe(orig_SteamAPI_GetHSteamPipe orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_SteamAPI_RestartAppIfNecessary(uint unOwnAppID);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_SteamAPI_RestartAppIfNecessary(orig_SteamAPI_RestartAppIfNecessary orig, uint unOwnAppID);

			public static event hook_SteamAPI_Init SteamAPI_Init
			{
				add
				{
					HookEndpointManager.Add<hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_SteamAPI_Shutdown SteamAPI_Shutdown
			{
				add
				{
					HookEndpointManager.Add<hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_SteamAPI_GetHSteamPipe SteamAPI_GetHSteamPipe
			{
				add
				{
					HookEndpointManager.Add<hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_SteamAPI_RestartAppIfNecessary SteamAPI_RestartAppIfNecessary
			{
				add
				{
					HookEndpointManager.Add<hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}
		}

		public static event hook_Init Init
		{
			add
			{
				HookEndpointManager.Add<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Shutdown Shutdown
		{
			add
			{
				HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetHSteamPipe GetHSteamPipe
		{
			add
			{
				HookEndpointManager.Add<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_RestartAppIfNecessary RestartAppIfNecessary
		{
			add
			{
				HookEndpointManager.Add<hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class SteamAPI
	{
		public static class Native
		{
			public static event Manipulator SteamAPI_Init
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator SteamAPI_Shutdown
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator SteamAPI_GetHSteamPipe
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator SteamAPI_RestartAppIfNecessary
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.Native.hook_SteamAPI_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}
		}

		public static event Manipulator Init
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Shutdown
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetHSteamPipe
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator RestartAppIfNecessary
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamAPI.hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamAPI.hook_RestartAppIfNecessary>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class SteamGameServer
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_RunCallbacks();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_RunCallbacks(orig_RunCallbacks orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_Shutdown();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_Shutdown(orig_Shutdown orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_GetHSteamPipe();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_GetHSteamPipe(orig_GetHSteamPipe orig);

		public static class Native
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_SteamGameServer_RunCallbacks();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_SteamGameServer_RunCallbacks(orig_SteamGameServer_RunCallbacks orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void orig_SteamGameServer_Shutdown();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate void hook_SteamGameServer_Shutdown(orig_SteamGameServer_Shutdown orig);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ValueType orig_SteamGameServer_GetHSteamPipe();

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate ValueType hook_SteamGameServer_GetHSteamPipe(orig_SteamGameServer_GetHSteamPipe orig);

			public static event hook_SteamGameServer_RunCallbacks SteamGameServer_RunCallbacks
			{
				add
				{
					HookEndpointManager.Add<hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_SteamGameServer_Shutdown SteamGameServer_Shutdown
			{
				add
				{
					HookEndpointManager.Add<hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}

			public static event hook_SteamGameServer_GetHSteamPipe SteamGameServer_GetHSteamPipe
			{
				add
				{
					HookEndpointManager.Add<hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}
		}

		public static event hook_RunCallbacks RunCallbacks
		{
			add
			{
				HookEndpointManager.Add<hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_Shutdown Shutdown
		{
			add
			{
				HookEndpointManager.Add<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetHSteamPipe GetHSteamPipe
		{
			add
			{
				HookEndpointManager.Add<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class SteamGameServer
	{
		public static class Native
		{
			public static event Manipulator SteamGameServer_RunCallbacks
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator SteamGameServer_Shutdown
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}

			public static event Manipulator SteamGameServer_GetHSteamPipe
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.Native.hook_SteamGameServer_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}
		}

		public static event Manipulator RunCallbacks
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_RunCallbacks>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator Shutdown
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_Shutdown>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetHSteamPipe
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamGameServer.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamGameServer.hook_GetHSteamPipe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class SteamInternal
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_GameServer_Init(orig_GameServer_Init orig, uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString);

		public static class Native
		{
			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool orig_SteamInternal_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString);

			[EditorBrowsable(EditorBrowsableState.Never)]
			public delegate bool hook_SteamInternal_GameServer_Init(orig_SteamInternal_GameServer_Init orig, uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString);

			public static event hook_SteamInternal_GameServer_Init SteamInternal_GameServer_Init
			{
				add
				{
					HookEndpointManager.Add<hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
				remove
				{
					HookEndpointManager.Remove<hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
				}
			}
		}

		public static event hook_GameServer_Init GameServer_Init
		{
			add
			{
				HookEndpointManager.Add<hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class SteamInternal
	{
		public static class Native
		{
			public static event Manipulator SteamInternal_GameServer_Init
			{
				add
				{
					HookEndpointManager.Modify<On.Steamworks.SteamInternal.Native.hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
				remove
				{
					HookEndpointManager.Unmodify<On.Steamworks.SteamInternal.Native.hook_SteamInternal_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
				}
			}
		}

		public static event Manipulator GameServer_Init
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.SteamInternal.hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.SteamInternal.hook_GameServer_Init>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class CallbackTypeFactory
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_cctor();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_cctor(orig_cctor orig);

		public static event hook_cctor cctor
		{
			add
			{
				HookEndpointManager.Add<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class CallbackTypeFactory
	{
		public static event Manipulator cctor
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.CallbackTypeFactory.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.CallbackTypeFactory.hook_cctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class ISteamAppList
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self, bool IsGameServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self, bool IsGameServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_SteamAPI_SteamAppList_v001();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_SteamAPI_SteamAppList_v001(orig_SteamAPI_SteamAppList_v001 orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_GetUserInterfacePointer(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_GetUserInterfacePointer(orig_GetUserInterfacePointer orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig__GetNumInstalledApps(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook__GetNumInstalledApps(orig__GetNumInstalledApps orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig_GetNumInstalledApps(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook_GetNumInstalledApps(orig_GetNumInstalledApps orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig__GetInstalledApps(IntPtr self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook__GetInstalledApps(orig__GetInstalledApps orig, IntPtr self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig_GetInstalledApps(object self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook_GetInstalledApps(orig_GetInstalledApps orig, object self, [In][Out] AppId[] pvecAppID, uint unMaxAppIDs);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetAppName(IntPtr self, AppId nAppID, IntPtr pchName, int cchNameMax);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetAppName(orig__GetAppName orig, IntPtr self, AppId nAppID, IntPtr pchName, int cchNameMax);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetAppName(object self, AppId nAppID, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetAppName(orig_GetAppName orig, object self, AppId nAppID, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetAppInstallDir(IntPtr self, AppId nAppID, IntPtr pchDirectory, int cchNameMax);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetAppInstallDir(orig__GetAppInstallDir orig, IntPtr self, AppId nAppID, IntPtr pchDirectory, int cchNameMax);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetAppInstallDir(object self, AppId nAppID, out string pchDirectory);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetAppInstallDir(orig_GetAppInstallDir orig, object self, AppId nAppID, out string pchDirectory);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetAppBuildId(IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetAppBuildId(orig__GetAppBuildId orig, IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetAppBuildId(object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetAppBuildId(orig_GetAppBuildId orig, object self, AppId nAppID);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_SteamAppList_v001 SteamAPI_SteamAppList_v001
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetUserInterfacePointer GetUserInterfacePointer
		{
			add
			{
				HookEndpointManager.Add<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetNumInstalledApps _GetNumInstalledApps
		{
			add
			{
				HookEndpointManager.Add<hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetNumInstalledApps GetNumInstalledApps
		{
			add
			{
				HookEndpointManager.Add<hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetInstalledApps _GetInstalledApps
		{
			add
			{
				HookEndpointManager.Add<hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetInstalledApps GetInstalledApps
		{
			add
			{
				HookEndpointManager.Add<hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppName _GetAppName
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppName GetAppName
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppInstallDir _GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppInstallDir GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppBuildId _GetAppBuildId
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppBuildId GetAppBuildId
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}
	}
}
namespace IL.Steamworks
{
	public static class ISteamAppList
	{
		public static event Manipulator ctor
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator SteamAPI_SteamAppList_v001
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_SteamAPI_SteamAppList_v001>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetUserInterfacePointer
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator _GetNumInstalledApps
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetNumInstalledApps
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetNumInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator _GetInstalledApps
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetInstalledApps
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetInstalledApps>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator _GetAppName
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetAppName
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator _GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator _GetAppBuildId
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}

		public static event Manipulator GetAppBuildId
		{
			add
			{
				HookEndpointManager.Modify<On.Steamworks.ISteamAppList.hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
			remove
			{
				HookEndpointManager.Unmodify<On.Steamworks.ISteamAppList.hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)(object)value);
			}
		}
	}
}
namespace On.Steamworks
{
	public static class ISteamApps
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_ctor(object self, bool IsGameServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_ctor(orig_ctor orig, object self, bool IsGameServer);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_SteamAPI_SteamApps_v008();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_SteamAPI_SteamApps_v008(orig_SteamAPI_SteamApps_v008 orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_GetUserInterfacePointer(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_GetUserInterfacePointer(orig_GetUserInterfacePointer orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_SteamAPI_SteamGameServerApps_v008();

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_SteamAPI_SteamGameServerApps_v008(orig_SteamAPI_SteamGameServerApps_v008 orig);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr orig_GetServerInterfacePointer(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate IntPtr hook_GetServerInterfacePointer(orig_GetServerInterfacePointer orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsSubscribed(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsSubscribed(orig__BIsSubscribed orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsSubscribed(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsSubscribed(orig_BIsSubscribed orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsLowViolence(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsLowViolence(orig__BIsLowViolence orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsLowViolence(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsLowViolence(orig_BIsLowViolence orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsCybercafe(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsCybercafe(orig__BIsCybercafe orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsCybercafe(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsCybercafe(orig_BIsCybercafe orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsVACBanned(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsVACBanned(orig__BIsVACBanned orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsVACBanned(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsVACBanned(orig_BIsVACBanned orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig__GetCurrentGameLanguage(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook__GetCurrentGameLanguage(orig__GetCurrentGameLanguage orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_GetCurrentGameLanguage(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_GetCurrentGameLanguage(orig_GetCurrentGameLanguage orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig__GetAvailableGameLanguages(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook__GetAvailableGameLanguages(orig__GetAvailableGameLanguages orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_GetAvailableGameLanguages(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_GetAvailableGameLanguages(orig_GetAvailableGameLanguages orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsSubscribedApp(IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsSubscribedApp(orig__BIsSubscribedApp orig, IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsSubscribedApp(object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsSubscribedApp(orig_BIsSubscribedApp orig, object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsDlcInstalled(IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsDlcInstalled(orig__BIsDlcInstalled orig, IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsDlcInstalled(object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsDlcInstalled(orig_BIsDlcInstalled orig, object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig__GetEarliestPurchaseUnixTime(IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook__GetEarliestPurchaseUnixTime(orig__GetEarliestPurchaseUnixTime orig, IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig_GetEarliestPurchaseUnixTime(object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook_GetEarliestPurchaseUnixTime(orig_GetEarliestPurchaseUnixTime orig, object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsSubscribedFromFreeWeekend(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsSubscribedFromFreeWeekend(orig__BIsSubscribedFromFreeWeekend orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsSubscribedFromFreeWeekend(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsSubscribedFromFreeWeekend(orig_BIsSubscribedFromFreeWeekend orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetDLCCount(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetDLCCount(orig__GetDLCCount orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetDLCCount(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetDLCCount(orig_GetDLCCount orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BGetDLCDataByIndex(IntPtr self, int iDLC, ref AppId pAppID, ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BGetDLCDataByIndex(orig__BGetDLCDataByIndex orig, IntPtr self, int iDLC, ref AppId pAppID, ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BGetDLCDataByIndex(object self, int iDLC, ref AppId pAppID, ref bool pbAvailable, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BGetDLCDataByIndex(orig_BGetDLCDataByIndex orig, object self, int iDLC, ref AppId pAppID, ref bool pbAvailable, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig__InstallDLC(IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook__InstallDLC(orig__InstallDLC orig, IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_InstallDLC(object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_InstallDLC(orig_InstallDLC orig, object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig__UninstallDLC(IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook__UninstallDLC(orig__UninstallDLC orig, IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_UninstallDLC(object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_UninstallDLC(orig_UninstallDLC orig, object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig__RequestAppProofOfPurchaseKey(IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook__RequestAppProofOfPurchaseKey(orig__RequestAppProofOfPurchaseKey orig, IntPtr self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_RequestAppProofOfPurchaseKey(object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_RequestAppProofOfPurchaseKey(orig_RequestAppProofOfPurchaseKey orig, object self, AppId nAppID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__GetCurrentBetaName(IntPtr self, IntPtr pchName, int cchNameBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__GetCurrentBetaName(orig__GetCurrentBetaName orig, IntPtr self, IntPtr pchName, int cchNameBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_GetCurrentBetaName(object self, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_GetCurrentBetaName(orig_GetCurrentBetaName orig, object self, out string pchName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__MarkContentCorrupt(IntPtr self, bool bMissingFilesOnly);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__MarkContentCorrupt(orig__MarkContentCorrupt orig, IntPtr self, bool bMissingFilesOnly);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_MarkContentCorrupt(object self, bool bMissingFilesOnly);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_MarkContentCorrupt(orig_MarkContentCorrupt orig, object self, bool bMissingFilesOnly);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig__GetInstalledDepots(IntPtr self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook__GetInstalledDepots(orig__GetInstalledDepots orig, IntPtr self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig_GetInstalledDepots(object self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook_GetInstalledDepots(orig_GetInstalledDepots orig, object self, AppId appID, [In][Out] ValueType pvecDepots, uint cMaxDepots);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig__GetAppInstallDir(IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook__GetAppInstallDir(orig__GetAppInstallDir orig, IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint orig_GetAppInstallDir(object self, AppId appID, out string pchFolder);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate uint hook_GetAppInstallDir(orig_GetAppInstallDir orig, object self, AppId appID, out string pchFolder);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsAppInstalled(IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsAppInstalled(orig__BIsAppInstalled orig, IntPtr self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsAppInstalled(object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsAppInstalled(orig_BIsAppInstalled orig, object self, AppId appID);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SteamId orig__GetAppOwner(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SteamId hook__GetAppOwner(orig__GetAppOwner orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SteamId orig_GetAppOwner(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate SteamId hook_GetAppOwner(orig_GetAppOwner orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig__GetLaunchQueryParam(IntPtr self, string pchKey);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook__GetLaunchQueryParam(orig__GetLaunchQueryParam orig, IntPtr self, string pchKey);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string orig_GetLaunchQueryParam(object self, string pchKey);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate string hook_GetLaunchQueryParam(orig_GetLaunchQueryParam orig, object self, string pchKey);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__GetDlcDownloadProgress(IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__GetDlcDownloadProgress(orig__GetDlcDownloadProgress orig, IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_GetDlcDownloadProgress(object self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_GetDlcDownloadProgress(orig_GetDlcDownloadProgress orig, object self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetAppBuildId(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetAppBuildId(orig__GetAppBuildId orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetAppBuildId(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetAppBuildId(orig_GetAppBuildId orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig__RequestAllProofOfPurchaseKeys(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook__RequestAllProofOfPurchaseKeys(orig__RequestAllProofOfPurchaseKeys orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void orig_RequestAllProofOfPurchaseKeys(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate void hook_RequestAllProofOfPurchaseKeys(orig_RequestAllProofOfPurchaseKeys orig, object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig__GetFileDetails(IntPtr self, string pszFileName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook__GetFileDetails(orig__GetFileDetails orig, IntPtr self, string pszFileName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType orig_GetFileDetails(object self, string pszFileName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate ValueType hook_GetFileDetails(orig_GetFileDetails orig, object self, string pszFileName);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig__GetLaunchCommandLine(IntPtr self, IntPtr pszCommandLine, int cubCommandLine);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook__GetLaunchCommandLine(orig__GetLaunchCommandLine orig, IntPtr self, IntPtr pszCommandLine, int cubCommandLine);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int orig_GetLaunchCommandLine(object self, out string pszCommandLine);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate int hook_GetLaunchCommandLine(orig_GetLaunchCommandLine orig, object self, out string pszCommandLine);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig__BIsSubscribedFromFamilySharing(IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook__BIsSubscribedFromFamilySharing(orig__BIsSubscribedFromFamilySharing orig, IntPtr self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool orig_BIsSubscribedFromFamilySharing(object self);

		[EditorBrowsable(EditorBrowsableState.Never)]
		public delegate bool hook_BIsSubscribedFromFamilySharing(orig_BIsSubscribedFromFamilySharing orig, object self);

		public static event hook_ctor ctor
		{
			add
			{
				HookEndpointManager.Add<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_ctor>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_SteamApps_v008 SteamAPI_SteamApps_v008
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_SteamApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_SteamApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetUserInterfacePointer GetUserInterfacePointer
		{
			add
			{
				HookEndpointManager.Add<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetUserInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_SteamAPI_SteamGameServerApps_v008 SteamAPI_SteamGameServerApps_v008
		{
			add
			{
				HookEndpointManager.Add<hook_SteamAPI_SteamGameServerApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_SteamAPI_SteamGameServerApps_v008>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetServerInterfacePointer GetServerInterfacePointer
		{
			add
			{
				HookEndpointManager.Add<hook_GetServerInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetServerInterfacePointer>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsSubscribed _BIsSubscribed
		{
			add
			{
				HookEndpointManager.Add<hook__BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsSubscribed BIsSubscribed
		{
			add
			{
				HookEndpointManager.Add<hook_BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsSubscribed>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsLowViolence _BIsLowViolence
		{
			add
			{
				HookEndpointManager.Add<hook__BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsLowViolence BIsLowViolence
		{
			add
			{
				HookEndpointManager.Add<hook_BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsLowViolence>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsCybercafe _BIsCybercafe
		{
			add
			{
				HookEndpointManager.Add<hook__BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsCybercafe BIsCybercafe
		{
			add
			{
				HookEndpointManager.Add<hook_BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsCybercafe>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsVACBanned _BIsVACBanned
		{
			add
			{
				HookEndpointManager.Add<hook__BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsVACBanned BIsVACBanned
		{
			add
			{
				HookEndpointManager.Add<hook_BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsVACBanned>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetCurrentGameLanguage _GetCurrentGameLanguage
		{
			add
			{
				HookEndpointManager.Add<hook__GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetCurrentGameLanguage GetCurrentGameLanguage
		{
			add
			{
				HookEndpointManager.Add<hook_GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetCurrentGameLanguage>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAvailableGameLanguages _GetAvailableGameLanguages
		{
			add
			{
				HookEndpointManager.Add<hook__GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAvailableGameLanguages GetAvailableGameLanguages
		{
			add
			{
				HookEndpointManager.Add<hook_GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAvailableGameLanguages>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsSubscribedApp _BIsSubscribedApp
		{
			add
			{
				HookEndpointManager.Add<hook__BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsSubscribedApp BIsSubscribedApp
		{
			add
			{
				HookEndpointManager.Add<hook_BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsSubscribedApp>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsDlcInstalled _BIsDlcInstalled
		{
			add
			{
				HookEndpointManager.Add<hook__BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsDlcInstalled BIsDlcInstalled
		{
			add
			{
				HookEndpointManager.Add<hook_BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsDlcInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetEarliestPurchaseUnixTime _GetEarliestPurchaseUnixTime
		{
			add
			{
				HookEndpointManager.Add<hook__GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetEarliestPurchaseUnixTime GetEarliestPurchaseUnixTime
		{
			add
			{
				HookEndpointManager.Add<hook_GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetEarliestPurchaseUnixTime>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsSubscribedFromFreeWeekend _BIsSubscribedFromFreeWeekend
		{
			add
			{
				HookEndpointManager.Add<hook__BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsSubscribedFromFreeWeekend BIsSubscribedFromFreeWeekend
		{
			add
			{
				HookEndpointManager.Add<hook_BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsSubscribedFromFreeWeekend>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetDLCCount _GetDLCCount
		{
			add
			{
				HookEndpointManager.Add<hook__GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetDLCCount GetDLCCount
		{
			add
			{
				HookEndpointManager.Add<hook_GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetDLCCount>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BGetDLCDataByIndex _BGetDLCDataByIndex
		{
			add
			{
				HookEndpointManager.Add<hook__BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BGetDLCDataByIndex BGetDLCDataByIndex
		{
			add
			{
				HookEndpointManager.Add<hook_BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BGetDLCDataByIndex>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__InstallDLC _InstallDLC
		{
			add
			{
				HookEndpointManager.Add<hook__InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_InstallDLC InstallDLC
		{
			add
			{
				HookEndpointManager.Add<hook_InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_InstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__UninstallDLC _UninstallDLC
		{
			add
			{
				HookEndpointManager.Add<hook__UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_UninstallDLC UninstallDLC
		{
			add
			{
				HookEndpointManager.Add<hook_UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_UninstallDLC>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__RequestAppProofOfPurchaseKey _RequestAppProofOfPurchaseKey
		{
			add
			{
				HookEndpointManager.Add<hook__RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_RequestAppProofOfPurchaseKey RequestAppProofOfPurchaseKey
		{
			add
			{
				HookEndpointManager.Add<hook_RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_RequestAppProofOfPurchaseKey>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetCurrentBetaName _GetCurrentBetaName
		{
			add
			{
				HookEndpointManager.Add<hook__GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetCurrentBetaName GetCurrentBetaName
		{
			add
			{
				HookEndpointManager.Add<hook_GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetCurrentBetaName>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__MarkContentCorrupt _MarkContentCorrupt
		{
			add
			{
				HookEndpointManager.Add<hook__MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_MarkContentCorrupt MarkContentCorrupt
		{
			add
			{
				HookEndpointManager.Add<hook_MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_MarkContentCorrupt>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetInstalledDepots _GetInstalledDepots
		{
			add
			{
				HookEndpointManager.Add<hook__GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetInstalledDepots GetInstalledDepots
		{
			add
			{
				HookEndpointManager.Add<hook_GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetInstalledDepots>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppInstallDir _GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppInstallDir GetAppInstallDir
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppInstallDir>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__BIsAppInstalled _BIsAppInstalled
		{
			add
			{
				HookEndpointManager.Add<hook__BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_BIsAppInstalled BIsAppInstalled
		{
			add
			{
				HookEndpointManager.Add<hook_BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_BIsAppInstalled>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppOwner _GetAppOwner
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppOwner GetAppOwner
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppOwner>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetLaunchQueryParam _GetLaunchQueryParam
		{
			add
			{
				HookEndpointManager.Add<hook__GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetLaunchQueryParam GetLaunchQueryParam
		{
			add
			{
				HookEndpointManager.Add<hook_GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetLaunchQueryParam>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetDlcDownloadProgress _GetDlcDownloadProgress
		{
			add
			{
				HookEndpointManager.Add<hook__GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetDlcDownloadProgress GetDlcDownloadProgress
		{
			add
			{
				HookEndpointManager.Add<hook_GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetDlcDownloadProgress>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__GetAppBuildId _GetAppBuildId
		{
			add
			{
				HookEndpointManager.Add<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook_GetAppBuildId GetAppBuildId
		{
			add
			{
				HookEndpointManager.Add<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook_GetAppBuildId>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
		}

		public static event hook__RequestAllProofOfPurchaseKeys _RequestAllProofOfPurchaseKeys
		{
			add
			{
				HookEndpointManager.Add<hook__RequestAllProofOfPurchaseKeys>(MethodBase.GetMethodFromHandle((RuntimeMethodHandle)/*OpCode not supported: LdMemberToken*/), (Delegate)value);
			}
			remove
			{
				HookEndpointManager.Remove<hook__RequestAllProofOfPurchaseKeys>(MethodBase.GetMethodFromHandle((Runt

plugins/Mom_Llama-Lethal_Company_Enhancer/Enhancer.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Enhancer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Tweaks plugin for Lethal Company")]
[assembly: AssemblyFileVersion("0.1.8.0")]
[assembly: AssemblyInformationalVersion("0.1.8")]
[assembly: AssemblyProduct("Enhancer")]
[assembly: AssemblyTitle("Enhancer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.8.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Readme
{
	internal class DecompilerMessage
	{
		private const string Hello = "The source code for this project is freely available on request, btw.";

		internal DecompilerMessage()
		{
			if ("The source code for this project is freely available on request, btw.".Length != 69)
			{
			}
		}
	}
}
namespace Enhancer
{
	public class SPPatcher
	{
		[HarmonyPatch(typeof(TimeOfDay), "SetBuyingRateForDay")]
		[HarmonyPostfix]
		public static void BuyingRatePost(TimeOfDay __instance)
		{
			Plugin.Log.LogInfo((object)"TimeOfDay SetBuyingRateForDay");
			if (Plugin.Cfg.UseRandomPrices)
			{
				PriceRandomizer.Randomize();
			}
			if (StartOfRound.Instance.companyBuyingRate < Plugin.Cfg.MinimumBuyRate)
			{
				StartOfRound.Instance.companyBuyingRate = Plugin.Cfg.MinimumBuyRate;
			}
			StartOfRound.Instance.SyncCompanyBuyingRateServerRpc();
		}

		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyPrefix]
		public static bool StartOfRoundShipStartPre()
		{
			Plugin.Log.LogInfo((object)"StartOfRound Start");
			TimeOfDay.Instance.quotaVariables.deadlineDaysAmount = Plugin.Cfg.DaysPerQuota;
			return true;
		}

		[HarmonyPatch(typeof(TimeOfDay), "Start")]
		[HarmonyPostfix]
		public static void TimeOfDayOnStartPost(TimeOfDay __instance)
		{
			Plugin.Log.LogInfo((object)"TimeOfDay Start");
			__instance.globalTimeSpeedMultiplier = Plugin.Cfg.TimeScale;
		}

		[HarmonyPatch(typeof(HangarShipDoor), "Start")]
		[HarmonyPostfix]
		public static void HangarShipDoorPost(HangarShipDoor __instance)
		{
			Plugin.Log.LogInfo((object)"HangarShipDoor Start");
			__instance.doorPowerDuration = Plugin.Cfg.DoorTimer;
		}

		[HarmonyPatch(typeof(Terminal), "Update")]
		[HarmonyPostfix]
		public static void TerminalUpdatePost(Terminal __instance)
		{
			if (!((Component)__instance.terminalUIScreen).gameObject.activeSelf && Plugin.Cfg.KeepConsoleEnabled)
			{
				((Component)__instance.terminalUIScreen).gameObject.SetActive(true);
			}
		}

		[HarmonyPatch(typeof(Terminal), "LoadNewNode")]
		[HarmonyPostfix]
		public static void TerminalLoadHackPost(Terminal __instance, TerminalNode node)
		{
			if (!(((Object)node).name == "ScanInfo") || Plugin.Cfg.ThreatScannerType == 0 || !RoundManager.Instance.currentLevel.spawnEnemiesAndScrap)
			{
				return;
			}
			int currentEnemyPower = RoundManager.Instance.currentEnemyPower;
			int maxEnemyPowerCount = RoundManager.Instance.currentLevel.maxEnemyPowerCount;
			string text = "\nThreat Level: ";
			switch (Plugin.Cfg.ThreatScannerType)
			{
			case 1:
			{
				int numberOfEnemiesInScene = RoundManager.Instance.numberOfEnemiesInScene;
				text = "\nHostile Contacts: " + numberOfEnemiesInScene;
				break;
			}
			case 2:
				text = text + ((float)currentEnemyPower / (float)maxEnemyPowerCount * 100f).ToString("N1") + "%";
				break;
			case 3:
			{
				string text2 = "CLEAR";
				float num = (float)currentEnemyPower / (float)maxEnemyPowerCount;
				if (num > 0.99f)
				{
					text2 = "OMEGA";
				}
				else if (num > 0.69f)
				{
					text2 = "RED";
				}
				else if ((double)num > 0.49)
				{
					text2 = "ORANGE";
				}
				else if ((double)num > 0.24)
				{
					text2 = "YELLOW";
				}
				else if (num > 0f)
				{
					text2 = "GREEN";
				}
				text += text2;
				break;
			}
			}
			text += "\n";
			TMP_InputField screenText = __instance.screenText;
			screenText.text += text;
			__instance.currentText = __instance.screenText.text;
			__instance.textAdded = 0;
		}
	}
	[BepInPlugin("mom.llama.enhancer", "Enhancer", "0.1.8")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		public static PluginConfig Cfg;

		private void Awake()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Cfg = new PluginConfig(this);
			if (!Cfg.Enabled)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Globally disabled, exit");
				return;
			}
			Harmony val = new Harmony("Enhancer");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Enabled, patching now");
			val.PatchAll(typeof(SPPatcher));
			if (Cfg.DoSuitPatches)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Doing suit patches");
				val.PatchAll(typeof(SuitPatches));
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Doing protection patches");
			val.PatchAll(typeof(SPProtectionPatches));
		}
	}
	public class PluginConfig
	{
		public readonly bool Enabled;

		public readonly bool KeepConsoleEnabled;

		public readonly bool UseRandomPrices;

		public readonly bool DoSuitPatches;

		public readonly float TimeScale;

		public readonly float MinimumBuyRate;

		public readonly float DoorTimer;

		public readonly int DaysPerQuota;

		public readonly int ThreatScannerType;

		public readonly SPProtectionPatches.ProtectionType ScrapProtection;

		public PluginConfig(Plugin BindingPlugin)
		{
			Enabled = ((BaseUnityPlugin)BindingPlugin).Config.Bind<bool>("Enhancer", "bEnabled", true, "Globally enable/disable the plugin").Value;
			KeepConsoleEnabled = ((BaseUnityPlugin)BindingPlugin).Config.Bind<bool>("Enhancer", "bAlwaysShowTerminal", true, "Whether to keep the terminal enabled after a player stops using it\nHost Required: No").Value;
			UseRandomPrices = ((BaseUnityPlugin)BindingPlugin).Config.Bind<bool>("Enhancer", "bUseRandomPrices", false, "Enables the random prices setting. Great if you're using longer quota deadlines.\nThis uses a variety of things to randomize prices such as the company mood, time passed in the quota, etc.\nRespects the minimum sale value, too.\nHost Required: Yes").Value;
			DoSuitPatches = ((BaseUnityPlugin)BindingPlugin).Config.Bind<bool>("Enhancer", "bUnlockSuits", false, "Unlocks a few of the cheaper suits from the start so your crew has options.\nHost Required: Yes").Value;
			TimeScale = ((BaseUnityPlugin)BindingPlugin).Config.Bind<float>("Enhancer", "fTimeScale", 1.5f, "How fast time passes on moons. Lower values mean time passes more slowly.\nRecommended value for single play: 1.15\nHost Required: Yes").Value;
			MinimumBuyRate = ((BaseUnityPlugin)BindingPlugin).Config.Bind<float>("Enhancer", "fMinCompanyBuyPCT", 0f, "The default formula for selling items to the company doesn't allow days remaining above 3.\nAlways keep this set to at least 0.0 but you probably want something higher if you have more days set for the quota.\nRecommended values for games above 3 days: 0.3 - 0.5\nHost Required: Yes").Value;
			DoorTimer = ((BaseUnityPlugin)BindingPlugin).Config.Bind<float>("Enhancer", "fDoorTimer", 30f, "How long the hangar door can be kept shut at a time (in seconds)\nRecommended values: 60.0 - 180.0\nHost Required: All players should use the same setting here").Value;
			DaysPerQuota = ((BaseUnityPlugin)BindingPlugin).Config.Bind<int>("Enhancer", "iQuotaDays", 3, "How long you have to meet each quota (in days)\nRecommended values: 3 - 7\nHost Required: Yes").Value;
			ThreatScannerType = ((BaseUnityPlugin)BindingPlugin).Config.Bind<int>("Enhancer", "eThreatScannerType", 0, "How the threat scanner functions. Valid types:\n0 - Disabled\n1 - Number of Enemies on level\n2 - Percentage of max enemies on level\n3 - Vague Text description (In order of threat level) [Clear -> Green -> Yellow -> Orange - Red]\nHost Required: No").Value;
			ScrapProtection = ((BaseUnityPlugin)BindingPlugin).Config.Bind<SPProtectionPatches.ProtectionType>("Enhancer", "eScrapProtection", SPProtectionPatches.ProtectionType.SAVE_NONE, "Sets how scrap will be handled when all players die in a round.\nSAVE_NONE: Default all scrap is deleted\nSAVE_ALL: No scrap is removed\nSAVE_COINFLIP: Each piece of scrap has a 50/50 of being removed\nHost Required: Yes").Value;
		}
	}
	public static class PriceRandomizer
	{
		public static void Randomize()
		{
			Plugin.Log.LogInfo((object)"Randomizing Prices");
			if (TimeOfDay.Instance.daysUntilDeadline < 1)
			{
				StartOfRound.Instance.companyBuyingRate = 1f;
				return;
			}
			float moodFactor = GetMoodFactor();
			Plugin.Log.LogInfo((object)"Got mood factor");
			float num = (float)(1.0 + (double)(0.05f * (float)(Plugin.Cfg.DaysPerQuota - TimeOfDay.Instance.daysUntilDeadline)));
			num = Mathf.Clamp(num, 1f, 2f);
			Random random = new Random(StartOfRound.Instance.randomMapSeed + 77);
			float companyBuyingRate = (float)random.NextDouble() * (1f - moodFactor * num) + moodFactor;
			Plugin.Log.LogInfo((object)("New prices set at" + companyBuyingRate));
			Plugin.Log.LogInfo((object)("    factors " + moodFactor + " : " + num + " : " + (StartOfRound.Instance.randomMapSeed + 77)));
			StartOfRound.Instance.companyBuyingRate = companyBuyingRate;
		}

		private static bool IsCompanyAvailable()
		{
			if (TimeOfDay.Instance == null)
			{
				return false;
			}
			if (TimeOfDay.Instance.currentCompanyMood == null)
			{
				return false;
			}
			if (((Object)TimeOfDay.Instance.currentCompanyMood).name == null)
			{
				return false;
			}
			return true;
		}

		private static float GetMoodFactor()
		{
			Plugin.Log.LogInfo((object)"Get mood factor");
			float num = 0.4f;
			if (!IsCompanyAvailable())
			{
				return num;
			}
			string name = ((Object)TimeOfDay.Instance.currentCompanyMood).name;
			if (1 == 0)
			{
			}
			float result = name switch
			{
				"SilentCalm" => 0.35f, 
				"SnoringGiant" => 0.45f, 
				"Agitated" => 0.25f, 
				_ => num, 
			};
			if (1 == 0)
			{
			}
			return result;
		}
	}
	public class SPProtectionPatches
	{
		public enum ProtectionType
		{
			SAVE_NONE,
			SAVE_ALL,
			SAVE_COINFLIP
		}

		private static Random rng;

		[HarmonyPatch(typeof(RoundManager), "DespawnPropsAtEndOfRound")]
		[HarmonyPrefix]
		public static bool ProtectionPrefix(RoundManager __instance, bool despawnAllItems)
		{
			if (Plugin.Cfg.ScrapProtection == ProtectionType.SAVE_NONE || despawnAllItems)
			{
				return true;
			}
			if (((NetworkBehaviour)__instance).IsHost || ((NetworkBehaviour)__instance).IsServer)
			{
				Plugin.Log.LogInfo((object)("ProtectionPatch -> " + despawnAllItems + " : " + StartOfRound.Instance.allPlayersDead));
				if (StartOfRound.Instance.allPlayersDead)
				{
					GrabbableObject[] array = Object.FindObjectsOfType<GrabbableObject>();
					rng = new Random(StartOfRound.Instance.randomMapSeed + 83);
					GrabbableObject[] array2 = array;
					foreach (GrabbableObject val in array2)
					{
						ProtectionType scrapProtection = Plugin.Cfg.ScrapProtection;
						if (!val.itemProperties.isScrap)
						{
							continue;
						}
						if (val.isInShipRoom && ShouldSaveScrap(scrapProtection))
						{
							Plugin.Log.LogInfo((object)("Saving scrap item " + ((Object)val).name));
							continue;
						}
						((Component)val).gameObject.GetComponent<NetworkObject>().Despawn(true);
						if (__instance.spawnedSyncedObjects.Contains(((Component)val).gameObject))
						{
							__instance.spawnedSyncedObjects.Remove(((Component)val).gameObject);
						}
					}
					GameObject[] array3 = GameObject.FindGameObjectsWithTag("TemporaryEffect");
					for (int j = 0; j < array3.Length; j++)
					{
						Object.Destroy((Object)(object)array3[j]);
					}
					return false;
				}
			}
			return true;
		}

		public static bool ShouldSaveScrap(ProtectionType pType)
		{
			return pType switch
			{
				ProtectionType.SAVE_ALL => true, 
				ProtectionType.SAVE_COINFLIP => rng.NextDouble() > 0.49, 
				_ => false, 
			};
		}
	}
	public class SuitPatches
	{
		private static readonly MethodInfo unlockItem = typeof(StartOfRound).GetMethod("SpawnUnlockable", BindingFlags.Instance | BindingFlags.NonPublic);

		public static void SpawnUnlockableDelegate(StartOfRound instance, int ID)
		{
			unlockItem.Invoke(instance, new object[1] { ID });
		}

		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyPostfix]
		public static void StartOfRoundSuitPatch(StartOfRound __instance)
		{
			Plugin.Log.LogInfo((object)"Setting unlocked suits this round");
			SpawnUnlockableDelegate(__instance, 1);
			SpawnUnlockableDelegate(__instance, 2);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Enhancer";

		public const string PLUGIN_NAME = "Enhancer";

		public const string PLUGIN_VERSION = "0.1.8";
	}
}

plugins/monkes_mods-JumpDelayPatch/JumpDelayPatch.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("JumpDelayPatch")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JumpDelayPatch")]
[assembly: AssemblyTitle("JumpDelayPatch")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace JumpDelayPatch
{
	[BepInPlugin("monke.lc.jumpdelay", "Jump Delay Patch", "0.0.0.1")]
	public class monkeDelayPatch : BaseUnityPlugin
	{
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		internal class PlayerControllerB_PlayerJump
		{
			private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Expected O, but got Unknown
				List<CodeInstruction> list = instructions.ToList();
				for (int i = 0; i < list.Count; i++)
				{
					if (list[i].opcode == OpCodes.Ldc_R4)
					{
						list[i] = new CodeInstruction(OpCodes.Ldc_R4, (object)0f);
					}
				}
				return list;
			}
		}

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin JumpDelayPatch is loaded!");
			Harmony val = new Harmony("monke.lc.jumpdelay");
			val.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "JumpDelayPatch";

		public const string PLUGIN_NAME = "JumpDelayPatch";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}

plugins/Monkeytype-HideChat/HideChat.dll

Decompiled 10 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HideChat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HideChat")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fa900f4d-71b1-433a-ad23-a10fc53dc3d8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HideChat
{
	[BepInPlugin("Miodec.HideChat", "Hide Chat", "1.0.0")]
	public class HidePlayerNames : BaseUnityPlugin
	{
		private const string modGUID = "Miodec.HideChat";

		private const string modName = "Hide Chat";

		private const string modVersion = "1.0.0";

		private static HidePlayerNames Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Miodec.HideChat");
			mls.LogDebug((object)"hidechat is awake");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		}
	}
}
namespace HideChat.Patches
{
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		[HarmonyPatch("OpenMenu_performed")]
		[HarmonyPatch("SubmitChat_performed")]
		[HarmonyPatch("AddChatMessage")]
		[HarmonyPostfix]
		public static void FadeToNothing(ref HUDManager __instance)
		{
			__instance.PingHUDElement(__instance.Chat, 5f, 1f, 0f);
		}
	}
}

plugins/NotAtomicBomb-TerminalApi/TerminalApi.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("NotAtomicBomb")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Terminal Api for the terminal in Lethal Company")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0+b87452af897d2b57619d1b55b8887fd436be901a")]
[assembly: AssemblyProduct("TerminalApi")]
[assembly: AssemblyTitle("TerminalApi")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/NotAtomicBomb/TerminalApi")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TerminalApi
{
	internal class DelayedAction
	{
		internal Action<TerminalKeyword> Action { get; set; }

		internal TerminalKeyword Keyword { get; set; }

		internal void Run()
		{
			Action(Keyword);
		}
	}
	[BepInPlugin("atomic.terminalapi", "Terminal Api", "1.3.0")]
	public class Plugin : BaseUnityPlugin
	{
		public ManualLogSource Log = new ManualLogSource("Terminal Api");

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin TerminalApi is loaded!");
			Logger.Sources.Add((ILogSource)(object)Log);
			TerminalApi.plugin = this;
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		}
	}
	public static class TerminalApi
	{
		public static Plugin plugin;

		internal static List<DelayedAction> QueuedActions = new List<DelayedAction>();

		public static Terminal Terminal { get; internal set; }

		public static string CurrentText => Terminal.currentText;

		public static TMP_InputField ScreenText => Terminal.screenText;

		public static bool IsInGame()
		{
			try
			{
				return Terminal != null;
			}
			catch (NullReferenceException)
			{
				return false;
			}
		}

		public static void AddCommand(string commandWord, string displayText, string verbWord = null, bool clearPreviousText = true)
		{
			commandWord = commandWord.ToLower();
			TerminalKeyword val = CreateTerminalKeyword(commandWord);
			TerminalNode val2 = CreateTerminalNode(displayText, clearPreviousText);
			if (verbWord != null)
			{
				verbWord = verbWord.ToLower();
				TerminalKeyword terminalKeyword = CreateTerminalKeyword(verbWord, isVerb: true);
				AddTerminalKeyword(val.defaultVerb = terminalKeyword.AddCompatibleNoun(val, val2));
				AddTerminalKeyword(val);
			}
			else
			{
				val.specialKeywordResult = val2;
				AddTerminalKeyword(val);
			}
		}

		public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, TerminalNode triggeringNode = null)
		{
			TerminalKeyword obj = ScriptableObject.CreateInstance<TerminalKeyword>();
			obj.word = word.ToLower();
			obj.isVerb = isVerb;
			obj.specialKeywordResult = triggeringNode;
			return obj;
		}

		public static TerminalKeyword CreateTerminalKeyword(string word, string displayText, bool clearPreviousText = false, string terminalEvent = "")
		{
			TerminalKeyword obj = ScriptableObject.CreateInstance<TerminalKeyword>();
			obj.word = word.ToLower();
			obj.isVerb = false;
			obj.specialKeywordResult = CreateTerminalNode(displayText, clearPreviousText, terminalEvent);
			return obj;
		}

		public static TerminalNode CreateTerminalNode(string displayText, bool clearPreviousText = false, string terminalEvent = "")
		{
			TerminalNode obj = ScriptableObject.CreateInstance<TerminalNode>();
			obj.displayText = displayText;
			obj.clearPreviousText = clearPreviousText;
			obj.terminalEvent = terminalEvent;
			return obj;
		}

		public static void AddTerminalKeyword(TerminalKeyword terminalKeyword)
		{
			if (IsInGame())
			{
				if (GetKeyword(terminalKeyword.word) == null)
				{
					Terminal.terminalNodes.allKeywords = Terminal.terminalNodes.allKeywords.Add(terminalKeyword);
					plugin.Log.LogMessage((object)("Added " + terminalKeyword.word + " keyword to terminal keywords."));
				}
				else
				{
					plugin.Log.LogWarning((object)("Failed to add " + terminalKeyword.word + " keyword. Already exists."));
				}
			}
			else
			{
				plugin.Log.LogMessage((object)("Not in game, waiting to be in game to add " + terminalKeyword.word + " keyword."));
				Action<TerminalKeyword> action = AddTerminalKeyword;
				DelayedAction item = new DelayedAction
				{
					Action = action,
					Keyword = terminalKeyword
				};
				QueuedActions.Add(item);
			}
		}

		public static TerminalKeyword GetKeyword(string keyword)
		{
			if (IsInGame())
			{
				return ((IEnumerable<TerminalKeyword>)Terminal.terminalNodes.allKeywords).FirstOrDefault((Func<TerminalKeyword, bool>)((TerminalKeyword Kw) => Kw.word == keyword));
			}
			return null;
		}

		public static void UpdateKeyword(TerminalKeyword keyword)
		{
			if (!IsInGame())
			{
				return;
			}
			for (int i = 0; i < Terminal.terminalNodes.allKeywords.Length; i++)
			{
				if (Terminal.terminalNodes.allKeywords[i].word == keyword.word)
				{
					Terminal.terminalNodes.allKeywords[i] = keyword;
					return;
				}
			}
			plugin.Log.LogWarning((object)("Failed to update " + keyword.word + ". Was not found in keywords."));
		}

		public static void DeleteKeyword(string word)
		{
			if (!IsInGame())
			{
				return;
			}
			for (int i = 0; i < Terminal.terminalNodes.allKeywords.Length; i++)
			{
				if (Terminal.terminalNodes.allKeywords[i].word == word.ToLower())
				{
					int newSize = Terminal.terminalNodes.allKeywords.Length - 1;
					for (int j = i + 1; j < Terminal.terminalNodes.allKeywords.Length; j++)
					{
						Terminal.terminalNodes.allKeywords[j - 1] = Terminal.terminalNodes.allKeywords[j];
					}
					Array.Resize(ref Terminal.terminalNodes.allKeywords, newSize);
					plugin.Log.LogMessage((object)(word + " was deleted successfully."));
					return;
				}
			}
			plugin.Log.LogWarning((object)("Failed to delete " + word + ". Was not found in keywords."));
		}

		public static void UpdateKeywordCompatibleNoun(TerminalKeyword verbKeyword, string noun, TerminalNode newTriggerNode)
		{
			if (!IsInGame() || !verbKeyword.isVerb)
			{
				return;
			}
			for (int i = 0; i < verbKeyword.compatibleNouns.Length; i++)
			{
				CompatibleNoun val = verbKeyword.compatibleNouns[i];
				if (val.noun.word == noun)
				{
					val.result = newTriggerNode;
					UpdateKeyword(verbKeyword);
					return;
				}
			}
			plugin.Log.LogWarning((object)$"WARNING: No noun found for {verbKeyword}");
		}

		public static void UpdateKeywordCompatibleNoun(string verbWord, string noun, TerminalNode newTriggerNode)
		{
			if (!IsInGame())
			{
				return;
			}
			TerminalKeyword keyword = GetKeyword(verbWord);
			if (!keyword.isVerb || verbWord == null)
			{
				return;
			}
			for (int i = 0; i < keyword.compatibleNouns.Length; i++)
			{
				CompatibleNoun val = keyword.compatibleNouns[i];
				if (val.noun.word == noun)
				{
					val.result = newTriggerNode;
					UpdateKeyword(keyword);
					return;
				}
			}
			plugin.Log.LogWarning((object)$"WARNING: No noun found for {keyword}");
		}

		public static void UpdateKeywordCompatibleNoun(TerminalKeyword verbKeyword, string noun, string newDisplayText)
		{
			if (!IsInGame() || !verbKeyword.isVerb)
			{
				return;
			}
			for (int i = 0; i < verbKeyword.compatibleNouns.Length; i++)
			{
				CompatibleNoun val = verbKeyword.compatibleNouns[i];
				if (val.noun.word == noun)
				{
					val.result.displayText = newDisplayText;
					UpdateKeyword(verbKeyword);
					return;
				}
			}
			plugin.Log.LogWarning((object)$"WARNING: No noun found for {verbKeyword}");
		}

		public static void UpdateKeywordCompatibleNoun(string verbWord, string noun, string newDisplayText)
		{
			if (!IsInGame())
			{
				return;
			}
			TerminalKeyword keyword = GetKeyword(verbWord);
			if (!keyword.isVerb)
			{
				return;
			}
			for (int i = 0; i < keyword.compatibleNouns.Length; i++)
			{
				CompatibleNoun val = keyword.compatibleNouns[i];
				if (val.noun.word == noun)
				{
					val.result.displayText = newDisplayText;
					UpdateKeyword(keyword);
					return;
				}
			}
			plugin.Log.LogWarning((object)$"WARNING: No noun found for {keyword}");
		}

		public static void AddCompatibleNoun(TerminalKeyword verbKeyword, string noun, string displayText, bool clearPreviousText = false)
		{
			if (IsInGame())
			{
				TerminalKeyword keyword = GetKeyword(noun);
				verbKeyword = verbKeyword.AddCompatibleNoun(keyword, displayText, clearPreviousText);
				UpdateKeyword(verbKeyword);
			}
		}

		public static void AddCompatibleNoun(TerminalKeyword verbKeyword, string noun, TerminalNode triggerNode)
		{
			if (IsInGame())
			{
				TerminalKeyword keyword = GetKeyword(noun);
				verbKeyword = verbKeyword.AddCompatibleNoun(keyword, triggerNode);
				UpdateKeyword(verbKeyword);
			}
		}

		public static void AddCompatibleNoun(string verbWord, string noun, TerminalNode triggerNode)
		{
			if (IsInGame())
			{
				TerminalKeyword keyword = GetKeyword(verbWord);
				TerminalKeyword keyword2 = GetKeyword(noun);
				if ((Object)(object)keyword == (Object)null)
				{
					plugin.Log.LogWarning((object)"The verb given does not exist.");
					return;
				}
				keyword = keyword.AddCompatibleNoun(keyword2, triggerNode);
				UpdateKeyword(keyword);
			}
		}

		public static void AddCompatibleNoun(string verbWord, string noun, string displayText, bool clearPreviousText = false)
		{
			if (IsInGame())
			{
				TerminalKeyword keyword = GetKeyword(verbWord);
				TerminalKeyword keyword2 = GetKeyword(noun);
				if ((Object)(object)keyword == (Object)null)
				{
					plugin.Log.LogWarning((object)"The verb given does not exist.");
					return;
				}
				keyword = keyword.AddCompatibleNoun(keyword2, displayText, clearPreviousText);
				UpdateKeyword(keyword);
			}
		}

		public static string GetTerminalInput()
		{
			if (IsInGame())
			{
				return CurrentText.Substring(CurrentText.Length - Terminal.textAdded);
			}
			return "";
		}

		public static void SetTerminalInput(string terminalInput)
		{
			Terminal.TextChanged(CurrentText.Substring(0, CurrentText.Length - Terminal.textAdded) + terminalInput);
			ScreenText.text = CurrentText;
			Terminal.textAdded = terminalInput.Length;
		}
	}
	public static class TerminalExtenstionMethods
	{
		public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, TerminalKeyword noun, TerminalNode result)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			if (terminalKeyword.isVerb)
			{
				CompatibleNoun val = new CompatibleNoun
				{
					noun = noun,
					result = result
				};
				if (terminalKeyword.compatibleNouns == null)
				{
					terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val };
				}
				else
				{
					terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val);
				}
				return terminalKeyword;
			}
			return null;
		}

		public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, string noun, TerminalNode result)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			if (terminalKeyword.isVerb)
			{
				CompatibleNoun val = new CompatibleNoun
				{
					noun = TerminalApi.CreateTerminalKeyword(noun),
					result = result
				};
				if (terminalKeyword.compatibleNouns == null)
				{
					terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val };
				}
				else
				{
					terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val);
				}
				return terminalKeyword;
			}
			return null;
		}

		public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, string noun, string displayText)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			if (terminalKeyword.isVerb)
			{
				CompatibleNoun val = new CompatibleNoun
				{
					noun = TerminalApi.CreateTerminalKeyword(noun),
					result = TerminalApi.CreateTerminalNode(displayText)
				};
				if (terminalKeyword.compatibleNouns == null)
				{
					terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val };
				}
				else
				{
					terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val);
				}
				return terminalKeyword;
			}
			return null;
		}

		public static TerminalKeyword AddCompatibleNoun(this TerminalKeyword terminalKeyword, TerminalKeyword noun, string displayText, bool clearPreviousText = false)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			if (terminalKeyword.isVerb)
			{
				CompatibleNoun val = new CompatibleNoun
				{
					noun = noun,
					result = TerminalApi.CreateTerminalNode(displayText, clearPreviousText)
				};
				if (terminalKeyword.compatibleNouns == null)
				{
					terminalKeyword.compatibleNouns = (CompatibleNoun[])(object)new CompatibleNoun[1] { val };
				}
				else
				{
					terminalKeyword.compatibleNouns = terminalKeyword.compatibleNouns.Add(val);
				}
				return terminalKeyword;
			}
			return null;
		}

		internal static T[] Add<T>(this T[] array, T newItem)
		{
			int num = array.Length + 1;
			Array.Resize(ref array, num);
			array[num - 1] = newItem;
			return array;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "TerminalApi";

		public const string PLUGIN_NAME = "TerminalApi";

		public const string PLUGIN_VERSION = "1.4.0";
	}
}
namespace TerminalApi.Events
{
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	[HarmonyPatch(typeof(Terminal))]
	public static class Events
	{
		public class TerminalEventArgs : EventArgs
		{
			public Terminal Terminal { get; set; }
		}

		public delegate void TerminalEventHandler(object sender, TerminalEventArgs e);

		public class TerminalParseSentenceEventArgs : TerminalEventArgs
		{
			public TerminalNode ReturnedNode { get; set; }

			public string SubmittedText { get; set; }
		}

		public delegate void TerminalParseSentenceEventHandler(object sender, TerminalParseSentenceEventArgs e);

		public class TerminalTextChangedEventArgs : TerminalEventArgs
		{
			public string NewText;

			public string CurrentInputText;
		}

		public delegate void TerminalTextChangedEventHandler(object sender, TerminalTextChangedEventArgs e);

		public static event TerminalEventHandler TerminalAwake;

		public static event TerminalEventHandler TerminalWaking;

		public static event TerminalEventHandler TerminalStarted;

		public static event TerminalEventHandler TerminalStarting;

		public static event TerminalEventHandler TerminalBeginUsing;

		public static event TerminalEventHandler TerminalBeganUsing;

		public static event TerminalEventHandler TerminalExited;

		public static event TerminalParseSentenceEventHandler TerminalParsedSentence;

		public static event TerminalTextChangedEventHandler TerminalTextChanged;

		[HarmonyPatch("Awake")]
		[HarmonyPostfix]
		public static void Awake(ref Terminal __instance)
		{
			TerminalApi.Terminal = __instance;
			if (TerminalApi.QueuedActions.Count > 0)
			{
				TerminalApi.plugin.Log.LogMessage((object)"In game, now adding words.");
				foreach (DelayedAction queuedAction in TerminalApi.QueuedActions)
				{
					queuedAction.Run();
				}
				TerminalApi.QueuedActions.Clear();
			}
			Events.TerminalAwake?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("BeginUsingTerminal")]
		[HarmonyPostfix]
		public static void BeganUsing(ref Terminal __instance)
		{
			Events.TerminalBeganUsing?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("QuitTerminal")]
		[HarmonyPostfix]
		public static void OnQuitTerminal(ref Terminal __instance)
		{
			Events.TerminalExited?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("BeginUsingTerminal")]
		[HarmonyPrefix]
		public static void OnBeginUsing(ref Terminal __instance)
		{
			Events.TerminalBeginUsing?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("ParsePlayerSentence")]
		[HarmonyPostfix]
		public static void ParsePlayerSentence(ref Terminal __instance, TerminalNode __result)
		{
			string submittedText = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded);
			Events.TerminalParsedSentence?.Invoke(__instance, new TerminalParseSentenceEventArgs
			{
				Terminal = __instance,
				SubmittedText = submittedText,
				ReturnedNode = __result
			});
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void Started(ref Terminal __instance)
		{
			Events.TerminalStarted?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void Starting(ref Terminal __instance)
		{
			Events.TerminalStarting?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}

		[HarmonyPatch("TextChanged")]
		[HarmonyPostfix]
		public static void OnTextChanged(ref Terminal __instance, string newText)
		{
			string currentInputText = "";
			if (newText.Trim().Length >= __instance.textAdded)
			{
				currentInputText = newText.Substring(newText.Length - __instance.textAdded);
			}
			Events.TerminalTextChanged?.Invoke(__instance, new TerminalTextChangedEventArgs
			{
				Terminal = __instance,
				NewText = newText,
				CurrentInputText = currentInputText
			});
		}

		[HarmonyPatch("Awake")]
		[HarmonyPrefix]
		public static void Waking(ref Terminal __instance)
		{
			Events.TerminalWaking?.Invoke(__instance, new TerminalEventArgs
			{
				Terminal = __instance
			});
		}
	}
}

plugins/NotAtomicBomb-Terminal_History/Terminal History.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TerminalApi;
using TerminalApi.Events;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("Terminal History")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Terminal Command History")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+22af0d131fcfcb352cbbd5a5a6fc0cb15967e567")]
[assembly: AssemblyProduct("Terminal History")]
[assembly: AssemblyTitle("Terminal History")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TerminalHistory
{
	[BepInPlugin("atomic.terminalhistory", "Terminal History", "1.0.1")]
	[BepInDependency("atomic.terminalapi", "1.3.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const int SIZE = 20;

		private Terminal Terminal;

		private List<string> _commands = new List<string>();

		private InputAction _upArrow;

		private InputAction _downArrow;

		private int _index = -1;

		private void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Terminal History is loaded!");
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			Events.TerminalStarted += new TerminalEventHandler(OnTerminalStarted);
			Events.TerminalExited += new TerminalEventHandler(OnTerminalExited);
			Events.TerminalBeginUsing += new TerminalEventHandler(OnTerminalBeginUsing);
			Events.TerminalParsedSentence += new TerminalParseSentenceEventHandler(OnTerminalSubmit);
			Events.TerminalTextChanged += new TerminalTextChangedEventHandler(OnTerminalTextChange);
		}

		private void OnTerminalTextChange(object sender, TerminalTextChangedEventArgs e)
		{
			if (e.CurrentInputText == "" && _index != -1)
			{
				_index = -1;
			}
		}

		private void OnTerminalSubmit(object sender, TerminalParseSentenceEventArgs e)
		{
			if (_commands.Contains(e.SubmittedText))
			{
				_commands.Remove(e.SubmittedText);
			}
			_commands.Insert(0, e.SubmittedText);
			if (_commands.Count > 20)
			{
				_commands.RemoveRange(20, _commands.Count - 20);
			}
			_index = -1;
		}

		private void OnTerminalExited(object sender, TerminalEventArgs e)
		{
			_upArrow.performed -= OnUpArrowPerformed;
			_upArrow.Disable();
			_downArrow.performed -= OnDownArrowPerformed;
			_downArrow.Disable();
		}

		private void OnTerminalBeginUsing(object sender, TerminalEventArgs e)
		{
			_upArrow.Enable();
			_upArrow.performed += OnUpArrowPerformed;
			_downArrow.Enable();
			_downArrow.performed += OnDownArrowPerformed;
		}

		private void OnTerminalStarted(object sender, TerminalEventArgs e)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			_commands.Clear();
			_upArrow = new InputAction("UpArrow", (InputActionType)0, "<Keyboard>/uparrow", "Press", (string)null, (string)null);
			_downArrow = new InputAction("DownArrow", (InputActionType)0, "<Keyboard>/downarrow", "Press", (string)null, (string)null);
			Terminal = TerminalApi.Terminal;
		}

		private void OnDownArrowPerformed(CallbackContext context)
		{
			if (_commands.Count > 0 && Terminal.terminalInUse)
			{
				_index--;
				if (_index <= -1)
				{
					_index = -1;
					SetTerminalText("");
				}
				else
				{
					string terminalText = _commands[_index];
					SetTerminalText(terminalText);
				}
			}
		}

		private void OnUpArrowPerformed(CallbackContext context)
		{
			if (Terminal.terminalInUse && _commands.Count > 0)
			{
				_index++;
				if (_index >= _commands.Count)
				{
					_index = _commands.Count - 1;
					string terminalText = _commands[_commands.Count - 1];
					SetTerminalText(terminalText);
				}
				else
				{
					string terminalText2 = _commands[_index];
					SetTerminalText(terminalText2);
				}
			}
		}

		private void SetTerminalText(string text)
		{
			Terminal.TextChanged(TerminalApi.Terminal.currentText.Substring(0, TerminalApi.Terminal.currentText.Length - TerminalApi.Terminal.textAdded) + text);
			Terminal.screenText.text = TerminalApi.Terminal.currentText;
			Terminal.textAdded = text.Length;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "Terminal History";

		public const string PLUGIN_NAME = "Terminal History";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}

plugins/notnotnotswipez-MoreCompany/MoreCompany.dll

Decompiled 10 months 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.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using Steamworks;
using Steamworks.Data;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MoreCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MoreCompany")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("511a1e5e-0611-49f1-b60f-cec69c668fd8")]
[assembly: AssemblyFileVersion("1.7.2")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.7.2.0")]
namespace MoreCompany
{
	[HarmonyPatch(typeof(AudioMixer), "SetFloat")]
	public static class AudioMixerSetFloatPatch
	{
		public static bool Prefix(string name, float value)
		{
			if (name.StartsWith("PlayerVolume") || name.StartsWith("PlayerPitch"))
			{
				string s = name.Replace("PlayerVolume", "").Replace("PlayerPitch", "");
				int num = int.Parse(s);
				PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[num];
				AudioSource currentVoiceChatAudioSource = val.currentVoiceChatAudioSource;
				if ((Object)(object)val != (Object)null && Object.op_Implicit((Object)(object)currentVoiceChatAudioSource))
				{
					if (name.StartsWith("PlayerVolume"))
					{
						currentVoiceChatAudioSource.volume = value / 16f;
					}
					else if (name.StartsWith("PlayerPitch"))
					{
						currentVoiceChatAudioSource.pitch = value;
					}
				}
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HUDManager), "AddTextToChatOnServer")]
	public static class SendChatToServerPatch
	{
		public static bool Prefix(HUDManager __instance, string chatMessage, int playerId = -1)
		{
			if (((NetworkBehaviour)StartOfRound.Instance).IsHost && chatMessage.StartsWith("/mc") && DebugCommandRegistry.commandEnabled)
			{
				string text = chatMessage.Replace("/mc ", "");
				DebugCommandRegistry.HandleCommand(text.Split(new char[1] { ' ' }));
				return false;
			}
			if (chatMessage.StartsWith("[morecompanycosmetics]"))
			{
				ReflectionUtils.InvokeMethod(__instance, "AddPlayerChatMessageServerRpc", new object[2] { chatMessage, 99 });
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageServerRpc")]
	public static class ServerReceiveMessagePatch
	{
		public static string previousDataMessage = "";

		public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId)
		{
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening)
			{
				return false;
			}
			if (chatMessage.StartsWith("[morecompanycosmetics]") && networkManager.IsServer)
			{
				previousDataMessage = chatMessage;
				chatMessage = "[replacewithdata]";
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
	public static class ConnectClientToPlayerObjectPatch
	{
		public static void Postfix(PlayerControllerB __instance)
		{
			string text = "[morecompanycosmetics]";
			text = text + ";" + __instance.playerClientId;
			foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics)
			{
				text = text + ";" + locallySelectedCosmetic;
			}
			HUDManager.Instance.AddTextToChatOnServer(text, -1);
		}
	}
	[HarmonyPatch(typeof(HUDManager), "AddChatMessage")]
	public static class AddChatMessagePatch
	{
		public static bool Prefix(HUDManager __instance, string chatMessage, string nameOfUserWhoTyped = "")
		{
			if (chatMessage.StartsWith("[replacewithdata]") || chatMessage.StartsWith("[morecompanycosmetics]"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HUDManager), "AddPlayerChatMessageClientRpc")]
	public static class ClientReceiveMessagePatch
	{
		public static bool ignoreSample;

		public static bool Prefix(HUDManager __instance, ref string chatMessage, int playerId)
		{
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening)
			{
				return false;
			}
			if (networkManager.IsServer)
			{
				if (chatMessage.StartsWith("[replacewithdata]"))
				{
					chatMessage = ServerReceiveMessagePatch.previousDataMessage;
					HandleDataMessage(chatMessage);
				}
				else if (chatMessage.StartsWith("[morecompanycosmetics]"))
				{
					return false;
				}
			}
			else if (chatMessage.StartsWith("[morecompanycosmetics]"))
			{
				HandleDataMessage(chatMessage);
			}
			return true;
		}

		private static void HandleDataMessage(string chatMessage)
		{
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			if (ignoreSample)
			{
				return;
			}
			chatMessage = chatMessage.Replace("[morecompanycosmetics]", "");
			string[] array = chatMessage.Split(new char[1] { ';' });
			string text = array[1];
			int num = int.Parse(text);
			CosmeticApplication component = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.GetComponent<CosmeticApplication>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.ClearCosmetics();
				Object.Destroy((Object)(object)component);
			}
			CosmeticApplication cosmeticApplication = ((Component)((Component)StartOfRound.Instance.allPlayerScripts[num]).transform.Find("ScavengerModel").Find("metarig")).gameObject.AddComponent<CosmeticApplication>();
			cosmeticApplication.ClearCosmetics();
			List<string> list = new List<string>();
			string[] array2 = array;
			foreach (string text2 in array2)
			{
				if (!(text2 == text))
				{
					list.Add(text2);
					if (MainClass.showCosmetics)
					{
						cosmeticApplication.ApplyCosmetic(text2, startEnabled: true);
					}
				}
			}
			if (num == StartOfRound.Instance.thisClientPlayerId)
			{
				cosmeticApplication.ClearCosmetics();
			}
			foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics)
			{
				Transform transform = ((Component)spawnedCosmetic).transform;
				transform.localScale *= 0.38f;
			}
			MainClass.playerIdsAndCosmetics.Remove(num);
			MainClass.playerIdsAndCosmetics.Add(num, list);
			if (!GameNetworkManager.Instance.isHostingGame || num == 0)
			{
				return;
			}
			ignoreSample = true;
			foreach (KeyValuePair<int, List<string>> playerIdsAndCosmetic in MainClass.playerIdsAndCosmetics)
			{
				string text3 = "[morecompanycosmetics]";
				text3 = text3 + ";" + playerIdsAndCosmetic.Key;
				foreach (string item in playerIdsAndCosmetic.Value)
				{
					text3 = text3 + ";" + item;
				}
				HUDManager.Instance.AddTextToChatOnServer(text3, -1);
			}
			ignoreSample = false;
		}
	}
	public class DebugCommandRegistry
	{
		public static bool commandEnabled;

		public static void HandleCommand(string[] args)
		{
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			if (!commandEnabled)
			{
				return;
			}
			PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
			switch (args[0])
			{
			case "money":
			{
				int groupCredits = int.Parse(args[1]);
				Terminal val5 = Resources.FindObjectsOfTypeAll<Terminal>().First();
				val5.groupCredits = groupCredits;
				break;
			}
			case "spawnscrap":
			{
				string text = "";
				for (int i = 1; i < args.Length; i++)
				{
					text = text + args[i] + " ";
				}
				text = text.Trim();
				Vector3 val = ((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f;
				SpawnableItemWithRarity val2 = null;
				foreach (SpawnableItemWithRarity item in StartOfRound.Instance.currentLevel.spawnableScrap)
				{
					if (item.spawnableItem.itemName.ToLower() == text.ToLower())
					{
						val2 = item;
						break;
					}
				}
				GameObject val3 = Object.Instantiate<GameObject>(val2.spawnableItem.spawnPrefab, val, Quaternion.identity, (Transform)null);
				GrabbableObject component = val3.GetComponent<GrabbableObject>();
				((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation);
				component.fallTime = 0f;
				NetworkObject component2 = val3.GetComponent<NetworkObject>();
				component2.Spawn(false);
				break;
			}
			case "spawnenemy":
			{
				string text2 = "";
				for (int j = 1; j < args.Length; j++)
				{
					text2 = text2 + args[j] + " ";
				}
				text2 = text2.Trim();
				SpawnableEnemyWithRarity val4 = null;
				foreach (SpawnableEnemyWithRarity enemy in StartOfRound.Instance.currentLevel.Enemies)
				{
					if (enemy.enemyType.enemyName.ToLower() == text2.ToLower())
					{
						val4 = enemy;
						break;
					}
				}
				RoundManager.Instance.SpawnEnemyGameObject(((Component)localPlayerController).transform.position + ((Component)localPlayerController).transform.forward * 2f, 0f, -1, val4.enemyType);
				break;
			}
			case "listall":
				MainClass.StaticLogger.LogInfo((object)"Spawnable scrap:");
				foreach (SpawnableItemWithRarity item2 in StartOfRound.Instance.currentLevel.spawnableScrap)
				{
					MainClass.StaticLogger.LogInfo((object)item2.spawnableItem.itemName);
				}
				MainClass.StaticLogger.LogInfo((object)"Spawnable enemies:");
				{
					foreach (SpawnableEnemyWithRarity enemy2 in StartOfRound.Instance.currentLevel.Enemies)
					{
						MainClass.StaticLogger.LogInfo((object)enemy2.enemyType.enemyName);
					}
					break;
				}
			}
		}
	}
	[HarmonyPatch(typeof(ForestGiantAI), "LookForPlayers")]
	public static class LookForPlayersForestGiantPatch
	{
		public static void Prefix(ForestGiantAI __instance)
		{
			if (__instance.playerStealthMeters.Length != MainClass.newPlayerCount)
			{
				__instance.playerStealthMeters = new float[MainClass.newPlayerCount];
				for (int i = 0; i < MainClass.newPlayerCount; i++)
				{
					__instance.playerStealthMeters[i] = 0f;
				}
			}
		}
	}
	[HarmonyPatch(typeof(SpringManAI), "Update")]
	public static class SpringManAIUpdatePatch
	{
		public static bool Prefix(SpringManAI __instance, ref float ___timeSinceHittingPlayer, ref float ___stopAndGoMinimumInterval, ref bool ___wasOwnerLastFrame, ref bool ___stoppingMovement, ref float ___currentChaseSpeed, ref bool ___hasStopped, ref float ___currentAnimSpeed, ref float ___updateDestinationInterval, ref Vector3 ___tempVelocity, ref float ___targetYRotation, ref float ___setDestinationToPlayerInterval, ref float ___previousYRotation)
		{
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: 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)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			UpdateBase((EnemyAI)(object)__instance, ref ___updateDestinationInterval, ref ___tempVelocity, ref ___targetYRotation, ref ___setDestinationToPlayerInterval, ref ___previousYRotation);
			if (((EnemyAI)__instance).isEnemyDead)
			{
				return false;
			}
			int currentBehaviourStateIndex = ((EnemyAI)__instance).currentBehaviourStateIndex;
			if (currentBehaviourStateIndex != 0 && currentBehaviourStateIndex == 1)
			{
				if (___timeSinceHittingPlayer >= 0f)
				{
					___timeSinceHittingPlayer -= Time.deltaTime;
				}
				if (((NetworkBehaviour)__instance).IsOwner)
				{
					if (___stopAndGoMinimumInterval > 0f)
					{
						___stopAndGoMinimumInterval -= Time.deltaTime;
					}
					if (!___wasOwnerLastFrame)
					{
						___wasOwnerLastFrame = true;
						if (!___stoppingMovement && ___timeSinceHittingPlayer < 0.12f)
						{
							((EnemyAI)__instance).agent.speed = ___currentChaseSpeed;
						}
						else
						{
							((EnemyAI)__instance).agent.speed = 0f;
						}
					}
					bool flag = false;
					for (int i = 0; i < MainClass.newPlayerCount; i++)
					{
						if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && StartOfRound.Instance.allPlayerScripts[i].HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 1.6f, 68f, 60, -1f) && Vector3.Distance(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, ((EnemyAI)__instance).eye.position) > 0.3f)
						{
							flag = true;
						}
					}
					if (((EnemyAI)__instance).stunNormalizedTimer > 0f)
					{
						flag = true;
					}
					if (flag != ___stoppingMovement && ___stopAndGoMinimumInterval <= 0f)
					{
						___stopAndGoMinimumInterval = 0.15f;
						if (flag)
						{
							__instance.SetAnimationStopServerRpc();
						}
						else
						{
							__instance.SetAnimationGoServerRpc();
						}
						___stoppingMovement = flag;
					}
				}
				if (___stoppingMovement)
				{
					if (__instance.animStopPoints.canAnimationStop)
					{
						if (!___hasStopped)
						{
							___hasStopped = true;
							__instance.mainCollider.isTrigger = false;
							if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position, 70f, 25, -1f))
							{
								float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position);
								if (num < 4f)
								{
									GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.9f, true);
								}
								else if (num < 9f)
								{
									GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.4f, true);
								}
							}
							if (___currentAnimSpeed > 2f)
							{
								RoundManager.PlayRandomClip(((EnemyAI)__instance).creatureVoice, __instance.springNoises, false, 1f, 0);
								if (__instance.animStopPoints.animationPosition == 1)
								{
									((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoing");
								}
								else
								{
									((EnemyAI)__instance).creatureAnimator.SetTrigger("springBoingPosition2");
								}
							}
						}
						((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", 0f);
						___currentAnimSpeed = 0f;
						if (((NetworkBehaviour)__instance).IsOwner)
						{
							((EnemyAI)__instance).agent.speed = 0f;
							return false;
						}
					}
				}
				else
				{
					if (___hasStopped)
					{
						___hasStopped = false;
						__instance.mainCollider.isTrigger = true;
					}
					___currentAnimSpeed = Mathf.Lerp(___currentAnimSpeed, 6f, 5f * Time.deltaTime);
					((EnemyAI)__instance).creatureAnimator.SetFloat("walkSpeed", ___currentAnimSpeed);
					if (((NetworkBehaviour)__instance).IsOwner)
					{
						((EnemyAI)__instance).agent.speed = Mathf.Lerp(((EnemyAI)__instance).agent.speed, ___currentChaseSpeed, 4.5f * Time.deltaTime);
					}
				}
			}
			return false;
		}

		private static void UpdateBase(EnemyAI __instance, ref float updateDestinationInterval, ref Vector3 tempVelocity, ref float targetYRotation, ref float setDestinationToPlayerInterval, ref float previousYRotation)
		{
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: 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_0255: 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_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			if (__instance.enemyType.isDaytimeEnemy && !__instance.daytimeEnemyLeaving)
			{
				ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "CheckTimeOfDayToLeave", null);
			}
			if (__instance.stunnedIndefinitely <= 0)
			{
				if ((double)__instance.stunNormalizedTimer >= 0.0)
				{
					__instance.stunNormalizedTimer -= Time.deltaTime / __instance.enemyType.stunTimeMultiplier;
				}
				else
				{
					__instance.stunnedByPlayer = null;
					if ((double)__instance.postStunInvincibilityTimer >= 0.0)
					{
						__instance.postStunInvincibilityTimer -= Time.deltaTime * 5f;
					}
				}
			}
			if (!__instance.ventAnimationFinished && (double)__instance.timeSinceSpawn < (double)__instance.exitVentAnimationTime + 0.004999999888241291 * (double)RoundManager.Instance.numberOfEnemiesInScene)
			{
				__instance.timeSinceSpawn += Time.deltaTime;
				if (!((NetworkBehaviour)__instance).IsOwner)
				{
					Vector3 serverPosition = __instance.serverPosition;
					if (__instance.serverPosition != Vector3.zero)
					{
						((Component)__instance).transform.position = __instance.serverPosition;
						((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, targetYRotation, ((Component)__instance).transform.eulerAngles.z);
					}
				}
				else if ((double)updateDestinationInterval >= 0.0)
				{
					updateDestinationInterval -= Time.deltaTime;
				}
				else
				{
					__instance.SyncPositionToClients();
					updateDestinationInterval = 0.1f;
				}
				return;
			}
			if (!__instance.ventAnimationFinished)
			{
				__instance.ventAnimationFinished = true;
				if ((Object)(object)__instance.creatureAnimator != (Object)null)
				{
					__instance.creatureAnimator.SetBool("inSpawningAnimation", false);
				}
			}
			if (!((NetworkBehaviour)__instance).IsOwner)
			{
				if (__instance.currentSearch.inProgress)
				{
					__instance.StopSearch(__instance.currentSearch, true);
				}
				__instance.SetClientCalculatingAI(false);
				if (!__instance.inSpecialAnimation)
				{
					((Component)__instance).transform.position = Vector3.SmoothDamp(((Component)__instance).transform.position, __instance.serverPosition, ref tempVelocity, __instance.syncMovementSpeed);
					((Component)__instance).transform.eulerAngles = new Vector3(((Component)__instance).transform.eulerAngles.x, Mathf.LerpAngle(((Component)__instance).transform.eulerAngles.y, targetYRotation, 15f * Time.deltaTime), ((Component)__instance).transform.eulerAngles.z);
				}
				__instance.timeSinceSpawn += Time.deltaTime;
				return;
			}
			if (__instance.isEnemyDead)
			{
				__instance.SetClientCalculatingAI(false);
				return;
			}
			if (!__instance.inSpecialAnimation)
			{
				__instance.SetClientCalculatingAI(true);
			}
			if (__instance.movingTowardsTargetPlayer && (Object)(object)__instance.targetPlayer != (Object)null)
			{
				if ((double)setDestinationToPlayerInterval <= 0.0)
				{
					setDestinationToPlayerInterval = 0.25f;
					__instance.destination = RoundManager.Instance.GetNavMeshPosition(((Component)__instance.targetPlayer).transform.position, RoundManager.Instance.navHit, 2.7f, -1);
				}
				else
				{
					__instance.destination = new Vector3(((Component)__instance.targetPlayer).transform.position.x, __instance.destination.y, ((Component)__instance.targetPlayer).transform.position.z);
					setDestinationToPlayerInterval -= Time.deltaTime;
				}
			}
			if (__instance.inSpecialAnimation)
			{
				return;
			}
			if ((double)updateDestinationInterval >= 0.0)
			{
				updateDestinationInterval -= Time.deltaTime;
			}
			else
			{
				__instance.DoAIInterval();
				updateDestinationInterval = __instance.AIIntervalTime;
			}
			if (!((double)Mathf.Abs(previousYRotation - ((Component)__instance).transform.eulerAngles.y) <= 6.0))
			{
				previousYRotation = ((Component)__instance).transform.eulerAngles.y;
				targetYRotation = previousYRotation;
				if (((NetworkBehaviour)__instance).IsServer)
				{
					ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationClientRpc", new object[1] { (short)previousYRotation });
				}
				else
				{
					ReflectionUtils.InvokeMethod(__instance, typeof(EnemyAI), "UpdateEnemyRotationServerRpc", new object[1] { (short)previousYRotation });
				}
			}
		}
	}
	[HarmonyPatch(typeof(SpringManAI), "DoAIInterval")]
	public static class SpringManAIIntervalPatch
	{
		public static bool Prefix(SpringManAI __instance)
		{
			//IL_0013: 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_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			if (((EnemyAI)__instance).moveTowardsDestination)
			{
				((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination);
			}
			((EnemyAI)__instance).SyncPositionToClients();
			if (StartOfRound.Instance.allPlayersDead)
			{
				return false;
			}
			if (((EnemyAI)__instance).isEnemyDead)
			{
				return false;
			}
			switch (((EnemyAI)__instance).currentBehaviourStateIndex)
			{
			default:
				return false;
			case 1:
				if (__instance.searchForPlayers.inProgress)
				{
					((EnemyAI)__instance).StopSearch(__instance.searchForPlayers, true);
				}
				if (((EnemyAI)__instance).TargetClosestPlayer(1.5f, false, 70f))
				{
					PlayerControllerB fieldValue = ReflectionUtils.GetFieldValue<PlayerControllerB>(__instance, "previousTarget");
					if ((Object)(object)fieldValue != (Object)(object)((EnemyAI)__instance).targetPlayer)
					{
						ReflectionUtils.SetFieldValue(__instance, "previousTarget", ((EnemyAI)__instance).targetPlayer);
						((EnemyAI)__instance).ChangeOwnershipOfEnemy(((EnemyAI)__instance).targetPlayer.actualClientId);
					}
					((EnemyAI)__instance).movingTowardsTargetPlayer = true;
					return false;
				}
				((EnemyAI)__instance).SwitchToBehaviourState(0);
				((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId);
				break;
			case 0:
			{
				if (!((NetworkBehaviour)__instance).IsServer)
				{
					((EnemyAI)__instance).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId);
					return false;
				}
				for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
				{
					if (((EnemyAI)__instance).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false) && !Physics.Linecast(((Component)__instance).transform.position + Vector3.up * 0.5f, ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 30f)
					{
						((EnemyAI)__instance).SwitchToBehaviourState(1);
						return false;
					}
				}
				if (!__instance.searchForPlayers.inProgress)
				{
					((EnemyAI)__instance).movingTowardsTargetPlayer = false;
					((EnemyAI)__instance).StartSearch(((Component)__instance).transform.position, __instance.searchForPlayers);
					return false;
				}
				break;
			}
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(EnemyAI), "GetClosestPlayer")]
	public static class GetClosestPlayerPatch
	{
		public static bool Prefix(EnemyAI __instance, ref PlayerControllerB __result, bool requireLineOfSight = false, bool cannotBeInShip = false, bool cannotBeNearShip = false)
		{
			//IL_00dc: 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_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB val = null;
			__instance.mostOptimalDistance = 2000f;
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], cannotBeInShip, false))
				{
					continue;
				}
				if (cannotBeNearShip)
				{
					if (StartOfRound.Instance.allPlayerScripts[i].isInElevator)
					{
						continue;
					}
					bool flag = false;
					for (int j = 0; j < RoundManager.Instance.spawnDenialPoints.Length; j++)
					{
						if (Vector3.Distance(RoundManager.Instance.spawnDenialPoints[j].transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 10f)
						{
							flag = true;
							break;
						}
					}
					if (flag)
					{
						continue;
					}
				}
				if (!requireLineOfSight || !Physics.Linecast(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position, 256))
				{
					__instance.tempDist = Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position);
					if (__instance.tempDist < __instance.mostOptimalDistance)
					{
						__instance.mostOptimalDistance = __instance.tempDist;
						val = StartOfRound.Instance.allPlayerScripts[i];
					}
				}
			}
			__result = val;
			return false;
		}
	}
	[HarmonyPatch(typeof(EnemyAI), "GetAllPlayersInLineOfSight")]
	public static class GetAllPlayersInLineOfSightPatch
	{
		public static bool Prefix(EnemyAI __instance, ref PlayerControllerB[] __result, float width = 45f, int range = 60, Transform eyeObject = null, float proximityCheck = -1f, int layerMask = -1)
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Invalid comparison between Unknown and I4
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			if (layerMask == -1)
			{
				layerMask = StartOfRound.Instance.collidersAndRoomMaskAndDefault;
			}
			if ((Object)(object)eyeObject == (Object)null)
			{
				eyeObject = __instance.eye;
			}
			if (__instance.enemyType.isOutsideEnemy && !__instance.enemyType.canSeeThroughFog && (int)TimeOfDay.Instance.currentLevelWeather == 3)
			{
				range = Mathf.Clamp(range, 0, 30);
			}
			List<PlayerControllerB> list = new List<PlayerControllerB>(MainClass.newPlayerCount);
			for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++)
			{
				if (!__instance.PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false))
				{
					continue;
				}
				Vector3 position = ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position;
				if (Vector3.Distance(__instance.eye.position, position) < (float)range && !Physics.Linecast(eyeObject.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
				{
					Vector3 val = position - eyeObject.position;
					if (Vector3.Angle(eyeObject.forward, val) < width || Vector3.Distance(((Component)__instance).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < proximityCheck)
					{
						list.Add(StartOfRound.Instance.allPlayerScripts[i]);
					}
				}
			}
			if (list.Count == MainClass.newPlayerCount)
			{
				__result = StartOfRound.Instance.allPlayerScripts;
				return false;
			}
			if (list.Count > 0)
			{
				__result = list.ToArray();
				return false;
			}
			__result = null;
			return false;
		}
	}
	[HarmonyPatch(typeof(DressGirlAI), "ChoosePlayerToHaunt")]
	public static class DressGirlHauntPatch
	{
		public static bool Prefix(DressGirlAI __instance)
		{
			ReflectionUtils.SetFieldValue(__instance, "timesChoosingAPlayer", ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") + 1);
			if (ReflectionUtils.GetFieldValue<int>(__instance, "timesChoosingAPlayer") > 1)
			{
				__instance.timer = __instance.hauntInterval - 1f;
			}
			__instance.SFXVolumeLerpTo = 0f;
			((EnemyAI)__instance).creatureVoice.Stop();
			__instance.heartbeatMusic.volume = 0f;
			if (!ReflectionUtils.GetFieldValue<bool>(__instance, "initializedRandomSeed"))
			{
				ReflectionUtils.SetFieldValue(__instance, "ghostGirlRandom", new Random(StartOfRound.Instance.randomMapSeed + 158));
			}
			float num = 0f;
			float num2 = 0f;
			int num3 = 0;
			int num4 = 0;
			for (int i = 0; i < MainClass.newPlayerCount; i++)
			{
				if (StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount > num3)
				{
					num3 = StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount;
					num4 = i;
				}
				if (StartOfRound.Instance.allPlayerScripts[i].insanityLevel > num)
				{
					num = StartOfRound.Instance.allPlayerScripts[i].insanityLevel;
					num2 = i;
				}
			}
			int[] array = new int[MainClass.newPlayerCount];
			for (int j = 0; j < MainClass.newPlayerCount; j++)
			{
				if (!StartOfRound.Instance.allPlayerScripts[j].isPlayerControlled)
				{
					array[j] = 0;
					continue;
				}
				array[j] += 80;
				if (num2 == (float)j && num > 1f)
				{
					array[j] += 50;
				}
				if (num4 == j)
				{
					array[j] += 30;
				}
				if (!StartOfRound.Instance.allPlayerScripts[j].hasBeenCriticallyInjured)
				{
					array[j] += 10;
				}
				if ((Object)(object)StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer != (Object)null && StartOfRound.Instance.allPlayerScripts[j].currentlyHeldObjectServer.scrapValue > 150)
				{
					array[j] += 30;
				}
			}
			__instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[RoundManager.Instance.GetRandomWeightedIndex(array, ReflectionUtils.GetFieldValue<Random>(__instance, "ghostGirlRandom"))];
			if (__instance.hauntingPlayer.isPlayerDead)
			{
				for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++)
				{
					if (!StartOfRound.Instance.allPlayerScripts[k].isPlayerDead)
					{
						__instance.hauntingPlayer = StartOfRound.Instance.allPlayerScripts[k];
						break;
					}
				}
			}
			Debug.Log((object)$"Little girl: Haunting player with playerClientId: {__instance.hauntingPlayer.playerClientId}; actualClientId: {__instance.hauntingPlayer.actualClientId}");
			((EnemyAI)__instance).ChangeOwnershipOfEnemy(__instance.hauntingPlayer.actualClientId);
			__instance.hauntingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)__instance.hauntingPlayer;
			if (ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine") != null)
			{
				((MonoBehaviour)__instance).StopCoroutine(ReflectionUtils.GetFieldValue<Coroutine>(__instance, "switchHauntedPlayerCoroutine"));
			}
			ReflectionUtils.SetFieldValue(__instance, "switchHauntedPlayerCoroutine", ((MonoBehaviour)__instance).StartCoroutine(ReflectionUtils.InvokeMethod<IEnumerator>(__instance, "setSwitchingHauntingPlayer", null)));
			return false;
		}
	}
	[HarmonyPatch(typeof(HUDManager), "AddChatMessage")]
	public static class HudChatPatch
	{
		public static void Prefix(HUDManager __instance, ref string chatMessage, string nameOfUserWhoTyped = "")
		{
			if (!(__instance.lastChatMessage == chatMessage))
			{
				StringBuilder stringBuilder = new StringBuilder(chatMessage);
				for (int i = 0; i < MainClass.newPlayerCount; i++)
				{
					string oldValue = $"[playerNum{i}]";
					string playerUsername = StartOfRound.Instance.allPlayerScripts[i].playerUsername;
					stringBuilder.Replace(oldValue, playerUsername);
				}
				chatMessage = stringBuilder.ToString();
			}
		}
	}
	[HarmonyPatch(typeof(MenuManager), "Awake")]
	public static class MenuManagerLogoOverridePatch
	{
		public static void Postfix(MenuManager __instance)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject;
				GameObject gameObject2 = ((Component)gameObject.transform.Find("MenuContainer").Find("MainButtons").Find("HeaderImage")).gameObject;
				Image component = gameObject2.GetComponent<Image>();
				MainClass.ReadSettingsFromFile();
				component.sprite = Sprite.Create(MainClass.mainLogo, new Rect(0f, 0f, (float)((Texture)MainClass.mainLogo).width, (float)((Texture)MainClass.mainLogo).height), new Vector2(0.5f, 0.5f));
				CosmeticRegistry.SpawnCosmeticGUI();
				Transform val = gameObject.transform.Find("MenuContainer").Find("LobbyHostSettings").Find("Panel")
					.Find("LobbyHostOptions")
					.Find("OptionsNormal");
				GameObject val2 = Object.Instantiate<GameObject>(MainClass.crewCountUI, val);
				RectTransform component2 = val2.GetComponent<RectTransform>();
				((Transform)component2).localPosition = new Vector3(96.9f, -70f, -6.7f);
				TMP_InputField inputField = ((Component)val2.transform.Find("InputField (TMP)")).GetComponent<TMP_InputField>();
				inputField.characterLimit = 3;
				inputField.text = MainClass.newPlayerCount.ToString();
				((UnityEvent<string>)(object)inputField.onValueChanged).AddListener((UnityAction<string>)delegate(string s)
				{
					if (int.TryParse(s, out var result))
					{
						MainClass.newPlayerCount = result;
						MainClass.newPlayerCount = Mathf.Clamp(MainClass.newPlayerCount, 1, MainClass.maxPlayerCount);
						inputField.text = MainClass.newPlayerCount.ToString();
						MainClass.SaveSettingsToFile();
					}
					else if (s.Length != 0)
					{
						inputField.text = MainClass.newPlayerCount.ToString();
						inputField.caretPosition = 1;
					}
				});
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "AddUserToPlayerList")]
	public static class AddUserPlayerListPatch
	{
		public static bool Prefix(QuickMenuManager __instance, ulong steamId, string playerName, int playerObjectId)
		{
			QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance);
			MainClass.EnablePlayerObjectsBasedOnConnected();
			return false;
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "RemoveUserFromPlayerList")]
	public static class RemoveUserPlayerListPatch
	{
		public static bool Prefix(QuickMenuManager __instance)
		{
			QuickmenuVisualInjectPatch.PopulateQuickMenu(__instance);
			return false;
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "Update")]
	public static class QuickMenuUpdatePatch
	{
		public static bool Prefix(QuickMenuManager __instance)
		{
			return false;
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "NonHostPlayerSlotsEnabled")]
	public static class QuickMenuDisplayPatch
	{
		public static bool Prefix(QuickMenuManager __instance, ref bool __result)
		{
			__result = true;
			return false;
		}
	}
	[HarmonyPatch(typeof(QuickMenuManager), "Start")]
	public static class QuickmenuVisualInjectPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__2_2;

			internal void <PopulateQuickMenu>b__2_2()
			{
				if (!GameNetworkManager.Instance.disableSteam)
				{
				}
			}
		}

		public static GameObject quickMenuScrollInstance;

		public static void Postfix(QuickMenuManager __instance)
		{
			//IL_0050: 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)
			GameObject gameObject = ((Component)__instance.playerListPanel.transform.Find("Image")).gameObject;
			GameObject val = Object.Instantiate<GameObject>(MainClass.quickMenuScrollParent);
			val.transform.SetParent(gameObject.transform);
			RectTransform component = val.GetComponent<RectTransform>();
			((Transform)component).localPosition = new Vector3(0f, -31.2f, 0f);
			((Transform)component).localScale = Vector3.one;
			quickMenuScrollInstance = val;
		}

		public static void PopulateQuickMenu(QuickMenuManager __instance)
		{
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Expected O, but got Unknown
			int childCount = quickMenuScrollInstance.transform.Find("Holder").childCount;
			List<GameObject> list = new List<GameObject>();
			for (int i = 0; i < childCount; i++)
			{
				list.Add(((Component)quickMenuScrollInstance.transform.Find("Holder").GetChild(i)).gameObject);
			}
			foreach (GameObject item in list)
			{
				Object.Destroy((Object)(object)item);
			}
			if (!Object.op_Implicit((Object)(object)StartOfRound.Instance))
			{
				return;
			}
			for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++)
			{
				PlayerControllerB playerScript = StartOfRound.Instance.allPlayerScripts[j];
				if (!playerScript.isPlayerControlled && !playerScript.isPlayerDead)
				{
					continue;
				}
				GameObject val = Object.Instantiate<GameObject>(MainClass.playerEntry, quickMenuScrollInstance.transform.Find("Holder"));
				RectTransform component = val.GetComponent<RectTransform>();
				((Transform)component).localScale = Vector3.one;
				((Transform)component).localPosition = new Vector3(0f, 0f - ((Transform)component).localPosition.y, 0f);
				TextMeshProUGUI component2 = ((Component)val.transform.Find("PlayerNameButton").Find("PName")).GetComponent<TextMeshProUGUI>();
				((TMP_Text)component2).text = playerScript.playerUsername;
				Slider playerVolume = ((Component)val.transform.Find("PlayerVolumeSlider")).GetComponent<Slider>();
				int finalIndex = j;
				((UnityEvent<float>)(object)playerVolume.onValueChanged).AddListener((UnityAction<float>)delegate(float f)
				{
					if (playerScript.isPlayerControlled || playerScript.isPlayerDead)
					{
						float num = f / playerVolume.maxValue + 1f;
						if (num <= -1f)
						{
							SoundManager.Instance.playerVoiceVolumes[finalIndex] = -70f;
						}
						else
						{
							SoundManager.Instance.playerVoiceVolumes[finalIndex] = num;
						}
					}
				});
				if (StartOfRound.Instance.localPlayerController.playerClientId == playerScript.playerClientId)
				{
					((Component)playerVolume).gameObject.SetActive(false);
					((Component)val.transform.Find("Text (1)")).gameObject.SetActive(false);
				}
				Button component3 = ((Component)val.transform.Find("KickButton")).GetComponent<Button>();
				((UnityEvent)component3.onClick).AddListener((UnityAction)delegate
				{
					__instance.KickUserFromServer(finalIndex);
				});
				if (!GameNetworkManager.Instance.isHostingGame)
				{
					((Component)component3).gameObject.SetActive(false);
				}
				Button component4 = ((Component)val.transform.Find("ProfileIcon")).GetComponent<Button>();
				ButtonClickedEvent onClick = component4.onClick;
				object obj = <>c.<>9__2_2;
				if (obj == null)
				{
					UnityAction val2 = delegate
					{
						if (!GameNetworkManager.Instance.disableSteam)
						{
						}
					};
					<>c.<>9__2_2 = val2;
					obj = (object)val2;
				}
				((UnityEvent)onClick).AddListener((UnityAction)obj);
			}
		}
	}
	[HarmonyPatch(typeof(HUDManager), "UpdateBoxesSpectateUI")]
	public static class SpectatorBoxUpdatePatch
	{
		public static void Postfix(HUDManager __instance)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<Animator, PlayerControllerB> fieldValue = ReflectionUtils.GetFieldValue<Dictionary<Animator, PlayerControllerB>>(__instance, "spectatingPlayerBoxes");
			int num = -64;
			int num2 = 0;
			int num3 = 0;
			int num4 = -70;
			int num5 = 230;
			int num6 = 4;
			foreach (KeyValuePair<Animator, PlayerControllerB> item in fieldValue)
			{
				if (((Component)item.Key).gameObject.activeInHierarchy)
				{
					GameObject gameObject = ((Component)item.Key).gameObject;
					RectTransform component = gameObject.GetComponent<RectTransform>();
					int num7 = (int)Math.Floor((double)num3 / (double)num6);
					int num8 = num3 % num6;
					int num9 = num8 * num4;
					int num10 = num7 * num5;
					component.anchoredPosition = Vector2.op_Implicit(new Vector3((float)(num + num10), (float)(num2 + num9), 0f));
					num3++;
				}
			}
		}
	}
	[HarmonyPatch(typeof(HUDManager), "FillEndGameStats")]
	public static class HudFillEndGameFix
	{
		public static bool Prefix(HUDManager __instance, EndOfGameStats stats)
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Invalid comparison between Unknown and I4
			int num = 0;
			int num2 = 0;
			for (int i = 0; i < __instance.statsUIElements.playerNamesText.Length; i++)
			{
				PlayerControllerB val = __instance.playersManager.allPlayerScripts[i];
				((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = "";
				((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = false;
				((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = "Notes: \n";
				if (val.disconnectedMidGame || val.isPlayerDead || val.isPlayerControlled)
				{
					if (val.isPlayerDead)
					{
						num++;
					}
					else if (val.isPlayerControlled)
					{
						num2++;
					}
					((TMP_Text)__instance.statsUIElements.playerNamesText[i]).text = __instance.playersManager.allPlayerScripts[i].playerUsername;
					((Behaviour)__instance.statsUIElements.playerStates[i]).enabled = true;
					if (__instance.playersManager.allPlayerScripts[i].isPlayerDead)
					{
						if ((int)__instance.playersManager.allPlayerScripts[i].causeOfDeath == 10)
						{
							__instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.missingIcon;
						}
						else
						{
							__instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.deceasedIcon;
						}
					}
					else
					{
						__instance.statsUIElements.playerStates[i].sprite = __instance.statsUIElements.aliveIcon;
					}
					for (int j = 0; j < 3 && j < stats.allPlayerStats[i].playerNotes.Count; j++)
					{
						TextMeshProUGUI val2 = __instance.statsUIElements.playerNotesText[i];
						((TMP_Text)val2).text = ((TMP_Text)val2).text + "* " + stats.allPlayerStats[i].playerNotes[j] + "\n";
					}
				}
				else
				{
					((TMP_Text)__instance.statsUIElements.playerNotesText[i]).text = "";
				}
			}
			((TMP_Text)__instance.statsUIElements.quotaNumerator).text = RoundManager.Instance.scrapCollectedInLevel.ToString();
			((TMP_Text)__instance.statsUIElements.quotaDenominator).text = RoundManager.Instance.totalScrapValueInLevel.ToString();
			if (StartOfRound.Instance.allPlayersDead)
			{
				((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = true;
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "F";
				return false;
			}
			((Behaviour)__instance.statsUIElements.allPlayersDeadOverlay).enabled = false;
			int num3 = 0;
			float num4 = (float)RoundManager.Instance.scrapCollectedInLevel / RoundManager.Instance.totalScrapValueInLevel;
			if (num2 == StartOfRound.Instance.connectedPlayersAmount + 1)
			{
				num3++;
			}
			else if (num > 1)
			{
				num3--;
			}
			if (num4 >= 0.99f)
			{
				num3 += 2;
			}
			else if (num4 >= 0.6f)
			{
				num3++;
			}
			else if (num4 <= 0.25f)
			{
				num3--;
			}
			switch (num3)
			{
			case -1:
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "D";
				return false;
			case 0:
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "C";
				return false;
			case 1:
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "B";
				return false;
			case 2:
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "A";
				return false;
			case 3:
				((TMP_Text)__instance.statsUIElements.gradeLetter).text = "S";
				return false;
			default:
				return false;
			}
		}
	}
	[HarmonyPatch(typeof(HUDManager), "Start")]
	public static class HudStartPatch
	{
		public static void Postfix(HUDManager __instance)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			EndOfGameStatUIElements statsUIElements = __instance.statsUIElements;
			GameObject gameObject = ((Component)((Component)statsUIElements.playerNamesText[0]).gameObject.transform.parent).gameObject;
			GameObject gameObject2 = ((Component)gameObject.transform.parent.parent).gameObject;
			GameObject gameObject3 = ((Component)gameObject2.transform.Find("BGBoxes")).gameObject;
			gameObject2.transform.parent.Find("DeathScreen").SetSiblingIndex(3);
			gameObject3.transform.localScale = new Vector3(2.5f, 1f, 1f);
			MakePlayerHolder(4, gameObject, statsUIElements, new Vector3(426.9556f, -0.7932f, 0f));
			MakePlayerHolder(5, gameObject, statsUIElements, new Vector3(426.9556f, -115.4483f, 0f));
			MakePlayerHolder(6, gameObject, statsUIElements, new Vector3(-253.6783f, -115.4483f, 0f));
			MakePlayerHolder(7, gameObject, statsUIElements, new Vector3(-253.6783f, -0.7932f, 0f));
			for (int i = 8; i < MainClass.newPlayerCount; i++)
			{
				MakePlayerHolder(i, gameObject, statsUIElements, new Vector3(10000f, 10000f, 0f));
			}
		}

		public static void MakePlayerHolder(int index, GameObject original, EndOfGameStatUIElements uiElements, Vector3 localPosition)
		{
			//IL_0049: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			if (index + 1 <= MainClass.newPlayerCount)
			{
				GameObject val = Object.Instantiate<GameObject>(original);
				RectTransform component = val.GetComponent<RectTransform>();
				RectTransform component2 = original.GetComponent<RectTransform>();
				((Transform)component).SetParent(((Transform)component2).parent);
				((Transform)component).localScale = new Vector3(1f, 1f, 1f);
				((Transform)component).localPosition = localPosition;
				GameObject gameObject = ((Component)val.transform.Find("PlayerName1")).gameObject;
				GameObject gameObject2 = ((Component)val.transform.Find("Notes")).gameObject;
				((Transform)gameObject2.GetComponent<RectTransform>()).localPosition = new Vector3(-95.7222f, 43.3303f, 0f);
				GameObject gameObject3 = ((Component)val.transform.Find("Symbol")).gameObject;
				if (index >= uiElements.playerNamesText.Length)
				{
					Array.Resize(ref uiElements.playerNamesText, index + 1);
					Array.Resize(ref uiElements.playerStates, index + 1);
					Array.Resize(ref uiElements.playerNotesText, index + 1);
				}
				uiElements.playerNamesText[index] = gameObject.GetComponent<TextMeshProUGUI>();
				uiElements.playerNotesText[index] = gameObject2.GetComponent<TextMeshProUGUI>();
				uiElements.playerStates[index] = gameObject3.GetComponent<Image>();
			}
		}
	}
	public static class PluginInformation
	{
		public const string PLUGIN_NAME = "MoreCompany";

		public const string PLUGIN_VERSION = "1.7.2";

		public const string PLUGIN_GUID = "me.swipez.melonloader.morecompany";
	}
	[BepInPlugin("me.swipez.melonloader.morecompany", "MoreCompany", "1.7.2")]
	public class MainClass : BaseUnityPlugin
	{
		public static int newPlayerCount = 32;

		public static int maxPlayerCount = 50;

		public static bool showCosmetics = true;

		public static List<PlayerControllerB> notSupposedToExistPlayers = new List<PlayerControllerB>();

		public static Texture2D mainLogo;

		public static GameObject quickMenuScrollParent;

		public static GameObject playerEntry;

		public static GameObject crewCountUI;

		public static GameObject cosmeticGUIInstance;

		public static GameObject cosmeticButton;

		public static ManualLogSource StaticLogger;

		public static Dictionary<int, List<string>> playerIdsAndCosmetics = new Dictionary<int, List<string>>();

		public static string cosmeticSavePath = Application.persistentDataPath + "/morecompanycosmetics.txt";

		public static string moreCompanySave = Application.persistentDataPath + "/morecompanysave.txt";

		public static string dynamicCosmeticsPath = Paths.PluginPath + "/MoreCompanyCosmetics";

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			StaticLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("me.swipez.melonloader.morecompany");
			try
			{
				val.PatchAll();
			}
			catch (Exception ex)
			{
				StaticLogger.LogError((object)("Failed to patch: " + ex));
			}
			ManualHarmonyPatches.ManualPatch(val);
			StaticLogger.LogInfo((object)"Loading MoreCompany...");
			StaticLogger.LogInfo((object)("Checking: " + dynamicCosmeticsPath));
			if (!Directory.Exists(dynamicCosmeticsPath))
			{
				StaticLogger.LogInfo((object)"Creating cosmetics directory");
				Directory.CreateDirectory(dynamicCosmeticsPath);
			}
			ReadSettingsFromFile();
			ReadCosmeticsFromFile();
			StaticLogger.LogInfo((object)"Read settings and cosmetics");
			AssetBundle bundle = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.assets", Assembly.GetExecutingAssembly());
			AssetBundle val2 = BundleUtilities.LoadBundleFromInternalAssembly("morecompany.cosmetics", Assembly.GetExecutingAssembly());
			CosmeticRegistry.LoadCosmeticsFromBundle(val2);
			val2.Unload(false);
			SteamFriends.OnGameLobbyJoinRequested += delegate(Lobby lobby, SteamId steamId)
			{
				newPlayerCount = ((Lobby)(ref lobby)).MaxMembers;
			};
			SteamMatchmaking.OnLobbyEntered += delegate(Lobby lobby)
			{
				newPlayerCount = ((Lobby)(ref lobby)).MaxMembers;
			};
			StaticLogger.LogInfo((object)"Loading USER COSMETICS...");
			RecursiveCosmeticLoad(Paths.PluginPath);
			LoadAssets(bundle);
			StaticLogger.LogInfo((object)"Loaded MoreCompany FULLY");
		}

		private void RecursiveCosmeticLoad(string directory)
		{
			string[] directories = Directory.GetDirectories(directory);
			foreach (string directory2 in directories)
			{
				RecursiveCosmeticLoad(directory2);
			}
			string[] files = Directory.GetFiles(directory);
			foreach (string text in files)
			{
				if (text.EndsWith(".cosmetics"))
				{
					AssetBundle val = AssetBundle.LoadFromFile(text);
					CosmeticRegistry.LoadCosmeticsFromBundle(val);
					val.Unload(false);
				}
			}
		}

		private void ReadCosmeticsFromFile()
		{
			if (File.Exists(cosmeticSavePath))
			{
				string[] array = File.ReadAllLines(cosmeticSavePath);
				string[] array2 = array;
				foreach (string item in array2)
				{
					CosmeticRegistry.locallySelectedCosmetics.Add(item);
				}
			}
		}

		public static void WriteCosmeticsToFile()
		{
			string text = "";
			foreach (string locallySelectedCosmetic in CosmeticRegistry.locallySelectedCosmetics)
			{
				text = text + locallySelectedCosmetic + "\n";
			}
			File.WriteAllText(cosmeticSavePath, text);
		}

		public static void SaveSettingsToFile()
		{
			string text = "";
			text = text + newPlayerCount + "\n";
			text = text + showCosmetics + "\n";
			File.WriteAllText(moreCompanySave, text);
		}

		public static void ReadSettingsFromFile()
		{
			if (File.Exists(moreCompanySave))
			{
				string[] array = File.ReadAllLines(moreCompanySave);
				try
				{
					newPlayerCount = int.Parse(array[0]);
					showCosmetics = bool.Parse(array[1]);
				}
				catch (Exception)
				{
					StaticLogger.LogError((object)"Failed to read settings from file, resetting to default");
					newPlayerCount = 32;
					showCosmetics = true;
				}
			}
		}

		private static void LoadAssets(AssetBundle bundle)
		{
			if (Object.op_Implicit((Object)(object)bundle))
			{
				mainLogo = bundle.LoadPersistentAsset<Texture2D>("assets/morecompanyassets/morecompanytransparentred.png");
				quickMenuScrollParent = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/quickmenuoverride.prefab");
				playerEntry = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/playerlistslot.prefab");
				cosmeticGUIInstance = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/testoverlay.prefab");
				cosmeticButton = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/cosmeticinstance.prefab");
				crewCountUI = bundle.LoadPersistentAsset<GameObject>("assets/morecompanyassets/crewcountfield.prefab");
				bundle.Unload(false);
			}
		}

		public static void ResizePlayerCache(Dictionary<uint, Dictionary<int, NetworkObject>> ScenePlacedObjects)
		{
			//IL_0091: 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_01be: 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_0261: Expected O, but got Unknown
			StartOfRound instance = StartOfRound.Instance;
			if (instance.allPlayerObjects.Length == newPlayerCount)
			{
				return;
			}
			playerIdsAndCosmetics.Clear();
			uint num = 10000u;
			int num2 = newPlayerCount - instance.allPlayerObjects.Length;
			int num3 = instance.allPlayerObjects.Length;
			GameObject val = instance.allPlayerObjects[3];
			for (int i = 0; i < num2; i++)
			{
				uint num4 = num + (uint)i;
				GameObject val2 = Object.Instantiate<GameObject>(val);
				NetworkObject component = val2.GetComponent<NetworkObject>();
				ReflectionUtils.SetFieldValue(component, "GlobalObjectIdHash", num4);
				Scene scene = ((Component)component).gameObject.scene;
				int handle = ((Scene)(ref scene)).handle;
				uint num5 = num4;
				if (!ScenePlacedObjects.ContainsKey(num5))
				{
					ScenePlacedObjects.Add(num5, new Dictionary<int, NetworkObject>());
				}
				if (ScenePlacedObjects[num5].ContainsKey(handle))
				{
					string arg = (((Object)(object)ScenePlacedObjects[num5][handle] != (Object)null) ? ((Object)ScenePlacedObjects[num5][handle]).name : "Null Entry");
					throw new Exception(((Object)component).name + " tried to registered with ScenePlacedObjects which already contains " + string.Format("the same {0} value {1} for {2}!", "GlobalObjectIdHash", num5, arg));
				}
				ScenePlacedObjects[num5].Add(handle, component);
				((Object)val2).name = $"Player ({4 + i})";
				val2.transform.parent = null;
				PlayerControllerB componentInChildren = val2.GetComponentInChildren<PlayerControllerB>();
				notSupposedToExistPlayers.Add(componentInChildren);
				componentInChildren.playerClientId = (ulong)(4 + i);
				componentInChildren.isPlayerControlled = false;
				componentInChildren.isPlayerDead = false;
				componentInChildren.DropAllHeldItems(false, false);
				componentInChildren.TeleportPlayer(instance.notSpawnedPosition.position, false, 0f, false, true);
				UnlockableSuit.SwitchSuitForPlayer(componentInChildren, 0, false);
				Array.Resize(ref instance.allPlayerObjects, instance.allPlayerObjects.Length + 1);
				Array.Resize(ref instance.allPlayerScripts, instance.allPlayerScripts.Length + 1);
				Array.Resize(ref instance.gameStats.allPlayerStats, instance.gameStats.allPlayerStats.Length + 1);
				Array.Resize(ref instance.playerSpawnPositions, instance.playerSpawnPositions.Length + 1);
				instance.allPlayerObjects[num3 + i] = val2;
				instance.gameStats.allPlayerStats[num3 + i] = new PlayerStats();
				instance.allPlayerScripts[num3 + i] = componentInChildren;
				instance.playerSpawnPositions[num3 + i] = instance.playerSpawnPositions[3];
			}
		}

		public static void EnablePlayerObjectsBasedOnConnected()
		{
			int connectedPlayersAmount = StartOfRound.Instance.connectedPlayersAmount;
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				for (int j = 0; j < connectedPlayersAmount + 1; j++)
				{
					if (!val.isPlayerControlled)
					{
						((Component)val).gameObject.SetActive(false);
					}
					else
					{
						((Component)val).gameObject.SetActive(true);
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesServerRpc")]
	public static class SendNewPlayerValuesServerRpcPatch
	{
		public static ulong lastId;

		public static void Prefix(PlayerControllerB __instance, ulong newPlayerSteamId)
		{
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer)
			{
				lastId = newPlayerSteamId;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesClientRpc")]
	public static class SendNewPlayerValuesClientRpcPatch
	{
		public static void Prefix(PlayerControllerB __instance, ref ulong[] playerSteamIds)
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if ((Object)(object)networkManager == (Object)null || !networkManager.IsListening)
			{
				return;
			}
			if (StartOfRound.Instance.mapScreen.radarTargets.Count != MainClass.newPlayerCount)
			{
				List<PlayerControllerB> useless = new List<PlayerControllerB>();
				foreach (PlayerControllerB notSupposedToExistPlayer in MainClass.notSupposedToExistPlayers)
				{
					if (Object.op_Implicit((Object)(object)notSupposedToExistPlayer))
					{
						StartOfRound.Instance.mapScreen.radarTargets.Add(new TransformAndName(((Component)notSupposedToExistPlayer).transform, notSupposedToExistPlayer.playerUsername, false));
					}
					else
					{
						useless.Add(notSupposedToExistPlayer);
					}
				}
				MainClass.notSupposedToExistPlayers.RemoveAll((PlayerControllerB x) => useless.Contains(x));
			}
			if (!networkManager.IsServer)
			{
				return;
			}
			List<ulong> list = new List<ulong>();
			for (int i = 0; i < MainClass.newPlayerCount; i++)
			{
				if (i == (int)__instance.playerClientId)
				{
					list.Add(SendNewPlayerValuesServerRpcPatch.lastId);
				}
				else
				{
					list.Add(__instance.playersManager.allPlayerScripts[i].playerSteamId);
				}
			}
			playerSteamIds = list.ToArray();
		}
	}
	public static class HUDManagerBullshitPatch
	{
		public static bool ManualPrefix(HUDManager __instance)
		{
			return false;
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesClientRpc")]
	public static class SyncShipUnlockablePatch
	{
		public static void Prefix(StartOfRound __instance, ref int[] playerSuitIDs, bool shipLightsOn, Vector3[] placeableObjectPositions, Vector3[] placeableObjectRotations, int[] placeableObjects, int[] storedItems, int[] scrapValues, int[] itemSaveData)
		{
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if (!((Object)(object)networkManager == (Object)null) && networkManager.IsListening && networkManager.IsServer)
			{
				int[] array = new int[MainClass.newPlayerCount];
				for (int i = 0; i < MainClass.newPlayerCount; i++)
				{
					array[i] = __instance.allPlayerScripts[i].currentSuitID;
				}
				playerSuitIDs = array;
			}
		}
	}
	[HarmonyPatch(typeof(NetworkSceneManager), "PopulateScenePlacedObjects")]
	public static class ScenePlacedObjectsInitPatch
	{
		public static void Postfix(ref Dictionary<uint, Dictionary<int, NetworkObject>> ___ScenePlacedObjects)
		{
			MainClass.ResizePlayerCache(___ScenePlacedObjects);
		}
	}
	[HarmonyPatch(typeof(GameNetworkManager), "LobbyDataIsJoinable")]
	public static class LobbyDataJoinablePatch
	{
		public static bool Prefix(ref bool __result)
		{
			__result = true;
			return false;
		}
	}
	[HarmonyPatch(typeof(NetworkConnectionManager), "HandleConnectionApproval")]
	public static class ConnectionApprovalTest
	{
		public static void Prefix(ulong ownerClientId, ConnectionApprovalResponse response)
		{
			if (Object.op_Implicit((Object)(object)StartOfRound.Instance))
			{
				if (StartOfRound.Instance.connectedPlayersAmount >= MainClass.newPlayerCount)
				{
					response.Approved = false;
					response.Reason = "Server is full";
				}
				else
				{
					response.Approved = true;
				}
			}
		}
	}
	[HarmonyPatch(typeof(SteamMatchmaking), "CreateLobbyAsync")]
	public static class LobbyThingPatch
	{
		public static void Prefix(ref int maxMembers)
		{
			MainClass.ReadSettingsFromFile();
			maxMembers = MainClass.newPlayerCount;
		}
	}
	public class ManualHarmonyPatches
	{
		public static void ManualPatch(Harmony HarmonyInstance)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			HarmonyInstance.Patch((MethodBase)AccessTools.Method(typeof(HUDManager), "SyncAllPlayerLevelsServerRpc", new Type[0], (Type[])null), new HarmonyMethod(typeof(HUDManagerBullshitPatch).GetMethod("ManualPrefix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}
	public class MimicPatches
	{
		[HarmonyPatch(typeof(MaskedPlayerEnemy), "SetEnemyOutside")]
		public class MaskedPlayerEnemyOnEnablePatch
		{
			public static void Postfix(MaskedPlayerEnemy __instance)
			{
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)__instance.mimickingPlayer != (Object)null))
				{
					return;
				}
				List<string> list = MainClass.playerIdsAndCosmetics[(int)__instance.mimickingPlayer.playerClientId];
				Transform val = ((Component)__instance).transform.Find("ScavengerModel").Find("metarig");
				CosmeticApplication component = ((Component)val).GetComponent<CosmeticApplication>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.ClearCosmetics();
					Object.Destroy((Object)(object)component);
				}
				component = ((Component)val).gameObject.AddComponent<CosmeticApplication>();
				foreach (string item in list)
				{
					component.ApplyCosmetic(item, startEnabled: true);
				}
				foreach (CosmeticInstance spawnedCosmetic in component.spawnedCosmetics)
				{
					Transform transform = ((Component)spawnedCosmetic).transform;
					transform.localScale *= 0.38f;
				}
			}
		}
	}
	public class ReflectionUtils
	{
		public static void InvokeMethod(object obj, string methodName, object[] parameters)
		{
			Type type = obj.GetType();
			MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			method.Invoke(obj, parameters);
		}

		public static void InvokeMethod(object obj, Type forceType, string methodName, object[] parameters)
		{
			MethodInfo method = forceType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			method.Invoke(obj, parameters);
		}

		public static void SetPropertyValue(object obj, string propertyName, object value)
		{
			Type type = obj.GetType();
			PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			property.SetValue(obj, value);
		}

		public static T InvokeMethod<T>(object obj, string methodName, object[] parameters)
		{
			Type type = obj.GetType();
			MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			return (T)method.Invoke(obj, parameters);
		}

		public static T GetFieldValue<T>(object obj, string fieldName)
		{
			Type type = obj.GetType();
			FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			return (T)field.GetValue(obj);
		}

		public static void SetFieldValue(object obj, string fieldName, object value)
		{
			Type type = obj.GetType();
			FieldInfo field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			field.SetValue(obj, value);
		}
	}
	[HarmonyPatch(typeof(ShipTeleporter), "Awake")]
	public static class ShipTeleporterAwakePatch
	{
		public static void Postfix(ShipTeleporter __instance)
		{
			int[] array = new int[MainClass.newPlayerCount];
			for (int i = 0; i < MainClass.newPlayerCount; i++)
			{
				array[i] = -1;
			}
			ReflectionUtils.SetFieldValue(__instance, "playersBeingTeleported", array);
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")]
	public static class SpectatePatches
	{
		public static bool Prefix(PlayerControllerB __instance)
		{
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			if ((Object)(object)__instance.spectatedPlayerScript != (Object)null)
			{
				num = (int)__instance.spectatedPlayerScript.playerClientId;
			}
			for (int i = 0; i < MainClass.newPlayerCount; i++)
			{
				num = (num + 1) % MainClass.newPlayerCount;
				if (!__instance.playersManager.allPlayerScripts[num].isPlayerDead && __instance.playersManager.allPlayerScripts[num].isPlayerControlled && (Object)(object)__instance.playersManager.allPlayerScripts[num] != (Object)(object)__instance)
				{
					__instance.spectatedPlayerScript = __instance.playersManager.allPlayerScripts[num];
					__instance.SetSpectatedPlayerEffects(false);
					return false;
				}
			}
			if ((Object)(object)__instance.deadBody != (Object)null && ((Component)__instance.deadBody).gameObject.activeSelf)
			{
				__instance.spectateCameraPivot.position = __instance.deadBody.bodyParts[0].position;
				ReflectionUtils.InvokeMethod(__instance, "RaycastSpectateCameraAroundPivot", null);
			}
			StartOfRound.Instance.SetPlayerSafeInShip();
			return false;
		}
	}
	[HarmonyPatch(typeof(SoundManager), "Start")]
	public static class SoundManagerStartPatch
	{
		public static void Postfix()
		{
			int num = MainClass.newPlayerCount - 4;
			int num2 = 4;
			for (int i = 0; i < num; i++)
			{
				Array.Resize(ref SoundManager.Instance.playerVoicePitches, SoundManager.Instance.playerVoicePitches.Length + 1);
				Array.Resize(ref SoundManager.Instance.playerVoicePitchTargets, SoundManager.Instance.playerVoicePitchTargets.Length + 1);
				Array.Resize(ref SoundManager.Instance.playerVoiceVolumes, SoundManager.Instance.playerVoiceVolumes.Length + 1);
				Array.Resize(ref SoundManager.Instance.playerVoicePitchLerpSpeed, SoundManager.Instance.playerVoicePitchLerpSpeed.Length + 1);
				Array.Resize(ref SoundManager.Instance.playerVoiceMixers, SoundManager.Instance.playerVoiceMixers.Length + 1);
				AudioMixerGroup val = ((IEnumerable<AudioMixerGroup>)Resources.FindObjectsOfTypeAll<AudioMixerGroup>()).FirstOrDefault((Func<AudioMixerGroup, bool>)((AudioMixerGroup x) => ((Object)x).name.Contains("Voice")));
				SoundManager.Instance.playerVoicePitches[num2 + i] = 1f;
				SoundManager.Instance.playerVoicePitchTargets[num2 + i] = 1f;
				SoundManager.Instance.playerVoiceVolumes[num2 + i] = 0.5f;
				SoundManager.Instance.playerVoicePitchLerpSpeed[num2 + i] = 3f;
				SoundManager.Instance.playerVoiceMixers[num2 + i] = val;
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "GetPlayerSpawnPosition")]
	public static class SpawnPositionClampPatch
	{
		public static void Prefix(ref int playerNum, bool simpleTeleport = false)
		{
			if (playerNum > 3)
			{
				playerNum = 3;
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound), "OnClientConnect")]
	public static class OnClientConnectedPatch
	{
		public static bool Prefix(StartOfRound __instance, ulong clientId)
		{
			if (!((NetworkBehaviour)__instance).IsServer)
			{
				return false;
			}
			Debug.Log((object)"player connected");
			Debug.Log((object)$"connected players #: {__instance.connectedPlayersAmount}");
			try
			{
				List<int> list = __instance.ClientPlayerList.Values.ToList();
				Debug.Log((object)$"Connecting new player on host; clientId: {clientId}");
				int num = 0;
				for (int i = 1; i < MainClass.newPlayerCount; i++)
				{
					if (!list.Contains(i))
					{
						num = i;
						break;
					}
				}
				__instance.allPlayerScripts[num].actualClientId = clientId;
				__instance.allPlayerObjects[num].GetComponent<NetworkObject>().ChangeOwnership(clientId);
				Debug.Log((object)$"New player assigned object id: {__instance.allPlayerObjects[num]}");
				List<ulong> list2 = new List<ulong>();
				for (int j = 0; j < __instance.allPlayerObjects.Length; j++)
				{
					NetworkObject component = __instance.allPlayerObjects[j].GetComponent<NetworkObject>();
					if (!component.IsOwnedByServer)
					{
						list2.Add(component.OwnerClientId);
					}
					else if (j == 0)
					{
						list2.Add(NetworkManager.Singleton.LocalClientId);
					}
					else
					{
						list2.Add(999uL);
					}
				}
				int groupCredits = Object.FindObjectOfType<Terminal>().groupCredits;
				int profitQuota = TimeOfDay.Instance.profitQuota;
				int quotaFulfilled = TimeOfDay.Instance.quotaFulfilled;
				int num2 = (int)TimeOfDay.Instance.timeUntilDeadline;
				ReflectionUtils.InvokeMethod(__instance, "OnPlayerConnectedClientRpc", new object[10]
				{
					clientId,
					__instance.connectedPlayersAmount,
					list2.ToArray(),
					num,
					groupCredits,
					__instance.currentLevelID,
					profitQuota,
					num2,
					quotaFulfilled,
					__instance.randomMapSeed
				});
				__instance.ClientPlayerList.Add(clientId, num);
				Debug.Log((object)$"client id connecting: {clientId} ; their corresponding player object id: {num}");
			}
			catch (Exception arg)
			{
				Debug.LogError((object)$"Error occured in OnClientConnected! Shutting server down. clientId: {clientId}. Error: {arg}");
				GameNetworkManager.Instance.disconnectionReasonMessage = "Error occured when a player attempted to join the server! Restart the application and please report the glitch!";
				GameNetworkManager.Instance.Disconnect();
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(SteamLobbyManager), "LoadServerList")]
	public static class LoadServerListPatch
	{
		public static bool Prefix(SteamLobbyManager __instance)
		{
			OverrideMethod(__instance);
			return false;
		}

		private static async void OverrideMethod(SteamLobbyManager __instance)
		{
			if (GameNetworkManager.Instance.waitingForLobbyDataRefresh)
			{
				return;
			}
			ReflectionUtils.SetFieldValue(__instance, "refreshServerListTimer", 0f);
			((TMP_Text)__instance.serverListBlankText).text = "Loading server list...";
			ReflectionUtils.GetFieldValue<Lobby[]>(__instance, "currentLobbyList");
			LobbySlot[] array = Object.FindObjectsOfType<LobbySlot>();
			for (int i = 0; i < array.Length; i++)
			{
				Object.Destroy((Object)(object)((Component)array[i]).gameObject);
			}
			LobbyQuery val;
			switch (__instance.sortByDistanceSetting)
			{
			case 0:
				val = SteamMatchmaking.LobbyList;
				((LobbyQuery)(ref val)).FilterDistanceClose();
				break;
			case 1:
				val = SteamMatchmaking.LobbyList;
				((LobbyQuery)(ref val)).FilterDistanceFar();
				break;
			case 2:
				val = SteamMatchmaking.LobbyList;
				((LobbyQuery)(ref val)).FilterDistanceWorldwide();
				break;
			}
			Debug.Log((object)"Requested server list");
			GameNetworkManager.Instance.waitingForLobbyDataRefresh = true;
			Lobby[] currentLobbyList;
			switch (__instance.sortByDistanceSetting)
			{
			case 0:
				val = SteamMatchmaking.LobbyList;
				val = ((LobbyQuery)(ref val)).FilterDistanceClose();
				val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1);
				val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString());
				currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync();
				break;
			case 1:
				val = SteamMatchmaking.LobbyList;
				val = ((LobbyQuery)(ref val)).FilterDistanceFar();
				val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1);
				val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString());
				currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync();
				break;
			default:
				val = SteamMatchmaking.LobbyList;
				val = ((LobbyQuery)(ref val)).FilterDistanceWorldwide();
				val = ((LobbyQuery)(ref val)).WithSlotsAvailable(1);
				val = ((LobbyQuery)(ref val)).WithKeyValue("vers", GameNetworkManager.Instance.gameVersionNum.ToString());
				currentLobbyList = await ((LobbyQuery)(ref val)).RequestAsync();
				break;
			}
			GameNetworkManager.Instance.waitingForLobbyDataRefresh = false;
			if (currentLobbyList != null)
			{
				Debug.Log((object)"Got lobby list!");
				ReflectionUtils.InvokeMethod(__instance, "DebugLogServerList", null);
				if (currentLobbyList.Length == 0)
				{
					((TMP_Text)__instance.serverListBlankText).text = "No available servers to join.";
				}
				else
				{
					((TMP_Text)__instance.serverListBlankText).text = "";
				}
				ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", 0f);
				for (int j = 0; j < currentLobbyList.Length; j++)
				{
					Friend[] array2 = SteamFriends.GetBlocked().ToArray();
					if (array2 != null)
					{
						for (int k = 0; k < array2.Length; k++)
						{
							Debug.Log((object)$"blocked user: {((Friend)(ref array2[k])).Name}; id: {array2[k].Id}");
							if (((Lobby)(ref currentLobbyList[j])).IsOwnedBy(array2[k].Id))
							{
								Debug.Log((object)("Hiding lobby by blocked user: " + ((Friend)(ref array2[k])).Name));
							}
						}
					}
					else
					{
						Debug.Log((object)"Blocked users list is null");
					}
					GameObject gameObject = Object.Instantiate<GameObject>(__instance.LobbySlotPrefab, __instance.levelListContainer);
					gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f + ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset"));
					ReflectionUtils.SetFieldValue(__instance, "lobbySlotPositionOffset", ReflectionUtils.GetFieldValue<float>(__instance, "lobbySlotPositionOffset") - 42f);
					LobbySlot componentInChildren = gameObject.GetComponentInChildren<LobbySlot>();
					((TMP_Text)componentInChildren.LobbyName).text = ((Lobby)(ref currentLobbyList[j])).GetData("name");
					((TMP_Text)componentInChildren.playerCount).text = $"{((Lobby)(ref currentLobbyList[j])).MemberCount} / {((Lobby)(ref currentLobbyList[j])).MaxMembers}";
					componentInChildren.lobbyId = ((Lobby)(ref currentLobbyList[j])).Id;
					componentInChildren.thisLobby = currentLobbyList[j];
					ReflectionUtils.SetFieldValue(__instance, "currentLobbyList", currentLobbyList);
				}
			}
			else
			{
				Debug.Log((object)"Lobby list is null after request.");
				((TMP_Text)__instance.serverListBlankText).text = "No available servers to join.";
			}
		}
	}
	[HarmonyPatch(typeof(GameNetworkManager), "Awake")]
	public static class GameNetworkAwakePatch
	{
		public static int originalVersion;

		public static void Postfix(GameNetworkManager __instance)
		{
			originalVersion = __instance.gameVersionNum;
			if (!AssemblyChecker.HasAssemblyLoaded("lc_api"))
			{
				__instance.gameVersionNum = 9999;
			}
		}
	}
	[HarmonyPatch(typeof(MenuManager), "Awake")]
	public static class MenuManagerVersionDisplayPatch
	{
		public static void Postfix(MenuManager __instance)
		{
			if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)__instance.versionNumberText != (Object)null)
			{
				((TMP_Text)__instance.versionNumberText).text = $"v{GameNetworkAwakePatch.originalVersion} (MC)";
			}
		}
	}
}
namespace MoreCompany.Utils
{
	public class AssemblyChecker
	{
		public static bool HasAssemblyLoaded(string name)
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			Assembly[] array = assemblies;
			foreach (Assembly assembly in array)
			{
				if (assembly.GetName().Name.ToLower().Equals(name))
				{
					return true;
				}
			}
			return false;
		}
	}
	public class BundleUtilities
	{
		public static byte[] GetResourceBytes(string filename, Assembly assembly)
		{
			string[] manifestResourceNames = assembly.GetManifestResourceNames();
			foreach (string text in manifestResourceNames)
			{
				if (!text.Contains(filename))
				{
					continue;
				}
				using Stream stream = assembly.GetManifestResourceStream(text);
				if (stream == null)
				{
					return null;
				}
				byte[] array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
				return array;
			}
			return null;
		}

		public static AssetBundle LoadBundleFromInternalAssembly(string filename, Assembly assembly)
		{
			return AssetBundle.LoadFromMemory(GetResourceBytes(filename, assembly));
		}
	}
	public static class AssetBundleExtension
	{
		public static T LoadPersistentAsset<T>(this AssetBundle bundle, string name) where T : Object
		{
			Object val = bundle.LoadAsset(name);
			if (val != (Object)null)
			{
				val.hideFlags = (HideFlags)32;
				return (T)(object)val;
			}
			return default(T);
		}
	}
}
namespace MoreCompany.Cosmetics
{
	public class CosmeticApplication : MonoBehaviour
	{
		public Transform head;

		public Transform hip;

		public Transform lowerArmRight;

		public Transform shinLeft;

		public Transform shinRight;

		public Transform chest;

		public List<CosmeticInstance> spawnedCosmetics = new List<CosmeticInstance>();

		public void Awake()
		{
			head = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002")
				.Find("spine.003")
				.Find("spine.004");
			chest = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002")
				.Find("spine.003");
			lowerArmRight = ((Component)this).transform.Find("spine").Find("spine.001").Find("spine.002")
				.Find("spine.003")
				.Find("shoulder.R")
				.Find("arm.R_upper")
				.Find("arm.R_lower");
			hip = ((Component)this).transform.Find("spine");
			shinLeft = ((Component)this).transform.Find("spine").Find("thigh.L").Find("shin.L");
			shinRight = ((Component)this).transform.Find("spine").Find("thigh.R").Find("shin.R");
			RefreshAllCosmeticPositions();
		}

		private void OnDisable()
		{
			foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics)
			{
				((Component)spawnedCosmetic).gameObject.SetActive(false);
			}
		}

		private void OnEnable()
		{
			foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics)
			{
				((Component)spawnedCosmetic).gameObject.SetActive(true);
			}
		}

		public void ClearCosmetics()
		{
			foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics)
			{
				Object.Destroy((Object)(object)((Component)spawnedCosmetic).gameObject);
			}
			spawnedCosmetics.Clear();
		}

		public void ApplyCosmetic(string cosmeticId, bool startEnabled)
		{
			if (CosmeticRegistry.cosmeticInstances.ContainsKey(cosmeticId))
			{
				CosmeticInstance cosmeticInstance = CosmeticRegistry.cosmeticInstances[cosmeticId];
				GameObject val = Object.Instantiate<GameObject>(((Component)cosmeticInstance).gameObject);
				val.SetActive(startEnabled);
				CosmeticInstance component = val.GetComponent<CosmeticInstance>();
				spawnedCosmetics.Add(component);
				if (startEnabled)
				{
					ParentCosmetic(component);
				}
			}
		}

		public void RefreshAllCosmeticPositions()
		{
			foreach (CosmeticInstance spawnedCosmetic in spawnedCosmetics)
			{
				ParentCosmetic(spawnedCosmetic);
			}
		}

		private void ParentCosmetic(CosmeticInstance cosmeticInstance)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			Transform val = null;
			switch (cosmeticInstance.cosmeticType)
			{
			case CosmeticType.HAT:
				val = head;
				break;
			case CosmeticType.R_LOWER_ARM:
				val = lowerArmRight;
				break;
			case CosmeticType.HIP:
				val = hip;
				break;
			case CosmeticType.L_SHIN:
				val = shinLeft;
				break;
			case CosmeticType.R_SHIN:
				val = shinRight;
				break;
			case CosmeticType.CHEST:
				val = chest;
				break;
			}
			((Component)cosmeticInstance).transform.position = val.position;
			((Component)cosmeticInstance).transform.rotation = val.rotation;
			((Component)cosmeticInstance).transform.parent = val;
		}
	}
	public class CosmeticInstance : MonoBehaviour
	{
		public CosmeticType cosmeticType;

		public string cosmeticId;

		public Texture2D icon;
	}
	public class CosmeticGeneric
	{
		public virtual string gameObjectPath { get; }

		public virtual string cosmeticId { get; }

		public virtual string textureIconPath { get; }

		public CosmeticType cosmeticType { get; }

		public void LoadFromBundle(AssetBundle bundle)
		{
			GameObject val = bundle.LoadPersistentAsset<GameObject>(gameObjectPath);
			Texture2D icon = bundle.LoadPersistentAsset<Texture2D>(textureIconPath);
			CosmeticInstance cosmeticInstance = val.AddComponent<CosmeticInstance>();
			cosmeticInstance.cosmeticId = cosmeticId;
			cosmeticInstance.icon = icon;
			cosmeticInstance.cosmeticType = cosmeticType;
			MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + cosmeticId + " from bundle: " + ((Object)bundle).name));
			CosmeticRegistry.cosmeticInstances.Add(cosmeticId, cosmeticInstance);
		}
	}
	public enum CosmeticType
	{
		HAT,
		WRIST,
		CHEST,
		R_LOWER_ARM,
		HIP,
		L_SHIN,
		R_SHIN
	}
	public class CosmeticRegistry
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__8_0;

			public static UnityAction <>9__8_1;

			internal void <SpawnCosmeticGUI>b__8_0()
			{
				MainClass.showCosmetics = true;
				MainClass.SaveSettingsToFile();
			}

			internal void <SpawnCosmeticGUI>b__8_1()
			{
				MainClass.showCosmetics = false;
				MainClass.SaveSettingsToFile();
			}
		}

		public static Dictionary<string, CosmeticInstance> cosmeticInstances = new Dictionary<string, CosmeticInstance>();

		public static GameObject cosmeticGUI;

		private static GameObject displayGuy;

		private static CosmeticApplication cosmeticApplication;

		public static List<string> locallySelectedCosmetics = new List<string>();

		public const float COSMETIC_PLAYER_SCALE_MULT = 0.38f;

		public static void LoadCosmeticsFromBundle(AssetBundle bundle)
		{
			string[] allAssetNames = bundle.GetAllAssetNames();
			foreach (string text in allAssetNames)
			{
				if (text.EndsWith(".prefab"))
				{
					GameObject val = bundle.LoadPersistentAsset<GameObject>(text);
					CosmeticInstance component = val.GetComponent<CosmeticInstance>();
					if (!((Object)(object)component == (Object)null))
					{
						MainClass.StaticLogger.LogInfo((object)("Loaded cosmetic: " + component.cosmeticId + " from bundle"));
						cosmeticInstances.Add(component.cosmeticId, component);
					}
				}
			}
		}

		public static void LoadCosmeticsFromAssembly(Assembly assembly, AssetBundle bundle)
		{
			Type[] types = assembly.GetTypes();
			foreach (Type type in types)
			{
				if (type.IsSubclassOf(typeof(CosmeticGeneric)))
				{
					CosmeticGeneric cosmeticGeneric = (CosmeticGeneric)type.GetConstructor(new Type[0]).Invoke(new object[0]);
					cosmeticGeneric.LoadFromBundle(bundle);
				}
			}
		}

		public static void SpawnCosmeticGUI()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			cosmeticGUI = Object.Instantiate<GameObject>(MainClass.cosmeticGUIInstance);
			((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale")).transform.localScale = new Vector3(2f, 2f, 2f);
			displayGuy = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen")
				.Find("ObjectHolder")
				.Find("ScavengerModel")
				.Find("metarig")).gameObject;
			cosmeticApplication = displayGuy.AddComponent<CosmeticApplication>();
			GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen")
				.Find("EnableButton")).gameObject;
			ButtonClickedEvent onClick = gameObject.GetComponent<Button>().onClick;
			object obj = <>c.<>9__8_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					MainClass.showCosmetics = true;
					MainClass.SaveSettingsToFile();
				};
				<>c.<>9__8_0 = val;
				obj = (object)val;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
			GameObject gameObject2 = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen")
				.Find("DisableButton")).gameObject;
			ButtonClickedEvent onClick2 = gameObject2.GetComponent<Button>().onClick;
			object obj2 = <>c.<>9__8_1;
			if (obj2 == null)
			{
				UnityAction val2 = delegate
				{
					MainClass.showCosmetics = false;
					MainClass.SaveSettingsToFile();
				};
				<>c.<>9__8_1 = val2;
				obj2 = (object)val2;
			}
			((UnityEvent)onClick2).AddListener((UnityAction)obj2);
			if (MainClass.showCosmetics)
			{
				gameObject.SetActive(false);
				gameObject2.SetActive(true);
			}
			else
			{
				gameObject.SetActive(true);
				gameObject2.SetActive(false);
			}
			PopulateCosmetics();
			UpdateCosmeticsOnDisplayGuy(startEnabled: false);
		}

		public static void PopulateCosmetics()
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Expected O, but got Unknown
			GameObject gameObject = ((Component)cosmeticGUI.transform.Find("Canvas").Find("GlobalScale").Find("CosmeticsScreen")
				.Find("CosmeticsHolder")
				.Find("Content")).gameObject;
			List<Transform> list = new List<Transform>();
			for (int i = 0; i < gameObject.transform.childCount; i++)
			{
				list.Add(gameObject.transform.GetChild(i));
			}
			foreach (Transform item in list)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
			foreach (KeyValuePair<string, CosmeticInstance> cosmeticInstance in cosmeticInstances)
			{
				GameObject val = Object.Instantiate<GameObject>(MainClass.cosmeticButton, gameObject.transform);
				val.transform.localScale = Vector3.one;
				GameObject disabledOverlay = ((Component)val.transform.Find("Deselected")).gameObject;
				disabledOverlay.SetActive(true);
				GameObject enabledOverlay = ((Component)val.transform.Find("Selected")).gameObject;
				enabledOverlay.SetActive(true);
				if (IsEquipped(cosmeticInstance.Value.cosmeticId))
				{
					enabledOverlay.SetActive(true);
					disabledOverlay.SetActive(false);
				}
				else
				{
					enabledOverlay.SetActive(false);
					disabledOverlay.SetActive(true);
				}
				RawImage component = ((Component)val.transform.Find("Icon")).GetComponent<RawImage>();
				component.texture = (Texture)(object)cosmeticInstance.Value.icon;
				Button component2 = val.GetComponent<Button>();
				((UnityEvent)component2.onClick).AddListener((UnityAction)delegate
				{
					ToggleCosmetic(cosmeticInstance.Value.cosmeticId);
					if (IsEquipped(cosmeticInstance.Value.cosmeticId))
					{
						enabledOverlay.SetActive(true);
						disabledOverlay.SetActive(false);
					}
					else
					{
						enabledOverlay.SetActive(false);
						disabledOverlay.SetActive(true);
					}
					MainClass.WriteCosmeticsToFile();
					UpdateCosmeticsOnDisplayGuy(startEnabled: true);
				});
			}
		}

		private static Color HexToColor(string hex)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Color result = default(Color);
			ColorUtility.TryParseHtmlString(hex, ref result);
			return result;
		}

		public static void UpdateCosmeticsOnDisplayGuy(bool startEnabled)
		{
			cosmeticApplication.ClearCosmetics();
			foreach (string locallySelectedCosmetic in locallySelectedCosmetics)
			{
				cosmeticApplication.ApplyCosmetic(locallySelectedCosmetic, startEnabled);
			}
			foreach (CosmeticInstance spawnedCosmetic in cosmeticApplication.spawnedCosmetics)
			{
				RecursiveLayerChange(((Component)spawnedCosmetic).transform, 5);
			}
		}

		private static void RecursiveLayerChange(Transform transform, int layer)
		{
			((Component)transform).gameObject.layer = layer;
			for (int i = 0; i < transform.childCount; i++)
			{
				RecursiveLayerChange(transform.GetChild(i), layer);
			}
		}

		public static bool IsEquipped(string cosmeticId)
		{
			return locallySelectedCosmetics.Contains(cosmeticId);
		}

		public static void ToggleCosmetic(string cosmeticId)
		{
			if (locallySelectedCosmetics.Contains(cosmeticId))
			{
				locallySelectedCosmetics.Remove(cosmeticId);
			}
			else
			{
				locallySelectedCosmetics.Add(cosmeticId);
			}
		}
	}
}
namespace MoreCompany.Behaviors
{
	public class SpinDragger : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IPointerUpHandler
	{
		public float speed = 1f;

		private Vector2 lastMousePosition;

		private bool dragging = false;

		private Vector3 rotationalVelocity = Vector3.zero;

		public float dragSpeed = 1f;

		public float airDrag = 0.99f;

		public GameObject target;

		private void Update()
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: 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_0016: 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_0021: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (dragging)
			{
				Vector3 val = Vector2.op_Implicit(((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue() - lastMousePosition);
				rotationalVelocity += new Vector3(0f, 0f - val.x, 0f) * dragSpeed;
				lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue();
			}
			rotationalVelocity *= airDrag;
			target.transform.Rotate(rotationalVelocity * Time.deltaTime * speed, (Space)0);
		}

		public void OnPointerDown(PointerEventData eventData)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			lastMousePosition = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue();
			dragging = true;
		}

		public void OnPointerUp(PointerEventData eventData)
		{
			dragging = false;
		}
	}
}

plugins/NutNutty-SellTracker/SellTracker.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;

[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("SellTracker")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SellTracker")]
[assembly: AssemblyTitle("SellTracker")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace SellTracker
{
	[BepInPlugin("NutNutty.SellTracker", "Sell Tracker", "1.0.0")]
	public class SellTracker : BaseUnityPlugin
	{
		public void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("SellTracker").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Sell Tracker plugin loaded!");
		}
	}
	public class Patches
	{
		[HarmonyPatch(typeof(DisplayCompanyBuyingRate))]
		public class DisplayCompanyBuyingRatePatch
		{
			[HarmonyPrefix]
			[HarmonyPatch("Update")]
			public static bool OverwriteText(ref DisplayCompanyBuyingRate __instance)
			{
				int num = TimeOfDay.Instance.quotaFulfilled + calculatedValue;
				((TMP_Text)__instance.displayText).fontSize = 28f;
				((TMP_Text)__instance.displayText).text = $"PROFIT QUOTA: {num}/{TimeOfDay.Instance.profitQuota}";
				return false;
			}
		}

		[HarmonyPatch(typeof(DepositItemsDesk))]
		public class DepositItemsDeskPatch
		{
			[HarmonyPostfix]
			[HarmonyPatch("AddObjectToDeskClientRpc")]
			public static void FetchValue(ref DepositItemsDesk __instance)
			{
				int num = 0;
				for (int i = 0; i < __instance.itemsOnCounter.Count; i++)
				{
					if (__instance.itemsOnCounter[i].itemProperties.isScrap)
					{
						num += __instance.itemsOnCounter[i].scrapValue;
					}
				}
				calculatedValue = (int)((float)num * StartOfRound.Instance.companyBuyingRate);
			}

			[HarmonyPostfix]
			[HarmonyPatch("SellItemsClientRpc")]
			public static void ClearValue()
			{
				calculatedValue = 0;
			}
		}

		public static int calculatedValue;
	}
}

plugins/Owen3H-IntroTweaks/IntroTweaks.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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 HarmonyLib;
using IntroTweaks.Core;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("IntroTweaks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Configurable, seamless skipping of intro menus in Lethal Company.")]
[assembly: AssemblyFileVersion("1.2.2.0")]
[assembly: AssemblyInformationalVersion("1.2.2+376e01eb494784877512c3d828b737154e215718")]
[assembly: AssemblyProduct("IntroTweaks")]
[assembly: AssemblyTitle("IntroTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace IntroTweaks
{
	[BepInPlugin("io.github.IntroTweaks", "IntroTweaks", "1.2.2")]
	public class Plugin : BaseUnityPlugin
	{
		internal static string SelectedMode;

		private Harmony patcher;

		internal static ManualLogSource Logger { get; private set; }

		public static PluginConfig Config { get; private set; }

		private void Awake()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			Logger = ((BaseUnityPlugin)this).Logger;
			Config = new PluginConfig(((BaseUnityPlugin)this).Config);
			if (!PluginEnabled(logDisabled: true))
			{
				return;
			}
			Config.InitBindings();
			SelectedMode = Config.AUTO_SELECT_MODE.ToLower();
			try
			{
				patcher = new Harmony("io.github.IntroTweaks");
				patcher.PatchAll();
				Logger.LogInfo((object)"Plugin loaded.");
			}
			catch (Exception ex)
			{
				Logger.LogError((object)ex);
			}
		}

		public bool PluginEnabled(bool logDisabled = false)
		{
			bool pLUGIN_ENABLED = Config.PLUGIN_ENABLED;
			if (!pLUGIN_ENABLED && logDisabled)
			{
				Logger.LogInfo((object)"IntroTweaks disabled globally.");
			}
			return pLUGIN_ENABLED;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "IntroTweaks";

		public const string PLUGIN_NAME = "IntroTweaks";

		public const string PLUGIN_VERSION = "1.2.2";
	}
}
namespace IntroTweaks.Patches
{
	[HarmonyPatch(typeof(InitializeGame))]
	internal class InitializeGamePatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Start")]
		private static void DisableBootAnimation(ref bool __runOriginal)
		{
			if (Plugin.Config.SKIP_BOOT_ANIMATION)
			{
				SceneManager.LoadScene("MainMenu");
				__runOriginal = false;
			}
		}
	}
	[HarmonyPatch(typeof(MenuManager))]
	internal class MenuManagerPatch
	{
		public static int gameVer { get; private set; }

		public static TextMeshProUGUI versionText { get; private set; }

		[HarmonyPrefix]
		[HarmonyPatch("ClickHostButton")]
		private static void DisableMenuOnHost(MenuManager __instance)
		{
			__instance.menuButtons.SetActive(false);
			if (Plugin.Config.CUSTOM_VERSION_TEXT)
			{
				((Component)((TMP_Text)versionText).transform).gameObject.SetActive(false);
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("Awake")]
		private static bool ReplaceVersionText(MenuManager __instance)
		{
			if (Plugin.Config.CUSTOM_VERSION_TEXT)
			{
				GameObject gameObject = ((Component)((TMP_Text)__instance.versionNumberText).transform).gameObject;
				GameObject val = Object.Instantiate<GameObject>(gameObject, __instance.menuButtons.transform);
				gameObject.SetActive(false);
				((Object)val).name = "VersionNumberText";
				versionText = InitTextMesh(val.GetComponent<TextMeshProUGUI>());
				AnchorToBottom(val.GetComponent<RectTransform>());
			}
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void StartPatch(MenuManager __instance)
		{
			if (Plugin.Config.REMOVE_NEWS_PANEL)
			{
				Object.Destroy((Object)(object)__instance.NewsPanel);
			}
			if (Plugin.Config.REMOVE_LAN_WARNING)
			{
				Object.Destroy((Object)(object)__instance.lanWarningContainer);
			}
			if (Plugin.Config.REMOVE_LAUNCHED_IN_LAN)
			{
				TextMeshProUGUI launchedInLanModeText = __instance.launchedInLanModeText;
				GameObject val = ((launchedInLanModeText != null) ? ((Component)((TMP_Text)launchedInLanModeText).transform).gameObject : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					Object.Destroy((Object)(object)val);
				}
			}
			if (Plugin.Config.AUTO_SELECT_HOST)
			{
				__instance.ClickHostButton();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void UpdatePatch()
		{
			if (Plugin.Config.CUSTOM_VERSION_TEXT)
			{
				((TMP_Text)versionText).text = ((TMP_Text)versionText).text.Replace("$VERSION", gameVer.ToString());
			}
		}

		private static TextMeshProUGUI InitTextMesh(TextMeshProUGUI tmp)
		{
			int gameVersionNum = GameNetworkManager.Instance.gameVersionNum;
			gameVer = Mathf.Abs(Plugin.Config.VERSION_TEXT_FORMAT.ToLower().Equals("short") ? (gameVersionNum - 16440) : gameVersionNum);
			((TMP_Text)tmp).text = Plugin.Config.VERSION_TEXT;
			((TMP_Text)tmp).fontSize = Mathf.Clamp(Plugin.Config.VERSION_TEXT_SIZE, 10f, 40f);
			((TMP_Text)tmp).alignment = (TextAlignmentOptions)514;
			((TMP_Text)tmp).enableWordWrapping = false;
			return tmp;
		}

		private static void AnchorToBottom(RectTransform rect)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0065: Unknown result type (might be due to invalid IL or missing references)
			rect.anchorMin = new Vector2(0.5f, 0f);
			rect.anchorMax = new Vector2(0.5f, 0f);
			rect.anchoredPosition = Vector2.zero;
			rect.anchoredPosition3D = Vector3.zero;
			((Transform)rect).rotation = Quaternion.identity;
			((Transform)rect).position = new Vector3(Plugin.Config.VERSION_TEXT_X, Plugin.Config.VERSION_TEXT_Y, -37f);
		}
	}
	[HarmonyPatch(typeof(PreInitSceneScript))]
	internal class PreSceneInitPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("SkipToFinalSetting")]
		private static bool OverrideSkipToFinal()
		{
			return false;
		}

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void SkipToOnline(PreInitSceneScript __instance, ref bool ___choseLaunchOption)
		{
			if (!Plugin.SelectedMode.Equals("off"))
			{
				CollectionExtensions.Do<GameObject>((IEnumerable<GameObject>)__instance.LaunchSettingsPanels, (Action<GameObject>)delegate(GameObject p)
				{
					p.gameObject.SetActive(false);
				});
				__instance.currentLaunchSettingPanel = 0;
				((TMP_Text)__instance.headerText).text = "";
				((Component)__instance.blackTransition).gameObject.SetActive(false);
				__instance.continueButton.gameObject.SetActive(false);
				___choseLaunchOption = true;
				__instance.mainAudio.PlayOneShot(__instance.selectSFX);
				IngamePlayerSettings.Instance.SetPlayerFinishedLaunchOptions();
				IngamePlayerSettings.Instance.SaveChangedSettings();
				if (!IngamePlayerSettings.Instance.encounteredErrorDuringSave)
				{
					SceneManager.LoadScene(Plugin.SelectedMode.Equals("online") ? "InitScene" : "InitSceneLANMode");
				}
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("PlayFirstDayShipAnimation")]
		private static bool DisableSpeaker()
		{
			return !Plugin.Config.DISABLE_FIRST_DAY_SFX;
		}
	}
}
namespace IntroTweaks.Core
{
	public class PluginConfig
	{
		private readonly ConfigFile configFile;

		public bool PLUGIN_ENABLED { get; private set; }

		public string AUTO_SELECT_MODE { get; private set; }

		public bool AUTO_SELECT_HOST { get; private set; }

		public bool SKIP_BOOT_ANIMATION { get; private set; }

		public bool REMOVE_LAN_WARNING { get; private set; }

		public bool REMOVE_LAUNCHED_IN_LAN { get; private set; }

		public bool REMOVE_NEWS_PANEL { get; private set; }

		public bool CUSTOM_VERSION_TEXT { get; private set; }

		public string VERSION_TEXT { get; private set; }

		public string VERSION_TEXT_FORMAT { get; private set; }

		public float VERSION_TEXT_SIZE { get; private set; }

		public float VERSION_TEXT_X { get; private set; }

		public float VERSION_TEXT_Y { get; private set; }

		public bool DISABLE_FIRST_DAY_SFX { get; private set; }

		public PluginConfig(ConfigFile cfg)
		{
			configFile = cfg;
			PLUGIN_ENABLED = NewEntry("bEnabled", defaultVal: true, "Enable or disable the plugin globally.");
		}

		private T NewEntry<T>(string key, T defaultVal, string description)
		{
			return configFile.Bind<T>("io.github.IntroTweaks", key, defaultVal, description).Value;
		}

		public void InitBindings()
		{
			AUTO_SELECT_MODE = NewEntry("sAutoSelectMode", "ONLINE", "Which mode to automatically enter into after the splash screen.\nValid options: ONLINE, LAN, OFF");
			AUTO_SELECT_HOST = NewEntry("bAutoSelectHost", defaultVal: false, "Whether the 'Host' button is automatically selected when the Online/LAN menu loads.");
			SKIP_BOOT_ANIMATION = NewEntry("bSkipBootAnimation", defaultVal: true, "If the loading animation (booting OS) should be skipped.");
			REMOVE_LAN_WARNING = NewEntry("bRemoveLanWarning", defaultVal: true, "Remove the warning popup when hosting a LAN session.");
			REMOVE_LAUNCHED_IN_LAN = NewEntry("bRemoveLaunchedInLanText", defaultVal: true, "Remove the 'Launched in LAN mode' text below the Quit button.");
			REMOVE_NEWS_PANEL = NewEntry("bRemoveNewsPanel", defaultVal: false, "Remove the panel that displays news such as game updates.");
			CUSTOM_VERSION_TEXT = NewEntry("bCustomVersionText", defaultVal: true, "Whether to replace the game's version text with a custom alternative.");
			VERSION_TEXT = NewEntry("sVersionText", "v$VERSION\n[MODDED]", "Replace the game's version text with this custom text in the main menu.\nTo insert the version number, use the $VERSION syntax. E.g. Ver69 would be Ver$VERSION");
			VERSION_TEXT_FORMAT = NewEntry("sVersionTextFormat", "FULL", "Determines how to display game version number.\nValid options: FULL, SHORT");
			VERSION_TEXT_SIZE = NewEntry("fVersionTextSize", 20f, "The font size of the version text. Min = 10, Max = 40.");
			VERSION_TEXT_X = NewEntry("fVersionTextXPos", 1089.9f, "The position on the horizontal axis where the version text should be placed.\nPositive = Right, Negative = Left");
			VERSION_TEXT_Y = NewEntry("fVersionTextYPos", 555f, "The position on the vertical axis where the version text should be placed.\nPositive = Up, Negative = Down");
			DISABLE_FIRST_DAY_SFX = NewEntry("bDisableFirstDaySFX", defaultVal: false, "Toggles the first day ship speaker SFX.");
		}
	}
	internal static class Metadata
	{
		public const string GUID = "io.github.IntroTweaks";

		public const string NAME = "IntroTweaks";

		public const string VERSION = "1.2.2";
	}
}

plugins/Ozone-BepInUtils/NicholaScott.BepInEx.Utils.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NicholaScott.BepInEx.Utils")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NicholaScott.BepInEx.Utils")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("40BD9160-E0A3-402F-AE4F-059B39509F43")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NicholaScott.BepInEx.Utils
{
	[BepInPlugin("NicholaScott.BepInEx.Utils", "BepInUtils", "1.2.0")]
	public class BepInUtils : BaseUnityPlugin
	{
		public void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"System loaded.");
		}
	}
}
namespace NicholaScott.BepInEx.Utils.Resources
{
	public static class Extensions
	{
		public static byte[] ReadAllBytes(this Stream inStream)
		{
			if (inStream is MemoryStream memoryStream)
			{
				return memoryStream.ToArray();
			}
			using MemoryStream memoryStream2 = new MemoryStream();
			inStream.CopyTo(memoryStream2);
			return memoryStream2.ToArray();
		}
	}
}
namespace NicholaScott.BepInEx.Utils.Patching
{
	[AttributeUsage(AttributeTargets.Class)]
	public class Production : Attribute
	{
	}
	public static class Extensions
	{
		public static Harmony PatchAttribute<TAttr>(this Assembly sourceAssembly, string guid, Action<object> logMethod = null) where TAttr : Attribute
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			Harmony val = new Harmony(string.Join(".", guid, typeof(TAttr).Name));
			foreach (Type item in from t in sourceAssembly.GetTypes()
				where t.IsClass && t.GetCustomAttributes(typeof(TAttr)).Any()
				select t)
			{
				int num = val.GetPatchedMethods().Count();
				val.PatchAll(item);
				int num2 = val.GetPatchedMethods().Count();
				int num3 = num2 - num;
				logMethod?.Invoke(string.Format("[{0}] Patched class {1}, containing {2} method{3}", typeof(TAttr).Name, item.Name, num3, (num3 > 1) ? "s." : "."));
			}
			return val;
		}
	}
}
namespace NicholaScott.BepInEx.Utils.Instancing
{
	public class AutoSingleton<TPrepare> where TPrepare : Object
	{
		private static TPrepare _instance;

		public static TPrepare Instance
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)_instance))
				{
					_instance = Object.FindObjectOfType<TPrepare>();
				}
				return _instance;
			}
		}
	}
	public class Singleton<TPrepare>
	{
		public static TPrepare Instance;

		public static ManualLogSource Logger
		{
			get
			{
				object? obj = typeof(BaseUnityPlugin).GetProperty("Logger", BindingFlags.Instance | BindingFlags.NonPublic)?.GetGetMethod(nonPublic: true)?.Invoke(Instance, Array.Empty<object>());
				return (ManualLogSource)((obj is ManualLogSource) ? obj : null);
			}
		}
	}
	public class Singleton<TPrepare, TConfig> : Singleton<TPrepare>
	{
		public static TConfig Configuration;
	}
}
namespace NicholaScott.BepInEx.Utils.Configuration
{
	[AttributeUsage(AttributeTargets.Field)]
	public class ConfigEntryDefinition : Attribute
	{
		public string Category;

		public string Name;

		public string Description;
	}
	public static class Extensions
	{
		public static TStruct BindStruct<TStruct>(this ConfigFile config, TStruct defaults) where TStruct : struct
		{
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			object obj = new TStruct();
			FieldInfo[] fields = typeof(TStruct).GetFields();
			foreach (FieldInfo fieldInfo in fields)
			{
				ConfigEntryDefinition configEntryDefinition = fieldInfo.GetCustomAttribute<ConfigEntryDefinition>() ?? new ConfigEntryDefinition();
				configEntryDefinition.Category = configEntryDefinition.Category ?? "General";
				configEntryDefinition.Name = configEntryDefinition.Name ?? fieldInfo.Name;
				configEntryDefinition.Description = configEntryDefinition.Description ?? "";
				object obj2 = ((typeof(ConfigFile).GetMethods()?.Where((MethodInfo m) => m.IsGenericMethod && m.Name.Contains("Bind") && m.GetParameters()[0].ParameterType == typeof(ConfigDefinition)).First())?.MakeGenericMethod(fieldInfo.FieldType))?.Invoke(config, new object[3]
				{
					(object)new ConfigDefinition(configEntryDefinition.Category, configEntryDefinition.Name),
					fieldInfo.GetValue(defaults),
					(object)new ConfigDescription(configEntryDefinition.Description, (AcceptableValueBase)null, Array.Empty<object>())
				});
				object obj3 = (obj2?.GetType().GetProperty("Value"))?.GetGetMethod().Invoke(obj2, null);
				fieldInfo.SetValue(obj, obj3 ?? fieldInfo.GetValue(defaults));
			}
			return (TStruct)obj;
		}
	}
}

plugins/Ozone-Lockdown/NicholaScott.LethalCompany.Lockdown.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using NicholaScott.BepInEx.Utils.Configuration;
using NicholaScott.BepInEx.Utils.Instancing;
using NicholaScott.BepInEx.Utils.Patching;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NicholaScott.LethalCompany.Lockdown")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NicholaScott.LethalCompany.Lockdown")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("F1E58CD9-995C-4551-8F0A-2CDA92D85C13")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NicholaScott.LethalCompany.Lockdown;

[BepInDependency("NicholaScott.BepInEx.Utils", "1.2.0")]
[BepInPlugin("NicholaScott.LethalCompany.Lockdown", "Lockdown", "1.0.3")]
public class Lockdown : BaseUnityPlugin
{
	public struct Configuration
	{
		public enum PermissionLevel
		{
			Unrestricted,
			HostOnly
		}

		[ConfigEntryDefinition(Name = "RestrictPurchasingItems", Description = "Whether any client, or only the host, can purchase items.")]
		public PermissionLevel PurchaseStoreItems;

		[ConfigEntryDefinition(Name = "RestrictPurchasingUnlockables", Description = "Whether any client, or only the host, can purchase unlockables.")]
		public PermissionLevel PurchaseStoreUnlocks;

		[ConfigEntryDefinition(Name = "RestrictRoutingShipToMoon", Description = "Whether any client, or only the host, can use the `route` command in the terminal.")]
		public PermissionLevel RouteShipToMoon;

		[ConfigEntryDefinition(Name = "RestrictPlacingObjectIntoStorage", Description = "Whether any client, or only the host, can put items into storage with the <B> key.")]
		public PermissionLevel PlaceObjectIntoStorage;

		[ConfigEntryDefinition(Name = "RestrictTakingObjectFromStorage", Description = "Whether any client, or only the host, can take items out of storage with the terminal.")]
		public PermissionLevel ReturnObjectFromStorage;

		[ConfigEntryDefinition(Name = "RestrictMovingObjectsInShip", Description = "Whether any client, or only the host, can move placeable objects in the ship.")]
		public PermissionLevel MoveObjects;

		[ConfigEntryDefinition(Name = "RestrictShipLights", Description = "Whether any client, or only the host, can toggle ship lights (except when host is not nearby).")]
		public PermissionLevel ToggleShipLights;

		[ConfigEntryDefinition(Description = "How fast time passes.")]
		public float TimeMultiplier;
	}

	public void Awake()
	{
		Singleton<Lockdown>.Instance = this;
		Singleton<Lockdown, Configuration>.Configuration = Extensions.BindStruct<Configuration>(((BaseUnityPlugin)this).Config, new Configuration
		{
			PurchaseStoreItems = Configuration.PermissionLevel.HostOnly,
			PurchaseStoreUnlocks = Configuration.PermissionLevel.HostOnly,
			RouteShipToMoon = Configuration.PermissionLevel.HostOnly,
			PlaceObjectIntoStorage = Configuration.PermissionLevel.HostOnly,
			ReturnObjectFromStorage = Configuration.PermissionLevel.HostOnly,
			MoveObjects = Configuration.PermissionLevel.HostOnly,
			ToggleShipLights = Configuration.PermissionLevel.HostOnly,
			TimeMultiplier = 0.5f
		});
		Extensions.PatchAttribute<Production>(Assembly.GetExecutingAssembly(), ((BaseUnityPlugin)this).Info.Metadata.GUID, (Action<object>)((BaseUnityPlugin)this).Logger.LogInfo);
	}
}
[Production]
public static class LockdownPatches
{
	private static readonly int PullLever = Animator.StringToHash("pullLever");

	private static bool IsHostSender(__RpcParams rpcParams)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		return rpcParams.Server.Receive.SenderClientId == GameNetworkManager.Instance.localPlayerController.actualClientId;
	}

	[HarmonyPatch("Start")]
	[HarmonyPostfix]
	public static void ChangeTimeSpeedMultiplier(TimeOfDay __instance)
	{
		if (NetworkManager.Singleton.IsServer)
		{
			__instance.globalTimeSpeedMultiplier = Singleton<Lockdown, Lockdown.Configuration>.Configuration.TimeMultiplier;
		}
	}

	[HarmonyPatch(typeof(Terminal), "__rpc_handler_4003509079")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostPurchases(NetworkBehaviour target, __RpcParams rpcParams)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (Singleton<Lockdown, Lockdown.Configuration>.Configuration.PurchaseStoreItems == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams))
		{
			return true;
		}
		Singleton<Lockdown>.Logger.LogInfo((object)"Blocking purchase from client!");
		Terminal val = (Terminal)(object)((target is Terminal) ? target : null);
		if (val != null)
		{
			val.SyncGroupCreditsClientRpc(val.groupCredits, val.orderedItemsFromTerminal.Count);
		}
		return false;
	}

	[HarmonyPatch(typeof(StartOfRound), "__rpc_handler_3953483456")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostPurchaseUnlockables(NetworkBehaviour target, __RpcParams rpcParams)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		if (Singleton<Lockdown, Lockdown.Configuration>.Configuration.PurchaseStoreUnlocks == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams))
		{
			return true;
		}
		Singleton<Lockdown>.Logger.LogInfo((object)"Blocking unlock-able purchase from client!");
		StartOfRound val = (StartOfRound)(object)((target is StartOfRound) ? target : null);
		if (val != null)
		{
			val.BuyShipUnlockableClientRpc(Object.FindObjectOfType<Terminal>().groupCredits, -1);
		}
		return false;
	}

	[HarmonyPatch(typeof(StartOfRound), "__rpc_handler_1134466287")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostRouteChanges(__RpcParams rpcParams)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		Singleton<Lockdown>.Logger.LogInfo((object)"Checking route change from client.");
		return Singleton<Lockdown, Lockdown.Configuration>.Configuration.RouteShipToMoon == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams);
	}

	[HarmonyPatch(typeof(StartOfRound), "__rpc_handler_3380566632")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostReturnFromStorage(__RpcParams rpcParams)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		Singleton<Lockdown>.Logger.LogInfo((object)"Checking spawn unlock-able from client.");
		return Singleton<Lockdown, Lockdown.Configuration>.Configuration.ReturnObjectFromStorage == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams);
	}

	[HarmonyPatch(typeof(ShipBuildModeManager), "__rpc_handler_3086821980")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostPlaceInStorage(FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_000d: 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)
		if (Singleton<Lockdown, Lockdown.Configuration>.Configuration.PlaceObjectIntoStorage == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams))
		{
			return true;
		}
		Singleton<Lockdown>.Logger.LogInfo((object)"Blocking unlock-able move to storage from client!");
		NetworkObjectReference val = default(NetworkObjectReference);
		((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref val, default(ForNetworkSerializable));
		NetworkObject val2 = default(NetworkObject);
		if (!((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null))
		{
			return false;
		}
		PlaceableShipObject componentInChildren = ((Component)val2).gameObject.GetComponentInChildren<PlaceableShipObject>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			Object.FindObjectOfType<StartOfRound>().ReturnUnlockableFromStorageClientRpc(componentInChildren.unlockableID);
		}
		return false;
	}

	[HarmonyPatch(typeof(ShipBuildModeManager), "__rpc_handler_861494715")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostMoveCabinet(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
	{
		//IL_000d: 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_0046: 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_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)
		if (Singleton<Lockdown, Lockdown.Configuration>.Configuration.MoveObjects == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams))
		{
			return true;
		}
		Vector3 val = default(Vector3);
		((FastBufferReader)(ref reader)).ReadValueSafe(ref val);
		((FastBufferReader)(ref reader)).ReadValueSafe(ref val);
		NetworkObjectReference val2 = default(NetworkObjectReference);
		((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref val2, default(ForNetworkSerializable));
		NetworkObject val3 = default(NetworkObject);
		if (!((NetworkObjectReference)(ref val2)).TryGet(ref val3, (NetworkManager)null))
		{
			return false;
		}
		PlaceableShipObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<PlaceableShipObject>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			Transform transform = ((Component)componentInChildren).transform;
			NetworkBehaviour obj = ((target is ShipBuildModeManager) ? target : null);
			if (obj != null)
			{
				((ShipBuildModeManager)obj).PlaceShipObjectClientRpc(transform.position, transform.eulerAngles, val2, (int)GameNetworkManager.Instance.localPlayerController.actualClientId);
			}
		}
		return false;
	}

	[HarmonyPatch(typeof(ShipLights), "__rpc_handler_1625678258")]
	[HarmonyPrefix]
	public static bool IgnoreClientButNotHostSetLights(__RpcParams rpcParams)
	{
		//IL_000d: 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_0051: Unknown result type (might be due to invalid IL or missing references)
		if (Singleton<Lockdown, Lockdown.Configuration>.Configuration.ToggleShipLights == Lockdown.Configuration.PermissionLevel.Unrestricted || IsHostSender(rpcParams))
		{
			return true;
		}
		ShipLights val = Object.FindObjectOfType<ShipLights>();
		if (GameNetworkManager.Instance.localPlayerController.isPlayerDead || Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)val).transform.position) >= 20f)
		{
			return true;
		}
		val.SetShipLightsClientRpc(val.areLightsOn);
		return false;
	}
}

plugins/Piggy-NotEnoughSubtitleENG/NotEnoughSubtitle.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using NotEnoughSubtitleENG.Patches;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RadiationIsCool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RadiationIsCool")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8ee335db-0cbe-470c-8fbc-69263f01b35a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NotEnoughSubtitleENG
{
	[BepInPlugin("Piggy3590.NotEnoughSubtitle", "Not Enough Subtitle ENG", "1.0.0")]
	public class SubtitleENGModBase : BaseUnityPlugin
	{
		private const string modGUID = "Piggy3590.NotEnoughSubtitle";

		private const string modName = "Not Enough Subtitle ENG";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Piggy3590.NotEnoughSubtitle");

		private static SubtitleENGModBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Piggy3590.NotEnoughSubtitle");
			mls.LogInfo((object)"Not Enough Subtitle is loaded");
			harmony.PatchAll(typeof(SubtitleENGModBase));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}
	}
}
namespace NotEnoughSubtitleENG.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		public static float introTimer = 5000f;

		public static float firedTimer = 5000f;

		public static float zeroDayTimer = 5000f;

		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void Awake_Postfix()
		{
			introTimer = 5000f;
			firedTimer = 5000f;
			zeroDayTimer = 5000f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void Update_Postfix()
		{
			if (introTimer < 5000f)
			{
				introTimer += Time.deltaTime;
			}
			if (firedTimer < 5000f)
			{
				firedTimer += Time.deltaTime;
			}
			if (zeroDayTimer < 5000f)
			{
				zeroDayTimer += Time.deltaTime;
			}
			if (introTimer > 7f && introTimer < 7.3f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> Welcome to your first day on the job.";
			}
			if (introTimer > 10.1f && introTimer < 10.4f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> This is your very own autopilot ship,";
			}
			if (introTimer > 12.5f && introTimer < 13f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> where you eat and sleep for the duration of your contract.";
			}
			if (introTimer > 15.3f && introTimer < 15.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "(unintelligible words)";
			}
			if (introTimer > 20f && (double)introTimer < 20.3)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> make yourself at home.";
			}
			if ((double)introTimer > 21.7 && introTimer < 22f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> complete the onboarding process, you will want to check the instruction manual\nand sign into your ship's computer terminal.";
			}
			if ((double)introTimer > 28.3 && introTimer < 29f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> we trust you will be a great asset to the company.";
			}
			if (introTimer > 31f && introTimer < 32f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> great great asset to the company...";
			}
			if (introTimer > 37f && introTimer < 38f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
			if (firedTimer > 0.15f && firedTimer < 1f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>COMPUTER PILOT:</color> As you have not met the profit quota,";
			}
			if (firedTimer > 2.2f && firedTimer < 2.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>COMPUTER PILOT:</color> your performance has been deemed below standard.";
			}
			if (firedTimer > 5.5f && firedTimer < 6f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>COMPUTER PILOT:</color> Welcome to our disciplinary process.";
			}
			if (firedTimer > 8f && firedTimer < 9f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
			if (zeroDayTimer > 5.25f && zeroDayTimer < 5.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> Report to the company building immediately to sell your scrap metal and other goods.";
			}
			if (zeroDayTimer > 10f && zeroDayTimer < 11f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> You have 0 days left to meet the profit quota.";
			}
			if (zeroDayTimer > 13.4f && zeroDayTimer < 14f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>COMPUTER PILOT:</color> You can use the terminal to route the autopilot to the company building.";
			}
			if (zeroDayTimer > 17f && zeroDayTimer < 18f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("playersFiredGameOver")]
		private static void playersFiredGameOver_Postfix()
		{
			firedTimer = -5f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("playDaysLeftAlertSFXDelayed")]
		private static void playDaysLeftAlertSFXDelayed_Postfix()
		{
			zeroDayTimer = -3f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("firstDayAnimation")]
		private static void firstDayAnimation_Postfix()
		{
			introTimer = -6f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("DisableShipSpeakerLocalClient")]
		private static void DisableShipSpeakerLocalClient_Postfix()
		{
			introTimer = 5000f;
			firedTimer = 5000f;
			zeroDayTimer = 5000f;
			((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		private static TextMeshProUGUI textComponent;

		public static TextMeshProUGUI RsubtitleGUItext;

		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void Awake_Postfix(ref HUDManager __instance)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("testSubtitlesGUI");
			val.AddComponent<RectTransform>();
			TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
			RectTransform rectTransform = ((TMP_Text)val2).rectTransform;
			((Transform)rectTransform).SetParent(GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform, false);
			rectTransform.sizeDelta = new Vector2(600f, 200f);
			rectTransform.anchoredPosition = new Vector2(0f, -125f);
			((TMP_Text)val2).alignment = (TextAlignmentOptions)514;
			((TMP_Text)val2).font = ((TMP_Text)__instance.controlTipLines[0]).font;
			((TMP_Text)val2).fontSize = 16f;
			RsubtitleGUItext = val2;
		}

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void Update_Postfix()
		{
			if ((Object)(object)RsubtitleGUItext == (Object)(object)textComponent)
			{
				((TMP_Text)RsubtitleGUItext).text = "Testing";
			}
		}
	}
}

plugins/Piggy-NotEnoughSubtitleRUS/NotEnoughSubtitleRU.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using NotEnoughSubtitle.Patches;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RadiationIsCool")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RadiationIsCool")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8ee335db-0cbe-470c-8fbc-69263f01b35a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NotEnoughSubtitle
{
	[BepInPlugin("Piggy3590.NotEnoughSubtitle", "Not Enough Subtitle", "1.0.0")]
	public class SubtitleModBase : BaseUnityPlugin
	{
		private const string modGUID = "Piggy3590.NotEnoughSubtitle";

		private const string modName = "Not Enough Subtitle";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Piggy3590.NotEnoughSubtitle");

		private static SubtitleModBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Piggy3590.NotEnoughSubtitle");
			mls.LogInfo((object)"Not Enough Subtitle is loaded");
			harmony.PatchAll(typeof(SubtitleModBase));
			harmony.PatchAll(typeof(HUDManagerPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			harmony.PatchAll(typeof(DepositItemsDeskPatch));
		}
	}
}
namespace NotEnoughSubtitle.Patches
{
	[HarmonyPatch(typeof(DepositItemsDesk))]
	[HarmonyPatch("MicrophoneSpeak")]
	internal class DepositItemsDeskPatch
	{
		public static float speakTimer = 20f;

		public static AudioClip audioClip;

		[HarmonyPatch("Update")]
		private static void Update_Fix()
		{
			if (speakTimer < 100f)
			{
				speakTimer += Time.deltaTime;
			}
			((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = ((Object)audioClip).name + "/" + speakTimer;
			if (((Object)audioClip).name == "Mic1" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> Your work keeps The Company happy.";
			}
			if (((Object)audioClip).name == "Mic2" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> We value your commitment.";
			}
			if (((Object)audioClip).name == "Mic3" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> We need you.";
			}
			if (((Object)audioClip).name == "Mic3" && speakTimer > 2f && speakTimer < 3f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> eeeeeeeee";
			}
			if (((Object)audioClip).name == "Mic4" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> Your handwork is invaluable to the company. ";
			}
			if (((Object)audioClip).name == "Mic6" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> Wa.";
			}
			if (((Object)audioClip).name == "Mic7" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> The Company must stay happy.";
			}
			if (((Object)audioClip).name == "Mic7" && speakTimer > 2f && speakTimer < 3f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> eetche compny muast";
			}
			if (((Object)audioClip).name == "Mic8" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> this wall cannot contain it-";
			}
			if (((Object)audioClip).name == "Mic8" && speakTimer > 2f && speakTimer < 3f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> ccontai n";
			}
			if (((Object)audioClip).name == "Mic9" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> Your honest work is invaluable to the Company.";
			}
			if (((Object)audioClip).name == "Mic10" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> You are true professionals.";
			}
			if (((Object)audioClip).name == "Mic11" && speakTimer > 1f && speakTimer < 2f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>???:</color> Keep our investors happy.";
			}
			if (speakTimer > 4f && speakTimer < 6f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
		}

		[HarmonyPrefix]
		public static bool MicrophoneSpeak_Prefix(ref AudioSource ___speakerAudio, ref AudioClip[] ___rareMicrophoneAudios, ref AudioClip[] ___microphoneAudios, ref Random ___CompanyLevelRandom)
		{
			speakTimer = 0f;
			if (___CompanyLevelRandom.NextDouble() < 0.029999999329447746)
			{
				audioClip = ___rareMicrophoneAudios[___CompanyLevelRandom.Next(0, ___rareMicrophoneAudios.Length)];
			}
			else
			{
				audioClip = ___microphoneAudios[___CompanyLevelRandom.Next(0, ___microphoneAudios.Length)];
			}
			___speakerAudio.PlayOneShot(audioClip, 1f);
			return false;
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		public static float introTimer = 5000f;

		public static float firedTimer = 5000f;

		public static float zeroDayTimer = 5000f;

		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void Awake_Postfix()
		{
			introTimer = 5000f;
			firedTimer = 5000f;
			zeroDayTimer = 5000f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("Update")]
		private static void Update_Postfix()
		{
			if (introTimer < 5000f)
			{
				introTimer += Time.deltaTime;
			}
			if (firedTimer < 5000f)
			{
				firedTimer += Time.deltaTime;
			}
			if (zeroDayTimer < 5000f)
			{
				zeroDayTimer += Time.deltaTime;
			}
			if (introTimer > 7f && introTimer < 7.3f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Добро пожаловать на ваш первый рабочий день.";
			}
			if (introTimer > 10.1f && introTimer < 10.4f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Это ваш собственный корабль с автопилотом,";
			}
			if (introTimer > 12.5f && introTimer < 13f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  где вы едите и спите в течение всего срока действия вашего контракта.";
			}
			if (introTimer > 15.3f && introTimer < 15.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "(неразборчивые слова)";
			}
			if (introTimer > 20f && (double)introTimer < 20.3)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Чувствуйте себя как дома.";
			}
			if ((double)introTimer > 21.7 && introTimer < 22f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Завершите процесс регистрации,\nвам нужно будет проверить руководство по эксплуатации и войти в компьютерный терминал вашего корабля.";
			}
			if ((double)introTimer > 28.3 && introTimer < 29f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Мы уверены, что вы станете отличным работником для компании.";
			}
			if (introTimer > 31f && introTimer < 32f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  от-от-отличным работником для компании ...";
			}
			if (introTimer > 37f && introTimer < 38f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
			if (firedTimer > 0.15f && firedTimer < 1f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Поскольку вы не выполнили норму прибыли,";
			}
			if (firedTimer > 2.2f && firedTimer < 2.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  ваши действия признаны ниже стандартных.";
			}
			if (firedTimer > 5.5f && firedTimer < 6f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#F15F5F>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Добро пожаловать на наш дисциплинарный процесс.";
			}
			if (firedTimer > 8f && firedTimer < 9f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
			if (zeroDayTimer > 5.25f && zeroDayTimer < 5.5f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Немедленно явитесь в здание компании, чтобы продать металлолом и другие товары.";
			}
			if (zeroDayTimer > 10f && zeroDayTimer < 11f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  У вас осталось 0 дней, чтобы выполнить норму прибыли.";
			}
			if (zeroDayTimer > 13.4f && zeroDayTimer < 14f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "<color=#5CD1E5>КОМПЬЮТЕРНЫЙ ПИЛОТ:</color>  Вы можете использовать терминал, чтобы направить автопилот к зданию компании.";
			}
			if (zeroDayTimer > 17f && zeroDayTimer < 18f)
			{
				((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("playersFiredGameOver")]
		private static void playersFiredGameOver_Postfix()
		{
			firedTimer = -5f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("playDaysLeftAlertSFXDelayed")]
		private static void playDaysLeftAlertSFXDelayed_Postfix()
		{
			zeroDayTimer = -3f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("firstDayAnimation")]
		private static void firstDayAnimation_Postfix()
		{
			introTimer = -6f;
		}

		[HarmonyPostfix]
		[HarmonyPatch("DisableShipSpeakerLocalClient")]
		private static void DisableShipSpeakerLocalClient_Postfix()
		{
			introTimer = 5000f;
			firedTimer = 5000f;
			zeroDayTimer = 5000f;
			((TMP_Text)HUDManagerPatch.RsubtitleGUItext).text = "";
		}
	}
	[HarmonyPatch(typeof(HUDManager))]
	internal class HUDManagerPatch
	{
		private static TextMeshProUGUI textComponent;

		public static TextMeshProUGUI RsubtitleGUItext;

		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void Awake_Postfix(ref HUDManager __instance)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("testSubtitlesGUI");
			val.AddComponent<RectTransform>();
			TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
			RectTransform rectTransform = ((TMP_Text)val2).rectTransform;
			((Transform)rectTransform).SetParent(GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen").transform, false);
			rectTransform.sizeDelta = new Vector2(600f, 200f);
			rectTransform.anchoredPosition = new Vector2(0f, -125f);
			((TMP_Text)val2).alignment = (TextAlignmentOptions)514;
			((TMP_Text)val2).font = ((TMP_Text)__instance.controlTipLines[0]).font;
			((TMP_Text)val2).fontSize = 17f;
			RsubtitleGUItext = val2;
		}
	}
}

plugins/Pooble-LCBetterSaves/LCBetterSaves.dll

Decompiled 10 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using LCBetterSaves;
using LCBetterSaves.Properties;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LCBetterSaves")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Better save files for Lethal Company")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0+c4704fdbef04f8b1a1445fc922475f8ee41eee5e")]
[assembly: AssemblyProduct("LCBetterSaves")]
[assembly: AssemblyTitle("LCBetterSaves")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class NewFileUISlot_BetterSaves : MonoBehaviour
{
	public Animator buttonAnimator;

	public Button button;

	public bool isSelected;

	public void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		buttonAnimator = ((Component)this).GetComponent<Animator>();
		button = ((Component)this).GetComponent<Button>();
		((UnityEvent)button.onClick).AddListener(new UnityAction(SetFileToThis));
	}

	public void SetFileToThis()
	{
		string currentSaveFileName = "LCSaveFile" + Plugin.newSaveFileNum;
		GameNetworkManager.Instance.currentSaveFileName = currentSaveFileName;
		GameNetworkManager.Instance.saveFileNum = Plugin.newSaveFileNum;
		SetButtonColorForAllFileSlots();
		isSelected = true;
		SetButtonColor();
	}

	public void SetButtonColorForAllFileSlots()
	{
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			saveFileUISlot_BetterSaves.SetButtonColor();
			saveFileUISlot_BetterSaves.deleteButton.SetActive(false);
			saveFileUISlot_BetterSaves.renameButton.SetActive(false);
		}
	}

	public void SetButtonColor()
	{
		buttonAnimator.SetBool("isPressed", isSelected);
	}
}
public class SaveFileUISlot_BetterSaves : MonoBehaviour
{
	public Animator buttonAnimator;

	public Button button;

	public TextMeshProUGUI fileStatsText;

	public int fileNum;

	public string fileString;

	public TextMeshProUGUI fileNotCompatibleAlert;

	public GameObject deleteButton;

	public GameObject renameButton;

	public void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Expected O, but got Unknown
		buttonAnimator = ((Component)this).GetComponent<Animator>();
		button = ((Component)this).GetComponent<Button>();
		((UnityEvent)button.onClick).AddListener(new UnityAction(SetFileToThis));
		fileStatsText = ((Component)((Component)this).transform.GetChild(2)).GetComponent<TextMeshProUGUI>();
		fileNotCompatibleAlert = ((Component)((Component)this).transform.GetChild(4)).GetComponent<TextMeshProUGUI>();
		deleteButton = ((Component)((Component)this).transform.GetChild(3)).gameObject;
	}

	public void Start()
	{
		UpdateStats();
	}

	private void OnEnable()
	{
		if (!Object.FindObjectOfType<MenuManager>().filesCompatible[fileNum])
		{
			((Behaviour)fileNotCompatibleAlert).enabled = true;
		}
	}

	public void UpdateStats()
	{
		try
		{
			if (ES3.FileExists(fileString))
			{
				int num = ES3.Load<int>("GroupCredits", fileString, 30);
				int num2 = ES3.Load<int>("Stats_DaysSpent", fileString, 0);
				((TMP_Text)fileStatsText).text = $"${num}\nDays: {num2}";
			}
			else
			{
				((TMP_Text)fileStatsText).text = "";
			}
		}
		catch (Exception ex)
		{
			Debug.LogError((object)("Error updating stats: " + ex.Message));
		}
	}

	public void SetButtonColor()
	{
		buttonAnimator.SetBool("isPressed", GameNetworkManager.Instance.currentSaveFileName == fileString);
	}

	public void SetFileToThis()
	{
		Plugin.fileToModify = fileNum;
		GameNetworkManager.Instance.currentSaveFileName = fileString;
		GameNetworkManager.Instance.saveFileNum = fileNum;
		SetButtonColorForAllFileSlots();
	}

	public void SetButtonColorForAllFileSlots()
	{
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			saveFileUISlot_BetterSaves.SetButtonColor();
			saveFileUISlot_BetterSaves.deleteButton.SetActive((Object)(object)saveFileUISlot_BetterSaves == (Object)(object)this);
			saveFileUISlot_BetterSaves.renameButton.SetActive((Object)(object)saveFileUISlot_BetterSaves == (Object)(object)this);
		}
		NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = Object.FindObjectOfType<NewFileUISlot_BetterSaves>();
		newFileUISlot_BetterSaves.isSelected = false;
		newFileUISlot_BetterSaves.SetButtonColor();
	}
}
public class RenameFileButton_BetterSaves : MonoBehaviour
{
	public void RenameFile()
	{
		string text = $"LCSaveFile{Plugin.fileToModify}";
		string text2 = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/Panel/LobbyHostOptions/OptionsNormal/ServerNameField/Text Area/Text").GetComponent<TMP_Text>().text;
		if (ES3.FileExists(text))
		{
			ES3.Save<string>("Alias_BetterSaves", text2, text);
			Debug.Log((object)("Granted alias " + text2 + " to file " + text));
		}
		Plugin.RefreshNameFields();
	}
}
public class DeleteFileButton_BetterSaves : MonoBehaviour
{
	public int fileToDelete;

	public AudioClip deleteFileSFX;

	public TextMeshProUGUI deleteFileText;

	public void UpdateFileToDelete()
	{
		fileToDelete = Plugin.fileToModify;
		if (ES3.Load<string>("Alias_BetterSaves", $"LCSaveFile{fileToDelete}", "") != "")
		{
			((TMP_Text)deleteFileText).text = "Do you want to delete file (" + ES3.Load<string>("Alias_BetterSaves", $"LCSaveFile{fileToDelete}", "") + ")?";
		}
		else
		{
			((TMP_Text)deleteFileText).text = $"Do you want to delete File {fileToDelete + 1}?";
		}
	}

	public void DeleteFile()
	{
		string text = $"LCSaveFile{fileToDelete}";
		if (ES3.FileExists(text))
		{
			ES3.DeleteFile(text);
			Object.FindObjectOfType<MenuManager>().MenuAudio.PlayOneShot(deleteFileSFX);
		}
		SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>(true);
		SaveFileUISlot_BetterSaves[] array2 = array;
		foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
		{
			Debug.Log((object)$"Deleted {fileToDelete}");
			if (saveFileUISlot_BetterSaves.fileNum == fileToDelete)
			{
				((Behaviour)saveFileUISlot_BetterSaves.fileNotCompatibleAlert).enabled = false;
				Object.FindObjectOfType<MenuManager>().filesCompatible[fileToDelete] = true;
			}
		}
		Plugin.InitializeBetterSaves();
	}
}
namespace LCBetterSaves
{
	[BepInPlugin("LCBetterSaves", "LCBetterSaves", "1.4.0")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony = new Harmony("BetterSaves");

		public static int fileToModify = -1;

		public static int newSaveFileNum;

		public static Sprite renameSprite;

		public static MenuManager menuManager;

		public static AudioClip deleteFileSFX;

		public static TextMeshProUGUI deleteFileText;

		public static float buttonBaseY;

		public void Awake()
		{
			_harmony.PatchAll(typeof(Plugin));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LCBetterSaves is loaded!");
		}

		[HarmonyPatch(typeof(MenuManager), "Start")]
		public static void Postfix(MenuManager __instance)
		{
			//IL_0047: 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)
			menuManager = __instance;
			if ((Object)(object)renameSprite == (Object)null)
			{
				AssetBundle val = AssetBundle.LoadFromMemory(Resources.lcbettersaves);
				Texture2D val2 = val.LoadAsset<Texture2D>("Assets/RenameSprite.png");
				renameSprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f));
			}
			InitializeBetterSaves();
		}

		public static void InitializeBetterSaves()
		{
			try
			{
				DestroyBetterSavesButtons();
				DestroyOriginalSaveButtons();
				UpdateTopText();
				CreateModdedDeleteFileButton();
				CreateBetterSaveButtons();
				UpdateFilesPanelRect(CountSaveFiles());
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("An error occurred during initialization: " + ex.Message));
			}
		}

		public static void DestroyBetterSavesButtons()
		{
			try
			{
				SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
				foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array)
				{
					Object.Destroy((Object)(object)((Component)saveFileUISlot_BetterSaves).gameObject);
				}
				NewFileUISlot_BetterSaves[] array2 = Object.FindObjectsOfType<NewFileUISlot_BetterSaves>();
				foreach (NewFileUISlot_BetterSaves newFileUISlot_BetterSaves in array2)
				{
					Object.Destroy((Object)(object)((Component)newFileUISlot_BetterSaves).gameObject);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while destroying better saves buttons: " + ex.Message));
			}
		}

		public static void UpdateTopText()
		{
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/EnterAName");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Panel label not found.");
			}
			else
			{
				((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = "BetterSaves";
			}
		}

		public static void CreateModdedDeleteFileButton()
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			GameObject val = GameObject.Find("Canvas/MenuContainer/DeleteFileConfirmation/Panel/Delete");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Delete file game object not found.");
				return;
			}
			if ((Object)(object)val.GetComponent<DeleteFileButton_BetterSaves>() != (Object)null)
			{
				Debug.LogWarning((object)"DeleteFileButton_BetterSaves component already exists on deleteFileGO");
				return;
			}
			DeleteFileButton component = val.GetComponent<DeleteFileButton>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogError((object)"DeleteFileButton component not found on deleteFileGO");
				return;
			}
			if ((Object)(object)deleteFileSFX == (Object)null)
			{
				deleteFileSFX = component.deleteFileSFX;
			}
			if ((Object)(object)deleteFileText == (Object)null)
			{
				deleteFileText = component.deleteFileText;
			}
			Object.Destroy((Object)(object)component);
			if ((Object)(object)val.GetComponent<DeleteFileButton_BetterSaves>() == (Object)null)
			{
				DeleteFileButton_BetterSaves deleteFileButton_BetterSaves = val.AddComponent<DeleteFileButton_BetterSaves>();
				deleteFileButton_BetterSaves.deleteFileSFX = deleteFileSFX;
				deleteFileButton_BetterSaves.deleteFileText = deleteFileText;
				Button component2 = val.GetComponent<Button>();
				if ((Object)(object)component2 != (Object)null)
				{
					((UnityEventBase)component2.onClick).RemoveAllListeners();
					((UnityEvent)component2.onClick).AddListener(new UnityAction(deleteFileButton_BetterSaves.DeleteFile));
				}
				else
				{
					Debug.LogError((object)"Button component not found on deleteFileGO");
				}
			}
			else
			{
				Debug.LogWarning((object)"DeleteFileButton_BetterSaves component already exists on deleteFileGO");
			}
		}

		public static void CreateBetterSaveButtons()
		{
			try
			{
				GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
				val.SetActive(true);
				int numSaves = CountSaveFiles();
				Debug.Log((object)("Positioning based on " + numSaves + " saves."));
				NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = CreateNewFileNode(numSaves);
				List<string> list = NormalizeFileNames();
				newSaveFileNum = list.Count;
				menuManager.filesCompatible = new bool[16];
				for (int i = 0; i < menuManager.filesCompatible.Length; i++)
				{
					menuManager.filesCompatible[i] = true;
				}
				for (int j = 0; j < list.Count; j++)
				{
					CreateModdedSaveNode(int.Parse(list[j].Replace("LCSaveFile", "")), j, ((Component)newFileUISlot_BetterSaves).gameObject);
				}
				val.SetActive(false);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while refreshing save buttons: " + ex.Message));
			}
		}

		public static NewFileUISlot_BetterSaves CreateNewFileNode(int numSaves)
		{
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Original GameObject not found.");
				return null;
			}
			Transform parent = val.transform.parent;
			SaveFileUISlot component = val.GetComponent<SaveFileUISlot>();
			if ((Object)(object)component != (Object)null)
			{
				Object.Destroy((Object)(object)component);
			}
			GameObject val2 = Object.Instantiate<GameObject>(val, parent);
			((Object)val2).name = "NewFile";
			TMP_Text component2 = ((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.text = "New File";
				NewFileUISlot_BetterSaves newFileUISlot_BetterSaves = val2.AddComponent<NewFileUISlot_BetterSaves>();
				if ((Object)(object)newFileUISlot_BetterSaves == (Object)null)
				{
					Debug.LogError((object)"Failed to add NewFileUISlot_BetterSaves component.");
					return null;
				}
				Transform child = val2.transform.GetChild(3);
				if ((Object)(object)child != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)child).gameObject);
					try
					{
						RectTransform component3 = val2.GetComponent<RectTransform>();
						if (!((Object)(object)component3 != (Object)null))
						{
							Debug.LogError((object)"RectTransform component not found.");
							return null;
						}
						float x = component3.anchoredPosition.x;
						if (buttonBaseY == 0f)
						{
							buttonBaseY = component3.anchoredPosition.y - component3.sizeDelta.y * 1.75f;
						}
						float num = buttonBaseY + component3.sizeDelta.y * (float)numSaves / 2f;
						component3.anchoredPosition = new Vector2(x, num);
					}
					catch (Exception ex)
					{
						Debug.LogError((object)("Error setting anchored position: " + ex.Message));
						return null;
					}
					return newFileUISlot_BetterSaves;
				}
				Debug.LogError((object)"Delete button not found.");
				return null;
			}
			Debug.LogError((object)"Text component not found.");
			return null;
		}

		private static int CountSaveFiles()
		{
			int num = 0;
			string[] files = ES3.GetFiles();
			foreach (string text in files)
			{
				if (ES3.FileExists(text) && text.StartsWith("LCSaveFile"))
				{
					num++;
				}
			}
			return num;
		}

		public static void DestroyOriginalSaveButtons()
		{
			Object.Destroy((Object)(object)GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File2"));
			Object.Destroy((Object)(object)GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File3"));
		}

		public static List<string> NormalizeFileNames()
		{
			List<string> list = new List<string>();
			List<string> list2 = new List<string>();
			string[] files = ES3.GetFiles();
			foreach (string text in files)
			{
				if (ES3.FileExists(text) && text.StartsWith("LCSaveFile"))
				{
					Debug.Log((object)("Found file: " + text));
					list.Add(text);
				}
				if (ES3.FileExists(text) && text.StartsWith("LGU"))
				{
					Debug.Log((object)("Found LGU file: " + text));
					list2.Add(text);
				}
				else if (ES3.FileExists(text) && text.StartsWith("LCSaveFile"))
				{
					list2.Add("placeholder");
				}
			}
			int num = 0;
			foreach (string item in list)
			{
				string text2 = "TempFile" + num;
				ES3.RenameFile(item, text2);
				Debug.Log((object)("Renamed " + item + " to " + text2));
				num++;
			}
			num = 0;
			foreach (string item2 in list2)
			{
				if (item2 == "placeholder")
				{
					num++;
					continue;
				}
				string text3 = "LGUTempFile" + num;
				ES3.RenameFile(item2, text3);
				Debug.Log((object)("Renamed " + item2 + " to " + text3));
				num++;
			}
			int num2 = 0;
			List<string> list3 = new List<string>();
			foreach (string item3 in list)
			{
				string text4 = "TempFile" + num2;
				string text5 = "LCSaveFile" + num2;
				if (ES3.FileExists(text4))
				{
					ES3.RenameFile(text4, text5);
					list3.Add(text5);
					Debug.Log((object)("Renamed " + text4 + " to " + text5));
				}
				else
				{
					Debug.Log((object)("Temporary file " + text4 + " not found. It might have been moved or deleted."));
				}
				num2++;
			}
			num2 = 0;
			List<string> list4 = new List<string>();
			foreach (string item4 in list2)
			{
				string text6 = "LGUTempFile" + num2;
				string text7 = "LGU_" + num2;
				if (item4 == "placeholder")
				{
					num2++;
					continue;
				}
				if (ES3.FileExists(text6))
				{
					ES3.RenameFile(text6, text7);
					list3.Add(text7);
					Debug.Log((object)("Renamed " + text6 + " to " + text7));
				}
				else
				{
					Debug.Log((object)("Temporary file " + text6 + " not found. It might have been moved or deleted."));
				}
				num2++;
			}
			return list3;
		}

		public static void CreateModdedSaveNode(int fileIndex, int listIndex, GameObject newFileButton)
		{
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Expected O, but got Unknown
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			int num = fileIndex + 1;
			GameObject val = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"Original GameObject not found.");
				return;
			}
			Transform parent = val.transform.parent;
			GameObject val2 = Object.Instantiate<GameObject>(val, parent);
			((Object)val2).name = "File" + num + "_BetterSaves";
			string text = ES3.Load<string>("Alias_BetterSaves", "LCSaveFile" + fileIndex, "");
			if (text == "")
			{
				((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>().text = "File " + num;
			}
			else
			{
				((Component)val2.transform.GetChild(1)).GetComponent<TMP_Text>().text = text;
			}
			val2.AddComponent<SaveFileUISlot_BetterSaves>();
			SaveFileUISlot_BetterSaves component = val2.GetComponent<SaveFileUISlot_BetterSaves>();
			if ((Object)(object)component != (Object)null)
			{
				component.fileNum = fileIndex;
				component.fileString = "LCSaveFile" + fileIndex;
				RectTransform component2 = val2.GetComponent<RectTransform>();
				if ((Object)(object)component2 != (Object)null)
				{
					float x = component2.anchoredPosition.x;
					float y = newFileButton.GetComponent<RectTransform>().anchoredPosition.y;
					float num2 = y - component2.sizeDelta.y * (float)num;
					component2.anchoredPosition = new Vector2(x, num2);
				}
				GameObject gameObject = ((Component)val2.transform.GetChild(3)).gameObject;
				DeleteFileButton_BetterSaves component3 = GameObject.Find("Canvas/MenuContainer/DeleteFileConfirmation/Panel/Delete").GetComponent<DeleteFileButton_BetterSaves>();
				((UnityEvent)gameObject.gameObject.GetComponent<Button>().onClick).AddListener(new UnityAction(component3.UpdateFileToDelete));
				gameObject.SetActive(false);
				component.renameButton = CreateRenameFileButton(val2);
			}
			else
			{
				Debug.LogError((object)"SaveFileUISlot_BetterSaves component not found on the cloned GameObject.");
				Object.Destroy((Object)(object)val2);
			}
		}

		public static GameObject CreateRenameFileButton(GameObject fileNode)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject gameObject = ((Component)fileNode.transform.GetChild(3)).gameObject;
				GameObject val = Object.Instantiate<GameObject>(gameObject, fileNode.transform);
				((Object)val).name = "RenameButton";
				val.GetComponent<Image>().sprite = renameSprite;
				Button component = val.GetComponent<Button>();
				component.onClick = new ButtonClickedEvent();
				val.AddComponent<RenameFileButton_BetterSaves>();
				RenameFileButton_BetterSaves component2 = val.GetComponent<RenameFileButton_BetterSaves>();
				if ((Object)(object)component2 != (Object)null)
				{
					((UnityEvent)component.onClick).AddListener(new UnityAction(component2.RenameFile));
				}
				else
				{
					Debug.LogError((object)"RenameFileButton_BetterSaves component not found on renameButton");
				}
				RectTransform component3 = val.GetComponent<RectTransform>();
				if ((Object)(object)component3 != (Object)null)
				{
					float num = ((Transform)component3).localPosition.x + 20f;
					float y = ((Transform)component3).localPosition.y;
					((Transform)component3).localPosition = Vector2.op_Implicit(new Vector2(num, y));
				}
				val.SetActive(false);
				return val;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while creating rename file button: " + ex.Message));
				return null;
			}
		}

		public static void UpdateFilesPanelRect(int numSaves)
		{
			//IL_0033: 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject obj = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel");
				RectTransform val = ((obj != null) ? obj.GetComponent<RectTransform>() : null);
				if ((Object)(object)val == (Object)null)
				{
					throw new Exception("Failed to find FilesPanel RectTransform.");
				}
				Vector2 sizeDelta = val.sizeDelta;
				GameObject obj2 = GameObject.Find("Canvas/MenuContainer/LobbyHostSettings/FilesPanel/File1");
				RectTransform val2 = ((obj2 != null) ? obj2.GetComponent<RectTransform>() : null);
				if ((Object)(object)val2 == (Object)null)
				{
					throw new Exception("Failed to find File1 RectTransform.");
				}
				float y = val2.sizeDelta.y;
				sizeDelta.y = y * (float)(numSaves + 3);
				val.sizeDelta = sizeDelta;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error occurred while updating files panel rect: " + ex.Message));
			}
		}

		public static void RefreshNameFields()
		{
			SaveFileUISlot_BetterSaves[] array = Object.FindObjectsOfType<SaveFileUISlot_BetterSaves>();
			SaveFileUISlot_BetterSaves[] array2 = array;
			foreach (SaveFileUISlot_BetterSaves saveFileUISlot_BetterSaves in array2)
			{
				string text = ES3.Load<string>("Alias_BetterSaves", saveFileUISlot_BetterSaves.fileString, "");
				if (text == "")
				{
					((Component)((Component)saveFileUISlot_BetterSaves).transform.GetChild(1)).GetComponent<TMP_Text>().text = "File " + (saveFileUISlot_BetterSaves.fileNum + 1);
				}
				else
				{
					((Component)((Component)saveFileUISlot_BetterSaves).transform.GetChild(1)).GetComponent<TMP_Text>().text = text;
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LCBetterSaves";

		public const string PLUGIN_NAME = "LCBetterSaves";

		public const string PLUGIN_VERSION = "1.4.0";
	}
}
namespace LCBetterSaves.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	public class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("LCBetterSaves.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		public static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		public static byte[] lcbettersaves
		{
			get
			{
				object @object = ResourceManager.GetObject("lcbettersaves", resourceCulture);
				return (byte[])@object;
			}
		}

		internal Resources()
		{
		}
	}
}

plugins/RaspberryProgramming-NoDeathDespawn/NoDeathDespawn/NoDeathDespawn.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Camerin Figueroa")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © RaspberryProgramming 2023")]
[assembly: AssemblyDescription("Lethal Company Mod to prevent Despawning of items after all players die.")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoDeathDespawn")]
[assembly: AssemblyTitle("NoDeathDespawn")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/RaspberryProgramming/NoDeathDespawn")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoDeathDespawn
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "NoDeathDespawn";

		public const string PLUGIN_NAME = "NoDeathDespawn";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace NoDeathDespawn.NoDeathDespawn
{
	[BepInPlugin("com.github.raspberryprogramming.NoDeathDespawn", "NoDeathDespawn", "1.0")]
	internal class NoDeathDespawn : BaseUnityPlugin
	{
		public const string GUID = "com.github.raspberryprogramming.NoDeathDespawn";

		public const string NAME = "NoDeathDespawn";

		public const string VERSION = "1.0";

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogMessage((object)"Starting NoDeathDespawn Patching");
			new Harmony("com.github.raspberryprogramming.NoDeathDespawn").PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace NoDeathDespawn.NoDeathDespawn.Patches
{
	[HarmonyPatch(typeof(RoundManager), "DespawnPropsAtEndOfRound")]
	internal class RoundManagerPatcher
	{
		public static void Prefix(bool despawnAllItems)
		{
			Singleton.Instance.allPlayersDead = StartOfRound.Instance.allPlayersDead;
			StartOfRound.Instance.allPlayersDead = false;
		}

		private static void Postfix(bool despawnAllItems)
		{
			StartOfRound.Instance.allPlayersDead = Singleton.Instance.allPlayersDead;
		}
	}
	public sealed class Singleton
	{
		public bool allPlayersDead;

		private static readonly Lazy<Singleton> lazy = new Lazy<Singleton>(() => new Singleton());

		public static Singleton Instance => lazy.Value;

		private Singleton()
		{
		}
	}
}

plugins/RickArg-Helmet_Cameras/HelmetCamera.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HelmetCamera")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HelmetCamera")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b99c4d46-5f13-47b3-a5af-5e3f37772e77")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HelmetCamera
{
	[BepInPlugin("RickArg.lethalcompany.helmetcameras", "Helmet_Cameras", "2.1.5")]
	public class PluginInit : BaseUnityPlugin
	{
		public static Harmony _harmony;

		public static ConfigEntry<int> config_isHighQuality;

		public static ConfigEntry<int> config_renderDistance;

		public static ConfigEntry<int> config_cameraFps;

		private void Awake()
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			config_isHighQuality = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "monitorResolution", 0, "Low FPS affection. High Quality mode. 0 - vanilla (48x48), 1 - vanilla+ (128x128), 2 - mid quality (256x256), 3 - high quality (512x512), 4 - Very High Quality (1024x1024)");
			config_renderDistance = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "renderDistance", 20, "Low FPS affection. Render distance for helmet camera.");
			config_cameraFps = ((BaseUnityPlugin)this).Config.Bind<int>("MONITOR QUALITY", "cameraFps", 30, "Very high FPS affection. FPS for helmet camera. To increase YOUR fps, you should low cameraFps value.");
			_harmony = new Harmony("HelmetCamera");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Helmet_Cameras is loaded with version 2.1.5!");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"--------Helmet camera patch done.---------");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "RickArg.lethalcompany.helmetcameras";

		public const string PLUGIN_NAME = "Helmet_Cameras";

		public const string PLUGIN_VERSION = "2.1.5";
	}
	public class Plugin : MonoBehaviour
	{
		private RenderTexture renderTexture;

		private bool isMonitorChanged = false;

		private GameObject helmetCameraNew;

		private bool isSceneLoaded = false;

		private bool isCoroutineStarted = false;

		private int currentTransformIndex;

		private int resolution = 0;

		private int renderDistance = 50;

		private float cameraFps = 30f;

		private float elapsed;

		private void Awake()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			resolution = PluginInit.config_isHighQuality.Value;
			renderDistance = PluginInit.config_renderDistance.Value;
			cameraFps = PluginInit.config_cameraFps.Value;
			switch (resolution)
			{
			case 0:
				renderTexture = new RenderTexture(48, 48, 24);
				break;
			case 1:
				renderTexture = new RenderTexture(128, 128, 24);
				break;
			case 2:
				renderTexture = new RenderTexture(256, 256, 24);
				break;
			case 3:
				renderTexture = new RenderTexture(512, 512, 24);
				break;
			case 4:
				renderTexture = new RenderTexture(1024, 1024, 24);
				break;
			}
		}

		public void Start()
		{
			//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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_005e: 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)
			isCoroutineStarted = false;
			while ((Object)(object)helmetCameraNew == (Object)null)
			{
				helmetCameraNew = new GameObject("HelmetCamera");
			}
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name != "MainMenu")
			{
				activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name != "InitScene")
				{
					activeScene = SceneManager.GetActiveScene();
					if (((Scene)(ref activeScene)).name != "InitSceneLaunchOptions")
					{
						isSceneLoaded = true;
						Debug.Log((object)"[HELMET_CAMERAS] Starting coroutine...");
						((MonoBehaviour)this).StartCoroutine(LoadSceneEnter());
						return;
					}
				}
			}
			isSceneLoaded = false;
			isMonitorChanged = false;
		}

		private IEnumerator LoadSceneEnter()
		{
			Debug.Log((object)"[HELMET_CAMERAS] 5 seconds for init mode... Please wait...");
			yield return (object)new WaitForSeconds(5f);
			isCoroutineStarted = true;
			if ((Object)(object)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera") != (Object)null)
			{
				Debug.Log((object)"[HELMET_CAMERAS] Ship camera founded...");
				if (!isMonitorChanged)
				{
					((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube").GetComponent<MeshRenderer>()).materials[2].mainTexture = ((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture;
					((Renderer)GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001").GetComponent<MeshRenderer>()).materials[2].mainTexture = (Texture)(object)renderTexture;
					helmetCameraNew.AddComponent<Camera>();
					((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false;
					helmetCameraNew.GetComponent<Camera>().targetTexture = renderTexture;
					helmetCameraNew.GetComponent<Camera>().cullingMask = 20649983;
					helmetCameraNew.GetComponent<Camera>().farClipPlane = renderDistance;
					helmetCameraNew.GetComponent<Camera>().nearClipPlane = 0.55f;
					isMonitorChanged = true;
					Debug.Log((object)"[HELMET_CAMERAS] Monitors were changed...");
					Debug.Log((object)"[HELMET_CAMERAS] Turning off vanilla internal ship camera");
					((Behaviour)GameObject.Find("Environment/HangarShip/Cameras/ShipCamera").GetComponent<Camera>()).enabled = false;
				}
			}
		}

		public void Update()
		{
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			bool flag = isSceneLoaded && isCoroutineStarted;
			if (flag && StartOfRound.Instance.localPlayerController.isInHangarShipRoom)
			{
				helmetCameraNew.SetActive(true);
				elapsed += Time.deltaTime;
				if (elapsed > 1f / cameraFps)
				{
					elapsed = 0f;
					((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = true;
				}
				else
				{
					((Behaviour)helmetCameraNew.GetComponent<Camera>()).enabled = false;
				}
				GameObject val = GameObject.Find("Environment/HangarShip/ShipModels2b/MonitorWall/Cube.001/CameraMonitorScript");
				currentTransformIndex = val.GetComponent<ManualCameraRenderer>().targetTransformIndex;
				TransformAndName val2 = val.GetComponent<ManualCameraRenderer>().radarTargets[currentTransformIndex];
				if (!val2.isNonPlayer)
				{
					try
					{
						helmetCameraNew.transform.SetPositionAndRotation(val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").position + new Vector3(0f, 0f, 0f), val2.transform.Find("ScavengerModel/metarig/CameraContainer/MainCamera/HelmetLights").rotation * Quaternion.Euler(0f, 0f, 0f));
						DeadBodyInfo[] array = Object.FindObjectsOfType<DeadBodyInfo>();
						for (int i = 0; i < array.Length; i++)
						{
							if (array[i].playerScript.playerUsername == val2.name)
							{
								helmetCameraNew.transform.SetPositionAndRotation(((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").position, ((Component)array[i]).gameObject.transform.Find("spine.001/spine.002/spine.003").rotation * Quaternion.Euler(0f, 0f, 0f));
							}
						}
						return;
					}
					catch (NullReferenceException)
					{
						Debug.Log((object)"[HELMET_CAMERAS] ERROR NULL REFERENCE");
						return;
					}
				}
				helmetCameraNew.transform.SetPositionAndRotation(val2.transform.position + new Vector3(0f, 1.6f, 0f), val2.transform.rotation * Quaternion.Euler(0f, -90f, 0f));
			}
			else if (flag && !StartOfRound.Instance.localPlayerController.isInHangarShipRoom)
			{
				helmetCameraNew.SetActive(false);
			}
		}
	}
}
namespace HelmetCamera.Patches
{
	[HarmonyPatch]
	internal class HelmetCamera
	{
		public static void InitCameras()
		{
			GameObject val = GameObject.Find("Environment/HangarShip/Cameras/ShipCamera");
			val.AddComponent<Plugin>();
		}

		[HarmonyPatch(typeof(StartOfRound), "Start")]
		[HarmonyPostfix]
		public static void InitCamera(ref ManualCameraRenderer __instance)
		{
			InitCameras();
		}
	}
}

plugins/Rozebud-FOV_Adjust/FovAdjust.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FovAdjust")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FovAdjust")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dfb6681a-9f25-4737-a7fe-10b3c23f65b3")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FovAdjust;

[BepInPlugin("Rozebud.FovAdjust", "FOV Adjust", "1.1.1")]
public class FovAdjustBase : BaseUnityPlugin
{
	private const string modGUID = "Rozebud.FovAdjust";

	private const string modName = "FOV Adjust";

	private const string modVer = "1.1.1";

	private readonly Harmony harmony = new Harmony("Rozebud.FovAdjust");

	private static FovAdjustBase Instance;

	public static ManualLogSource log;

	public static ConfigEntry<float> configFov;

	public static ConfigEntry<bool> configHideVisor;

	public static bool inDebugMode;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		log = Logger.CreateLogSource("Rozebud.FovAdjust");
		log.LogInfo((object)"Starting.");
		configFov = ((BaseUnityPlugin)this).Config.Bind<float>("General", "fov", 66f, "Change the field of view of the camera. Clamped from 66 to 130 for my sanity. Also keep in mind that this is vertical FOV.");
		configHideVisor = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "hideVisor", false, "Changes whether the first person visor is visible.");
		PlayerControllerBPatches.newTargetFovBase = Mathf.Clamp(configFov.Value, 66f, 130f);
		PlayerControllerBPatches.hideVisor = configHideVisor.Value;
		log.LogInfo((object)"Configs DONE!");
		PlayerControllerBPatches.calculateVisorStuff();
		harmony.PatchAll(typeof(PlayerControllerBPatches));
		harmony.PatchAll(typeof(HUDManagerPatches));
		log.LogInfo((object)"All FOV Adjust patches have loaded successfully.");
	}
}
public class PlayerControllerBPatches
{
	public static float newTargetFovBase = 66f;

	private static float prefixCamFov = 0f;

	public static bool hideVisor = false;

	private static Vector3 visorScale;

	public static Vector3 visorScaleBottom = new Vector3(0.68f, 0.8f, 0.95f);

	public static Vector3 visorScaleTop = new Vector3(0.68f, 0.35f, 0.99f);

	public static float linToSinLerp = 0.6f;

	public static float visorScaleTopRefFOV = 130f;

	[HarmonyPatch(typeof(PlayerControllerB), "Awake")]
	[HarmonyPostfix]
	private static void Awake_Postfix(PlayerControllerB __instance)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		if (!filterPlayerControllers(__instance))
		{
			__instance.localVisor.localScale = visorScale;
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyPrefix]
	private static void Update_Prefix(PlayerControllerB __instance)
	{
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: 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_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		if (filterPlayerControllers(__instance))
		{
			return;
		}
		prefixCamFov = __instance.gameplayCamera.fieldOfView;
		if (FovAdjustBase.inDebugMode)
		{
			if (((ButtonControl)Keyboard.current.minusKey).wasPressedThisFrame)
			{
				visorScale.x -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.equalsKey).wasPressedThisFrame)
			{
				visorScale.x += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			if (((ButtonControl)Keyboard.current.leftBracketKey).wasPressedThisFrame)
			{
				visorScale.y -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.rightBracketKey).wasPressedThisFrame)
			{
				visorScale.y += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			if (((ButtonControl)Keyboard.current.semicolonKey).wasPressedThisFrame)
			{
				visorScale.z -= 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
			else if (((ButtonControl)Keyboard.current.quoteKey).wasPressedThisFrame)
			{
				visorScale.z += 0.00049999997f;
				FovAdjustBase.log.LogMessage((object)visorScale);
			}
		}
		if (__instance.localVisor.localScale != visorScale)
		{
			__instance.localVisor.localScale = visorScale;
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "Update")]
	[HarmonyPostfix]
	private static void Update_Postfix(PlayerControllerB __instance)
	{
		if (!filterPlayerControllers(__instance))
		{
			float num = newTargetFovBase;
			if (__instance.inTerminalMenu)
			{
				num = 60f;
			}
			else if (__instance.IsInspectingItem)
			{
				num = 46f;
			}
			else if (__instance.isSprinting)
			{
				num *= 1.03f;
			}
			__instance.gameplayCamera.fieldOfView = Mathf.Lerp(prefixCamFov, num, 6f * Time.deltaTime);
		}
	}

	[HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")]
	[HarmonyPostfix]
	private static void LateUpdate_Postfix(PlayerControllerB __instance)
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: 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_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)
		if (!filterPlayerControllers(__instance) && (newTargetFovBase > 66f || FovAdjustBase.inDebugMode))
		{
			__instance.localVisor.position = __instance.localVisor.position + __instance.localVisor.rotation * new Vector3(0f, 0f, -0.06f);
		}
	}

	private static float easeOutSine(float x)
	{
		return Mathf.Sin(x * (float)Math.PI / 2f);
	}

	public static void calculateVisorStuff()
	{
		//IL_001a: 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)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: 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_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)
		if (hideVisor)
		{
			visorScale = new Vector3(0f, 0f, 0f);
		}
		else if (newTargetFovBase > 66f || FovAdjustBase.inDebugMode)
		{
			float num = (newTargetFovBase - 66f) / (visorScaleTopRefFOV - 66f);
			num = Mathf.Lerp(num, easeOutSine(num), linToSinLerp);
			visorScale = Vector3.LerpUnclamped(visorScaleBottom, visorScaleTop, num);
		}
		else
		{
			visorScale = new Vector3(0.36f, 0.49f, 0.49f);
		}
	}

	private static bool filterPlayerControllers(PlayerControllerB player)
	{
		return !((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || (((NetworkBehaviour)player).IsServer && !player.isHostPlayerObject && !player.isTestingPlayer);
	}
}
public class HUDManagerPatches
{
	[HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")]
	[HarmonyPrefix]
	public static bool SubmitChat_performed_Prefix(HUDManager __instance)
	{
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		string text = __instance.chatTextField.text;
		if (text.StartsWith("/fov"))
		{
			string[] array = text.Split(new char[1] { ' ' });
			if (array.Length > 1 && float.TryParse(array[1], out var result))
			{
				result = Mathf.Clamp(result, 66f, 130f);
				PlayerControllerBPatches.newTargetFovBase = result;
				if (!FovAdjustBase.inDebugMode)
				{
					PlayerControllerBPatches.calculateVisorStuff();
				}
			}
		}
		else if (text.StartsWith("/toggleVisor"))
		{
			PlayerControllerBPatches.hideVisor = !PlayerControllerBPatches.hideVisor;
			PlayerControllerBPatches.calculateVisorStuff();
		}
		else if (text.StartsWith("/recalcVisor") && FovAdjustBase.inDebugMode)
		{
			PlayerControllerBPatches.calculateVisorStuff();
		}
		else if (text.StartsWith("/setScaleBottom") && FovAdjustBase.inDebugMode)
		{
			string[] array2 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleBottom = new Vector3(float.Parse(array2[1]), float.Parse(array2[2]), float.Parse(array2[3]));
		}
		else if (text.StartsWith("/setScaleTop") && FovAdjustBase.inDebugMode)
		{
			string[] array3 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleTop = new Vector3(float.Parse(array3[1]), float.Parse(array3[2]), float.Parse(array3[3]));
		}
		else if (text.StartsWith("/setSinAmount") && FovAdjustBase.inDebugMode)
		{
			string[] array4 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.linToSinLerp = float.Parse(array4[1]);
		}
		else if (text.StartsWith("/setTopRef") && FovAdjustBase.inDebugMode)
		{
			string[] array5 = text.Split(new char[1] { ' ' });
			PlayerControllerBPatches.visorScaleTopRefFOV = float.Parse(array5[1]);
		}
		else
		{
			if (!text.StartsWith("/gimmeMyValues") || !FovAdjustBase.inDebugMode)
			{
				return true;
			}
			ManualLogSource log = FovAdjustBase.log;
			Vector3 val = PlayerControllerBPatches.visorScaleBottom;
			log.LogMessage((object)("visorScaleBottom: " + ((object)(Vector3)(ref val)).ToString()));
			ManualLogSource log2 = FovAdjustBase.log;
			val = PlayerControllerBPatches.visorScaleTop;
			log2.LogMessage((object)("visorScaleTop: " + ((object)(Vector3)(ref val)).ToString()));
			FovAdjustBase.log.LogMessage((object)("linToSinLerp: " + PlayerControllerBPatches.linToSinLerp));
			FovAdjustBase.log.LogMessage((object)("visorScaleTopRefFOV: " + PlayerControllerBPatches.visorScaleTopRefFOV));
		}
		__instance.localPlayer = GameNetworkManager.Instance.localPlayerController;
		__instance.localPlayer.isTypingChat = false;
		__instance.chatTextField.text = "";
		EventSystem.current.SetSelectedGameObject((GameObject)null);
		((Behaviour)__instance.typingIndicator).enabled = false;
		return false;
	}
}

plugins/Sligili-HDLethalCompany/HDLethalCompany.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HDLethalCompany.Patch;
using HDLethalCompany.Tools;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("HDLethalCompanyRemake")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HDLethalCompanyRemake")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7f379bc1-1fd4-4c72-9247-a181862eec6b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HDLethalCompany
{
	[BepInPlugin("HDLethalCompany", "HDLethalCompany-Sligili", "1.5.5")]
	public class HDLethalCompanyInitialization : BaseUnityPlugin
	{
		private static ConfigEntry<float> config_ResMult;

		private static ConfigEntry<bool> config_EnablePostProcessing;

		private static ConfigEntry<bool> config_EnableFog;

		private static ConfigEntry<bool> config_EnableAntialiasing;

		private static ConfigEntry<bool> config_EnableResolution;

		private static ConfigEntry<bool> config_EnableFoliage;

		private static ConfigEntry<int> config_FogQuality;

		private static ConfigEntry<int> config_TextureQuality;

		private static ConfigEntry<int> config_LOD;

		private static ConfigEntry<int> config_ShadowmapQuality;

		private Harmony _harmony;

		private void Awake()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"HDLethalCompany loaded");
			ConfigFile();
			GraphicsPatch.assetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "HDLethalCompany/hdlethalcompany"));
			_harmony = new Harmony("HDLethalCompany");
			_harmony.PatchAll(typeof(GraphicsPatch));
		}

		private void ConfigFile()
		{
			config_ResMult = ((BaseUnityPlugin)this).Config.Bind<float>("RESOLUTION", "Value", 2.233f, "Resolution Scale Multiplier - <EXAMPLES -> | 1.000 = 860x520p | 2.233 =~ 1920x1080p | 2.977 = 2560x1440p | 4.465 = 3840x2060p > - The UI scanned elements have slightly incorrect offsets after 3.000");
			config_EnableResolution = ((BaseUnityPlugin)this).Config.Bind<bool>("RESOLUTION", "EnableRes", true, "Resolution Fix - In case you wanna use another resolution mod or apply any widescreen mod while keeping the graphics settings");
			config_EnableAntialiasing = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableAA", false, "Anti-Aliasing (Unity's SMAA)");
			config_EnablePostProcessing = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnablePP", true, "Post-Processing (Color grading)");
			config_TextureQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "TextureQuality", 3, "Texture Resolution Quality - <PRESETS -> | 0 = VERY LOW (1/8) | 1 = LOW (1/4) | 2 = MEDIUM (1/2) | 3 = HIGH (1/1 VANILLA) >");
			config_FogQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "FogQuality", 1, "Volumetric Fog Quality - <PRESETS -> | 0 = VERY LOW | 1 = VANILLA FOG | 2 = MEDIUM | 3 = HIGH >");
			config_EnableFog = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableFOG", true, "Volumetric Fog Toggle - Use this as a last resource in case lowering the fog quality is not enough to get decent performance");
			config_LOD = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "LOD", 1, "Level Of Detail - <PRESETS -> | 0 = LOW (HALF DISTANCE) | 1 = VANILLA | 2 = HIGH (TWICE THE DISTANCE) >");
			config_ShadowmapQuality = ((BaseUnityPlugin)this).Config.Bind<int>("EFFECTS", "ShadowQuality", 3, "Shadows Resolution - <PRESETS -> 0 = VERY LOW (SHADOWS DISABLED)| 1 = LOW (256) | 2 = MEDIUM (1024) | 3 = VANILLA (2048) > - Shadowmap max resolution");
			config_EnableFoliage = ((BaseUnityPlugin)this).Config.Bind<bool>("EFFECTS", "EnableF", true, "Foliage Toggle - If the game camera should or not render bushes/grass (trees won't be affected)");
			GraphicsPatch.m_enableFoliage = config_EnableFoliage.Value;
			GraphicsPatch.m_enableResolutionFix = config_EnableResolution.Value;
			GraphicsPatch.m_setShadowQuality = config_ShadowmapQuality.Value;
			GraphicsPatch.m_setLOD = config_LOD.Value;
			GraphicsPatch.m_setTextureResolution = config_TextureQuality.Value;
			GraphicsPatch.m_setFogQuality = config_FogQuality.Value;
			GraphicsPatch.multiplier = config_ResMult.Value;
			GraphicsPatch.anchorOffsetZ = 0.123f * config_ResMult.Value + 0.877f;
			GraphicsPatch.m_widthResolution = 860f * config_ResMult.Value;
			GraphicsPatch.m_heightResolution = 520f * config_ResMult.Value;
			GraphicsPatch.m_enableAntiAliasing = config_EnableAntialiasing.Value;
			GraphicsPatch.m_enableFog = config_EnableFog.Value;
			GraphicsPatch.m_enablePostProcessing = config_EnablePostProcessing.Value;
		}
	}
	public static class PluginInfo
	{
		public const string Guid = "HDLethalCompany";

		public const string Name = "HDLethalCompany-Sligili";

		public const string Ver = "1.5.5";
	}
}
namespace HDLethalCompany.Tools
{
	public class Reflection
	{
		public static object GetInstanceField(Type type, object instance, string fieldName)
		{
			BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
			FieldInfo field = type.GetField(fieldName, bindingAttr);
			return field.GetValue(instance);
		}

		public static object CallMethod(object instance, string methodName, params object[] args)
		{
			MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
			if (method != null)
			{
				return method.Invoke(instance, args);
			}
			return null;
		}
	}
}
namespace HDLethalCompany.Patch
{
	internal class GraphicsPatch
	{
		public static bool m_enablePostProcessing;

		public static bool m_enableFog;

		public static bool m_enableAntiAliasing;

		public static bool m_enableResolutionFix;

		public static bool m_enableFoliage = true;

		public static int m_setFogQuality;

		public static int m_setTextureResolution;

		public static int m_setLOD;

		public static int m_setShadowQuality;

		private static HDRenderPipelineAsset myAsset;

		public static AssetBundle assetBundle;

		public static float anchorOffsetX = 439.48f;

		public static float anchorOffsetY = 244.8f;

		public static float anchorOffsetZ;

		public static float multiplier;

		public static float m_widthResolution;

		public static float m_heightResolution;

		[HarmonyPatch(typeof(PlayerControllerB), "Start")]
		[HarmonyPrefix]
		private static void StartPrefix(PlayerControllerB __instance)
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(HDAdditionalCameraData));
			foreach (Object obj in array)
			{
				HDAdditionalCameraData val = (HDAdditionalCameraData)(object)((obj is HDAdditionalCameraData) ? obj : null);
				if (!(((Object)((Component)val).gameObject).name == "MapCamera"))
				{
					val.customRenderingSettings = true;
					ToggleCustomPass(val, m_enablePostProcessing);
					SetLevelOfDetail(val);
					ToggleVolumetricFog(val, m_enableFog);
					if (!m_enableFoliage)
					{
						LayerMask val2 = LayerMask.op_Implicit(((Component)val).GetComponent<Camera>().cullingMask);
						val2 = LayerMask.op_Implicit(LayerMask.op_Implicit(val2) & -1025);
						((Component)val).GetComponent<Camera>().cullingMask = LayerMask.op_Implicit(val2);
					}
					SetShadowQuality(assetBundle, val);
					if (!(((Object)((Component)val).gameObject).name == "SecurityCamera") && !(((Object)((Component)val).gameObject).name == "ShipCamera"))
					{
						SetAntiAliasing(val);
					}
				}
			}
			array = null;
			SetTextureQuality();
			SetFogQuality();
			if (m_enableResolutionFix && multiplier != 1f)
			{
				int width = (int)Math.Round(m_widthResolution, 0);
				int height = (int)Math.Round(m_heightResolution, 0);
				((Texture)__instance.gameplayCamera.targetTexture).width = width;
				((Texture)__instance.gameplayCamera.targetTexture).height = height;
			}
		}

		[HarmonyPatch(typeof(RoundManager), "GenerateNewFloor")]
		[HarmonyPrefix]
		private static void RoundPostFix()
		{
			SetFogQuality();
			if (m_setLOD == 0)
			{
				RemoveLodFromGameObject("CatwalkStairs");
			}
		}

		[HarmonyPatch(typeof(HUDManager), "UpdateScanNodes")]
		[HarmonyPostfix]
		private static void UpdateScanNodesPostfix(PlayerControllerB playerScript, HUDManager __instance)
		{
			//IL_003c: 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_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			if (anchorOffsetZ > 1.238f)
			{
				anchorOffsetZ = 1.238f;
			}
			if (!m_enableResolutionFix || multiplier == 1f)
			{
				return;
			}
			Vector3 zero = Vector3.zero;
			bool flag = false;
			for (int i = 0; i < __instance.scanElements.Length; i++)
			{
				if ((Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).Count > 0 && (Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).TryGetValue(__instance.scanElements[i], out var value) && (Object)(object)value != (Object)null)
				{
					try
					{
						if ((bool)Reflection.CallMethod(__instance, "NodeIsNotVisible", value, i))
						{
							continue;
						}
						if (!((Component)__instance.scanElements[i]).gameObject.activeSelf)
						{
							((Component)__instance.scanElements[i]).gameObject.SetActive(true);
							((Component)__instance.scanElements[i]).GetComponent<Animator>().SetInteger("colorNumber", value.nodeType);
							if (value.creatureScanID != -1)
							{
								Traverse.Create((object)__instance).Method("AttemptScanNewCreature", new object[1] { value.creatureScanID });
							}
						}
						goto IL_0186;
					}
					catch (Exception arg)
					{
						Debug.LogError((object)$"Error in updatescanNodes A: {arg}");
						goto IL_0186;
					}
				}
				(Traverse.Create((object)__instance).Field("scanNodes").GetValue() as Dictionary<RectTransform, ScanNodeProperties>).Remove(__instance.scanElements[i]);
				((Component)__instance.scanElements[i]).gameObject.SetActive(false);
				continue;
				IL_0186:
				try
				{
					Traverse.Create((object)__instance).Field("scanElementText").SetValue((object)((Component)__instance.scanElements[i]).gameObject.GetComponentsInChildren<TextMeshProUGUI>());
					if ((Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[]).Length > 1)
					{
						((TMP_Text)(Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[])[0]).text = value.headerText;
						((TMP_Text)(Traverse.Create((object)__instance).Field("scanElementText").GetValue() as TextMeshProUGUI[])[1]).text = value.subText;
					}
					if (value.nodeType == 2)
					{
						flag = true;
					}
					zero = playerScript.gameplayCamera.WorldToScreenPoint(((Component)value).transform.position);
					((Transform)__instance.scanElements[i]).position = new Vector3(((Transform)__instance.scanElements[i]).position.x, ((Transform)__instance.scanElements[i]).position.y, 12.17f * anchorOffsetZ);
					__instance.scanElements[i].anchoredPosition = Vector2.op_Implicit(new Vector3(zero.x - anchorOffsetX * multiplier, zero.y - anchorOffsetY * multiplier));
					if (!(multiplier > 3f))
					{
						((Transform)__instance.scanElements[i]).localScale = new Vector3(multiplier, multiplier, multiplier);
					}
					else
					{
						((Transform)__instance.scanElements[i]).localScale = new Vector3(3f, 3f, 3f);
					}
				}
				catch (Exception arg2)
				{
					Debug.LogError((object)$"Error in updatescannodes B: {arg2}");
				}
			}
			try
			{
				if (!flag)
				{
					__instance.totalScrapScanned = 0;
					Traverse.Create((object)__instance).Field("totalScrapScannedDisplayNum").SetValue((object)0);
					Traverse.Create((object)__instance).Field("addToDisplayTotalInterval").SetValue((object)0.35f);
				}
				__instance.scanInfoAnimator.SetBool("display", (int)Reflection.GetInstanceField(typeof(HUDManager), __instance, "scannedScrapNum") >= 2 && flag);
			}
			catch (Exception arg3)
			{
				Debug.LogError((object)$"Error in updatescannodes C: {arg3}");
			}
		}

		public static void SetShadowQuality(AssetBundle assetBundle, HDAdditionalCameraData cameraData)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)assetBundle == (Object)null)
			{
				Debug.LogError((object)"HDLETHALCOMPANY: Something is wrong with the Asset Bundle - Null");
				return;
			}
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[20u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)20, (m_setShadowQuality != 0) ? true : false);
			myAsset = (HDRenderPipelineAsset)((m_setShadowQuality != 1) ? ((m_setShadowQuality != 2) ? ((object)(HDRenderPipelineAsset)QualitySettings.renderPipeline) : ((object)(myAsset = assetBundle.LoadAsset<HDRenderPipelineAsset>("Assets/HDLethalCompany/MediumShadowsAsset.asset")))) : (myAsset = assetBundle.LoadAsset<HDRenderPipelineAsset>("Assets/HDLethalCompany/VeryLowShadowsAsset.asset")));
			QualitySettings.renderPipeline = (RenderPipelineAsset)(object)myAsset;
		}

		public static void SetLevelOfDetail(HDAdditionalCameraData cameraData)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			if (m_setLOD != 1)
			{
				((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[60u] = true;
				((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[61u] = true;
				((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)60, true);
				((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)61, true);
				cameraData.renderingPathCustomFrameSettings.lodBiasMode = (LODBiasMode)2;
				cameraData.renderingPathCustomFrameSettings.lodBias = ((m_setLOD == 0) ? 0.6f : 2.3f);
				if (m_setLOD == 0 && ((Component)cameraData).GetComponent<Camera>().farClipPlane > 180f)
				{
					((Component)cameraData).GetComponent<Camera>().farClipPlane = 170f;
				}
			}
		}

		public static void SetTextureQuality()
		{
			if (m_setTextureResolution < 3)
			{
				int globalTextureMipmapLimit = 3 - m_setTextureResolution;
				QualitySettings.globalTextureMipmapLimit = globalTextureMipmapLimit;
			}
		}

		public static void SetAntiAliasing(HDAdditionalCameraData cameraData)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (m_enableAntiAliasing)
			{
				cameraData.antialiasing = (AntialiasingMode)3;
			}
		}

		public static void ToggleCustomPass(HDAdditionalCameraData cameraData, bool enable)
		{
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[6u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)6, enable);
		}

		public static void ToggleVolumetricFog(HDAdditionalCameraData cameraData, bool enable)
		{
			((BitArray128)(ref cameraData.renderingPathCustomFrameSettingsOverrideMask.mask))[28u] = true;
			((FrameSettings)(ref cameraData.renderingPathCustomFrameSettings)).SetEnabled((FrameSettingsField)28, enable);
		}

		public static void SetFogQuality()
		{
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(Volume));
			if (array.Length == 0)
			{
				Debug.LogError((object)"No volumes found");
				return;
			}
			Fog val2 = default(Fog);
			foreach (Object obj in array)
			{
				Volume val = (Volume)(object)((obj is Volume) ? obj : null);
				if (!val.sharedProfile.TryGet<Fog>(ref val2))
				{
					continue;
				}
				((VolumeParameter<int>)(object)((VolumeComponentWithQuality)val2).quality).Override(3);
				switch (m_setFogQuality)
				{
				case -1:
					if (val2.volumetricFogBudget > 0.05f)
					{
						val2.volumetricFogBudget = 0.05f;
					}
					if (val2.resolutionDepthRatio > 0.5f)
					{
						val2.resolutionDepthRatio = 0.5f;
					}
					break;
				case 0:
					if (val2.volumetricFogBudget > 0.05f)
					{
						val2.volumetricFogBudget = 0.05f;
					}
					if (val2.resolutionDepthRatio > 0.5f)
					{
						val2.resolutionDepthRatio = 0.5f;
					}
					break;
				case 2:
					if (val2.volumetricFogBudget > 0.333f)
					{
						val2.volumetricFogBudget = 0.333f;
					}
					if (val2.resolutionDepthRatio > 0.666f)
					{
						val2.resolutionDepthRatio = 0.666f;
					}
					break;
				case 3:
					if (val2.volumetricFogBudget > 0.666f)
					{
						val2.volumetricFogBudget = 0.666f;
					}
					if (val2.resolutionDepthRatio > 0.5f)
					{
						val2.resolutionDepthRatio = 0.5f;
					}
					break;
				}
			}
		}

		public static void RemoveLodFromGameObject(string name)
		{
			Object[] array = Resources.FindObjectsOfTypeAll(typeof(LODGroup));
			foreach (Object obj in array)
			{
				LODGroup val = (LODGroup)(object)((obj is LODGroup) ? obj : null);
				if (((Object)((Component)val).gameObject).name == name)
				{
					val.enabled = false;
				}
			}
		}
	}
}

plugins/Sligili-More_Emotes/MoreEmotes1.2.0.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using MoreEmotes.Patch;
using Tools;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FuckYouMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FuckYouMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5ecc2bf2-af12-4e83-a6f1-cf2eacbf3060")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Tools
{
	public class Reflection
	{
		public static object GetInstanceField(Type type, object instance, string fieldName)
		{
			BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
			FieldInfo field = type.GetField(fieldName, bindingAttr);
			return field.GetValue(instance);
		}

		public static object CallMethod(object instance, string methodName, params object[] args)
		{
			MethodInfo method = instance.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
			if (method != null)
			{
				return method.Invoke(instance, args);
			}
			return null;
		}
	}
}
namespace MoreEmotes
{
	[BepInPlugin("MoreEmotes", "MoreEmotes-Sligili", "1.2.0")]
	public class FuckYouModInitialization : BaseUnityPlugin
	{
		private Harmony _harmony;

		private ConfigEntry<string> config_KeyWheel;

		private ConfigEntry<bool> config_InventoryCheck;

		private ConfigEntry<string> config_KeyEmote3;

		private ConfigEntry<string> config_KeyEmote4;

		private ConfigEntry<string> config_KeyEmote5;

		private ConfigEntry<string> config_KeyEmote6;

		private ConfigEntry<string> config_KeyEmote7;

		private ConfigEntry<string> config_KeyEmote8;

		private ConfigEntry<bool> config_toggleEmote3;

		private ConfigEntry<bool> config_toggleEmote4;

		private ConfigEntry<bool> config_toggleEmote5;

		private ConfigEntry<bool> config_toggleEmote6;

		private ConfigEntry<bool> config_toggleEmote7;

		private ConfigEntry<bool> config_toggleEmote8;

		private void Awake()
		{
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreEmotes loaded");
			EmotePatch.animationsBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animationsbundle"));
			EmotePatch.animatorBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MoreEmotes/animatorbundle"));
			EmotePatch.local = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarig.controller");
			EmotePatch.others = EmotePatch.animatorBundle.LoadAsset<RuntimeAnimatorController>("Assets/MoreEmotes/NEWmetarigOtherPlayers.controller");
			CustomAudioAnimationEvent.claps[0] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote1.wav");
			CustomAudioAnimationEvent.claps[1] = EmotePatch.animationsBundle.LoadAsset<AudioClip>("Assets/MoreEmotes/SingleClapEmote2.wav");
			ConfigFile();
			IncompatibilityAids();
			_harmony = new Harmony("MoreEmotes");
			_harmony.PatchAll(typeof(EmotePatch));
		}

		private void IncompatibilityAids()
		{
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				BepInPlugin metadata = pluginInfo.Value.Metadata;
				if (metadata.GUID.Equals("com.malco.lethalcompany.moreshipupgrades") || metadata.GUID.Equals("Stoneman.LethalProgression"))
				{
					EmotePatch.IncompatibleStuff = true;
					break;
				}
			}
		}

		private void ConfigFile()
		{
			EmotePatch.keybinds = new string[8];
			config_KeyWheel = ((BaseUnityPlugin)this).Config.Bind<string>("EMOTE WHEEL", "Key", "v", "SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			EmotePatch.wheelKeybind = config_KeyWheel.Value;
			config_InventoryCheck = ((BaseUnityPlugin)this).Config.Bind<bool>("OTHERS", "InventoryCheck", true, "Prevents some emotes from performing while holding any item/scrap");
			EmotePatch.InvCheck = config_InventoryCheck.Value;
			config_KeyEmote3 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Middle Finger", "3", "MIDDLEFINGER: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote3 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Middle Finger", true, "ENABLE QUICK MIDDLEFINGER");
			EmotePatch.keybinds[2] = (config_toggleEmote3.Value ? config_KeyEmote3.Value : "/");
			EmotePatch.enable3 = config_toggleEmote3.Value;
			config_KeyEmote4 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "The Griddy", "6", "THE GRIDDY: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote4 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable The Griddy", true, "ENABLE QUICK THE GRIDDY");
			EmotePatch.keybinds[5] = (config_toggleEmote4.Value ? config_KeyEmote4.Value : "/");
			EmotePatch.enable4 = config_toggleEmote4.Value;
			config_KeyEmote5 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Shy", "5", "SHY: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote5 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Shy", true, "ENABLE QUICK SHY");
			EmotePatch.keybinds[4] = (config_toggleEmote5.Value ? config_KeyEmote5.Value : "/");
			EmotePatch.enable5 = config_toggleEmote5.Value;
			config_KeyEmote6 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Clap", "4", "CLAP: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote6 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Clap", true, "ENABLE QUICK CLAP");
			EmotePatch.keybinds[3] = (config_toggleEmote6.Value ? config_KeyEmote6.Value : "/");
			EmotePatch.enable6 = config_toggleEmote6.Value;
			config_KeyEmote7 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Twerk", "7", "TWERK: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote7 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Twerk", true, "ENABLE QUICK TWERK");
			EmotePatch.keybinds[6] = (config_toggleEmote7.Value ? config_KeyEmote7.Value : "/");
			EmotePatch.enable7 = config_toggleEmote7.Value;
			config_KeyEmote8 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Salute", "8", "SALUTE: SUPPORTED KEYS A-Z | 0-9 | F1-F12 ");
			config_toggleEmote8 = ((BaseUnityPlugin)this).Config.Bind<bool>("QUICK EMOTES", "Enable Salute", true, "ENABLE QUICK SALUTE");
			EmotePatch.keybinds[7] = (config_toggleEmote8.Value ? config_KeyEmote8.Value : "/");
			EmotePatch.enable8 = config_toggleEmote8.Value;
		}
	}
	public static class PluginInfo
	{
		public const string Guid = "MoreEmotes";

		public const string Name = "MoreEmotes-Sligili";

		public const string Ver = "1.2.0";
	}
}
namespace MoreEmotes.Patch
{
	internal class EmotePatch
	{
		public static AssetBundle animationsBundle;

		public static AssetBundle animatorBundle;

		public static bool enable3;

		public static bool enable4;

		public static bool enable5;

		public static bool enable6;

		public static bool enable7;

		public static bool enable8;

		public static string[] keybinds;

		public static string wheelKeybind;

		private static CallbackContext context;

		public static RuntimeAnimatorController local;

		public static RuntimeAnimatorController others;

		private static int currentEmoteID;

		private static float svMovSpeed;

		public static bool IncompatibleStuff;

		public static bool InvCheck;

		public static bool emoteWheelIsOpened;

		public static GameObject wheel;

		private static SelectionWheel selectionWheel;

		[HarmonyPatch(typeof(PlayerControllerB), "Start")]
		[HarmonyPostfix]
		private static void StartPostfix(PlayerControllerB __instance)
		{
			GameObject gameObject = ((Component)((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel")).transform.Find("metarig")).gameObject;
			CustomAudioAnimationEvent customAudioAnimationEvent = gameObject.AddComponent<CustomAudioAnimationEvent>();
			svMovSpeed = __instance.movementSpeed;
			customAudioAnimationEvent.player = __instance;
			if (Object.FindObjectsOfType(typeof(SelectionWheel)).Length == 0)
			{
				GameObject val = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesMenu.prefab");
				GameObject gameObject2 = ((Component)((Component)GameObject.Find("Systems").gameObject.transform.Find("UI")).gameObject.transform.Find("Canvas")).gameObject;
				if ((Object)(object)wheel != (Object)null)
				{
					Object.Destroy((Object)(object)wheel.gameObject);
				}
				wheel = Object.Instantiate<GameObject>(val, gameObject2.transform);
				selectionWheel = wheel.AddComponent<SelectionWheel>();
				SelectionWheel.emotes_Keybinds = new string[keybinds.Length + 1];
				SelectionWheel.emotes_Keybinds = keybinds;
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "Update")]
		[HarmonyPostfix]
		private static void UpdatePostfix(PlayerControllerB __instance)
		{
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			if (!__instance.isPlayerControlled || !((NetworkBehaviour)__instance).IsOwner)
			{
				__instance.playerBodyAnimator.runtimeAnimatorController = others;
				return;
			}
			if ((Object)(object)__instance.playerBodyAnimator != (Object)(object)local)
			{
				__instance.playerBodyAnimator.runtimeAnimatorController = local;
			}
			if (__instance.performingEmote)
			{
				currentEmoteID = __instance.playerBodyAnimator.GetInteger("emoteNumber");
			}
			if (!IncompatibleStuff)
			{
				bool flag = (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && currentEmoteID == 6 && __instance.performingEmote;
				__instance.movementSpeed = (flag ? (svMovSpeed / 2f) : svMovSpeed);
			}
			if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[wheelKeybind], 0f) && !emoteWheelIsOpened && !__instance.isPlayerDead && !__instance.inTerminalMenu && !__instance.quickMenuManager.isMenuOpen)
			{
				emoteWheelIsOpened = true;
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)2;
				wheel.SetActive(emoteWheelIsOpened);
				__instance.disableLookInput = true;
			}
			else if ((!InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[wheelKeybind], 0f) && emoteWheelIsOpened) || __instance.quickMenuManager.isMenuOpen)
			{
				if (!__instance.quickMenuManager.isMenuOpen || __instance.isPlayerDead)
				{
					int selectedEmoteID = selectionWheel.selectedEmoteID;
					if (selectedEmoteID <= 3 || selectedEmoteID == 6 || !InvCheck)
					{
						__instance.PerformEmote(context, selectedEmoteID);
					}
					else if (!__instance.isHoldingObject)
					{
						__instance.PerformEmote(context, selectedEmoteID);
					}
					Cursor.visible = false;
					Cursor.lockState = (CursorLockMode)1;
				}
				if (__instance.isPlayerDead && !__instance.quickMenuManager.isMenuOpen)
				{
					Cursor.visible = false;
					Cursor.lockState = (CursorLockMode)1;
				}
				__instance.disableLookInput = false;
				emoteWheelIsOpened = false;
				wheel.SetActive(emoteWheelIsOpened);
			}
			if (!__instance.performingEmote || currentEmoteID == 7)
			{
			}
			if (!emoteWheelIsOpened)
			{
				EmoteInput(keybinds[2], enable3, needsEmptyHands: false, 3, __instance);
				EmoteInput(keybinds[3], enable6, needsEmptyHands: true, 4, __instance);
				EmoteInput(keybinds[4], enable5, needsEmptyHands: true, 5, __instance);
				EmoteInput(keybinds[5], enable4, needsEmptyHands: false, 6, __instance);
				EmoteInput(keybinds[6], enable7, needsEmptyHands: true, 7, __instance);
				EmoteInput(keybinds[7], enable8, needsEmptyHands: true, 8, __instance);
			}
		}

		private static void EmoteInput(string keyBind, bool enabled, bool needsEmptyHands, int emoteID, PlayerControllerB player)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[keyBind], 0f) && enabled && (!player.isHoldingObject || !needsEmptyHands || !InvCheck) && (!player.performingEmote || currentEmoteID != emoteID))
			{
				player.PerformEmote(context, emoteID);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB), "CheckConditionsForEmote")]
		[HarmonyPrefix]
		private static bool prefixCheckConditions(ref bool __result, PlayerControllerB __instance)
		{
			bool flag = (bool)Reflection.GetInstanceField(typeof(PlayerControllerB), __instance, "isJumping");
			if (currentEmoteID == 6)
			{
				__result = !__instance.inSpecialInteractAnimation && !__instance.isPlayerDead && !flag && __instance.moveInputVector.x == 0f && !__instance.isSprinting && !__instance.isCrouching && !__instance.isClimbingLadder && !__instance.isGrabbingObjectAnimation && !__instance.inTerminalMenu && !__instance.isTypingChat;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(PlayerControllerB), "PerformEmote")]
		[HarmonyPrefix]
		private static void PerformEmotePrefix(CallbackContext context, int emoteID, PlayerControllerB __instance)
		{
			if ((emoteID >= 3 || emoteWheelIsOpened || ((CallbackContext)(ref context)).performed) && ((((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) || __instance.isTestingPlayer) && (bool)Reflection.CallMethod(__instance, "CheckConditionsForEmote") && !(__instance.timeSinceStartingEmote < 0.5f))
			{
				__instance.timeSinceStartingEmote = 0f;
				__instance.performingEmote = true;
				__instance.playerBodyAnimator.SetInteger("emoteNumber", emoteID);
				__instance.StartPerformingEmoteServerRpc();
			}
		}
	}
	public class CustomAudioAnimationEvent : MonoBehaviour
	{
		private Animator animator;

		private AudioSource SoundsSource;

		public static AudioClip[] claps = (AudioClip[])(object)new AudioClip[2];

		public PlayerControllerB player;

		private void Start()
		{
			animator = ((Component)this).GetComponent<Animator>();
			SoundsSource = player.movementAudio;
		}

		public void PlayClapSound()
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 4))
			{
				bool flag = player.isInHangarShipRoom && player.playersManager.hangarDoorsClosed;
				RoundManager.Instance.PlayAudibleNoise(((Component)player).transform.position, 22f, 0.6f, 0, flag, 6);
				SoundsSource.pitch = Random.Range(0.59f, 0.79f);
				SoundsSource.PlayOneShot(claps[Random.Range(0, claps.Length)]);
			}
		}

		public void PlayFootstepSound()
		{
			if (player.performingEmote && (!((NetworkBehaviour)player).IsOwner || !player.isPlayerControlled || animator.GetInteger("emoteNumber") == 6 || animator.GetInteger("emoteNumber") == 8) && ((Vector2)(ref player.moveInputVector)).sqrMagnitude == 0f)
			{
				player.PlayFootstepLocal();
				player.PlayFootstepServer();
			}
		}
	}
	public enum Emotes
	{
		Dance_1 = 1,
		Point,
		Middle_Finger,
		Clap,
		Shy,
		The_Griddy,
		Twerk,
		Salute
	}
	public class SelectionWheel : MonoBehaviour
	{
		public RectTransform selectionBlock;

		public Text emoteInformation;

		public Text pageInformation;

		private int blocksNumber = 8;

		private int currentBlock = 1;

		public int pageNumber;

		public int selectedEmoteID;

		private float angle;

		private float pageCooldown = 0.1f;

		public GameObject[] Pages;

		private int cuadrante = 0;

		public string selectedEmoteName;

		public float wheelMovementOffset = 3.3f;

		public static string[] emotes_Keybinds;

		private Vector2 center;

		private void OnEnable()
		{
			//IL_0012: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
			center = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
			PlayerInput component = GameObject.Find("PlayerSettingsObject").GetComponent<PlayerInput>();
			emotes_Keybinds[0] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote1", false), 0, (DisplayStringOptions)0);
			emotes_Keybinds[1] = InputActionRebindingExtensions.GetBindingDisplayString(component.currentActionMap.FindAction("Emote2", false), 0, (DisplayStringOptions)0);
			Cursor.visible = true;
			selectionBlock = ((Component)((Component)this).gameObject.transform.Find("SelectedEmote")).gameObject.GetComponent<RectTransform>();
			GameObject gameObject = ((Component)((Component)this).gameObject.transform.Find("FunctionalContent")).gameObject;
			emoteInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("EmoteInfo")).GetComponent<Text>();
			Pages = (GameObject[])(object)new GameObject[gameObject.transform.childCount];
			pageInformation = ((Component)((Component)((Component)this).gameObject.transform.Find("Graphics")).gameObject.transform.Find("PageNumber")).GetComponent<Text>();
			pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1);
			for (int i = 0; i < gameObject.transform.childCount; i++)
			{
				Pages[i] = ((Component)gameObject.transform.GetChild(i)).gameObject;
			}
			Mouse.current.WarpCursorPosition(center);
		}

		private void Update()
		{
			wheelSelection();
			pageSelection();
			selectedEmoteID = currentBlock + Mathf.RoundToInt((float)(blocksNumber / 4)) + blocksNumber * pageNumber;
			displayEmoteInfo();
		}

		private void wheelSelection()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_0197: Unknown result type (might be due to invalid IL or missing references)
			if (!(Vector2.Distance(center, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue()) < wheelMovementOffset))
			{
				bool flag = ((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() > center.x;
				bool flag2 = ((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() > center.y;
				cuadrante = ((!flag) ? (flag2 ? 2 : 3) : (flag2 ? 1 : 4));
				float num = (((InputControl<float>)(object)((Pointer)Mouse.current).position.y).ReadValue() - center.y) / (((InputControl<float>)(object)((Pointer)Mouse.current).position.x).ReadValue() - center.x);
				float num2 = 180 * (cuadrante - ((cuadrante <= 2) ? 1 : 2));
				angle = Mathf.Atan(num) * (180f / (float)Math.PI) + num2;
				if (angle == 90f)
				{
					angle = 270f;
				}
				else if (angle == 270f)
				{
					angle = 90f;
				}
				float num3 = 360 / blocksNumber;
				currentBlock = Mathf.RoundToInt((angle - num3 * 1.5f) / num3);
				((Transform)selectionBlock).localRotation = Quaternion.Euler(((Component)this).transform.rotation.z, ((Component)this).transform.rotation.y, num3 * (float)currentBlock);
			}
		}

		private void pageSelection()
		{
			pageInformation.text = "Page " + Pages.Length + "/" + (pageNumber + 1);
			if (pageCooldown > 0f)
			{
				pageCooldown -= Time.deltaTime;
			}
			else if (((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() != 0f)
			{
				GameObject[] pages = Pages;
				foreach (GameObject val in pages)
				{
					val.SetActive(false);
				}
				int num = ((((InputControl<float>)(object)((Vector2Control)Mouse.current.scroll).y).ReadValue() > 0f) ? 1 : (-1));
				if (pageNumber + 1 > Pages.Length - 1 && num > 0)
				{
					pageNumber = 0;
				}
				else if (pageNumber - 1 < 0 && num < 0)
				{
					pageNumber = Pages.Length - 1;
				}
				else
				{
					pageNumber += num;
				}
				Pages[pageNumber].SetActive(true);
				pageCooldown = 0.1f;
			}
		}

		private void displayEmoteInfo()
		{
			string text = ((selectedEmoteID > emotes_Keybinds.Length) ? "" : emotes_Keybinds[selectedEmoteID - 1]);
			object obj;
			if (selectedEmoteID <= Enum.GetValues(typeof(Emotes)).Length)
			{
				Emotes emotes = (Emotes)selectedEmoteID;
				obj = emotes.ToString().Replace("_", " ");
			}
			else
			{
				obj = "EMPTY";
			}
			string text2 = (string)obj;
			emoteInformation.text = text2 + "\n[" + text.ToUpper() + "]";
		}
	}
}

plugins/SoulWithMae-BlackMesaInternTransferProgram/BlackMesaInternTransferProgram.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BlackMesaInternTransferProgram.Assets;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SoulWithMae")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2e2c161cfab5518029adb2eabead8e34988b7254")]
[assembly: AssemblyProduct("BlackMesaInternTransferProgram")]
[assembly: AssemblyTitle("BlackMesaInternTransferProgram")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BlackMesaInternTransferProgram
{
	internal static class ModInfo
	{
		public const string PluginGuid = "SoulWithMae.BlackMesaInternTransferProgram";

		public const string PluginName = "BlackMesaInternTransferProgram";

		public const string PluginVersion = "1.1.0";
	}
	[BepInPlugin("SoulWithMae.BlackMesaInternTransferProgram", "BlackMesaInternTransferProgram", "1.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource StaticLogger;

		private static readonly Harmony Harmony = new Harmony("SoulWithMae.BlackMesaInternTransferProgram");

		public static ConfigEntry<float> Volume;

		public static ConfigEntry<bool> AlertEnemies;

		public static ConfigEntry<float> NoiseRange;

		public static ConfigEntry<float> NoiseLoudness;

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SoulWithMae.BlackMesaInternTransferProgram is loaded as version 1.1.0!");
			StaticLogger = ((BaseUnityPlugin)this).Logger;
			Resources.Load();
			Volume = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Volume", 1f, "The volume of the sounds. Minimum 0, maximum 1.");
			AlertEnemies = ((BaseUnityPlugin)this).Config.Bind<bool>("Alerting Enemies", "AlertEnemies", false, "Whether to alert enemies or not with the screams.");
			NoiseRange = ((BaseUnityPlugin)this).Config.Bind<float>("Alerting Enemies", "NoiseRange", 100f, "The range of the noise.");
			NoiseLoudness = ((BaseUnityPlugin)this).Config.Bind<float>("Alerting Enemies", "NoiseLoudness", 100f, "The loudness of the noise.");
			Harmony.PatchAll(Assembly.GetExecutingAssembly());
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "BlackMesaInternTransferProgram";

		public const string PLUGIN_NAME = "BlackMesaInternTransferProgram";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace BlackMesaInternTransferProgram.Patching
{
	internal static class PlayerDeathPatch
	{
		[HarmonyPatch(typeof(PlayerControllerB))]
		internal static class LocalPlayerDeath
		{
			[HarmonyPostfix]
			[HarmonyPatch("KillPlayer")]
			private static void Postfix(PlayerControllerB __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				OnPlayerDeath(__instance.playerUsername, __instance.causeOfDeath, ((Component)__instance).transform.position);
			}
		}

		[HarmonyPatch(typeof(PlayerControllerB))]
		internal static class ServerPlayerDeath
		{
			[HarmonyPostfix]
			[HarmonyPatch("KillPlayerServerRpc")]
			private static void Postfix(PlayerControllerB __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				OnPlayerDeath(__instance.playerUsername, __instance.causeOfDeath, ((Component)__instance).transform.position);
			}
		}

		private static void OnPlayerDeath(string username, CauseOfDeath causeOfDeath, Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected I4, but got Unknown
			//IL_0039: 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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			switch ((int)causeOfDeath)
			{
			case 0:
				UnknownDeath(username, position);
				break;
			case 1:
				BludgeoningDeath(username, position);
				break;
			case 2:
				GravityDeath(username, position);
				break;
			case 3:
				BlastDeath(username, position);
				break;
			case 4:
				StrangulationDeath(username, position);
				break;
			case 5:
				SuffocationDeath(username, position);
				break;
			case 6:
				MaulingDeath(username, position);
				break;
			case 7:
				GunshotsDeath(username, position);
				break;
			case 8:
				CrushingDeath(username, position);
				break;
			case 9:
				DrowningDeath(username, position);
				break;
			case 10:
				AbandonedDeath(username, position);
				break;
			case 11:
				ElectrocutionDeath(username, position);
				break;
			default:
				UnknownDeath(username, position);
				Plugin.StaticLogger.LogError((object)("Death type was wrong. Playing unknown sound at " + ((object)(Vector3)(ref position)).ToString()));
				break;
			}
		}

		private static void PlayAudio(AudioClip sound, Vector3 position)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.AlertEnemies.Value)
			{
				RoundManager.Instance.PlayAudibleNoise(position, Plugin.NoiseRange.Value, Plugin.NoiseLoudness.Value, 0, false, 0);
				AudioSource.PlayClipAtPoint(sound, position, Plugin.Volume.Value);
			}
			else
			{
				AudioSource.PlayClipAtPoint(sound, position, Plugin.Volume.Value);
			}
		}

		private static void UnknownDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Unknown.Count);
			AudioClip val = Resources.Unknown[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to unknown. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void BludgeoningDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Bludgeoning.Count);
			AudioClip val = Resources.Bludgeoning[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to bludgeoning. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void GravityDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Gravity.Count);
			AudioClip val = Resources.Gravity[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to gravity. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void BlastDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Blast.Count);
			AudioClip val = Resources.Blast[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to blast. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void StrangulationDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Strangulation.Count);
			AudioClip val = Resources.Strangulation[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to strangulation. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void SuffocationDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Suffocation.Count);
			AudioClip val = Resources.Suffocation[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to suffocation. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void MaulingDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Mauling.Count);
			AudioClip val = Resources.Mauling[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to mauling. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void GunshotsDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Gunshots.Count);
			AudioClip val = Resources.Gunshots[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to gunshots. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void CrushingDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Crushing.Count);
			AudioClip val = Resources.Crushing[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to crushing. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void DrowningDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Drowning.Count);
			AudioClip val = Resources.Drowning[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to drowning. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void AbandonedDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Abandoned.Count);
			AudioClip val = Resources.Abandoned[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to abandoned. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}

		private static void ElectrocutionDeath(string username, Vector3 position)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			int index = Random.Range(0, Resources.Electrocution.Count);
			AudioClip val = Resources.Electrocution[index];
			PlayAudio(val, position);
			Plugin.StaticLogger.LogInfo((object)(username + " died to electrocution. Playing " + ((Object)val).name + " at " + ((object)(Vector3)(ref position)).ToString()));
		}
	}
}
namespace BlackMesaInternTransferProgram.Assets
{
	internal static class AssetLoader
	{
		public static AssetBundle LoadEmbeddedAssetBundle(Assembly assembly, string name)
		{
			string[] manifestResourceNames = assembly.GetManifestResourceNames();
			AssetBundle result = null;
			if (manifestResourceNames.Contains(name))
			{
				Plugin.StaticLogger.LogInfo((object)("Loading embedded resource data " + name + "..."));
				using Stream stream = assembly.GetManifestResourceStream(name);
				using MemoryStream memoryStream = new MemoryStream();
				stream?.CopyTo(memoryStream);
				Plugin.StaticLogger.LogInfo((object)"Sending assetBundle data to memory...");
				byte[] array = memoryStream.ToArray();
				Plugin.StaticLogger.LogInfo((object)"Loading assetBundle from data, please be patient...");
				result = AssetBundle.LoadFromMemory(array);
				Plugin.StaticLogger.LogInfo((object)"Done!");
			}
			return result;
		}

		public static T LoadPersistentAsset<T>(this AssetBundle assetBundle, string name) where T : Object
		{
			Object val = assetBundle.LoadAsset(name);
			if (val != (Object)null)
			{
				val.hideFlags = (HideFlags)32;
				return (T)(object)((val is T) ? val : null);
			}
			return default(T);
		}
	}
	internal static class Resources
	{
		private static AssetBundle _assetBundle;

		public static readonly List<AudioClip> Unknown = new List<AudioClip>();

		public static readonly List<AudioClip> Bludgeoning = new List<AudioClip>();

		public static readonly List<AudioClip> Gravity = new List<AudioClip>();

		public static readonly List<AudioClip> Blast = new List<AudioClip>();

		public static readonly List<AudioClip> Strangulation = new List<AudioClip>();

		public static readonly List<AudioClip> Suffocation = new List<AudioClip>();

		public static readonly List<AudioClip> Mauling = new List<AudioClip>();

		public static readonly List<AudioClip> Gunshots = new List<AudioClip>();

		public static readonly List<AudioClip> Crushing = new List<AudioClip>();

		public static readonly List<AudioClip> Drowning = new List<AudioClip>();

		public static readonly List<AudioClip> Abandoned = new List<AudioClip>();

		public static readonly List<AudioClip> Electrocution = new List<AudioClip>();

		public static void Load()
		{
			_assetBundle = AssetLoader.LoadEmbeddedAssetBundle(Assembly.GetExecutingAssembly(), "BlackMesaInternTransferProgram.Resources.Audio.bundle");
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream5.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream6.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream06.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream07.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream7.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream08.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream09.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream10.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream11.wav"));
			Unknown.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Unknown/scream12.wav"));
			Bludgeoning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Bludgeoning/sci_pain3.wav"));
			Bludgeoning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Bludgeoning/sci_pain4.wav"));
			Bludgeoning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Bludgeoning/sci_pain9.wav"));
			Bludgeoning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Bludgeoning/scream11.wav"));
			Bludgeoning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Bludgeoning/stopattacking.wav"));
			Gravity.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Gravity/scream04.wav"));
			Gravity.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Gravity/scream06.wav"));
			Gravity.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Gravity/scream24.wav"));
			Blast.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Blast/sci_fear6.wav"));
			Blast.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Blast/sci_pain4.wav"));
			Blast.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Blast/scream01.wav"));
			Blast.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Blast/scream3.wav"));
			Blast.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Blast/scream14.wav"));
			Strangulation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Strangulation/sci_dragoff.wav"));
			Strangulation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Strangulation/sci_pain10.wav"));
			Strangulation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Strangulation/scream03.wav"));
			Strangulation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Strangulation/scream18.wav"));
			Strangulation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Strangulation/scream20.wav"));
			Suffocation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Suffocation/c1a4_sci_tent.wav"));
			Suffocation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Suffocation/sci_die1.wav"));
			Suffocation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Suffocation/sci_die2.wav"));
			Suffocation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Suffocation/sci_die3.wav"));
			Suffocation.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Suffocation/sci_die4.wav"));
			Mauling.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Mauling/sci_pain1.wav"));
			Mauling.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Mauling/sci_pain5.wav"));
			Mauling.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Mauling/sci_pain6.wav"));
			Mauling.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Mauling/sci_pain7.wav"));
			Mauling.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Mauling/sci_pain8.wav"));
			Gunshots.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Gunshots/scream09.wav"));
			Gunshots.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Gunshots/scream25.wav"));
			Crushing.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Crushing/sci_fear14.wav"));
			Crushing.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Crushing/sci_fear15.wav"));
			Drowning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Drowning/sci_die1.wav"));
			Drowning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Drowning/sci_die2.wav"));
			Drowning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Drowning/sci_die3.wav"));
			Drowning.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Drowning/sci_die4.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/c1a2_sci_darkroom.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/c1a3_sci_silo1a.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/c1a3_sci_silo2a.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/dontwantdie.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/evergetout.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/gottogetout.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/leavingme.wav"));
			Abandoned.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Abandoned/whyleavehere.wav"));
			Electrocution.Add(_assetBundle.LoadPersistentAsset<AudioClip>("Assets/Electrocution/scream07.wav"));
		}
	}
}

plugins/sunnobunno-BonkHitSFX/BonkHitSFX.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using BonkHitSFX.Patches;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BonkHitSFX")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BonkHitSFX")]
[assembly: AssemblyTitle("BonkHitSFX")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace BonkHitSFX
{
	[BepInPlugin("sunnobunno.bonkhitsfx", "Bonk Hit SFX", "1.0.4")]
	public class BonkHitSFXBase : BaseUnityPlugin
	{
		private const string modGUID = "sunnobunno.bonkhitsfx";

		private const string modName = "Bonk Hit SFX";

		private const string modVersion = "1.0.4";

		private readonly Harmony harmony = new Harmony("sunnobunno.bonkhitsfx");

		private static BonkHitSFXBase? Instance;

		internal ManualLogSource? mls;

		internal static AudioClip[]? newHitSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("sunnobunno.bonkhitsfx");
			mls.LogInfo((object)"sunnobunno.bonkhitsfx is loading.");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "BonkHitSFX.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "bonkhitsfx";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newHitSFX = val.LoadAssetWithSubAssets<AudioClip>("Assets/bonkhitsfx.mp3");
			harmony.PatchAll(typeof(HitSFXPatch));
			mls.LogInfo((object)"sunnobunno.bonkhitsfx is loaded. Ow.");
		}
	}
}
namespace BonkHitSFX.Patches
{
	[HarmonyPatch(typeof(Shovel))]
	internal class HitSFXPatch
	{
		[HarmonyPatch("HitShovelClientRpc")]
		[HarmonyPatch("HitShovel")]
		[HarmonyPrefix]
		public static void hitSFXPatch(ref AudioClip[] ___hitSFX)
		{
			AudioClip[] newHitSFX = BonkHitSFXBase.newHitSFX;
			___hitSFX = newHitSFX;
		}
	}
}

plugins/sunnobunno-YippeeMod/YippeeMod.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using YippeeMod.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("YippeeMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("YippeeMod")]
[assembly: AssemblyTitle("YippeeMod")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
		}
	}
}
namespace YippeeMod
{
	[BepInPlugin("sunnobunno.YippeeMod", "Yippee tbh mod", "1.2.2")]
	public class YippeeModBase : BaseUnityPlugin
	{
		private const string modGUID = "sunnobunno.YippeeMod";

		private const string modName = "Yippee tbh mod";

		private const string modVersion = "1.2.2";

		private readonly Harmony harmony = new Harmony("sunnobunno.YippeeMod");

		private static YippeeModBase? Instance;

		internal ManualLogSource? mls;

		internal static AudioClip[]? newSFX;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("sunnobunno.YippeeMod");
			mls.LogInfo((object)"sunnobunno.YippeeMod is loading.");
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			string text = "YippeeMod.dll";
			string text2 = location.TrimEnd(text.ToCharArray());
			string text3 = text2 + "yippeesound";
			AssetBundle val = AssetBundle.LoadFromFile(text3);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load audio assets!");
				return;
			}
			newSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/yippee-tbh.mp3");
			harmony.PatchAll(typeof(HoarderBugPatch));
			mls.LogInfo((object)"sunnobunno.YippeeMod is loaded. Yippee!!!");
		}
	}
}
namespace YippeeMod.Patches
{
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderBugPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
		{
			AudioClip[] newSFX = YippeeModBase.newSFX;
			___chitterSFX = newSFX;
		}
	}
}

plugins/Sv_Matt-HideModList/HideModList.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;

[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("HideModList")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Hides the LC api modlist info")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HideModList")]
[assembly: AssemblyTitle("HideModList")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace HideModList
{
	[HarmonyPatch(typeof(HUDManager), "DisplayTip")]
	public static class DisplayTipPatch
	{
		public static bool Prefix(HUDManager __instance, string headerText, string bodyText, bool isWarning = false, bool useSave = false, string prefsKey = "LC_Tip1")
		{
			if (headerText.StartsWith("Mod List"))
			{
				return false;
			}
			return true;
		}
	}
	[BepInPlugin("HideModList", "HideModList", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("plugin.HideModList");
			val.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin HideModList is loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "HideModList";

		public const string PLUGIN_NAME = "HideModList";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}

plugins/taffyko-NameplateTweaks/NameplateTweaks.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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 Dissonance;
using GameNetcodeStuff;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("NameplateTweaks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Configurable client-side mod for player username billboards. Speaking indicators, better visibility, etc.")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("NameplateTweaks")]
[assembly: AssemblyTitle("NameplateTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
namespace NameplateTweaks;

[BepInPlugin("taffyko.NameplateTweaks", "NameplateTweaks", "1.0.2")]
public class Plugin : BaseUnityPlugin
{
	public const string modGUID = "taffyko.NameplateTweaks";

	public const string modName = "NameplateTweaks";

	public const string modVersion = "1.0.2";

	public static ConfigEntry<bool> ConfigEnableSpeakingIndicator;

	public static ConfigEntry<bool> ConfigVariableSpeakingIndicatorOpacity;

	public static ConfigEntry<bool> ConfigSpeakingIndicatorAlwaysVisible;

	public static ConfigEntry<float> ConfigNameplateScale;

	public static ConfigEntry<float> ConfigNameplateVisibilityDistance;

	public static ConfigEntry<bool> ConfigNameplateScaleWithDistance;

	public static ManualLogSource log;

	private readonly Harmony harmony = new Harmony("taffyko.NameplateTweaks");

	public static Vector3? OriginalNameplateScale = new Vector3(-0.0025f, 0.0025f, 0.0025f);

	private void Awake()
	{
		log = Logger.CreateLogSource("NameplateTweaks");
		log.LogInfo((object)"Loading taffyko.NameplateTweaks");
		ConfigEnableSpeakingIndicator = ((BaseUnityPlugin)this).Config.Bind<bool>("Speaking Indicator", "EnableSpeakingIndicator", true, "Enable a voice-activity speaking indicator above player nameplates");
		ConfigVariableSpeakingIndicatorOpacity = ((BaseUnityPlugin)this).Config.Bind<bool>("Speaking Indicator", "VariableSpeakingIndicatorOpacity", true, "Speaking indicator opacity changes depending on volume");
		ConfigSpeakingIndicatorAlwaysVisible = ((BaseUnityPlugin)this).Config.Bind<bool>("Speaking Indicator", "SpeakingIndicatorAlwaysVisible", true, "Display speaking indicators even when the nameplate is hidden");
		ConfigNameplateScale = ((BaseUnityPlugin)this).Config.Bind<float>("Nameplate", "NameplateScale", 1.5f, "Nameplate size multiplier (1.0 is the vanilla size)");
		ConfigNameplateVisibilityDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Nameplate", "NameplateVisibilityDistance", 20f, "Distance from the camera within which nameplates are visible (0.0 reverts to vanilla behavior). The length of the ship is ~20 units, for reference");
		ConfigNameplateScaleWithDistance = ((BaseUnityPlugin)this).Config.Bind<bool>("Nameplate", "NameplateScaleWithDistance", false, "Scale nameplates so that they retain their apparent size as they get further away");
		harmony.PatchAll(Assembly.GetExecutingAssembly());
	}

	private void OnDestroy()
	{
	}
}
public class SpeakingIndicator : MonoBehaviour
{
	public PlayerControllerB player;

	public Canvas canvas;

	public GameObject canvasItem;

	public CanvasGroup canvasItemAlpha;

	public static Dictionary<PlayerControllerB, SpeakingIndicator> speakingIndicators = new Dictionary<PlayerControllerB, SpeakingIndicator>();

	private static Texture2D speakingIconTexture = null;

	public static Texture2D GetSpeakingIconTexture()
	{
		if ((Object)(object)speakingIconTexture != (Object)null)
		{
			return speakingIconTexture;
		}
		return GameObject.Find("PTTIcon").GetComponent<Image>().sprite.texture;
	}

	public static SpeakingIndicator GetSpeakingIndicator(PlayerControllerB player)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		speakingIndicators.TryGetValue(player, out var value);
		if ((Object)(object)value == (Object)null)
		{
			GameObject val = new GameObject("SpeakingIndicator");
			val.SetActive(false);
			value = val.AddComponent<SpeakingIndicator>();
			value.player = player;
			((Component)value).transform.SetParent(((Component)player).transform, false);
			speakingIndicators.Add(player, value);
			val.SetActive(true);
		}
		return value;
	}

	public void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Expected O, but got Unknown
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: 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)
		canvasItem = new GameObject("SpeakingIndicatorCanvasItem");
		canvasItem.transform.SetParent(player.usernameBillboard, false);
		canvasItem.AddComponent<CanvasRenderer>();
		canvasItemAlpha = canvasItem.AddComponent<CanvasGroup>();
		canvasItemAlpha.alpha = 0f;
		canvasItem.transform.localPosition = new Vector3(0f, 60f, 0f);
		canvasItem.AddComponent<Image>().sprite = Sprite.Create(GetSpeakingIconTexture(), new Rect(0f, 0f, 260f, 280f), new Vector2(130f, 140f), 100f);
	}

	private float lexp(float a, float b, float t)
	{
		return Mathf.Lerp(a, b, Mathf.Exp(0f - t));
	}

	public void Update()
	{
		VoicePlayerState voicePlayerState = player.voicePlayerState;
		if (voicePlayerState != null)
		{
			float num = Mathf.Clamp(voicePlayerState.Amplitude * 35f, 0f, 1f);
			if (Plugin.ConfigVariableSpeakingIndicatorOpacity.Value)
			{
				if (num > 0.01f)
				{
					canvasItemAlpha.alpha = lexp(canvasItemAlpha.alpha, num, Time.deltaTime * 100f);
				}
				else
				{
					canvasItemAlpha.alpha = lexp(canvasItemAlpha.alpha, num, Time.deltaTime * 50f);
				}
			}
			else if (num > 0.05f)
			{
				canvasItemAlpha.alpha = 1f;
			}
			else if (num < 0.01f)
			{
				canvasItemAlpha.alpha = 0f;
			}
		}
		if (!Plugin.ConfigSpeakingIndicatorAlwaysVisible.Value)
		{
			canvasItemAlpha.alpha = Math.Min(canvasItemAlpha.alpha, player.usernameAlpha.alpha);
		}
		if (!Plugin.ConfigEnableSpeakingIndicator.Value)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public void OnDestroy()
	{
		speakingIndicators.Remove(player);
		Object.Destroy((Object)(object)canvasItem);
	}
}
[HarmonyPatch(typeof(PlayerControllerB))]
internal class PlayerControllerBPatches
{
	[HarmonyPatch("Update")]
	[HarmonyPostfix]
	private static void Update_Postfix(PlayerControllerB __instance)
	{
		//IL_0030: 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_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		((TMP_Text)__instance.usernameBillboardText).text = __instance.playerUsername;
		if (Plugin.ConfigEnableSpeakingIndicator.Value)
		{
			SpeakingIndicator.GetSpeakingIndicator(__instance);
		}
		__instance.usernameBillboard.position = new Vector3(__instance.playerGlobalHead.position.x, __instance.playerGlobalHead.position.y + 0.55f, __instance.playerGlobalHead.position.z);
		PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController;
		if ((Object)(object)localPlayerController != (Object)null)
		{
			float num = Vector3.Distance(((Component)localPlayerController.gameplayCamera).transform.position, __instance.usernameBillboard.position);
			if (num < Plugin.ConfigNameplateVisibilityDistance.Value)
			{
				__instance.usernameAlpha.alpha = 1f;
				((Behaviour)__instance.usernameBillboardText).enabled = true;
				((Component)__instance.usernameCanvas).gameObject.SetActive(true);
			}
			float num2 = 1f;
			if (Plugin.ConfigNameplateScaleWithDistance.Value)
			{
				num2 = 1f + Math.Max(0f, (num - 4f) * 0.11f);
			}
			__instance.usernameBillboard.localScale = Plugin.OriginalNameplateScale.Value * Plugin.ConfigNameplateScale.Value * num2;
		}
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "NameplateTweaks";

	public const string PLUGIN_NAME = "NameplateTweaks";

	public const string PLUGIN_VERSION = "1.0.2";
}

plugins/tinyhoot-ShipLoot/ShipLoot/ShipLoot.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ShipLoot")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("ShipLoot")]
[assembly: AssemblyCopyright("Copyright © tinyhoot 2023")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ShipLoot
{
	[BepInPlugin("com.github.tinyhoot.ShipLoot", "ShipLoot", "1.0")]
	internal class ShipLoot : BaseUnityPlugin
	{
		public const string GUID = "com.github.tinyhoot.ShipLoot";

		public const string NAME = "ShipLoot";

		public const string VERSION = "1.0";

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			new Harmony("com.github.tinyhoot.ShipLoot").PatchAll(Assembly.GetExecutingAssembly());
		}
	}
}
namespace ShipLoot.Patches
{
	[HarmonyPatch]
	internal class HudManagerPatcher
	{
		private static GameObject _totalCounter;

		private static TextMeshProUGUI _textMesh;

		private static float _displayTimeLeft;

		private const float DisplayTime = 5f;

		[HarmonyPrefix]
		[HarmonyPatch(typeof(HUDManager), "PingScan_performed")]
		private static void OnScan(HUDManager __instance, CallbackContext context)
		{
			if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) && ((CallbackContext)(ref context)).performed && __instance.CanPlayerScan() && !(__instance.playerPingingScan > -0.5f) && (StartOfRound.Instance.inShipPhase || GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom))
			{
				if (!Object.op_Implicit((Object)(object)_totalCounter))
				{
					CopyValueCounter();
				}
				float num = CalculateLootValue();
				((TMP_Text)_textMesh).text = $"SHIP: ${num:F0}";
				_displayTimeLeft = 5f;
				if (!_totalCounter.activeSelf)
				{
					((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ShipLootCoroutine());
				}
			}
		}

		private static IEnumerator ShipLootCoroutine()
		{
			_totalCounter.SetActive(true);
			while (_displayTimeLeft > 0f)
			{
				float displayTimeLeft = _displayTimeLeft;
				_displayTimeLeft = 0f;
				yield return (object)new WaitForSeconds(displayTimeLeft);
			}
			_totalCounter.SetActive(false);
		}

		private static float CalculateLootValue()
		{
			List<GrabbableObject> list = (from obj in GameObject.Find("/Environment/HangarShip").GetComponentsInChildren<GrabbableObject>()
				where ((Object)obj).name != "ClipboardManual" && ((Object)obj).name != "StickyNoteItem"
				select obj).ToList();
			ShipLoot.Log.LogDebug((object)"Calculating total ship scrap value.");
			CollectionExtensions.Do<GrabbableObject>((IEnumerable<GrabbableObject>)list, (Action<GrabbableObject>)delegate(GrabbableObject scrap)
			{
				ShipLoot.Log.LogDebug((object)$"{((Object)scrap).name} - ${scrap.scrapValue}");
			});
			return list.Sum((GrabbableObject scrap) => scrap.scrapValue);
		}

		private static void CopyValueCounter()
		{
			//IL_0066: 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_0076: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("/Systems/UI/Canvas/IngamePlayerHUD/BottomMiddle/ValueCounter");
			if (!Object.op_Implicit((Object)(object)val))
			{
				ShipLoot.Log.LogError((object)"Failed to find ValueCounter object to copy!");
			}
			_totalCounter = Object.Instantiate<GameObject>(val.gameObject, val.transform.parent, false);
			_totalCounter.transform.Translate(0f, 1f, 0f);
			Vector3 localPosition = _totalCounter.transform.localPosition;
			_totalCounter.transform.localPosition = new Vector3(localPosition.x + 50f, -50f, localPosition.z);
			_textMesh = _totalCounter.GetComponentInChildren<TextMeshProUGUI>();
		}
	}
}

plugins/vasanex-ItemQuickSwitch/ItemQuickSwitchMod.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[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("ItemQuickSwitchMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Mod for selecting item slots directly")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0")]
[assembly: AssemblyProduct("ItemQuickSwitchMod")]
[assembly: AssemblyTitle("ItemQuickSwitchMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ItemQuickSwitchMod
{
	public sealed class CustomAction
	{
		public class ActionItem
		{
			public string Id { get; }

			public Key Shortcut { get; }

			public string Description { get; }

			public int SlotNumber { get; }

			public ConfigEntry<Key> ConfigEntry { get; set; }

			public ActionItem(string id, Key config, string description, int slotNumber)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				Id = id;
				Shortcut = config;
				Description = description;
				SlotNumber = slotNumber;
			}
		}

		public static readonly ActionItem Emote1 = new ActionItem("Emote1", (Key)94, "Dance emote", 0);

		public static readonly ActionItem Emote2 = new ActionItem("Emote2", (Key)95, "Point emote", 0);

		public static readonly ActionItem Slot1 = new ActionItem("Slot1", (Key)41, "Equip Slot 1", 0);

		public static readonly ActionItem Slot2 = new ActionItem("Slot2", (Key)42, "Equip Slot 2", 1);

		public static readonly ActionItem Slot3 = new ActionItem("Slot3", (Key)43, "Equip Slot 3", 2);

		public static readonly ActionItem Slot4 = new ActionItem("Slot4", (Key)44, "Equip Slot 4", 3);

		public static readonly ActionItem[] AllActions = new ActionItem[6] { Emote1, Emote2, Slot1, Slot2, Slot3, Slot4 };
	}
	[BepInPlugin("de.vasanex.ItemQuickSwitchMod", "ItemQuickSwitchMod", "1.1.0")]
	public class ItemQuickSwitchMod : BaseUnityPlugin
	{
		private Harmony _harmony;

		private void Awake()
		{
			//IL_0034: 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_0068: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"ItemQuickSwitchMod is creating binds!");
			CustomAction.ActionItem[] allActions = CustomAction.AllActions;
			foreach (CustomAction.ActionItem actionItem in allActions)
			{
				ConfigEntry<Key> configEntry = ((BaseUnityPlugin)this).Config.Bind<Key>("Bindings", actionItem.Id, actionItem.Shortcut, actionItem.Description);
				actionItem.ConfigEntry = configEntry;
			}
			_harmony = new Harmony("de.vasanex.ItemQuickSwitchMod");
			_harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ItemQuickSwitchMod is loaded!");
		}
	}
	public static class StaticPluginInfo
	{
		public const string GUID = "de.vasanex.ItemQuickSwitchMod";

		public const string NAME = "ItemQuickSwitchMod";
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "ItemQuickSwitchMod";

		public const string PLUGIN_NAME = "ItemQuickSwitchMod";

		public const string PLUGIN_VERSION = "1.1.0";
	}
}
namespace ItemQuickSwitchMod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		private static readonly Dictionary<string, MethodInfo> MethodCache = new Dictionary<string, MethodInfo>();

		private static readonly object[] BackwardsParam = new object[1] { false };

		private static readonly object[] ForwardsParam = new object[1] { true };

		private static object InvokePrivateMethod(PlayerControllerB instance, string methodName, object[] parameters = null)
		{
			MethodCache.TryGetValue(methodName, out var value);
			if ((object)value == null)
			{
				value = typeof(PlayerControllerB).GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic);
			}
			MethodCache[methodName] = value;
			return value?.Invoke(instance, parameters);
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		public static void PlayerControllerB_Update(PlayerControllerB __instance, ref float ___timeSinceSwitchingSlots, ref bool ___throwingObject)
		{
			if ((!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || (((NetworkBehaviour)__instance).IsServer && !__instance.isHostPlayerObject)) && !__instance.isTestingPlayer)
			{
				return;
			}
			CustomAction.ActionItem actionItem = Array.Find(CustomAction.AllActions, (CustomAction.ActionItem it) => ((ButtonControl)Keyboard.current[it.ConfigEntry.Value]).wasPressedThisFrame);
			if (actionItem == null)
			{
				return;
			}
			string id = actionItem.Id;
			string text = id;
			if (!(text == "Emote1"))
			{
				if (text == "Emote2")
				{
					PerformEmote(__instance, 2);
					return;
				}
				StopEmotes(__instance);
				if (SwitchItemSlots(__instance, actionItem.SlotNumber, ___timeSinceSwitchingSlots, ___throwingObject))
				{
					___timeSinceSwitchingSlots = 0f;
				}
			}
			else
			{
				PerformEmote(__instance, 1);
			}
		}

		private static void PerformEmote(PlayerControllerB __instance, int emoteId)
		{
			__instance.timeSinceStartingEmote = 0f;
			__instance.performingEmote = true;
			__instance.playerBodyAnimator.SetInteger("emoteNumber", emoteId);
			__instance.StartPerformingEmoteServerRpc();
		}

		private static bool SwitchItemSlots(PlayerControllerB __instance, int requestedSlot, float timeSinceSwitchingSlots, bool isThrowingObject)
		{
			if (!IsItemSwitchPossible(__instance, timeSinceSwitchingSlots, isThrowingObject) || __instance.currentItemSlot == requestedSlot)
			{
				return false;
			}
			int num = __instance.currentItemSlot - requestedSlot;
			bool flag = num > 0;
			if (Math.Abs(num) == __instance.ItemSlots.Length - 1)
			{
				object[] parameters = (flag ? ForwardsParam : BackwardsParam);
				InvokePrivateMethod(__instance, "SwitchItemSlotsServerRpc", parameters);
			}
			else
			{
				object[] parameters2 = (flag ? BackwardsParam : ForwardsParam);
				do
				{
					InvokePrivateMethod(__instance, "SwitchItemSlotsServerRpc", parameters2);
					num += ((!flag) ? 1 : (-1));
				}
				while (num != 0);
			}
			ShipBuildModeManager.Instance.CancelBuildMode(true);
			__instance.playerBodyAnimator.SetBool("GrabValidated", false);
			object[] parameters3 = new object[2] { requestedSlot, null };
			InvokePrivateMethod(__instance, "SwitchToItemSlot", parameters3);
			if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null)
			{
				((Component)__instance.currentlyHeldObjectServer).gameObject.GetComponent<AudioSource>().PlayOneShot(__instance.currentlyHeldObjectServer.itemProperties.grabSFX, 0.6f);
			}
			return true;
		}

		private static bool IsItemSwitchPossible(PlayerControllerB __instance, float timeSinceSwitchingSlots, bool isThrowingObject)
		{
			return !((double)timeSinceSwitchingSlots < 0.01 || __instance.inTerminalMenu || __instance.isGrabbingObjectAnimation || __instance.inSpecialInteractAnimation || isThrowingObject) && !__instance.isTypingChat && !__instance.twoHanded && !__instance.activatingItem && !__instance.jetpackControls && !__instance.disablingJetpackControls;
		}

		private static void StopEmotes(PlayerControllerB __instance)
		{
			__instance.performingEmote = false;
			__instance.StopPerformingEmoteServerRpc();
			__instance.timeSinceStartingEmote = 0f;
		}
	}
}

plugins/VZP_Mods-BetterLethality/BetterLethality.dll

Decompiled 10 months ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BetterLethality.Patches;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("BetterLethality")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BetterLethality")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e1fe85a1-6433-439e-a3c1-f5d033f179ad")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace BetterLethality
{
	[BepInPlugin("vzp.lethality", "Better Lethality", "1.0.0.0")]
	public class LethalityMain : BaseUnityPlugin
	{
		private const string modGUID = "vzp.lethality";

		private const string modName = "Better Lethality";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("vzp.lethality");

		private static LethalityMain instance;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			harmony.PatchAll(typeof(LethalityMain));
			harmony.PatchAll(typeof(LethalPatch));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Lethality has been bettered");
		}
	}
}
namespace BetterLethality.Patches
{
	[HarmonyPatch(typeof(MenuManager))]
	internal class LethalPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__3_0;

			internal void <AddMods>b__3_0()
			{
				modsPanel.SetActive(true);
			}
		}

		private static GameObject modBtn;

		private static GameObject modsPanel;

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void UpdateNews(ref GameObject ___NewsPanel)
		{
			TextMeshProUGUI component = ((Component)((Component)___NewsPanel.transform.Find("Panel")).transform.Find("DemoText")).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component).text = ((TMP_Text)component).text + "\n\n[MODS DETECTED]";
		}

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void AddMods(ref GameObject ___menuButtons)
		{
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Expected O, but got Unknown
			modsPanel = Object.Instantiate<GameObject>(((Component)((Component)___menuButtons.transform.parent).transform.Find("CreditsPanel")).gameObject, ___menuButtons.transform.parent);
			((Object)modsPanel).name = "ModsPanel";
			((TMP_Text)((Component)modsPanel.transform.Find("Panel/NotificationText")).GetComponent<TextMeshProUGUI>()).text = "Installed Mods";
			GameObject val = Object.Instantiate<GameObject>(((Component)modsPanel.transform.Find("Panel/Scroll View/Viewport/Content/CreditsText")).gameObject, modsPanel.transform.Find("Panel/Scroll View/Viewport/Content"));
			((Behaviour)val.GetComponent<TextMeshProUGUI>()).enabled = true;
			Object.Destroy((Object)(object)modsPanel.transform.Find("Panel/Scroll View/Viewport/Content/CreditsText"));
			modBtn = Object.Instantiate<GameObject>(((Component)___menuButtons.transform.Find("HostButton")).gameObject, ___menuButtons.transform);
			((Object)modBtn).name = "ModsButton";
			modBtn.transform.localPosition = new Vector3(-253.6928f, -9.9013f, -5.7486f);
			((TMP_Text)modBtn.GetComponentInChildren<TextMeshProUGUI>()).text = "> Mods";
			((UnityEventBase)modBtn.GetComponent<Button>().onClick).RemoveAllListeners();
			ButtonClickedEvent onClick = modBtn.GetComponent<Button>().onClick;
			object obj = <>c.<>9__3_0;
			if (obj == null)
			{
				UnityAction val2 = delegate
				{
					modsPanel.SetActive(true);
				};
				<>c.<>9__3_0 = val2;
				obj = (object)val2;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
			string path = Path.Combine(Directory.GetCurrentDirectory(), "BepInEx/plugins");
			string[] files = Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories);
			StringBuilder stringBuilder = new StringBuilder("");
			string[] array = files;
			foreach (string path2 in array)
			{
				string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(path2);
				stringBuilder.AppendLine("- " + fileNameWithoutExtension);
			}
			((TMP_Text)val.GetComponent<TextMeshProUGUI>()).text = stringBuilder.ToString();
		}
	}
}

plugins/x753-More_Suits/MoreSuits.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("MoreSuits")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("A mod that adds more suit options to Lethal Company")]
[assembly: AssemblyFileVersion("1.4.1.0")]
[assembly: AssemblyInformationalVersion("1.4.1")]
[assembly: AssemblyProduct("MoreSuits")]
[assembly: AssemblyTitle("MoreSuits")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.1.0")]
[module: UnverifiableCode]
namespace MoreSuits;

[BepInPlugin("x753.More_Suits", "More Suits", "1.4.1")]
public class MoreSuitsMod : BaseUnityPlugin
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		private static void StartPatch(ref StartOfRound __instance)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Expected O, but got Unknown
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Expected O, but got Unknown
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			try
			{
				if (SuitsAdded)
				{
					return;
				}
				int count = __instance.unlockablesList.unlockables.Count;
				UnlockableItem val = new UnlockableItem();
				int num = 0;
				for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++)
				{
					UnlockableItem val2 = __instance.unlockablesList.unlockables[i];
					if (!((Object)(object)val2.suitMaterial != (Object)null) || !val2.alreadyUnlocked)
					{
						continue;
					}
					val = val2;
					List<string> list = Directory.GetDirectories(Paths.PluginPath, "moresuits", SearchOption.AllDirectories).ToList();
					List<string> list2 = new List<string>();
					List<string> list3 = new List<string>();
					List<string> list4 = DisabledSuits.ToLower().Replace(".png", "").Split(',')
						.ToList();
					List<string> list5 = new List<string>();
					if (!LoadAllSuits)
					{
						foreach (string item2 in list)
						{
							if (File.Exists(Path.Combine(item2, "!less-suits.txt")))
							{
								string[] collection = new string[9] { "glow", "kirby", "knuckles", "luigi", "mario", "minion", "skeleton", "slayer", "smile" };
								list5.AddRange(collection);
								break;
							}
						}
					}
					foreach (string item3 in list)
					{
						if (item3 != "")
						{
							string[] files = Directory.GetFiles(item3, "*.png");
							string[] files2 = Directory.GetFiles(item3, "*.matbundle");
							list2.AddRange(files);
							list3.AddRange(files2);
						}
					}
					list3.Sort();
					list2.Sort();
					try
					{
						foreach (string item4 in list3)
						{
							Object[] array = AssetBundle.LoadFromFile(item4).LoadAllAssets();
							foreach (Object val3 in array)
							{
								if (val3 is Material)
								{
									Material item = (Material)val3;
									customMaterials.Add(item);
								}
							}
						}
					}
					catch (Exception ex)
					{
						Debug.Log((object)("Something went wrong with More Suits! Could not load materials from asset bundle(s). Error: " + ex));
					}
					foreach (string item5 in list2)
					{
						if (list4.Contains(Path.GetFileNameWithoutExtension(item5).ToLower()))
						{
							continue;
						}
						string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
						if (list5.Contains(Path.GetFileNameWithoutExtension(item5).ToLower()) && item5.Contains(directoryName))
						{
							continue;
						}
						UnlockableItem val4;
						Material val5;
						if (Path.GetFileNameWithoutExtension(item5).ToLower() == "default")
						{
							val4 = val;
							val5 = val4.suitMaterial;
						}
						else
						{
							val4 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val));
							val5 = Object.Instantiate<Material>(val4.suitMaterial);
						}
						byte[] array2 = File.ReadAllBytes(item5);
						Texture2D val6 = new Texture2D(2, 2);
						ImageConversion.LoadImage(val6, array2);
						val5.mainTexture = (Texture)(object)val6;
						val4.unlockableName = Path.GetFileNameWithoutExtension(item5);
						try
						{
							string path = Path.Combine(Path.GetDirectoryName(item5), "advanced", val4.unlockableName + ".json");
							if (File.Exists(path))
							{
								string[] array3 = File.ReadAllLines(path);
								for (int j = 0; j < array3.Length; j++)
								{
									string[] array4 = array3[j].Trim().Split(':');
									if (array4.Length != 2)
									{
										continue;
									}
									string text = array4[0].Trim('"', ' ', ',');
									string text2 = array4[1].Trim('"', ' ', ',');
									if (text2.Contains(".png"))
									{
										byte[] array5 = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(item5), "advanced", text2));
										Texture2D val7 = new Texture2D(2, 2);
										ImageConversion.LoadImage(val7, array5);
										val5.SetTexture(text, (Texture)(object)val7);
										continue;
									}
									if (text == "PRICE" && int.TryParse(text2, out var result))
									{
										try
										{
											val4 = AddToRotatingShop(val4, result, __instance.unlockablesList.unlockables.Count);
										}
										catch (Exception ex2)
										{
											Debug.Log((object)("Something went wrong with More Suits! Could not add a suit to the rotating shop. Error: " + ex2));
										}
										continue;
									}
									switch (text2)
									{
									case "KEYWORD":
										val5.EnableKeyword(text);
										continue;
									case "DISABLEKEYWORD":
										val5.DisableKeyword(text);
										continue;
									case "SHADERPASS":
										val5.SetShaderPassEnabled(text, true);
										continue;
									case "DISABLESHADERPASS":
										val5.SetShaderPassEnabled(text, false);
										continue;
									}
									float result2;
									Vector4 vector;
									if (text == "SHADER")
									{
										Shader shader = Shader.Find(text2);
										val5.shader = shader;
									}
									else if (text == "MATERIAL")
									{
										foreach (Material customMaterial in customMaterials)
										{
											if (((Object)customMaterial).name == text2)
											{
												val5 = Object.Instantiate<Material>(customMaterial);
												val5.mainTexture = (Texture)(object)val6;
												break;
											}
										}
									}
									else if (float.TryParse(text2, out result2))
									{
										val5.SetFloat(text, result2);
									}
									else if (TryParseVector4(text2, out vector))
									{
										val5.SetVector(text, vector);
									}
								}
							}
						}
						catch (Exception ex3)
						{
							Debug.Log((object)("Something went wrong with More Suits! Error: " + ex3));
						}
						val4.suitMaterial = val5;
						if (val4.unlockableName.ToLower() != "default")
						{
							if (num == MaxSuits)
							{
								Debug.Log((object)"Attempted to add a suit, but you've already reached the max number of suits! Modify the config if you want more.");
								continue;
							}
							__instance.unlockablesList.unlockables.Add(val4);
							num++;
						}
					}
					SuitsAdded = true;
					break;
				}
				UnlockableItem val8 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val));
				val8.alreadyUnlocked = false;
				val8.hasBeenMoved = false;
				val8.placedPosition = Vector3.zero;
				val8.placedRotation = Vector3.zero;
				val8.unlockableType = 753;
				while (__instance.unlockablesList.unlockables.Count < count + MaxSuits)
				{
					__instance.unlockablesList.unlockables.Add(val8);
				}
			}
			catch (Exception ex4)
			{
				Debug.Log((object)("Something went wrong with More Suits! Error: " + ex4));
			}
		}

		[HarmonyPatch("PositionSuitsOnRack")]
		[HarmonyPrefix]
		private static bool PositionSuitsOnRackPatch(ref StartOfRound __instance)
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			List<UnlockableSuit> source = Object.FindObjectsOfType<UnlockableSuit>().ToList();
			source = source.OrderBy((UnlockableSuit suit) => suit.syncedSuitID.Value).ToList();
			int num = 0;
			foreach (UnlockableSuit item in source)
			{
				AutoParentToShip component = ((Component)item).gameObject.GetComponent<AutoParentToShip>();
				component.overrideOffset = true;
				float num2 = 0.18f;
				if (MakeSuitsFitOnRack && source.Count > 13)
				{
					num2 /= (float)Math.Min(source.Count, 20) / 12f;
				}
				component.positionOffset = new Vector3(-2.45f, 2.75f, -8.41f) + __instance.rightmostSuitPosition.forward * num2 * (float)num;
				component.rotationOffset = new Vector3(0f, 90f, 0f);
				num++;
			}
			return false;
		}
	}

	private const string modGUID = "x753.More_Suits";

	private const string modName = "More Suits";

	private const string modVersion = "1.4.1";

	private readonly Harmony harmony = new Harmony("x753.More_Suits");

	private static MoreSuitsMod Instance;

	public static bool SuitsAdded = false;

	public static string DisabledSuits;

	public static bool LoadAllSuits;

	public static bool MakeSuitsFitOnRack;

	public static int MaxSuits;

	public static List<Material> customMaterials = new List<Material>();

	private static TerminalNode cancelPurchase;

	private static TerminalKeyword buyKeyword;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		DisabledSuits = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Disabled Suit List", "UglySuit751.png,UglySuit752.png,UglySuit753.png", "Comma-separated list of suits that shouldn't be loaded").Value;
		LoadAllSuits = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Ignore !less-suits.txt", false, "If true, ignores the !less-suits.txt file and will attempt to load every suit, except those in the disabled list. This should be true if you're not worried about having too many suits.").Value;
		MakeSuitsFitOnRack = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Make Suits Fit on Rack", true, "If true, squishes the suits together so more can fit on the rack.").Value;
		MaxSuits = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Max Suits", 100, "The maximum number of suits to load. If you have more, some will be ignored.").Value;
		harmony.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin More Suits is loaded!");
	}

	private static UnlockableItem AddToRotatingShop(UnlockableItem newSuit, int price, int unlockableID)
	{
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Expected O, but got Unknown
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Expected O, but got Unknown
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Expected O, but got Unknown
		Terminal val = Object.FindObjectOfType<Terminal>();
		for (int i = 0; i < val.terminalNodes.allKeywords.Length; i++)
		{
			if (((Object)val.terminalNodes.allKeywords[i]).name == "Buy")
			{
				buyKeyword = val.terminalNodes.allKeywords[i];
				break;
			}
		}
		newSuit.alreadyUnlocked = false;
		newSuit.hasBeenMoved = false;
		newSuit.placedPosition = Vector3.zero;
		newSuit.placedRotation = Vector3.zero;
		newSuit.shopSelectionNode = ScriptableObject.CreateInstance<TerminalNode>();
		((Object)newSuit.shopSelectionNode).name = newSuit.unlockableName + "SuitBuy1";
		newSuit.shopSelectionNode.creatureName = newSuit.unlockableName + " suit";
		newSuit.shopSelectionNode.displayText = "You have requested to order " + newSuit.unlockableName + " suits.\nTotal cost of item: [totalCost].\n\nPlease CONFIRM or DENY.\n\n";
		newSuit.shopSelectionNode.clearPreviousText = true;
		newSuit.shopSelectionNode.shipUnlockableID = unlockableID;
		newSuit.shopSelectionNode.itemCost = price;
		newSuit.shopSelectionNode.overrideOptions = true;
		CompatibleNoun val2 = new CompatibleNoun();
		val2.noun = ScriptableObject.CreateInstance<TerminalKeyword>();
		val2.noun.word = "confirm";
		val2.noun.isVerb = true;
		val2.result = ScriptableObject.CreateInstance<TerminalNode>();
		((Object)val2.result).name = newSuit.unlockableName + "SuitBuyConfirm";
		val2.result.creatureName = "";
		val2.result.displayText = "Ordered " + newSuit.unlockableName + " suits! Your new balance is [playerCredits].\n\n";
		val2.result.clearPreviousText = true;
		val2.result.shipUnlockableID = unlockableID;
		val2.result.buyUnlockable = true;
		val2.result.itemCost = price;
		val2.result.terminalEvent = "";
		CompatibleNoun val3 = new CompatibleNoun();
		val3.noun = ScriptableObject.CreateInstance<TerminalKeyword>();
		val3.noun.word = "deny";
		val3.noun.isVerb = true;
		if ((Object)(object)cancelPurchase == (Object)null)
		{
			cancelPurchase = ScriptableObject.CreateInstance<TerminalNode>();
		}
		val3.result = cancelPurchase;
		((Object)val3.result).name = "MoreSuitsCancelPurchase";
		val3.result.displayText = "Cancelled order.\n";
		newSuit.shopSelectionNode.terminalOptions = (CompatibleNoun[])(object)new CompatibleNoun[2] { val2, val3 };
		TerminalKeyword val4 = ScriptableObject.CreateInstance<TerminalKeyword>();
		((Object)val4).name = newSuit.unlockableName + "Suit";
		val4.word = newSuit.unlockableName.ToLower() + " suit";
		val4.defaultVerb = buyKeyword;
		CompatibleNoun val5 = new CompatibleNoun();
		val5.noun = val4;
		val5.result = newSuit.shopSelectionNode;
		List<CompatibleNoun> list = buyKeyword.compatibleNouns.ToList();
		list.Add(val5);
		buyKeyword.compatibleNouns = list.ToArray();
		List<TerminalKeyword> list2 = val.terminalNodes.allKeywords.ToList();
		list2.Add(val4);
		list2.Add(val2.noun);
		list2.Add(val3.noun);
		val.terminalNodes.allKeywords = list2.ToArray();
		return newSuit;
	}

	public static bool TryParseVector4(string input, out Vector4 vector)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		vector = Vector4.zero;
		string[] array = input.Split(',');
		if (array.Length == 4 && float.TryParse(array[0], out var result) && float.TryParse(array[1], out var result2) && float.TryParse(array[2], out var result3) && float.TryParse(array[3], out var result4))
		{
			vector = new Vector4(result, result2, result3, result4);
			return true;
		}
		return false;
	}
}