Decompiled source of SVG Modpack v1.1.1
BepInEX/plugins/2018-LC_API/LC_API.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; 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 System.Text.RegularExpressions; 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.Exceptions; using LC_API.Extensions; using LC_API.GameInterfaceAPI; using LC_API.GameInterfaceAPI.Events; using LC_API.GameInterfaceAPI.Events.Cache; using LC_API.GameInterfaceAPI.Events.EventArgs.Player; using LC_API.GameInterfaceAPI.Events.Handlers; using LC_API.GameInterfaceAPI.Features; using LC_API.ManualPatches; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Netcode; 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: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("LC_API")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Utilities for plugin devs")] [assembly: AssemblyFileVersion("3.1.0.0")] [assembly: AssemblyInformationalVersion("3.1.0")] [assembly: AssemblyProduct("Lethal Company API")] [assembly: AssemblyTitle("LC_API")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace 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", "Lethal Company API", "3.1.0")] 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_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_0299: 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); MethodInfo methodInfo9 = AccessTools.Method(typeof(GameNetworkManager), "Awake", (Type[])null, (Type[])null); MethodInfo methodInfo10 = AccessTools.Method(typeof(ServerPatch), "GameNetworkManagerAwake", (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); val.Patch((MethodBase)methodInfo9, new HarmonyMethod(methodInfo10), (HarmonyMethod)null, (HarmonyMethod)null, (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)); Networking.SetupNetworking(); Events.Patch(val); } 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 Utils { public static string ReplaceWithCase(this string input, string toReplace, string replacement) { Dictionary<string, string> map = new Dictionary<string, string> { { toReplace, replacement } }; return input.ReplaceWithCase(map); } public static string ReplaceWithCase(this string input, Dictionary<string, string> map) { string text = input; foreach (KeyValuePair<string, string> item in map) { string key = item.Key; string value = item.Value; text = Regex.Replace(text, key, delegate(Match match) { string value2 = match.Value; char[] array = value2.ToCharArray(); string[] source = value2.Split(new char[1] { ' ' }); bool flag = char.IsUpper(array[0]); bool flag2 = source.All((string w) => char.IsUpper(w[0]) || !char.IsLetter(w[0])); if (array.All((char c) => char.IsUpper(c) || !char.IsLetter(c))) { return value.ToUpper(); } if (flag2) { return Regex.Replace(value, "\\b\\w", (Match charMatch) => charMatch.Value.ToUpper()); } char[] array2 = value.ToCharArray(); array2[0] = (flag ? char.ToUpper(array2[0]) : char.ToLower(array2[0])); return new string(array2); }, RegexOptions.IgnoreCase); } return text; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LC_API"; public const string PLUGIN_NAME = "Lethal Company API"; public const string PLUGIN_VERSION = "3.1.0"; } } 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 int GameVersion { get; internal set; } 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) { } internal static void SetupNetworking() { 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); } } } } } } 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; } internal static void GameNetworkManagerAwake(GameNetworkManager __instance) { if ((Object)(object)GameNetworkManager.Instance == (Object)null) { ModdedServer.GameVersion = __instance.gameVersionNum; } } } } 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.GameInterfaceAPI.Features { public class Item : NetworkBehaviour { private bool hasNewProps; internal static GameObject ItemNetworkPrefab { get; set; } public static Dictionary<GrabbableObject, Item> Dictionary { get; } = new Dictionary<GrabbableObject, Item>(); public static IReadOnlyCollection<Item> List => Dictionary.Values; public GrabbableObject GrabbableObject { get; private set; } public Item ItemProperties => GrabbableObject.itemProperties; public ScanNodeProperties ScanNodeProperties { get; set; } public bool IsHeld => GrabbableObject.isHeld; public bool IsTwoHanded => ItemProperties.twoHanded; public Player Holder { get { if (!IsHeld) { return null; } if (!Player.Dictionary.TryGetValue(GrabbableObject.playerHeldBy, out var value)) { return null; } return value; } } public string Name { get { return ItemProperties.itemName; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item name on client."); } string oldName = ItemProperties.itemName.ToLower(); CloneProperties(); ItemProperties.itemName = value; OverrideTooltips(oldName, value.ToLower()); ScanNodeProperties.headerText = value; SetGrabbableNameClientRpc(value); } } public Vector3 Position { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.position; } set { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0036: 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_004d: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item position on client."); } GrabbableObject.startFallingPosition = value; GrabbableObject.targetFloorPosition = value; ((Component)GrabbableObject).transform.position = value; SetItemPositionClientRpc(value); } } public Quaternion Rotation { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.rotation; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)GrabbableObject).transform.rotation = value; } } public Vector3 Scale { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)GrabbableObject).transform.localScale; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((Component)GrabbableObject).transform.localScale = value; } } public bool IsScrap { get { return ItemProperties.isScrap; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set item name on client."); } CloneProperties(); ItemProperties.isScrap = value; SetIsScrapClientRpc(value); } } public int ScrapValue { get { return GrabbableObject.scrapValue; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set scrap value on client."); } GrabbableObject.SetScrapValue(value); SetScrapValueClientRpc(value); } } [ClientRpc] private void SetGrabbableNameClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(66243798u, val, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 66243798u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { string oldName = ItemProperties.itemName.ToLower(); CloneProperties(); ItemProperties.itemName = name; OverrideTooltips(oldName, name.ToLower()); ScanNodeProperties.headerText = name; } } private void OverrideTooltips(string oldName, string newName) { for (int i = 0; i < ItemProperties.toolTips.Length; i++) { ItemProperties.toolTips[i] = ItemProperties.toolTips[i].ReplaceWithCase(oldName, newName); } if (IsHeld && (Object)(object)Holder == (Object)(object)Player.LocalPlayer) { GrabbableObject.SetControlTipsForItem(); } } [ClientRpc] private void SetItemPositionClientRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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_00ce: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) 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(949135576u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 949135576u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GrabbableObject.startFallingPosition = pos; GrabbableObject.targetFloorPosition = pos; ((Component)GrabbableObject).transform.position = pos; } } } public void SetAndSyncRotation(Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to sync item rotation from client."); } SetItemRotationClientRpc(rotation); } [ClientRpc] private void SetItemRotationClientRpc(Quaternion rotation) { //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_00c9: 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(1528367091u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1528367091u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Rotation = rotation; } } } public void SetAndSyncScale(Vector3 scale) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to sync item scale from client."); } SetItemScaleClientRpc(scale); } [ClientRpc] private void SetItemScaleClientRpc(Vector3 scale) { //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_00c9: 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(2688253945u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scale); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2688253945u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Scale = scale; } } } [ClientRpc] private void SetIsScrapClientRpc(bool isScrap) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4227417717u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isScrap, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4227417717u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { CloneProperties(); ItemProperties.isScrap = isScrap; } } } [ClientRpc] private void SetScrapValueClientRpc(int scrapValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3866863385u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, scrapValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3866863385u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { GrabbableObject.SetScrapValue(scrapValue); } } } public void RemoveFromHolder(Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion)) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to remove item from player on client."); } if (IsHeld) { ((NetworkBehaviour)this).NetworkObject.RemoveOwnership(); Holder.Inventory.RemoveItem(this); RemoveFromHolderClientRpc(); Position = position; Rotation = rotation; } } [ClientRpc] private void RemoveFromHolderClientRpc() { //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(1050513218u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1050513218u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && IsHeld) { Holder.Inventory.RemoveItem(this); } } } public void EnablePhysics(bool enable) { GrabbableObject.EnablePhysics(enable); } public void EnableMeshes(bool enable) { GrabbableObject.EnableItemMeshes(enable); } public void FallToGround(bool randomizePosition = false) { GrabbableObject.FallToGround(randomizePosition); } public bool PocketItem() { if (!IsHeld || (Object)(object)Holder.HeldItem != (Object)(object)this || IsTwoHanded) { return false; } GrabbableObject.PocketItem(); return true; } public bool GiveTo(Player player, bool switchTo = true) { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to give item to player on client."); } return player.Inventory.TryAddItem(this, switchTo); } public void InitializeScrap() { if (RoundManager.Instance.AnomalyRandom != null) { InitializeScrap((int)((float)RoundManager.Instance.AnomalyRandom.Next(ItemProperties.minValue, ItemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier)); } else { InitializeScrap((int)((float)Random.Range(ItemProperties.minValue, ItemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier)); } } public void InitializeScrap(int scrapValue) { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to initialize scrap on client."); } ScrapValue = scrapValue; InitializeScrapClientRpc(); } [ClientRpc] private void InitializeScrapClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1334565671u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1334565671u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } MeshFilter val3 = default(MeshFilter); if (((Component)GrabbableObject).gameObject.TryGetComponent<MeshFilter>(ref val3) && ItemProperties.meshVariants != null && ItemProperties.meshVariants.Length != 0) { if (RoundManager.Instance.ScrapValuesRandom != null) { val3.mesh = ItemProperties.meshVariants[RoundManager.Instance.ScrapValuesRandom.Next(ItemProperties.meshVariants.Length)]; } else { val3.mesh = ItemProperties.meshVariants[0]; } } MeshRenderer val4 = default(MeshRenderer); if (((Component)GrabbableObject).gameObject.TryGetComponent<MeshRenderer>(ref val4) && ItemProperties.materialVariants != null && ItemProperties.materialVariants.Length != 0) { if (RoundManager.Instance.ScrapValuesRandom != null) { ((Renderer)val4).sharedMaterial = ItemProperties.materialVariants[RoundManager.Instance.ScrapValuesRandom.Next(ItemProperties.materialVariants.Length)]; } else { ((Renderer)val4).sharedMaterial = ItemProperties.materialVariants[0]; } } } public static Item CreateAndSpawnItem(string itemName, bool andInitialize = true, Vector3 position = default(Vector3), Quaternion rotation = default(Quaternion)) { //IL_006c: 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) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to create and spawn item on client."); } string name = itemName.ToLower(); GameObject val = ((IEnumerable<Item>)StartOfRound.Instance.allItemsList.itemsList).FirstOrDefault((Func<Item, bool>)((Item i) => i.itemName.ToLower().Contains(name)))?.spawnPrefab; if ((Object)(object)val != (Object)null) { GameObject obj = Object.Instantiate<GameObject>(val, position, rotation); obj.GetComponent<NetworkObject>().Spawn(false); Item component = obj.GetComponent<Item>(); if (component.IsScrap && andInitialize) { component.InitializeScrap(); } return component; } return null; } public static Item CreateAndGiveItem(string itemName, Player player, bool andInitialize = true, bool switchTo = true) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to create and give item on client."); } string name = itemName.ToLower(); GameObject val = ((IEnumerable<Item>)StartOfRound.Instance.allItemsList.itemsList).FirstOrDefault((Func<Item, bool>)((Item i) => i.itemName.ToLower().Contains(name)))?.spawnPrefab; if ((Object)(object)val != (Object)null) { GameObject obj = Object.Instantiate<GameObject>(val, Vector3.zero, default(Quaternion)); obj.GetComponent<NetworkObject>().Spawn(false); Item component = obj.GetComponent<Item>(); if (component.IsScrap && andInitialize) { component.InitializeScrap(); } component.GiveTo(player, switchTo); return component; } return null; } private void Awake() { GrabbableObject = ((Component)this).GetComponent<GrabbableObject>(); ScanNodeProperties = ((Component)GrabbableObject).gameObject.GetComponentInChildren<ScanNodeProperties>(); Dictionary.Add(GrabbableObject, this); } private void CloneProperties() { Item itemProperties = Object.Instantiate<Item>(ItemProperties); if (hasNewProps) { Object.Destroy((Object)(object)ItemProperties); } GrabbableObject.itemProperties = itemProperties; hasNewProps = true; } public override void OnDestroy() { Dictionary.Remove(GrabbableObject); ((NetworkBehaviour)this).OnDestroy(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Item() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(66243798u, new RpcReceiveHandler(__rpc_handler_66243798)); NetworkManager.__rpc_func_table.Add(949135576u, new RpcReceiveHandler(__rpc_handler_949135576)); NetworkManager.__rpc_func_table.Add(1528367091u, new RpcReceiveHandler(__rpc_handler_1528367091)); NetworkManager.__rpc_func_table.Add(2688253945u, new RpcReceiveHandler(__rpc_handler_2688253945)); NetworkManager.__rpc_func_table.Add(4227417717u, new RpcReceiveHandler(__rpc_handler_4227417717)); NetworkManager.__rpc_func_table.Add(3866863385u, new RpcReceiveHandler(__rpc_handler_3866863385)); NetworkManager.__rpc_func_table.Add(1050513218u, new RpcReceiveHandler(__rpc_handler_1050513218)); NetworkManager.__rpc_func_table.Add(1334565671u, new RpcReceiveHandler(__rpc_handler_1334565671)); } private static void __rpc_handler_66243798(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string grabbableNameClientRpc = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableNameClientRpc, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetGrabbableNameClientRpc(grabbableNameClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_949135576(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 itemPositionClientRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemPositionClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemPositionClientRpc(itemPositionClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1528367091(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) { Quaternion itemRotationClientRpc = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemRotationClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemRotationClientRpc(itemRotationClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2688253945(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 itemScaleClientRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemScaleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetItemScaleClientRpc(itemScaleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4227417717(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isScrapClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isScrapClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetIsScrapClientRpc(isScrapClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3866863385(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int scrapValueClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((Item)(object)target).SetScrapValueClientRpc(scrapValueClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1050513218(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; ((Item)(object)target).RemoveFromHolderClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1334565671(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; ((Item)(object)target).InitializeScrapClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Item"; } } public class Player : NetworkBehaviour { public class PlayerInventory : NetworkBehaviour { public Player Player { get; private set; } public Item[] Items => Player.PlayerController.ItemSlots.Select((GrabbableObject i) => (!((Object)(object)i != (Object)null)) ? null : Item.Dictionary[i]).ToArray(); public int CurrentSlot { get { return Player.PlayerController.currentItemSlot; } set { //IL_0011: 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) if (Player.IsLocalPlayer) { SetSlotServerRpc(value); } else if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { SetSlotClientRpc(value); } } } [ServerRpc] private void SetSlotServerRpc(int slot, ServerRpcParams serverRpcParams = default(ServerRpcParams)) { //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_010e: Unknown result type (might be due to invalid IL or missing references) //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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1475903090u, serverRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1475903090u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && serverRpcParams.Receive.SenderClientId == Player.ClientId) { SetSlotClientRpc(slot); } } [ClientRpc] private void SetSlotClientRpc(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2977994897u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2977994897u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Player.PlayerController.SwitchToItemSlot(slot, (GrabbableObject)null); } } } public int GetFirstEmptySlot() { return Player.PlayerController.FirstEmptyItemSlot(); } public bool TryGetFirstEmptySlot(out int slot) { slot = Player.PlayerController.FirstEmptyItemSlot(); return slot != -1; } public bool TryAddItem(Item item, bool switchTo = true) { //IL_0052: 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_005b: 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) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to add item from client."); } if (TryGetFirstEmptySlot(out var slot)) { if (item.IsTwoHanded && !Player.HasFreeHands) { return false; } if (item.IsHeld) { item.RemoveFromHolder(); } ((NetworkBehaviour)item).NetworkObject.ChangeOwnership(Player.ClientId); if (item.IsTwoHanded) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (switchTo && Player.HasFreeHands) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (Player.PlayerController.currentItemSlot == slot) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else { SetItemInSlotClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } return true; } return false; } public bool TryAddItemToSlot(Item item, int slot, bool switchTo = true) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to add item from client."); } if (slot < Player.PlayerController.ItemSlots.Length && (Object)(object)Player.PlayerController.ItemSlots[slot] == (Object)null) { if (item.IsTwoHanded && !Player.HasFreeHands) { return false; } if (item.IsHeld) { item.RemoveFromHolder(); } ((NetworkBehaviour)item).NetworkObject.ChangeOwnership(Player.ClientId); if (item.IsTwoHanded) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (switchTo && Player.HasFreeHands) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else if (Player.PlayerController.currentItemSlot == slot) { SetSlotAndItemClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } else { SetItemInSlotClientRpc(slot, ((NetworkBehaviour)item).NetworkObjectId); } return true; } return false; } [ClientRpc] private void SetItemInSlotClientRpc(int slot, ulong itemId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2222069819u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, itemId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2222069819u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ulong itemId2 = itemId; Item item = Item.List.FirstOrDefault((Item i) => ((NetworkBehaviour)i).NetworkObjectId == itemId2); if ((Object)(object)item != (Object)null) { if (Player.IsLocalPlayer) { HUDManager.Instance.itemSlotIcons[slot].sprite = item.ItemProperties.itemIcon; ((Behaviour)HUDManager.Instance.itemSlotIcons[slot]).enabled = true; } item.GrabbableObject.EnablePhysics(false); item.GrabbableObject.EnableItemMeshes(false); item.GrabbableObject.playerHeldBy = Player.PlayerController; item.GrabbableObject.hasHitGround = false; item.GrabbableObject.isInFactory = Player.IsInFactory; Player.CarryWeight += Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); if (!Player.IsLocalPlayer) { item.GrabbableObject.parentObject = Player.PlayerController.serverItemHolder; } else { item.GrabbableObject.parentObject = Player.PlayerController.localItemHolder; } Player.PlayerController.ItemSlots[slot] = item.GrabbableObject; } } [ClientRpc] private void SetSlotAndItemClientRpc(int slot, ulong itemId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1630079273u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); BytePacker.WriteValueBitPacked(val2, itemId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1630079273u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ulong itemId2 = itemId; Item item = Item.List.FirstOrDefault((Item i) => ((NetworkBehaviour)i).NetworkObjectId == itemId2); if ((Object)(object)item != (Object)null) { Player.PlayerController.SwitchToItemSlot(slot, item.GrabbableObject); item.GrabbableObject.EnablePhysics(false); item.GrabbableObject.isHeld = true; item.GrabbableObject.hasHitGround = false; item.GrabbableObject.isInFactory = Player.IsInFactory; Player.PlayerController.twoHanded = item.ItemProperties.twoHanded; Player.PlayerController.twoHandedAnimation = item.ItemProperties.twoHandedAnimation; Player.PlayerController.isHoldingObject = true; Player.CarryWeight += Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); if (!Player.IsLocalPlayer) { item.GrabbableObject.parentObject = Player.PlayerController.serverItemHolder; } else { item.GrabbableObject.parentObject = Player.PlayerController.localItemHolder; } } } public void RemoveItem(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { RemoveItemClientRpc(slot); } else { RemoveItemServerRpc(slot); } } [ServerRpc(RequireOwnership = false)] private void RemoveItemServerRpc(int slot, ServerRpcParams serverRpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1641630752u, serverRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, slot); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1641630752u, serverRpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && serverRpcParams.Receive.SenderClientId == Player.ClientId) { RemoveItemClientRpc(slot); } } } [ClientRpc] private void RemoveItemClientRpc(int slot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2246700294u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, slot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2246700294u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || slot == -1) { return; } bool flag = slot == Player.Inventory.CurrentSlot; Item item = Items[slot]; if ((Object)(object)item == (Object)null) { return; } GrabbableObject grabbableObject = item.GrabbableObject; if (Player.IsLocalPlayer) { ((Behaviour)HUDManager.Instance.itemSlotIcons[slot]).enabled = false; if (item.IsTwoHanded) { ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; } } if (flag) { if (Player.IsLocalPlayer) { grabbableObject.DiscardItemOnClient(); } else { grabbableObject.DiscardItem(); } Player.PlayerController.currentlyHeldObject = null; Player.PlayerController.currentlyHeldObjectServer = null; Player.PlayerController.isHoldingObject = false; if (item.IsTwoHanded) { Player.PlayerController.twoHanded = false; Player.PlayerController.twoHandedAnimation = false; } } grabbableObject.heldByPlayerOnServer = false; grabbableObject.parentObject = null; item.EnablePhysics(enable: false); item.EnableMeshes(enable: true); item.Scale = item.GrabbableObject.originalScale; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { item.Position = Vector3.zero; } grabbableObject.isHeld = false; grabbableObject.isPocketed = false; Player.CarryWeight -= Mathf.Clamp(item.ItemProperties.weight - 1f, 0f, 10f); Player.PlayerController.ItemSlots[slot] = null; } public void RemoveItem(Item item) { RemoveItem(Array.IndexOf(Player.PlayerController.ItemSlots, item.GrabbableObject)); } public void RemoveAllItems() { for (int i = 0; i < Player.PlayerController.ItemSlots.Length; i++) { RemoveItem(i); } } private void Awake() { Player = ((Component)this).GetComponent<Player>(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PlayerInventory() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1475903090u, new RpcReceiveHandler(__rpc_handler_1475903090)); NetworkManager.__rpc_func_table.Add(2977994897u, new RpcReceiveHandler(__rpc_handler_2977994897)); NetworkManager.__rpc_func_table.Add(2222069819u, new RpcReceiveHandler(__rpc_handler_2222069819)); NetworkManager.__rpc_func_table.Add(1630079273u, new RpcReceiveHandler(__rpc_handler_1630079273)); NetworkManager.__rpc_func_table.Add(1641630752u, new RpcReceiveHandler(__rpc_handler_1641630752)); NetworkManager.__rpc_func_table.Add(2246700294u, new RpcReceiveHandler(__rpc_handler_2246700294)); } private static void __rpc_handler_1475903090(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerInventory)(object)target).SetSlotServerRpc(slot, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2977994897(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slotClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slotClientRpc); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetSlotClientRpc(slotClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2222069819(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ulong itemId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref itemId); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetItemInSlotClientRpc(slot, itemId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1630079273(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ulong itemId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref itemId); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).SetSlotAndItemClientRpc(slot, itemId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1641630752(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((PlayerInventory)(object)target).RemoveItemServerRpc(slot, server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2246700294(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int slot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref slot); target.__rpc_exec_stage = (__RpcExecStage)2; ((PlayerInventory)(object)target).RemoveItemClientRpc(slot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlayerInventory"; } } internal static GameObject PlayerNetworkPrefab { get; set; } public static Dictionary<PlayerControllerB, Player> Dictionary { get; } = new Dictionary<PlayerControllerB, Player>(); public static IReadOnlyCollection<Player> List => Dictionary.Values; public static IReadOnlyCollection<Player> ActiveList => List.Where((Player p) => p.IsActive).ToList(); public static Player LocalPlayer { get; internal set; } public static Player HostPlayer { get; internal set; } public PlayerControllerB PlayerController { get; internal set; } internal NetworkVariable<ulong> NetworkClientId { get; } = new NetworkVariable<ulong>(ulong.MaxValue, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public ulong ClientId => PlayerController.actualClientId; public ulong SteamId => PlayerController.playerSteamId; public bool IsHost => (Object)(object)((Component)PlayerController).gameObject == (Object)(object)PlayerController.playersManager.allPlayerObjects[0]; public bool IsLocalPlayer => (Object)(object)PlayerController == (Object)(object)StartOfRound.Instance.localPlayerController; public bool IsActive { get { if (!IsControlled) { return IsDead; } return true; } } public bool IsControlled => PlayerController.isPlayerControlled; public bool IsDead => PlayerController.isPlayerDead; public string Username { get { return PlayerController.playerUsername; } set { //IL_0030: 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) PlayerController.playerUsername = value; if (NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost) { SetPlayerUsernameClientRpc(value); } else { SetPlayerUsernameServerRpc(value); } } } public float SprintMeter { get { return PlayerController.sprintMeter; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set sprint meter on client."); } PlayerController.sprintMeter = value; SetSprintMeterClientRpc(value); } } public Vector3 Position { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.position; } set { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set position on client."); } ((Component)PlayerController).transform.position = value; PlayerController.serverPlayerPosition = value; TeleportPlayerClientRpc(value); } } public Vector3 EulerAngles { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.eulerAngles; } set { //IL_0036: 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) if (!IsLocalPlayer && !NetworkManager.Singleton.IsHost && !NetworkManager.Singleton.IsServer) { throw new NoAuthorityException("Tried to update euler angles from other client."); } ((Component)PlayerController).transform.eulerAngles = value; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { PlayerController.UpdatePlayerRotationFullClientRpc(value); } } } public Quaternion Rotation { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return ((Component)PlayerController).transform.rotation; } set { //IL_0036: 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_0073: Unknown result type (might be due to invalid IL or missing references) if (!IsLocalPlayer && !NetworkManager.Singleton.IsHost && !NetworkManager.Singleton.IsServer) { throw new NoAuthorityException("Tried to update rotation from other client."); } ((Component)PlayerController).transform.rotation = value; ((Component)PlayerController).transform.eulerAngles = ((Quaternion)(ref value)).eulerAngles; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { PlayerController.UpdatePlayerRotationFullClientRpc(((Quaternion)(ref value)).eulerAngles); } } } public int Health { get { return PlayerController.health; } set { if (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) { throw new NoAuthorityException("Tried to set health on client."); } PlayerController.health = value; SetHealthClientRpc(value); } } public bool IsInFactory => PlayerController.isInsideFactory; public Item HeldItem { get { if ((Object)(object)PlayerController.currentlyHeldObjectServer == (Object)null) { return null; } return Item.Dictionary[PlayerController.currentlyHeldObjectServer]; } } public bool IsHoldingItem => (Object)(object)HeldItem != (Object)null; public bool HasFreeHands { get { if (IsHoldingItem) { return !HeldItem.IsTwoHanded; } return true; } } public PlayerInventory Inventory { get; private set; } public float CarryWeight { get { return PlayerController.carryWeight; } set { PlayerController.carryWeight = value; } } [ServerRpc(RequireOwnership = false)] private void SetPlayerUsernameServerRpc(string name, ServerRpcParams @params = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3898702292u, @params, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3898702292u, @params, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && @params.Receive.SenderClientId == ClientId) { SetPlayerUsernameClientRpc(name); } } [ClientRpc] private void SetPlayerUsernameClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1254211676u, val, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1254211676u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerController.playerUsername = name; ((TMP_Text)PlayerController.usernameBillboardText).text = name; } } [ClientRpc] private void SetSprintMeterClientRpc(float value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(442815492u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 442815492u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { PlayerController.sprintMeter = value; } } } [ClientRpc] private void TeleportPlayerClientRpc(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_00db: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1267434055u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1267434055u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { PlayerController.TeleportPlayer(position, false, 0f, false, true); if (IsLocalPlayer) { PlayerController.UpdatePlayerPositionServerRpc(position, PlayerController.isInElevator, PlayerController.isExhausted, PlayerController.thisController.isGrounded); } } } [ClientRpc] private void SetHealthClientRpc(int health) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1407071784u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, health); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1407071784u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.IsClient) { int health2 = PlayerController.health; PlayerController.health = health; if (((NetworkBehaviour)PlayerController).IsOwner) { HUDManager.Instance.UpdateHealthUI(health, health < health2); } if (health <= 0 && !PlayerController.isPlayerDead && PlayerController.AllowPlayerDeath()) { PlayerController.KillPlayer(default(Vector3), true, (CauseOfDeath)0, 0); } } } public void Hurt(int damage, CauseOfDeath causeOfDeath = 0, Vector3 bodyVelocity = default(Vector3), bool overrideOneShotProtection = false, int deathAnimation = 0, bool fallDamage = false, bool hasSFX = true) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) if (overrideOneShotProtection && Health - da
BepInEX/plugins/299792458-MoreMoneyStart/FasterStart.dll
Decompiled 11 months agousing 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 MoreMoneyStart.Patches; 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("FasterStart")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FasterStart")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1794c9e2-6213-4024-b55e-67f56da5b373")] [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 MoreMoneyStart { [BepInPlugin("299792458.MoreMoneyStart", "MoreMoneyStart", "2.1.0")] public class MoreMoneyStart : BaseUnityPlugin { private const string modGUID = "299792458.MoreMoneyStart"; private const string modName = "MoreMoneyStart"; private const string modVersion = "2.1.0"; private readonly Harmony harmony = new Harmony("299792458.MoreMoneyStart"); public ConfigEntry<int> startingAmount; public static MoreMoneyStart Instance; private void Awake() { if (!Object.op_Implicit((Object)(object)Instance)) { Instance = this; } startingAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Starting Amount Config", "Starting Amount", 1000, "The starting amount can be configured here"); harmony.PatchAll(typeof(TimeOfDayAwakePatch)); } } } namespace MoreMoneyStart.Patches { [HarmonyPatch(typeof(TimeOfDay))] [HarmonyPatch("Awake")] public static class TimeOfDayAwakePatch { private static void Postfix(TimeOfDay __instance) { if (__instance.quotaVariables != null) { __instance.quotaVariables.startingCredits = MoreMoneyStart.Instance.startingAmount.Value; } } } }
BepInEX/plugins/5Bit-FPSSpectate/FPSSpectate.dll
Decompiled 11 months agousing 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 GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; 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("FPSSpectate")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("FPS spectate camera")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ada41809ef3e18d1ac6f547212c170f1debd12d4")] [assembly: AssemblyProduct("FPSSpectate")] [assembly: AssemblyTitle("FPSSpectate")] [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 FPSSpectate { [BepInPlugin("5Bit.FPSSpectate", "FPSSpectate", "1.0.0")] public class FPSSpectate : BaseUnityPlugin { private const string modGUID = "5Bit.FPSSpectate"; private const string modName = "FPSSpectate"; private const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("5Bit.FPSSpectate"); private static FPSSpectate Instance; internal static ManualLogSource mls; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("5Bit.FPSSpectate"); harmony.PatchAll(); } } public static class PluginInfo { public const string PLUGIN_GUID = "FPSSpectate"; public const string PLUGIN_NAME = "FPSSpectate"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace FPSSpectate.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class FPSSpectatePatch { private const float SPECTATE_OFFSET = 1.5f; private static bool firstPerson = true; private static bool debounced = false; [HarmonyPatch("LateUpdate")] [HarmonyPostfix] private static void LateUpdate(PlayerControllerB __instance) { //IL_008d: 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_009d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (((ButtonControl)Keyboard.current.vKey).wasPressedThisFrame && !debounced) { firstPerson = !firstPerson; debounced = true; } if (((ButtonControl)Keyboard.current.vKey).wasReleasedThisFrame) { debounced = false; } if ((Object)(object)__instance.spectatedPlayerScript != (Object)null && firstPerson) { Transform transform = ((Component)__instance.spectateCameraPivot).transform; Transform transform2 = ((Component)__instance.spectatedPlayerScript.visorCamera).transform; Vector3 position = transform2.position; Vector3 forward = transform2.forward; transform.position = position + ((Vector3)(ref forward)).normalized * 1.5f; transform.rotation = transform2.rotation; } } } }
BepInEX/plugins/anormaltwig-LateCompany/LateCompanyV1.0.7.dll
Decompiled 11 months agousing 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+dd1c760480cb012e5275a3b7e6464b2b2dffb1d0")] [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.7"; } [BepInPlugin("twig.latecompany", "Late Company", "1.0.7")] 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")] internal static class DisableInviteFriendsButton_Patch { [HarmonyPrefix] private static bool Prefix() { return false; } } [HarmonyPatch(typeof(QuickMenuManager), "InviteFriendsButton")] 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_0020: 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_0032: 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) NetworkManager networkManager = target.NetworkManager; if ((Object)(object)networkManager != (Object)null && networkManager.IsListening) { 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.CurrentWeather = (LevelWeatherType)num3; WeatherSync.DoOverride = true; RPCExecStage.SetValue(target, RpcEnum.Client); ((RoundManager)((target is RoundManager) ? target : null)).GenerateNewLevelClientRpc(num, num2); RPCExecStage.SetValue(target, RpcEnum.None); } catch { WeatherSync.DoOverride = false; ((FastBufferReader)(ref reader)).Seek(0); return true; } } return false; } } [HarmonyPatch(typeof(RoundManager), "SetToCurrentLevelWeather")] internal static class SetToCurrentLevelWeather_Patch { [HarmonyPrefix] private static void Prefix() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (WeatherSync.DoOverride) { RoundManager.Instance.currentLevel.currentWeather = WeatherSync.CurrentWeather; WeatherSync.DoOverride = false; } } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyWrapSafe] internal static 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_0106: Expected I4, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_01a5: 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, (int)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 static class OnPlayerDC_Patch { [HarmonyPostfix] private static void Postfix() { if (StartOfRound.Instance.inShipPhase || (!Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.shipHasLanded)) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] internal static class SetShipReadyToLand_Patch { [HarmonyPostfix] private static void Postfix() { if (Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "StartGame")] internal static class StartGame_Patch { [HarmonyPrefix] private static void Prefix() { Plugin.SetLobbyJoinable(joinable: false); } } [HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")] internal static class OnShipLandedMiscEvents_Patch { [HarmonyPostfix] private static void Postfix() { if (!Plugin.OnlyLateJoinInOrbit && StartOfRound.Instance.connectedPlayersAmount + 1 < StartOfRound.Instance.allPlayerScripts.Length) { Plugin.SetLobbyJoinable(joinable: true); } } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] internal static class ShipLeave_Patch { [HarmonyPostfix] private static void Postfix() { Plugin.SetLobbyJoinable(joinable: false); } } }
BepInEX/plugins/BatTeam-LethalFashion/LethalFashion.dll
Decompiled 11 months agousing 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"; } }
BepInEX/plugins/bizzlemip-BiggerLobby/BiggerLobby.dll
Decompiled 11 months agousing System; using System.Collections; 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 System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BiggerLobby.Models; using BiggerLobby.Patches; using BiggerLobby.UI; using Dissonance.Audio.Playback; using GameNetcodeStuff; using HarmonyLib; using LC_API.BundleAPI; using LC_API.ServerAPI; using Microsoft.CodeAnalysis; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Events; 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("BiggerLobby")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Increase the max players to 50 in Lethal Company")] [assembly: AssemblyFileVersion("2.6.0.0")] [assembly: AssemblyInformationalVersion("2.6.0")] [assembly: AssemblyProduct("BiggerLobby")] [assembly: AssemblyTitle("BiggerLobby")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.6.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BiggerLobby { public static class Helper { public static T[] ResizeArray<T>(T[] oldArray, int newSize) { if (oldArray.Length >= newSize) { return oldArray; } T[] array = new T[newSize]; oldArray.CopyTo(array, 0); return array; } public static void ResizeList<T>(this List<T> list, int size, T element = default(T)) { int count = list.Count; if (size < count) { list.RemoveRange(size, count - size); } else if (size > count) { if (size > list.Capacity) { list.Capacity = size; } list.AddRange(Enumerable.Repeat(element, size - count)); } } } [BepInPlugin("BiggerLobby", "BiggerLobby", "2.6.0")] public class Plugin : BaseUnityPlugin { public static Plugin Instance; public static bool oldhastime; public static int MaxPlayers = 16; public static bool instantiating; public static NetworkObject[] PlayerObjects = (NetworkObject[])(object)new NetworkObject[0]; public static Harmony _harmony; public static Harmony _harmony2; public static ConfigEntry<int>? _LoudnessMultiplier; public static bool Initialized = false; public static IDictionary<uint, NetworkObject> CustomNetObjects = new Dictionary<uint, NetworkObject>(); private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown Instance = this; _LoudnessMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Player loudness", 1, "Default player loudness"); _harmony = new Harmony("BiggerLobby"); _harmony2 = new Harmony("BiggerLobbyA"); _harmony.PatchAll(typeof(NonGamePatches)); _harmony.PatchAll(typeof(NonGamePatches.InternalPatches)); _harmony.PatchAll(typeof(NonGamePatches.InternalPatches2)); CustomNetObjects.Clear(); _harmony2.PatchAll(typeof(InternalPatch3)); _harmony2.PatchAll(typeof(ListSizeTranspilers)); _harmony2.PatchAll(typeof(PlayerObjects)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"BiggerLobby loaded"); BundleLoader.OnLoadedAssets = (OnLoadedAssetsDelegate)Delegate.Combine((Delegate?)(object)BundleLoader.OnLoadedAssets, (Delegate?)new OnLoadedAssetsDelegate(OnLoaded)); } private void Start() { Initialize(); } private void OnDestroy() { Initialize(); } private void Initialize() { if (!Initialized) { Initialized = true; ModdedServer.SetServerModdedOnly(); } } private void OnLoaded() { Object.op_Implicit((Object)(object)BundleLoader.GetLoadedAsset<AudioMixer>("assets/diagetic.mixer")); } public static int GetPlayerCount() { return MaxPlayers; } public static int GetPlayerCountMinusOne() { return MaxPlayers - 1; } public static PlayerControllerB[] GetRealPlayerScripts(StartOfRound startOfRound) { if ((Object)(object)startOfRound == (Object)null || startOfRound.allPlayerScripts == null) { return (PlayerControllerB[])(object)new PlayerControllerB[0]; } return startOfRound.allPlayerScripts.Where((PlayerControllerB x) => x.isPlayerDead || x.isPlayerControlled).ToArray(); } } public static class PluginInfo { public const string PLUGIN_GUID = "BiggerLobby"; public const string PLUGIN_NAME = "BiggerLobby"; public const string PLUGIN_VERSION = "2.6.0"; } } namespace BiggerLobby.UI { public class ExpandedStatsUI : MonoBehaviour { private bool _initialized; private bool _debugStatsUI; private static StatsUIReferences? _statsUIReferences; private PlayerStatsList _fourPlayersList; private PlayerStatsList _eightPlayersList; private PlayerStatsList _moreThanEightPlayersList; private List<GameObject> _moreThanEightPlayersPages = new List<GameObject>(); public int UpperPlayerLimit = 40; public float SecondsPanelVisible = 8.5f; private Sprite FourPlayerStatBoxes; private Sprite EightPlayerStatBoxes; private void Start() { if (!_initialized) { if (_debugStatsUI) { DebugStats(); } SetupFourPlayerSlots(); SetupEightPlayerSlots(); SetupMoreThanEightPlayersSlots(); EightPlayerStatBoxes = _statsUIReferences.StatsBoxesThin; FourPlayerStatBoxes = ((Component)((Component)this).transform.GetChild(1)).GetComponent<Image>().sprite; ((Component)this).transform.GetChild(2).Find("AllDead").SetAsLastSibling(); _initialized = true; } } private void DebugStats() { ((Behaviour)((Component)this).gameObject.GetComponent<Animator>()).enabled = false; ((Component)((Component)this).transform.GetChild(0)).GetComponent<CanvasGroup>().alpha = 1f; ((Component)((Component)this).transform.GetChild(1)).GetComponent<CanvasGroup>().alpha = 1f; ((Component)((Component)this).transform.GetChild(2)).GetComponent<CanvasGroup>().alpha = 1f; ((Component)((Component)this).transform.GetChild(2).Find("AllDead")).gameObject.SetActive(false); } private void SetupFourPlayerSlots() { _fourPlayersList = new PlayerStatsList(CreateTransformAtParentOrigin("FourPlayersList", ((Component)this).transform.GetChild(2))); for (int i = 0; i < 4; i++) { Transform val = ((Component)this).transform.GetChild(2).Find($"PlayerSlot{i + 1}"); val.SetParent(_fourPlayersList.transform); _fourPlayersList.AddPlayerSlotTransform(val); } } private void SetupEightPlayerSlots() { _eightPlayersList = new PlayerStatsList(CreateTransformAtParentOrigin("EightPlayersList", ((Component)this).transform.GetChild(2))); List<Transform> playerSlots = SetupEightPlayerPage(_eightPlayersList.transform); _eightPlayersList.AddPlayerSlotTransforms(playerSlots); } private void SetupMoreThanEightPlayersSlots() { _moreThanEightPlayersList = new PlayerStatsList(CreateTransformAtParentOrigin("MoreThanEightPlayersList", ((Component)this).transform.GetChild(2))); int num = (int)Math.Ceiling((float)UpperPlayerLimit / 8f); for (int i = 0; i < num; i++) { Transform val = CreateTransformAtParentOrigin($"Page{i}", _moreThanEightPlayersList.transform); _moreThanEightPlayersPages.Add(((Component)val).gameObject); List<Transform> playerSlots = SetupEightPlayerPage(val); _moreThanEightPlayersList.AddPlayerSlotTransforms(playerSlots); if (i != 0) { ((Component)val).gameObject.SetActive(false); } } } private List<Transform> SetupEightPlayerPage(Transform parent) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) List<Transform> list = new List<Transform>(); for (int i = 0; i < 8; i++) { Transform val = Object.Instantiate<Transform>(_fourPlayersList.transform.GetChild(0), parent, true); SetupPlayerSlot(val); val.localPosition = new Vector3(val.localPosition.x, -26.1f * (float)i, val.localPosition.z); list.Add(val); } return list; } private void SetupPlayerSlot(Transform playerSlot) { //IL_005a: 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_0074: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) TextMeshProUGUI component = ((Component)playerSlot.Find("Notes")).GetComponent<TextMeshProUGUI>(); TextMeshProUGUI component2 = ((Component)playerSlot.GetChild(0)).GetComponent<TextMeshProUGUI>(); RectTransform component3 = ((Component)component2).GetComponent<RectTransform>(); Image component4 = ((Component)playerSlot.GetChild(1)).GetComponent<Image>(); RectTransform component5 = ((Component)component4).GetComponent<RectTransform>(); ((TMP_Text)component).text = "* Most lazy employee\n* Most paranoid employee\n* Sustained the most injuries"; ((TMP_Text)component).fontSize = 9f; ((TMP_Text)component2).text = "CrazyDude12WW"; ((Transform)component3).localPosition = new Vector3(((Transform)component3).localPosition.x, 101.5f, ((Transform)component3).localPosition.z); component4.sprite = _statsUIReferences.CheckmarkThin; component5.sizeDelta = new Vector2(component5.sizeDelta.x, 31.235f); ((Transform)component5).localPosition = new Vector3(((Transform)component5).localPosition.x, 101.5f, ((Transform)component5).localPosition.z); } private Transform CreateTransformAtParentOrigin(string name, Transform parent) { //IL_0001: 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_001e: 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) Transform transform = new GameObject(name).transform; transform.SetParent(parent); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; transform.localScale = Vector3.one; return transform; } public void LoadStatsUIBundle() { AssetBundle obj = AssetBundle.LoadFromFile(Path.Join((ReadOnlySpan<char>)Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location), (ReadOnlySpan<char>)"statsuireferences")); _statsUIReferences = obj.LoadAsset<GameObject>("assets/prefabs/statsuireferences.prefab").GetComponent<StatsUIReferences>(); obj.Unload(false); } public PlayerStatsList GetStatsListFromPlayerCount(int playerCount) { _fourPlayersList.gameObject.SetActive(false); _eightPlayersList.gameObject.SetActive(false); _moreThanEightPlayersList.gameObject.SetActive(false); PlayerStatsList playerStatsList = _fourPlayersList; if (playerCount > 8) { playerStatsList = _moreThanEightPlayersList; } else if (playerCount > 4) { playerStatsList = _eightPlayersList; } SetupStatsList(playerStatsList, playerCount); return playerStatsList; } private void SetupStatsList(PlayerStatsList playerStatsList, int playerCount) { playerStatsList.gameObject.SetActive(true); ((Component)((Component)this).transform.GetChild(1)).GetComponent<Image>().sprite = ((playerCount <= 4) ? FourPlayerStatBoxes : EightPlayerStatBoxes); if (playerCount > 8) { ((MonoBehaviour)this).StartCoroutine(PaginatePlayers(playerCount)); } for (int i = 0; i < playerStatsList.Names.Count; i++) { ((TMP_Text)playerStatsList.Names[i]).text = ""; ((TMP_Text)playerStatsList.Notes[i]).text = ""; ((Behaviour)playerStatsList.States[i]).enabled = false; } } private IEnumerator PaginatePlayers(int playerCount) { int maxPageCount = (int)Math.Ceiling((float)playerCount / 8f); float pageDuration = SecondsPanelVisible / (float)maxPageCount; foreach (GameObject moreThanEightPlayersPage in _moreThanEightPlayersPages) { moreThanEightPlayersPage.SetActive(false); } for (int i = 0; i < maxPageCount; i++) { _moreThanEightPlayersPages[i].SetActive(true); if (i > 0) { _moreThanEightPlayersPages[i - 1].SetActive(false); } yield return (object)new WaitForSeconds(pageDuration); } } public static ExpandedStatsUI GetFromAnimator(Animator endgameStatsAnimator) { ExpandedStatsUI result = default(ExpandedStatsUI); if (((Component)endgameStatsAnimator).TryGetComponent<ExpandedStatsUI>(ref result)) { return result; } ExpandedStatsUI expandedStatsUI = ((Component)endgameStatsAnimator).gameObject.AddComponent<ExpandedStatsUI>(); if ((Object)(object)_statsUIReferences == (Object)null) { expandedStatsUI.LoadStatsUIBundle(); } return expandedStatsUI; } public static Sprite? GetReplacementCheckmark() { return _statsUIReferences?.CheckmarkThin; } } } namespace BiggerLobby.Patches { [HarmonyPatch(typeof(HUDManager))] internal class InternalPatch3 { private static MethodInfo TargetMethod() { return typeof(HUDManager).GetMethod("AddChatMessage", BindingFlags.Instance | BindingFlags.NonPublic); } [HarmonyPrefix] private static void Prefix(HUDManager __instance, string chatMessage, string nameOfUserWhoTyped = "") { if (!(__instance.lastChatMessage == chatMessage)) { __instance.lastChatMessage = chatMessage; __instance.PingHUDElement(__instance.Chat, 4f, 1f, 0.2f); if (__instance.ChatMessageHistory.Count >= 4) { ((TMP_Text)__instance.chatText).text.Remove(0, __instance.ChatMessageHistory[0].Length); __instance.ChatMessageHistory.Remove(__instance.ChatMessageHistory[0]); } StringBuilder stringBuilder = new StringBuilder(chatMessage); for (int i = 1; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { stringBuilder.Replace("[playerNum" + i + "]", StartOfRound.Instance.allPlayerScripts[i].playerUsername); } stringBuilder.Replace("bizzlemip", "<color=#008282>bizzlemip</color>"); chatMessage = stringBuilder.ToString(); nameOfUserWhoTyped = nameOfUserWhoTyped.Replace("bizzlemip", "<color=#008282>bizzlemip</color>"); string item = ((!string.IsNullOrEmpty(nameOfUserWhoTyped)) ? ("<color=#FF0000>" + nameOfUserWhoTyped + "</color>: <color=#FFFF00>'" + chatMessage + "'</color>") : ("<color=#7069ff>" + chatMessage + "</color>")); __instance.ChatMessageHistory.Add(item); ((TMP_Text)__instance.chatText).text = ""; for (int j = 0; j < __instance.ChatMessageHistory.Count; j++) { TextMeshProUGUI chatText = __instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n" + __instance.ChatMessageHistory[j]; } } } } [HarmonyPatch] public class ListSizeTranspilers { private static MethodInfo _playerCountMethod = AccessTools.Method(typeof(Plugin), "GetPlayerCount", (Type[])null, (Type[])null); private static MethodInfo _playerCountMinusOneMethod = AccessTools.Method(typeof(Plugin), "GetPlayerCountMinusOne", (Type[])null, (Type[])null); private static MethodInfo _realPlayerScriptsMethod = AccessTools.Method(typeof(Plugin), "GetRealPlayerScripts", (Type[])null, (Type[])null); private static void CheckAndReplace(List<CodeInstruction> codes, int index) { if (codes[index].opcode == OpCodes.Ldc_I4_4) { codes[index].opcode = OpCodes.Call; codes[index].operand = _playerCountMethod; } } [HarmonyPatch(typeof(HUDManager), "SyncAllPlayerLevelsServerRpc", new Type[] { })] [HarmonyPatch(typeof(DressGirlAI), "ChoosePlayerToHaunt")] [HarmonyPatch(typeof(CrawlerAI), "Start")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SyncLevelsRpc(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Newarr) { CheckAndReplace(list, i - 1); } } return list.AsEnumerable(); } [HarmonyPatch(typeof(PlayerControllerB), "SendNewPlayerValuesServerRpc")] [HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesClientRpc")] [HarmonyPatch(typeof(DressGirlAI), "ChoosePlayerToHaunt")] [HarmonyPatch(typeof(EnemyAI), "GetClosestPlayer")] [HarmonyPatch(typeof(SpringManAI), "DoAIInterval")] [HarmonyPatch(typeof(SpringManAI), "Update")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SendNewPlayerValuesServerRpc(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Blt) { CheckAndReplace(list, i - 1); } } return list.AsEnumerable(); } [HarmonyPatch(typeof(QuickMenuManager), "ConfirmKickUserFromServer")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> ConfirmKickUserFromServer(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_I4_3) { list[i].opcode = OpCodes.Call; list[i].operand = _playerCountMinusOneMethod; Debug.Log((object)"Kick Fix Applied"); break; } } return list.AsEnumerable(); } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> FillEndGameStatsPatch(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "allPlayerScripts") { list[i].opcode = OpCodes.Call; list[i].operand = _realPlayerScriptsMethod; } } return list.Where((CodeInstruction x) => x.opcode != OpCodes.Nop).AsEnumerable(); } [HarmonyPatch(typeof(StartOfRound), "SyncShipUnlockablesServerRpc")] [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SyncShipUnlockablesServerRpc(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldc_I4_4) { list[i].opcode = OpCodes.Call; list[i].operand = _playerCountMethod; } } return list.AsEnumerable(); } } [HarmonyPatch] public class NonGamePatches { [HarmonyPatch(typeof(GameNetworkManager))] internal class InternalPatches { private static MethodInfo TargetMethod() { return typeof(GameNetworkManager).GetMethod("ConnectionApproval", BindingFlags.Instance | BindingFlags.NonPublic); } [HarmonyPrefix] private static bool PostFix(GameNetworkManager __instance, ConnectionApprovalRequest request, ConnectionApprovalResponse response) { //IL_000a: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("Connection approval callback! Game version of client request: " + Encoding.ASCII.GetString(request.Payload).ToString())); Debug.Log((object)$"Joining client id: {request.ClientNetworkId}; Local/host client id: {NetworkManager.Singleton.LocalClientId}"); if (request.ClientNetworkId == NetworkManager.Singleton.LocalClientId) { Debug.Log((object)"Stopped connection approval callback, as the client in question was the host!"); return false; } bool flag = !__instance.disallowConnection; if (flag) { string @string = Encoding.ASCII.GetString(request.Payload); string[] array = @string.Split(","); if (string.IsNullOrEmpty(@string)) { response.Reason = "Unknown; please verify your game files."; flag = false; } else if (__instance.gameHasStarted) { response.Reason = "Game has already started!"; flag = false; } else if (__instance.gameVersionNum.ToString() != array[0]) { response.Reason = $"Game version mismatch! Their version: {__instance.gameVersionNum}. Your version: {array[0]}"; flag = false; } else if (!__instance.disableSteam && ((Object)(object)StartOfRound.Instance == (Object)null || array.Length < 2 || StartOfRound.Instance.KickedClientIds.Contains((ulong)Convert.ToInt64(array[1])))) { response.Reason = "You cannot rejoin after being kicked."; flag = false; } else if (!@string.Contains("BiggerLobbyVersion2.5.0")) { response.Reason = "You need to have <color=#008282>BiggerLobby V2.5.0</color> to join this server!"; flag = false; } } else { response.Reason = "The host was not accepting connections."; } Debug.Log((object)$"Approved connection?: {flag}. Connected players #: {__instance.connectedPlayers}"); Debug.Log((object)("Disapproval reason: " + response.Reason)); response.CreatePlayerObject = false; response.Approved = flag; response.Pending = false; return false; } } [HarmonyPatch(typeof(GameNetworkManager))] internal class InternalPatches2 { private static MethodInfo TargetMethod() { return typeof(GameNetworkManager).GetMethod("SteamMatchmaking_OnLobbyCreated", BindingFlags.Instance | BindingFlags.NonPublic); } [HarmonyPostfix] private static void PostFix(GameNetworkManager __instance, Result result, Lobby lobby) { ((Lobby)(ref lobby)).SetData("name", "[BiggerLobby]" + ((Lobby)(ref lobby)).GetData("name")); } } private static PropertyInfo _playbackVolumeProperty = typeof(VoicePlayback).GetInterface("IVoicePlaybackInternal").GetProperty("PlaybackVolume"); private static FieldInfo _lobbyListField = AccessTools.Field(typeof(SteamLobbyManager), "currentLobbyList"); [HarmonyPatch(typeof(StartOfRound), "UpdatePlayerVoiceEffects")] [HarmonyPrefix] public static void UpdatePlayerVoiceEffects(StartOfRound __instance) { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } typeof(StartOfRound).GetField("updatePlayerVoiceInterval", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, 2f); PlayerControllerB val = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead || !((Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript != (Object)null)) ? GameNetworkManager.Instance.localPlayerController : GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript); for (int i = 0; i < __instance.allPlayerScripts.Length; i++) { PlayerControllerB val2 = __instance.allPlayerScripts[i]; if ((!val2.isPlayerControlled && !val2.isPlayerDead) || (Object)(object)val2 == (Object)(object)GameNetworkManager.Instance.localPlayerController) { continue; } if (val2.voicePlayerState == null || val2.currentVoiceChatIngameSettings._playerState == null || (Object)(object)val2.currentVoiceChatAudioSource == (Object)null) { __instance.RefreshPlayerVoicePlaybackObjects(); if (val2.voicePlayerState == null || (Object)(object)val2.currentVoiceChatAudioSource == (Object)null) { Debug.Log((object)$"Was not able to access voice chat object for player #{i}; {val2.voicePlayerState == null}; {(Object)(object)val2.currentVoiceChatAudioSource == (Object)null}"); continue; } } AudioSource currentVoiceChatAudioSource = __instance.allPlayerScripts[i].currentVoiceChatAudioSource; bool flag = val2.speakingToWalkieTalkie && val.holdingWalkieTalkie && (Object)(object)val2 != (Object)(object)val; if (val2.isPlayerDead) { ((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>()).enabled = false; ((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>()).enabled = false; currentVoiceChatAudioSource.panStereo = 0f; SoundManager.Instance.playerVoicePitchTargets[val2.playerClientId] = 1f; SoundManager.Instance.SetPlayerPitch(1f, (int)val2.playerClientId); if (GameNetworkManager.Instance.localPlayerController.isPlayerDead) { currentVoiceChatAudioSource.spatialBlend = 0f; val2.currentVoiceChatIngameSettings.set2D = true; if ((Object)(object)val2.currentVoiceChatIngameSettings != (Object)null && (Object)(object)val2.currentVoiceChatIngameSettings._playbackComponent != (Object)null) { _playbackVolumeProperty.SetValue(val2.currentVoiceChatIngameSettings._playbackComponent, Mathf.Clamp((SoundManager.Instance.playerVoiceVolumes[i] + 1f) * (float)(2 * Plugin._LoudnessMultiplier.Value), 0f, 1f)); } } else { currentVoiceChatAudioSource.spatialBlend = 1f; val2.currentVoiceChatIngameSettings.set2D = false; if ((Object)(object)val2.currentVoiceChatIngameSettings != (Object)null && (Object)(object)val2.currentVoiceChatIngameSettings._playbackComponent != (Object)null) { _playbackVolumeProperty.SetValue(val2.currentVoiceChatIngameSettings._playbackComponent, 0); } } continue; } AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); OccludeAudio component2 = ((Component)currentVoiceChatAudioSource).GetComponent<OccludeAudio>(); ((Behaviour)component).enabled = true; component2.overridingLowPass = flag || __instance.allPlayerScripts[i].voiceMuffledByEnemy; ((Behaviour)((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>()).enabled = flag; if (!flag) { currentVoiceChatAudioSource.spatialBlend = 1f; val2.currentVoiceChatIngameSettings.set2D = false; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[val2.playerClientId]; component.lowpassResonanceQ = 1f; } else { currentVoiceChatAudioSource.spatialBlend = 0f; val2.currentVoiceChatIngameSettings.set2D = true; if (GameNetworkManager.Instance.localPlayerController.isPlayerDead) { currentVoiceChatAudioSource.panStereo = 0f; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[val2.playerClientId]; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; } else { currentVoiceChatAudioSource.panStereo = 0.4f; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[val2.playerClientId]; } component2.lowPassOverride = 4000f; component.lowpassResonanceQ = 3f; } if ((Object)(object)val2.currentVoiceChatIngameSettings != (Object)null && (Object)(object)val2.currentVoiceChatIngameSettings._playbackComponent != (Object)null) { _playbackVolumeProperty.SetValue(val2.currentVoiceChatIngameSettings._playbackComponent, Mathf.Clamp((SoundManager.Instance.playerVoiceVolumes[i] + 1f) * (float)(2 * Plugin._LoudnessMultiplier.Value), 0f, 1f)); } } } [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] public static void ResizeLists(ref StartOfRound __instance) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown __instance.allPlayerObjects = Helper.ResizeArray(__instance.allPlayerObjects, Plugin.MaxPlayers); __instance.allPlayerScripts = Helper.ResizeArray(__instance.allPlayerScripts, Plugin.MaxPlayers); __instance.gameStats.allPlayerStats = Helper.ResizeArray(__instance.gameStats.allPlayerStats, Plugin.MaxPlayers); __instance.playerSpawnPositions = Helper.ResizeArray(__instance.playerSpawnPositions, Plugin.MaxPlayers); for (int i = 4; i < Plugin.MaxPlayers; i++) { __instance.gameStats.allPlayerStats[i] = new PlayerStats(); __instance.playerSpawnPositions[i] = __instance.playerSpawnPositions[0]; } } [HarmonyPatch(typeof(HUDManager), "Awake")] [HarmonyPrefix] public static void ResizeHUD(ref HUDManager __instance) { ExpandedStatsUI.GetFromAnimator(__instance.endgameStatsAnimator); } [HarmonyPatch(typeof(SoundManager), "SetPlayerVoiceFilters")] [HarmonyPrefix] public static bool SetPlayerVoiceFilters(ref SoundManager __instance) { for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (!StartOfRound.Instance.allPlayerScripts[i].isPlayerControlled && !StartOfRound.Instance.allPlayerScripts[i].isPlayerDead) { __instance.playerVoicePitches[i] = 1f; __instance.playerVoiceVolumes[i] = 1f; continue; } if (StartOfRound.Instance.allPlayerScripts[i].voicePlayerState != null) { typeof(VoicePlayback).GetProperty("Dissonance.Audio.Playback.IVoicePlaybackInternal.PlaybackVolume", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(StartOfRound.Instance.allPlayerScripts[i].currentVoiceChatIngameSettings._playbackComponent, Mathf.Clamp((SoundManager.Instance.playerVoiceVolumes[i] + 1f) * (float)(2 * Plugin._LoudnessMultiplier.Value), 0f, 1f)); } if (Mathf.Abs(__instance.playerVoicePitches[i] - __instance.playerVoicePitchTargets[i]) > 0.025f) { __instance.playerVoicePitches[i] = Mathf.Lerp(__instance.playerVoicePitches[i], __instance.playerVoicePitchTargets[i], 3f * Time.deltaTime); } else if (__instance.playerVoicePitches[i] != __instance.playerVoicePitchTargets[i]) { __instance.playerVoicePitches[i] = __instance.playerVoicePitchTargets[i]; } } return false; } [HarmonyPatch(typeof(MenuManager), "OnEnable")] [HarmonyPostfix] public static void CustomMenu(ref MenuManager __instance) { //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022b: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0265: 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_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) GameObject p2; RectTransform rt9 = default(RectTransform); if (!__instance.isInitScene) { GameObject gameObject = ((Component)__instance.HostSettingsOptionsNormal.transform.parent.parent).gameObject; Component component = gameObject.GetComponent(typeof(RectTransform)); RectTransform val = (RectTransform)(object)((component is RectTransform) ? component : null); p2 = ((Component)gameObject.transform.Find("PrivatePublicDescription")).gameObject; Component component2 = p2.GetComponent(typeof(RectTransform)); RectTransform val2 = (RectTransform)(object)((component2 is RectTransform) ? component2 : null); Component component3 = ((Component)__instance.HostSettingsOptionsNormal.transform.Find("EnterAName")).gameObject.GetComponent(typeof(RectTransform)); RectTransform val3 = (RectTransform)(object)((component3 is RectTransform) ? component3 : null); GameObject gameObject2 = ((Component)__instance.HostSettingsOptionsNormal.transform.Find("ServerNameField")).gameObject; Component component4 = gameObject2.GetComponent(typeof(RectTransform)); RectTransform val4 = (RectTransform)(object)((component4 is RectTransform) ? component4 : null); Component component5 = ((Component)gameObject.transform.Find("Confirm")).gameObject.GetComponent(typeof(RectTransform)); RectTransform val5 = (RectTransform)(object)((component5 is RectTransform) ? component5 : null); Component component6 = ((Component)gameObject.transform.Find("Back")).gameObject.GetComponent(typeof(RectTransform)); RectTransform val6 = (RectTransform)(object)((component6 is RectTransform) ? component6 : null); Component component7 = ((Component)__instance.HostSettingsOptionsNormal.transform.Find("Public")).gameObject.GetComponent(typeof(RectTransform)); RectTransform val7 = (RectTransform)(object)((component7 is RectTransform) ? component7 : null); Component component8 = ((Component)__instance.HostSettingsOptionsNormal.transform.Find("Private")).gameObject.GetComponent(typeof(RectTransform)); Component obj = ((component8 is RectTransform) ? component8 : null); GameObject val8 = Object.Instantiate<GameObject>(gameObject2, gameObject2.transform.parent); ref RectTransform reference = ref rt9; Component component9 = val8.GetComponent(typeof(RectTransform)); reference = (RectTransform)(object)((component9 is RectTransform) ? component9 : null); val.sizeDelta = new Vector2(val.sizeDelta.x, 200f); val2.anchoredPosition = new Vector2(val2.anchoredPosition.x, -50f); val3.anchoredPosition = new Vector2(val3.anchoredPosition.x, 40f); val4.anchoredPosition = new Vector2(val4.anchoredPosition.x, 55f); val5.anchoredPosition = new Vector2(val5.anchoredPosition.x, -60f); val6.anchoredPosition = new Vector2(val6.anchoredPosition.x, -85f); val7.anchoredPosition = new Vector2(val7.anchoredPosition.x, -23f); ((RectTransform)obj).anchoredPosition = new Vector2(((RectTransform)obj).anchoredPosition.x, -23f); rt9.anchoredPosition = new Vector2(rt9.anchoredPosition.x, 21f); ((Object)rt9).name = "ServerPlayersField"; ((Component)rt9).GetComponent<TMP_InputField>().contentType = (ContentType)2; ((TMP_Text)((Component)((Component)rt9).transform.Find("Text Area").Find("Placeholder")).gameObject.GetComponent<TextMeshProUGUI>()).text = "Max players (16)..."; ((Component)rt9).transform.parent = __instance.HostSettingsOptionsNormal.transform; ((UnityEvent<string>)(object)((Component)rt9).GetComponent<TMP_InputField>().onValueChanged).AddListener((UnityAction<string>)delegate { OnChange(); }); } void OnChange() { string text = Regex.Replace(((Component)rt9).GetComponent<TMP_InputField>().text, "[^0-9]", ""); Debug.Log((object)text); if (!int.TryParse(text, out var result)) { result = 16; } result = Math.Min(Math.Max(result, 4), 40); Debug.Log((object)result); if (result > 16) { ((TMP_Text)p2.GetComponent<TextMeshProUGUI>()).text = "Notice: High max player counts\nmay cause lag."; } else if (((TMP_Text)p2.GetComponent<TextMeshProUGUI>()).text == "Notice: High max player counts\nmay cause lag.") { ((TMP_Text)p2.GetComponent<TextMeshProUGUI>()).text = "yeah you should be good now lol"; } } } [HarmonyPatch(typeof(MenuManager), "StartHosting")] [HarmonyPrefix] public static bool StartHost(MenuManager __instance) { //IL_008f: 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) if (!GameNetworkManager.Instance.currentLobby.HasValue) { return true; } if (!int.TryParse(Regex.Replace(((TMP_Text)((Component)((Component)__instance.HostSettingsOptionsNormal.transform.Find("ServerPlayersField")).gameObject.transform.Find("Text Area").Find("Text")).gameObject.GetComponent<TextMeshProUGUI>()).text, "[^0-9]", ""), out var result)) { result = 16; } result = Math.Min(Math.Max(result, 4), 40); Lobby valueOrDefault = GameNetworkManager.Instance.currentLobby.GetValueOrDefault(); ((Lobby)(ref valueOrDefault)).SetData("MaxPlayers", result.ToString()); Debug.Log((object)$"SETTING MAX PLAYERS TO {result}!"); Plugin.MaxPlayers = result; if ((Object)(object)GameNetworkManager.Instance != (Object)null) { GameNetworkManager.Instance.maxAllowedPlayers = Plugin.MaxPlayers; } return true; } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] [HarmonyPrefix] public static void FillEndGameStats(HUDManager __instance) { ExpandedStatsUI fromAnimator = ExpandedStatsUI.GetFromAnimator(__instance.endgameStatsAnimator); if (!((Object)(object)fromAnimator == (Object)null) && !((Object)(object)StartOfRound.Instance == (Object)null)) { PlayerStatsList statsListFromPlayerCount = fromAnimator.GetStatsListFromPlayerCount(Plugin.GetRealPlayerScripts(StartOfRound.Instance).Length); __instance.statsUIElements.playerNamesText = statsListFromPlayerCount.Names.ToArray(); __instance.statsUIElements.playerStates = statsListFromPlayerCount.States.ToArray(); __instance.statsUIElements.playerNotesText = statsListFromPlayerCount.Notes.ToArray(); Debug.Log((object)"Adding EXPANDED stats!"); } } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] [HarmonyPostfix] public static void FillEndGameStatsPostfix(HUDManager __instance) { if ((Object)(object)StartOfRound.Instance == (Object)null || Plugin.GetRealPlayerScripts(StartOfRound.Instance).Length <= 4) { return; } TextMeshProUGUI[] playerNotesText = __instance.statsUIElements.playerNotesText; foreach (TextMeshProUGUI val in playerNotesText) { if (!(((TMP_Text)val).text == "")) { ((TMP_Text)val).text = ((TMP_Text)val).text.Replace("Notes:", "").Trim(); } } Sprite replacementCheckmark = ExpandedStatsUI.GetReplacementCheckmark(); if ((Object)(object)replacementCheckmark == (Object)null) { return; } Image[] playerStates = __instance.statsUIElements.playerStates; foreach (Image val2 in playerStates) { if (!((Object)(object)val2.sprite != (Object)(object)__instance.statsUIElements.aliveIcon)) { val2.sprite = replacementCheckmark; } } } [HarmonyPatch(typeof(GameNetworkManager), "StartHost")] [HarmonyPrefix] public static bool DoTheThe() { Plugin.CustomNetObjects.Clear(); return true; } [HarmonyPatch(typeof(GameNetworkManager), "StartClient")] [HarmonyPrefix] public static bool StartClient(GameNetworkManager __instance) { Plugin.CustomNetObjects.Clear(); return true; } [HarmonyPatch(typeof(MenuManager), "StartAClient")] [HarmonyPrefix] public static bool StartAClient() { Plugin.CustomNetObjects.Clear(); Debug.Log((object)"LanRunningggg!"); return true; } [HarmonyPatch(typeof(SteamLobbyManager), "loadLobbyListAndFilter")] [HarmonyPostfix] public static IEnumerator LoadLobbyListAndFilter(IEnumerator result, SteamLobbyManager __instance) { while (result.MoveNext()) { yield return result.Current; } Debug.Log((object)"Injecting BL playercounts into lobby list."); LobbySlot[] componentsInChildren = ((Component)__instance.levelListContainer).GetComponentsInChildren<LobbySlot>(true); foreach (LobbySlot val in componentsInChildren) { try { ((TMP_Text)val.LobbyName).text = ((TMP_Text)val.LobbyName).text.Replace("[BiggerLobby]", "[BL]"); if (!int.TryParse(((Lobby)(ref val.thisLobby)).GetData("MaxPlayers"), out var result2)) { result2 = 4; } ((TMP_Text)val.playerCount).text = ((TMP_Text)val.playerCount).text.Replace("/ 4", $"/ {result2}"); } catch (Exception ex) { Debug.LogWarning((object)"Exception while injecting BL lobby metadata:"); Debug.LogWarning((object)ex); } } } [HarmonyPatch(typeof(SteamMatchmaking), "CreateLobbyAsync")] [HarmonyPrefix] public static void SetMaxMembers(ref int maxMembers) { maxMembers = Plugin.MaxPlayers; } [HarmonyPatch(typeof(GameNetworkManager), "SetConnectionDataBeforeConnecting")] [HarmonyPrefix] public static bool SetConnectionDataBeforeConnecting(GameNetworkManager __instance) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) __instance.localClientWaitingForApproval = true; Debug.Log((object)("Game version: " + __instance.gameVersionNum)); if (__instance.disableSteam) { NetworkManager.Singleton.NetworkConfig.ConnectionData = Encoding.ASCII.GetBytes(__instance.gameVersionNum + ",BiggerLobbyVersion2.5.0"); } else { NetworkManager.Singleton.NetworkConfig.ConnectionData = Encoding.ASCII.GetBytes(__instance.gameVersionNum + "," + SteamId.op_Implicit(SteamClient.SteamId) + ",BiggerLobbyVersion2.5.0"); } return false; } [HarmonyPatch(typeof(GameNetworkManager), "LobbyDataIsJoinable")] [HarmonyPrefix] public static bool SkipLobbySizeCheck(ref GameNetworkManager __instance, ref bool __result, Lobby lobby) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) string data = ((Lobby)(ref lobby)).GetData("vers"); if (!int.TryParse(((Lobby)(ref lobby)).GetData("MaxPlayers"), out var result)) { result = 16; } result = Math.Min(Math.Max(result, 4), 40); if (((Lobby)(ref lobby)).MemberCount >= result || ((Lobby)(ref lobby)).MemberCount < 1) { Debug.Log((object)$"Lobby join denied! Too many members in lobby! {((Lobby)(ref lobby)).Id}"); Object.FindObjectOfType<MenuManager>().SetLoadingScreen(false, (RoomEnter)4, "The server is full!"); __result = false; return false; } if (data != __instance.gameVersionNum.ToString()) { Debug.Log((object)$"Lobby join denied! Attempted to join vers.{data} lobby id: {((Lobby)(ref lobby)).Id}"); Object.FindObjectOfType<MenuManager>().SetLoadingScreen(false, (RoomEnter)2, $"The server host is playing on version {data} while you are on version {__instance.gameVersionNum}."); __result = false; return false; } if (((Lobby)(ref lobby)).GetData("joinable") == "false") { Debug.Log((object)"Lobby join denied! Host lobby is not joinable"); Object.FindObjectOfType<MenuManager>().SetLoadingScreen(false, (RoomEnter)2, "The server host has already landed their ship, or they are still loading in."); __result = false; return false; } Plugin.MaxPlayers = result; Debug.Log((object)$"SETTING MAX PLAYERS TO {result}!"); if ((Object)(object)__instance != (Object)null) { __instance.maxAllowedPlayers = Plugin.MaxPlayers; } __result = true; return false; } } [HarmonyPatch] internal class PlayerObjects { private static StartOfRound startOfRound; private static bool instantiating; private static int nextClientId; private static PlayerControllerB referencePlayer; [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] public static void ResizeLists(ref StartOfRound __instance) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown __instance.allPlayerObjects = Helper.ResizeArray(__instance.allPlayerObjects, Plugin.MaxPlayers); __instance.allPlayerScripts = Helper.ResizeArray(__instance.allPlayerScripts, Plugin.MaxPlayers); __instance.gameStats.allPlayerStats = Helper.ResizeArray(__instance.gameStats.allPlayerStats, Plugin.MaxPlayers); __instance.playerSpawnPositions = Helper.ResizeArray(__instance.playerSpawnPositions, Plugin.MaxPlayers); for (int i = 4; i < Plugin.MaxPlayers; i++) { __instance.gameStats.allPlayerStats[i] = new PlayerStats(); __instance.playerSpawnPositions[i] = __instance.playerSpawnPositions[0]; } } [HarmonyPatch(typeof(ForestGiantAI), "Start")] [HarmonyPrefix] public static bool ResizeLists2(ref ForestGiantAI __instance) { __instance.playerStealthMeters = Helper.ResizeArray(__instance.playerStealthMeters, Plugin.MaxPlayers); return true; } [HarmonyPatch(typeof(HUDManager), "Awake")] [HarmonyPostfix] public static void ResizeLists2(ref HUDManager __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown __instance.playerLevels = Helper.ResizeArray(__instance.playerLevels, Plugin.MaxPlayers + 1); for (int i = 4; i < Plugin.MaxPlayers; i++) { __instance.playerLevels[i] = new PlayerLevel(); } } [HarmonyPatch(typeof(SoundManager), "Awake")] [HarmonyPostfix] public static void SoundWake(ref SoundManager __instance) { __instance.playerVoiceMixers = Helper.ResizeArray(__instance.playerVoiceMixers, Plugin.MaxPlayers); for (int i = 0; i < Plugin.MaxPlayers; i++) { __instance.playerVoiceMixers[i] = __instance.diageticMixer.outputAudioMixerGroup; } } [HarmonyPatch(typeof(SoundManager), "Start")] [HarmonyPostfix] public static void ResizeSoundManagerLists(ref SoundManager __instance) { __instance.playerVoicePitchLerpSpeed = new float[Plugin.MaxPlayers + 1]; __instance.playerVoicePitchTargets = new float[Plugin.MaxPlayers + 1]; __instance.playerVoiceVolumes = new float[Plugin.MaxPlayers + 1]; __instance.playerVoicePitches = new float[Plugin.MaxPlayers + 1]; for (int i = 1; i < Plugin.MaxPlayers + 1; i++) { __instance.playerVoicePitchLerpSpeed[i] = 3f; __instance.playerVoicePitchTargets[i] = 1f; __instance.playerVoicePitches[i] = 1f; __instance.playerVoiceVolumes[i] = 1f; } } [HarmonyPatch(typeof(EnemyAI), "EnableEnemyMesh")] [HarmonyPrefix] public static bool EnableEnemyMesh(EnemyAI __instance, bool enable, bool overrideDoNotSet = false) { int layer = ((!enable) ? 23 : 19); for (int i = 0; i < __instance.skinnedMeshRenderers.Length; i++) { if (Object.op_Implicit((Object)(object)__instance.skinnedMeshRenderers[i]) && (!((Component)__instance.skinnedMeshRenderers[i]).CompareTag("DoNotSet") || overrideDoNotSet)) { ((Component)__instance.skinnedMeshRenderers[i]).gameObject.layer = layer; } } for (int j = 0; j < __instance.meshRenderers.Length; j++) { if (Object.op_Implicit((Object)(object)__instance.meshRenderers[j]) && (!((Component)__instance.meshRenderers[j]).CompareTag("DoNotSet") || overrideDoNotSet)) { ((Component)__instance.meshRenderers[j]).gameObject.layer = layer; } } return false; } [HarmonyPatch(typeof(ShipTeleporter), "Awake")] [HarmonyPrefix] public static bool Awake2(ShipTeleporter __instance) { int[] array = new int[Plugin.MaxPlayers]; for (int i = 0; i < Plugin.MaxPlayers; i++) { array[i] = -1; } typeof(ShipTeleporter).GetField("playersBeingTeleported", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, array); __instance.buttonTrigger.interactable = false; typeof(ShipTeleporter).GetField("cooldownTime", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, __instance.cooldownAmount); return false; } [HarmonyPatch(typeof(NetworkSceneManager), "PopulateScenePlacedObjects")] [HarmonyPrefix] public static bool AddPlayers(NetworkSceneManager __instance) { //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) startOfRound = StartOfRound.Instance; if ((Object)(object)startOfRound.allPlayerObjects[Plugin.MaxPlayers - 1] != (Object)null) { return true; } referencePlayer = startOfRound.allPlayerObjects[0].GetComponent<PlayerControllerB>(); GameObject playerPrefab = startOfRound.playerPrefab; Transform transform = ((Component)startOfRound.playersContainer).transform; FieldInfo field = typeof(NetworkObject).GetField("GlobalObjectIdHash", BindingFlags.Instance | BindingFlags.NonPublic); PropertyInfo property = typeof(NetworkObject).GetProperty("NetworkObjectId", BindingFlags.Instance | BindingFlags.Public); typeof(NetworkSceneManager).GetField("ScenePlacedObjects", BindingFlags.Instance | BindingFlags.NonPublic); instantiating = true; typeof(NetworkSpawnManager).GetMethod("SpawnNetworkObjectLocally", BindingFlags.Instance | BindingFlags.NonPublic, null, CallingConventions.Any, new Type[6] { typeof(NetworkObject), typeof(ulong), typeof(bool), typeof(bool), typeof(ulong), typeof(bool) }, null); for (int i = 4; i < Plugin.MaxPlayers; i++) { nextClientId = i; GameObject val = Object.Instantiate<GameObject>(playerPrefab, transform); PlayerControllerB component = val.GetComponent<PlayerControllerB>(); NetworkObject component2 = val.GetComponent<NetworkObject>(); NetworkObject component3 = ((Component)val.transform.Find("PlayerPhysicsBox")).gameObject.GetComponent<NetworkObject>(); NetworkObject component4 = ((Component)val.transform.Find("ScavengerModel/metarig/ScavengerModelArmsOnly/metarig/spine.003/shoulder.R/arm.R_upper/arm.R_lower/hand.R/LocalItemHolder")).gameObject.GetComponent<NetworkObject>(); NetworkObject component5 = ((Component)val.transform.Find("ScavengerModel/metarig/spine/spine.001/spine.002/spine.003/shoulder.R/arm.R_upper/arm.R_lower/hand.R/ServerItemHolder")).gameObject.GetComponent<NetworkObject>(); component.TeleportPlayer(StartOfRound.Instance.notSpawnedPosition.position, false, 0f, false, true); startOfRound.allPlayerObjects[i] = val; startOfRound.allPlayerScripts[i] = component; uint num = (uint)(6942069 + i); ulong num2 = 6942069uL + (ulong)i; uint num3 = (uint)(123456789 + i); uint num4 = (uint)(987654321 + i); uint num5 = (uint)(124585949 + i); ulong num6 = 123456789uL + (ulong)i; ulong num7 = 987654321uL + (ulong)i; ulong num8 = 124585949uL + (ulong)i; Scene scene = ((Component)component2).gameObject.scene; _ = ((Scene)(ref scene)).handle; field.SetValue(component2, num); property.SetValue(component2, num2); field.SetValue(component3, num3); property.SetValue(component3, num6); field.SetValue(component4, num4); property.SetValue(component4, num7); field.SetValue(component5, num5); property.SetValue(component5, num8); ManualCameraRenderer[] array = Object.FindObjectsByType<ManualCameraRenderer>((FindObjectsInactive)1, (FindObjectsSortMode)0); for (int j = 0; j < array.Length; j++) { array[j].AddTransformAsTargetToRadar(((Component)component).transform, "Player #" + j, false); } } instantiating = false; return true; } [HarmonyPatch(typeof(QuickMenuManager), "AddUserToPlayerList")] [HarmonyPrefix] public static bool AddUserToPlayerList(QuickMenuManager __instance, ulong steamId, string playerName, int playerObjectId) { if (playerObjectId >= 0 && playerObjectId <= Plugin.MaxPlayers) { __instance.playerListSlots[playerObjectId].KickUserButton.SetActive(((NetworkBehaviour)StartOfRound.Instance).IsServer); __instance.playerListSlots[playerObjectId].slotContainer.SetActive(true); __instance.playerListSlots[playerObjectId].isConnected = true; __instance.playerListSlots[playerObjectId].playerSteamId = steamId; ((TMP_Text)__instance.playerListSlots[playerObjectId].usernameHeader).text = playerName.Replace("bizzlemip", "<color=#008282>bizzlemip</color>"); if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { __instance.playerListSlots[playerObjectId].volumeSliderContainer.SetActive(playerObjectId != (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } return false; } [HarmonyPatch(typeof(QuickMenuManager), "Update")] [HarmonyPrefix] private static bool Update(QuickMenuManager __instance) { for (int i = 0; i < __instance.playerListSlots.Length; i++) { if (__instance.playerListSlots[i].isConnected) { float num = __instance.playerListSlots[i].volumeSlider.value / __instance.playerListSlots[i].volumeSlider.maxValue; if (num == -1f) { SoundManager.Instance.playerVoiceVolumes[i] = -1f; } else { SoundManager.Instance.playerVoiceVolumes[i] = num; } } } return false; } [HarmonyPatch(typeof(QuickMenuManager), "Start")] [HarmonyPrefix] public static bool FixPlayerList(ref QuickMenuManager __instance) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0173: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Expected O, but got Unknown GameObject val = null; GameObject gameObject = ((Component)__instance.playerListPanel.transform.Find("Image")).gameObject; if (Object.op_Implicit((Object)(object)gameObject.transform.Find("Mask"))) { val = ((Component)gameObject.transform.Find("Mask")).gameObject; } GameObject val2 = new GameObject("Mask"); GameObject val3 = new GameObject("ScrollViewport"); GameObject val4 = new GameObject("BGCollision"); GameObject val5 = new GameObject("ScrollContent"); val2.transform.SetParent(gameObject.transform); val3.transform.SetParent(val2.transform); val4.transform.SetParent(val3.transform); val5.transform.SetParent(val3.transform); val2.transform.localScale = Vector3.one; val3.transform.localScale = Vector3.one; val5.transform.localScale = Vector3.one; val2.AddComponent<RectTransform>().sizeDelta = new Vector2(300f, 280f); val2.transform.localPosition = new Vector3(-10f, 110f, 0f); val3.transform.localPosition = new Vector3(0f, -10f, 0f); val5.AddComponent<RectTransform>().pivot = new Vector2(0.5f, 1f); val2.GetComponent<RectTransform>().pivot = new Vector2(0.5f, 1f); val2.transform.localPosition = new Vector3(-10f, 110f, 0f); val2.AddComponent<RectMask2D>(); VerticalLayoutGroup val6 = val5.AddComponent<VerticalLayoutGroup>(); ContentSizeFitter obj = val5.AddComponent<ContentSizeFitter>(); ScrollRect obj2 = val3.AddComponent<ScrollRect>(); obj2.viewport = val3.AddComponent<RectTransform>(); obj2.content = val5.GetComponent<RectTransform>(); obj2.horizontal = false; Image val7 = val4.AddComponent<Image>(); val4.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f); val4.GetComponent<RectTransform>().anchorMax = new Vector2(1f, 1f); ((Graphic)val7).color = new Color(255f, 255f, 255f, 0f); ((HorizontalOrVerticalLayoutGroup)val6).spacing = 50f; obj.horizontalFit = (FitMode)0; obj.verticalFit = (FitMode)2; __instance.playerListSlots = Helper.ResizeArray(__instance.playerListSlots, Plugin.MaxPlayers); for (int i = 0; i < Plugin.MaxPlayers; i++) { if (i < 4) { __instance.playerListSlots[i].slotContainer.transform.SetParent(val5.transform); continue; } PlayerListSlot val8 = new PlayerListSlot(); GameObject val9 = (val8.slotContainer = Object.Instantiate<GameObject>(__instance.playerListSlots[0].slotContainer)); val8.volumeSliderContainer = ((Component)val9.transform.Find("VoiceVolumeSlider")).gameObject; val8.KickUserButton = ((Component)val9.transform.Find("KickButton")).gameObject; QuickMenuManager yeahoriginal = __instance; int localI = i; ((UnityEvent)val8.KickUserButton.GetComponent<Button>().onClick).AddListener((UnityAction)delegate { yeahoriginal.KickUserFromServer(localI); }); val8.isConnected = false; val8.usernameHeader = ((Component)val9.transform.Find("PlayerNameButton").Find("PName")).gameObject.GetComponent<TextMeshProUGUI>(); val8.volumeSlider = ((Component)val9.transform.Find("VoiceVolumeSlider").Find("Slider")).gameObject.GetComponent<Slider>(); val8.playerSteamId = __instance.playerListSlots[0].playerSteamId; val9.transform.SetParent(val5.transform, false); __instance.playerListSlots[i] = val8; } if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } return true; } [HarmonyPatch(typeof(ManualCameraRenderer), "Awake")] [HarmonyPrefix] public static bool Mawake(ref ManualCameraRenderer __instance) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown for (int i = 0; i < 4; i++) { __instance.radarTargets.Add(new TransformAndName(((Component)StartOfRound.Instance.allPlayerScripts[i]).transform, StartOfRound.Instance.allPlayerScripts[i].playerUsername, false)); } __instance.targetTransformIndex = 0; __instance.targetedPlayer = StartOfRound.Instance.allPlayerScripts[0]; return false; } [HarmonyPatch(typeof(PlayerControllerB), "Awake")] [HarmonyPrefix] public static bool FixPlayerObject(ref PlayerControllerB __instance) { if (!instantiating) { return true; } ((Object)((Component)__instance).gameObject).name = $"ExtraPlayer{nextClientId}"; __instance.playerClientId = (ulong)nextClientId; __instance.actualClientId = (ulong)nextClientId; StartOfRound.Instance.allPlayerObjects[nextClientId] = ((Component)((Component)__instance).transform.parent).gameObject; StartOfRound.Instance.allPlayerScripts[nextClientId] = __instance; FieldInfo[] fields = typeof(PlayerControllerB).GetFields(); foreach (FieldInfo fieldInfo in fields) { object value = fieldInfo.GetValue(__instance); object value2 = fieldInfo.GetValue(referencePlayer); if (value == null && value2 != null) { fieldInfo.SetValue(__instance, value2); } } ((Behaviour)__instance).enabled = true; return true; } [HarmonyPatch(typeof(StartOfRound), "GetPlayerSpawnPosition")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> GetPlayerSpawnPosition(IEnumerable<CodeInstruction> instructions) { List<CodeInstruction> list = new List<CodeInstruction>(instructions); list[0].opcode = OpCodes.Ldc_I4_1; return list.AsEnumerable(); } } } namespace BiggerLobby.Models { public class PlayerStatsList { public Transform transform; public List<TextMeshProUGUI> Names = new List<TextMeshProUGUI>(); public List<Image> States = new List<Image>(); public List<TextMeshProUGUI> Notes = new List<TextMeshProUGUI>(); public GameObject gameObject => ((Component)transform).gameObject; public PlayerStatsList(Transform transform) { this.transform = transform; } public void AddPlayerSlotTransform(Transform playerSlot) { TextMeshProUGUI component = ((Component)playerSlot.GetChild(0)).GetComponent<TextMeshProUGUI>(); Image component2 = ((Component)playerSlot.GetChild(1)).GetComponent<Image>(); TextMeshProUGUI component3 = ((Component)playerSlot.Find("Notes")).GetComponent<TextMeshProUGUI>(); Names.Add(component); States.Add(component2); Notes.Add(component3); } public void AddPlayerSlotTransforms(List<Transform> playerSlots) { foreach (Transform playerSlot in playerSlots) { AddPlayerSlotTransform(playerSlot); } } } public enum StatsScreenType { FourPlayers, EightPlayers, MoreThanEightPlayers } public class StatsUIReferences : MonoBehaviour { public Sprite StatsBoxesThin; public Sprite StatsBoxesGradeOnly; public Sprite CheckmarkThin; public ScrollRect ThinScrollRect; } }
BepInEX/plugins/BzzzThe18th-CommandLib/CommandLib.dll
Decompiled 11 months agousing 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; 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 = "")] [assembly: AssemblyCompany("CommandLib")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Template mod for lethal company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CommandLib")] [assembly: AssemblyTitle("CommandLib")] [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 CommandLib { public class ModInfo { public const string name = "Command Library"; public const string guid = "buzzbb.cmdlib"; public const string version = "1.0.0"; } [BepInPlugin("buzzbb.cmdlib", "Command Library", "1.0.0")] public class Commands : BaseUnityPlugin { private Harmony harmonyInstance = new Harmony("buzzbb.cmdlib"); private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Reached awake point for Command [email protected], applying patches"); harmonyInstance.PatchAll(Assembly.GetExecutingAssembly()); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Applied patches"); } public static void RegisterCommand(string word, string returnText, string eventName, Terminal terminal) { TerminalKeyword val = MakeKeyword(word.ToLower()); TerminalNode specialKeywordResult = MakeNode(returnText, eventName); val.specialKeywordResult = specialKeywordResult; RegisterKeyword(val, terminal); } public static TerminalKeyword MakeKeyword(string word) { TerminalKeyword val = ScriptableObject.CreateInstance<TerminalKeyword>(); val.word = word; return val; } public static TerminalNode MakeNode(string returnText, string associatedEvent) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = returnText; val.clearPreviousText = true; val.terminalEvent = associatedEvent; return val; } public static void RegisterKeyword(TerminalKeyword keyword, Terminal terminal) { if ((Object)(object)terminal != (Object)null) { terminal.terminalNodes.allKeywords = CollectionExtensions.AddToArray<TerminalKeyword>(terminal.terminalNodes.allKeywords, keyword); } else { Debug.LogError((object)"Tried to register keyword with null terminal"); } } } }
BepInEX/plugins/ChooMcoo-MoreAdditionalSuits/AdditionalSuits.dll
Decompiled 11 months agousing 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.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("AdditionalSuits")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AdditionalSuits")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("0c25b026-8574-4dd2-9af2-4265f618ef8a")] [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 AdditionalSuits; [Serializable] public class UnlockableSuitDef { public string suitID; public string suitName; public string suitTexture; } public class UnlockableSuitDefListing { public List<UnlockableSuitDef> unlockableSuits = new List<UnlockableSuitDef>(); } [BepInPlugin("ACS.AdditionalSuits", "AdditionalSuits", "1.1.3")] public class AdditionalSuitsBase : BaseUnityPlugin { [HarmonyPatch(typeof(StartOfRound))] internal class acgAdditionalSuitsPatch { [HarmonyPatch("Start")] [HarmonyPrefix] private static void acsStartOfRoundPatch(StartOfRound __instance) { //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown try { if (SuitsLoaded) { return; } UnlockableItem val = null; 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) { val = val2; break; } } string text = Path.Combine(ModResourceFolder, "suit-defs.json"); AddLog("attempting to parse json file: " + text); string text2 = File.ReadAllText(text); if (text2 == null) { AddLog("ERROR: json file was not found"); return; } AddLog("converting json file to manifest..."); string[] array = text2.Split(new char[1] { '[' }); array = array[1].Split(new char[1] { ']' }); array = array[0].Split(new char[1] { '{' }); SuitDefManifest = new UnlockableSuitDefListing(); for (int j = 1; j < array.Length; j++) { string text3 = "{" + array[j].Trim(); if (j != array.Length - 1) { text3 = text3.Substring(0, text3.Length - 1); } UnlockableSuitDef item = JsonUtility.FromJson<UnlockableSuitDef>(text3); SuitDefManifest.unlockableSuits.Add(item); } AddLog("attempting to parse json file: items were found..."); foreach (UnlockableSuitDef unlockableSuit in SuitDefManifest.unlockableSuits) { AddLog("processing custom suit {id=" + unlockableSuit.suitID + ", name=" + unlockableSuit.suitName + "}..."); UnlockableItem val3 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); Texture2D val4 = new Texture2D(2, 2); ImageConversion.LoadImage(val4, File.ReadAllBytes(Path.Combine(ModResourceFolder, unlockableSuit.suitTexture))); Material val5 = Object.Instantiate<Material>(val3.suitMaterial); val5.mainTexture = (Texture)(object)val4; val3.suitMaterial = val5; val3.unlockableName = unlockableSuit.suitName; __instance.unlockablesList.unlockables.Add(val3); mls.LogInfo((object)("AdditionalSuits - added custom suit {id=" + unlockableSuit.suitID + ", name=" + unlockableSuit.suitName + "}!")); } mls.LogInfo((object)"AdditionalSuits - loaded item defs from json file!"); SuitsLoaded = true; } catch (Exception ex) { mls.LogInfo((object)("AdditionalSuits - initialization failed!\nERROR: " + ex)); } } } private static AdditionalSuitsBase Instance; private const string modGUID = "ACS.AdditionalSuits"; private const string modName = "AdditionalSuits"; private const string modVersion = "1.1.3"; private readonly Harmony harmony = new Harmony("ACS.AdditionalSuits"); private static ManualLogSource mls; public static bool SuitsLoaded; public static string ModResourceFolder; public static UnlockableSuitDefListing SuitDefManifest; public string ModGUID => "ACS.AdditionalSuits"; public string ModName => "AdditionalSuits"; public string ModVersion => "1.1.3"; public static void AddLog(string log) { mls.LogInfo((object)("AdditionalSuits - " + log)); } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } mls = Logger.CreateLogSource("ACS.AdditionalSuits"); AddLog("initializing..."); ModResourceFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "resAdditionalSuits"); harmony.PatchAll(); AddLog("initialized!"); } }
BepInEX/plugins/Clementinise-CustomSounds/CustomSounds.dll
Decompiled 11 months agousing 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.Security.Cryptography; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CustomSounds.Networking; using CustomSounds.Patches; using GameNetcodeStuff; using HarmonyLib; using LCSoundTool; 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("CustomSounds")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CustomSounds")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9e086160-a7fd-4721-ba09-3e8534cb7011")] [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")] internal class <Module> { static <Module>() { } } namespace CustomSounds { [BepInPlugin("CustomSounds", "Custom Sounds", "2.2.0")] public class Plugin : BaseUnityPlugin { private const string PLUGIN_GUID = "CustomSounds"; private const string PLUGIN_NAME = "Custom Sounds"; private const string PLUGIN_VERSION = "2.2.0"; public static Plugin Instance; internal ManualLogSource logger; private Harmony harmony; public HashSet<string> currentSounds = new HashSet<string>(); public HashSet<string> oldSounds = new HashSet<string>(); public HashSet<string> modifiedSounds = new HashSet<string>(); public Dictionary<string, string> soundHashes = new Dictionary<string, string>(); public Dictionary<string, string> soundPacks = new Dictionary<string, string>(); public static ConfigEntry<KeyboardShortcut> AcceptSyncKey; public ConfigEntry<bool> configUseNetworking; private Dictionary<string, string> customSoundNames = new Dictionary<string, string>(); public static bool Initialized { get; private set; } private void Awake() { //IL_0065: 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_0089: Expected O, but got Unknown if (!((Object)(object)Instance == (Object)null)) { return; } Instance = this; logger = Logger.CreateLogSource("CustomSounds"); configUseNetworking = ((BaseUnityPlugin)this).Config.Bind<bool>("Experimental", "EnableNetworking", true, "Whether or not to use the networking built into this plugin. If set to true everyone in the lobby needs CustomSounds to join and also \"EnableNetworking\" set to true."); AcceptSyncKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Experimental", "AcceptSyncKey", new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()), "Key to accept audio sync."); harmony = new Harmony("CustomSounds"); harmony.PatchAll(typeof(TerminalParsePlayerSentencePatch)); harmony.PatchAll(typeof(RemapKeyPatch)); if (configUseNetworking.Value) { harmony.PatchAll(typeof(NetworkObjectManager)); } modifiedSounds = new HashSet<string>(); string customSoundsFolderPath = GetCustomSoundsFolderPath(); if (!Directory.Exists(customSoundsFolderPath)) { logger.LogInfo((object)"\"CustomSounds\" folder not found. Creating it now."); Directory.CreateDirectory(customSoundsFolderPath); } string path = Path.Combine(Paths.BepInExConfigPath); try { List<string> list = File.ReadAllLines(path).ToList(); int num = list.FindIndex((string line) => line.StartsWith("HideManagerGameObject")); if (num != -1) { logger.LogInfo((object)"\"hideManagerGameObject\" value not correctly set. Fixing it now."); list[num] = "HideManagerGameObject = true"; } File.WriteAllLines(path, list); } catch (Exception ex) { logger.LogError((object)("Error modifying config file: " + ex.Message)); } Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } logger.LogInfo((object)"Plugin CustomSounds is loaded!"); } internal void Start() { Initialize(); } internal void OnDestroy() { Initialize(); } internal void Initialize() { if (!Initialized) { Initialized = true; DeleteTempFolder(); ReloadSounds(serverSync: false, isTemporarySync: false); } } private void OnApplicationQuit() { DeleteTempFolder(); } public GameObject LoadNetworkPrefabFromEmbeddedResource() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = "CustomSounds.Bundle.audionetworkhandler"; using Stream stream = executingAssembly.GetManifestResourceStream(name); if (stream == null) { Debug.LogError((object)"Asset bundle not found in embedded resources."); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); AssetBundle val = AssetBundle.LoadFromMemory(array); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"Failed to load AssetBundle from memory."); return null; } return val.LoadAsset<GameObject>("audionetworkhandler"); } public void DeleteTempFolder() { string customSoundsTempFolderPath = GetCustomSoundsTempFolderPath(); if (Directory.Exists(customSoundsTempFolderPath)) { try { Directory.Delete(customSoundsTempFolderPath, recursive: true); logger.LogInfo((object)"Temporary-Sync folder deleted successfully."); } catch (Exception ex) { logger.LogError((object)("Error deleting Temporary-Sync folder: " + ex.Message)); } } } public string GetCustomSoundsFolderPath() { return Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), "CustomSounds"); } public string GetCustomSoundsTempFolderPath() { return Path.Combine(GetCustomSoundsFolderPath(), "Temporary-Sync"); } public static byte[] SerializeWavToBytes(string filePath) { try { return File.ReadAllBytes(filePath); } catch (Exception ex) { Console.WriteLine("An error occurred: " + ex.Message); return null; } } public static string SerializeWavToBase64(string filePath) { try { byte[] inArray = File.ReadAllBytes(filePath); return Convert.ToBase64String(inArray); } catch (Exception ex) { Console.WriteLine("An error occurred: " + ex.Message); return null; } } public static void DeserializeBytesToWav(byte[] byteArray, string audioFileName) { try { string customSoundsTempFolderPath = Instance.GetCustomSoundsTempFolderPath(); if (!Directory.Exists(customSoundsTempFolderPath)) { Instance.logger.LogInfo((object)"\"Temporary-Sync\" folder not found. Creating it now."); Directory.CreateDirectory(customSoundsTempFolderPath); } File.WriteAllBytes(Path.Combine(customSoundsTempFolderPath, audioFileName), byteArray); Console.WriteLine("WAV file \"" + audioFileName + "\" created!"); } catch (Exception ex) { Console.WriteLine("An error occurred: " + ex.Message); } } public static List<byte[]> SplitAudioData(byte[] audioData, int maxSegmentSize = 62000) { List<byte[]> list = new List<byte[]>(); for (int i = 0; i < audioData.Length; i += maxSegmentSize) { int num = Mathf.Min(maxSegmentSize, audioData.Length - i); byte[] array = new byte[num]; Array.Copy(audioData, i, array, 0, num); list.Add(array); } return list; } public static byte[] CombineAudioSegments(List<byte[]> segments) { List<byte> list = new List<byte>(); foreach (byte[] segment in segments) { list.AddRange(segment); } return list.ToArray(); } public void ShowCustomTip(string header, string body, bool isWarning) { HUDManager.Instance.DisplayTip(header, body, isWarning, false, "LC_Tip1"); } public void ForceUnsync() { DeleteTempFolder(); ReloadSounds(serverSync: false, isTemporarySync: false); } public void RevertSounds() { HashSet<string> hashSet = new HashSet<string>(); foreach (string currentSound in currentSounds) { string text = currentSound; if (currentSound.Contains("-")) { text = currentSound.Substring(0, currentSound.IndexOf("-")); } if (!hashSet.Contains(text)) { logger.LogInfo((object)(text + " restored.")); SoundTool.RestoreAudioClip(text); hashSet.Add(text); } } logger.LogInfo((object)"Original game sounds restored."); } public static string CalculateMD5(string filename) { using MD5 mD = MD5.Create(); using FileStream inputStream = File.OpenRead(filename); byte[] array = mD.ComputeHash(inputStream); return BitConverter.ToString(array).Replace("-", "").ToLowerInvariant(); } public void ReloadSounds(bool serverSync, bool isTemporarySync) { oldSounds = new HashSet<string>(currentSounds); modifiedSounds.Clear(); string directoryName = Path.GetDirectoryName(Paths.PluginPath); currentSounds.Clear(); customSoundNames.Clear(); string customSoundsTempFolderPath = GetCustomSoundsTempFolderPath(); if (isTemporarySync) { logger.LogInfo((object)("Temporary folder: " + customSoundsTempFolderPath)); if (Directory.Exists(customSoundsTempFolderPath)) { ProcessDirectory(customSoundsTempFolderPath, serverSync, isTemporarySync: true); } } ProcessDirectory(directoryName, serverSync, isTemporarySync: false); } private void ProcessDirectory(string directoryPath, bool serverSync, bool isTemporarySync) { string[] directories = Directory.GetDirectories(directoryPath, "CustomSounds", SearchOption.AllDirectories); foreach (string text in directories) { string fileName = Path.GetFileName(Path.GetDirectoryName(text)); ProcessSoundFiles(text, fileName, serverSync, isTemporarySync); string[] directories2 = Directory.GetDirectories(text); foreach (string text2 in directories2) { string fileName2 = Path.GetFileName(text2); ProcessSoundFiles(text2, fileName2, serverSync, isTemporarySync); } } } private (string soundName, int? percentage, string customName) ParseSoundFileName(string fullSoundName) { string[] array = fullSoundName.Split(new char[1] { '-' }); string s = array[^1].Replace(".wav", ""); if (int.TryParse(s, out var result)) { string item = array[0]; string item2 = string.Join(" ", array.Skip(1).Take(array.Length - 2)); return (item, result, item2); } return (array[0], null, string.Join(" ", array.Skip(1)).Replace(".wav", "")); } private void ProcessSoundFiles(string directoryPath, string packName, bool serverSync, bool isTemporarySync) { string[] files = Directory.GetFiles(directoryPath, "*.wav"); foreach (string text in files) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(text); (string soundName, int? percentage, string customName) tuple = ParseSoundFileName(fileNameWithoutExtension); string item = tuple.soundName; int? item2 = tuple.percentage; string item3 = tuple.customName; string text2 = (item2.HasValue ? $"{item}-{item3}-{item2.Value}" : (item + "-" + item3)); string text3 = CalculateMD5(text); if (isTemporarySync || !currentSounds.Contains(text2)) { if (soundHashes.TryGetValue(text2, out var value) && value != text3) { modifiedSounds.Add(text2); } AudioClip audioClip = SoundTool.GetAudioClip(directoryPath, "", text); SoundTool.ReplaceAudioClip(item, audioClip); soundHashes[text2] = text3; currentSounds.Add(text2); soundPacks[item] = packName; string text4 = "[" + packName + "] " + item + " sound replaced!"; if (item2 > 0) { text4 += $" (Random chance: {item2}%)"; } logger.LogInfo((object)text4); string key = item + (item2.HasValue ? $"-{item2.Value}-{item3}" : ("-" + item3)); if (!string.IsNullOrEmpty(item3)) { customSoundNames[key] = item3; } if (serverSync) { string text5 = Path.Combine(directoryPath, fileNameWithoutExtension + ".wav"); logger.LogInfo((object)("[" + text5 + "] " + fileNameWithoutExtension + ".wav!")); AudioNetworkHandler.Instance.QueueAudioData(SerializeWavToBytes(text5), fileNameWithoutExtension + ".wav"); } } } } public string ListAllSounds(bool isListing) { StringBuilder stringBuilder = new StringBuilder(isListing ? "Listing all currently loaded custom sounds:\n\n" : "Customsounds reloaded.\n\n"); Dictionary<string, List<string>> soundsByPack = new Dictionary<string, List<string>>(); Action<HashSet<string>, string> action = delegate(HashSet<string> soundsSet, string status) { foreach (string item5 in soundsSet) { (string soundName, int? percentage, string customName) tuple = ParseSoundFileName(item5); string item = tuple.soundName; int? item2 = tuple.percentage; string item3 = tuple.customName; string text = (item2.HasValue ? $" (Random: {item2.Value}%)" : ""); string text2 = ""; string key = item + (item2.HasValue ? $"-{item2.Value}-{item3}" : ("-" + item3)); if (customSoundNames.TryGetValue(key, out var value)) { text2 = " [" + value + "]"; } string key2 = (soundPacks.ContainsKey(item) ? soundPacks[item] : "Unknown"); if (!soundsByPack.ContainsKey(key2)) { soundsByPack[key2] = new List<string>(); } string item4 = (isListing ? (item + text + text2) : (item + " (" + status + ")" + text + text2)); soundsByPack[key2].Add(item4); } }; if (!isListing) { action(new HashSet<string>(currentSounds.Except(oldSounds)), "N¹"); action(new HashSet<string>(oldSounds.Except(currentSounds)), "D²"); action(new HashSet<string>(oldSounds.Intersect(currentSounds).Except(modifiedSounds)), "A.E³"); action(new HashSet<string>(modifiedSounds), "M⁴"); } else { action(new HashSet<string>(currentSounds), "N¹"); } foreach (string key3 in soundsByPack.Keys) { stringBuilder.AppendLine(key3 + " :"); foreach (string item6 in soundsByPack[key3]) { stringBuilder.AppendLine("- " + item6); } stringBuilder.AppendLine(); } if (!isListing) { stringBuilder.AppendLine("Footnotes:"); stringBuilder.AppendLine("¹ N = New"); stringBuilder.AppendLine("² D = Deleted"); stringBuilder.AppendLine("³ A.E = Already Existed"); stringBuilder.AppendLine("⁴ M = Modified"); stringBuilder.AppendLine(); } return stringBuilder.ToString(); } } } namespace CustomSounds.Patches { [HarmonyPatch] public class NetworkObjectManager { private static GameObject networkPrefab; private static GameObject networkHandlerHost; [HarmonyPatch(typeof(GameNetworkManager), "Start")] [HarmonyPrefix] public static void Init() { if (!((Object)(object)networkPrefab != (Object)null)) { networkPrefab = Plugin.Instance.LoadNetworkPrefabFromEmbeddedResource(); networkPrefab.AddComponent<AudioNetworkHandler>(); NetworkManager.Singleton.AddNetworkPrefab(networkPrefab); Plugin.Instance.logger.LogInfo((object)"Created AudioNetworkHandler prefab"); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void SpawnNetworkHandler() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) try { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { Plugin.Instance.logger.LogInfo((object)"Spawning network handler"); networkHandlerHost = Object.Instantiate<GameObject>(networkPrefab, Vector3.zero, Quaternion.identity); if (networkHandlerHost.GetComponent<NetworkObject>().IsSpawned) { Debug.Log((object)"NetworkObject is spawned and active."); } else { Debug.Log((object)"Failed to spawn NetworkObject."); } networkHandlerHost.GetComponent<NetworkObject>().Spawn(true); if ((Object)(object)AudioNetworkHandler.Instance != (Object)null) { Debug.Log((object)"Successfully accessed AudioNetworkHandler instance."); } else { Debug.Log((object)"AudioNetworkHandler instance is null."); } } } catch { Plugin.Instance.logger.LogError((object)"Failed to spawned network handler"); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")] private static void DestroyNetworkHandler() { try { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { Plugin.Instance.logger.LogInfo((object)"Destroying network handler"); Object.Destroy((Object)(object)networkHandlerHost); networkHandlerHost = null; } } catch { Plugin.Instance.logger.LogError((object)"Failed to destroy network handler"); } } } [HarmonyPatch] public class RemapKeyPatch { public Harmony _harmony; public static InputActionAsset asset; private static string defaultKey; private static string path; public static string actionName; public static void UpdateInputActionAsset(string thing) { asset = InputActionAsset.FromJson("\r\n {\r\n \"maps\" : [\r\n {\r\n \"name\" : \"CustomSounds\",\r\n \"actions\": [\r\n {\"name\": \"" + actionName + "\", \"type\" : \"button\"}\r\n ],\r\n \"bindings\" : [\r\n {\"path\" : \"" + thing + "\", \"action\": \"" + actionName + "\"}\r\n ]\r\n }\r\n ]\r\n }"); } [HarmonyPatch(typeof(KepRemapPanel), "LoadKeybindsUI")] [HarmonyPrefix] public static void AddRemappableKey(KepRemapPanel __instance) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown Debug.Log((object)("[CustomSounds] Default key for sync is " + defaultKey)); for (int i = 0; i < __instance.remappableKeys.Count; i++) { if (__instance.remappableKeys[i].ControlName == "Accept Sync") { return; } } RemappableKey val = new RemappableKey(); UpdateInputActionAsset(defaultKey); if ((Object)(object)asset == (Object)null) { Debug.LogError((object)"InputActionAsset is null."); return; } InputAction val2 = asset.FindAction("CustomSounds/" + actionName, false); if (val2 == null) { Debug.LogError((object)"Action 'CustomSounds/AcceptSyncAction' not found."); return; } InputActionReference currentInput = InputActionReference.Create(asset.FindAction("CustomSounds/" + actionName, false)); val.ControlName = "Accept Sync"; val.currentInput = currentInput; __instance.remappableKeys.Add(val); } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void ReadInput(PlayerControllerB __instance) { if (((((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled && (!((NetworkBehaviour)__instance).IsServer || __instance.isHostPlayerObject)) || __instance.isTestingPlayer) && Application.isFocused) { if (!Object.op_Implicit((Object)(object)asset) || !asset.enabled) { UpdateInputActionAsset(defaultKey); asset.Enable(); } InputAction val = asset.FindAction("CustomSounds/" + actionName, false); if (val != null && val.WasPressedThisFrame() && AudioNetworkHandler.isRequestingSync) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "Sync request accepted successfully!", isWarning: false); AudioNetworkHandler.hasAcceptedSync = true; AudioNetworkHandler.isRequestingSync = false; } } } [HarmonyPatch(typeof(IngamePlayerSettings), "CompleteRebind")] [HarmonyPrefix] public static void SavingActionRebind(IngamePlayerSettings __instance) { //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_0083: 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) if (!(__instance.rebindingOperation.action.name != actionName)) { string text = ((object)__instance.rebindingOperation.action).ToString(); string text2 = text.Split('[', ']')[1]; string value = text2.Replace("/Keyboard/", ""); defaultKey = text2; try { KeyCode val = (KeyCode)Enum.Parse(typeof(KeyCode), value, ignoreCase: true); Plugin.AcceptSyncKey.Value = new KeyboardShortcut(val, Array.Empty<KeyCode>()); } catch (Exception ex) { Debug.LogError((object)("Erreur lors de la conversion de la chaîne en KeyCode: " + ex.Message)); } UpdateInputActionAsset(defaultKey); } } [HarmonyPatch(typeof(KepRemapPanel), "ResetKeybindsUI")] [HarmonyPrefix] public static void ResetAcceptAction(KepRemapPanel __instance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Plugin.AcceptSyncKey.Value = new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()); defaultKey = "<Keyboard>/f8"; UpdateInputActionAsset(defaultKey); bool flag = UpdateAcceptSyncKeybind(__instance, "<Keyboard>/f8"); } private static bool UpdateAcceptSyncKeybind(KepRemapPanel panel, string defaultBinding) { foreach (RemappableKey remappableKey in panel.remappableKeys) { if (remappableKey.ControlName == "Accept Sync") { remappableKey.currentInput = InputActionReference.Create(asset.FindAction("CustomSounds/AcceptSyncAction", false)); Debug.Log((object)"[CustomSounds] Found and updated 'Accept Sync' keybinding"); return true; } } Debug.Log((object)"[CustomSounds] 'Accept Sync' keybinding not found"); return false; } static RemapKeyPatch() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = Plugin.AcceptSyncKey.Value; defaultKey = "<Keyboard>/" + ((object)(KeyboardShortcut)(ref value)).ToString(); path = Application.persistentDataPath + "/AcceptSyncButton.txt"; actionName = "AcceptSyncAction"; } } [HarmonyPatch(typeof(Terminal), "ParsePlayerSentence")] public static class TerminalParsePlayerSentencePatch { public static bool Prefix(Terminal __instance, ref TerminalNode __result) { string[] array = __instance.screenText.text.Split(new char[1] { '\n' }); if (array.Length == 0) { return true; } string[] array2 = array.Last().Trim().ToLower() .Split(new char[1] { ' ' }); if (array2.Length == 0 || (array2[0] != "customsounds" && array2[0] != "cs")) { return true; } Plugin.Instance.logger.LogInfo((object)("Received terminal command: " + string.Join(" ", array2))); if (array2.Length > 1 && (array2[0] == "customsounds" || array2[0] == "cs")) { switch (array2[1]) { case "reload": case "rl": Plugin.Instance.RevertSounds(); Plugin.Instance.ReloadSounds(serverSync: false, isTemporarySync: false); __result = CreateTerminalNode(Plugin.Instance.ListAllSounds(isListing: false)); return false; case "revert": case "rv": Plugin.Instance.RevertSounds(); __result = CreateTerminalNode("Game sounds reverted to original.\n\n"); return false; case "list": case "l": __result = CreateTerminalNode(Plugin.Instance.ListAllSounds(isListing: true)); return false; case "help": case "h": if (NetworkManager.Singleton.IsHost) { __result = CreateTerminalNode("CustomSounds commands \n(Can also be used with 'CS' as an alias).\n\n>CUSTOMSOUNDS LIST/L\nTo display all currently loaded sounds\n\n>CUSTOMSOUNDS RELOAD/RL\nTo reload and apply sounds from the 'CustomSounds' folder and its subfolders.\n\n>CUSTOMSOUNDS REVERT/RV\nTo unload all custom sounds and restore original game sounds\n\n>CUSTOMSOUNDS SYNC/S\nTo start the sync of custom sounds with clients\n\n>CUSTOMSOUNDS FORCE-UNSYNC/FU\nTo force the unsync process for all clients\n\n"); } else { __result = CreateTerminalNode("CustomSounds commands \n(Can also be used with 'CS' as an alias).\n\n>CUSTOMSOUNDS LIST/L\nTo display all currently loaded sounds\n\n>CUSTOMSOUNDS RELOAD/RL\nTo reload and apply sounds from the 'CustomSounds' folder and its subfolders.\n\n>CUSTOMSOUNDS REVERT/RV\nTo unload all custom sounds and restore original game sounds\n\n>CUSTOMSOUNDS UNSYNC/U\nUnsyncs sounds sent by the host.\n\n"); } return false; case "sync": case "s": if (NetworkManager.Singleton.IsHost) { if (Plugin.Instance.configUseNetworking.Value) { __result = CreateTerminalNode("Custom sound sync initiated. \nSyncing sounds with clients...\n\n"); Plugin.Instance.ReloadSounds(serverSync: true, isTemporarySync: false); } else { __result = CreateTerminalNode("Custom sound sync is currently disabled. \nPlease enable network support in the plugin config to use this feature.\n\n"); } } else { __result = CreateTerminalNode("/!\\ ERROR /!\\ \nThis command can only be used by the host!\n\n"); } return false; case "unsync": case "u": if (!NetworkManager.Singleton.IsHost) { __result = CreateTerminalNode("Unsyncing custom sounds. \nTemporary files deleted and original sounds reloaded.\n\n"); Plugin.Instance.DeleteTempFolder(); Plugin.Instance.ReloadSounds(serverSync: false, isTemporarySync: false); } else { __result = CreateTerminalNode("/!\\ ERROR /!\\ \nThis command cannot be used by the host!\n\n"); } return false; case "fu": case "force-unsync": if (NetworkManager.Singleton.IsHost) { __result = CreateTerminalNode("Forcing unsync for all clients. \nAll client-side temporary synced files have been deleted, and original sounds reloaded.\n\n"); AudioNetworkHandler.Instance.ForceUnsync(); } else { __result = CreateTerminalNode("/!\\ ERROR /!\\ \nThis command can only be used by the host!\n\n"); } return false; default: __result = CreateTerminalNode("Unknown customsounds command.\n\n"); return false; } } return true; } private static TerminalNode CreateTerminalNode(string message) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); val.displayText = message; val.clearPreviousText = true; return val; } } } namespace CustomSounds.Networking { public class AudioNetworkHandler : NetworkBehaviour { private struct AudioData { public List<byte[]> Segments; public string FileName; public AudioData(List<byte[]> segments, string fileName) { Segments = segments; FileName = fileName; } } private List<byte[]> receivedAudioSegments = new List<byte[]>(); private string audioFileName; private int totalAudioFiles; private int processedAudioFiles; private int totalSegments; private int processedSegments; public static bool isRequestingSync; private float[] progressThresholds = new float[4] { 0.25f, 0.5f, 0.75f, 1f }; private int lastThresholdIndex = -1; public static bool hasAcceptedSync; private Queue<AudioData> audioQueue = new Queue<AudioData>(); private bool isSendingAudio = false; public static AudioNetworkHandler Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Debug.Log((object)"AudioNetworkHandler instance created."); } else { Object.Destroy((Object)(object)((Component)this).gameObject); Debug.Log((object)"Extra AudioNetworkHandler instance destroyed."); } } public void QueueAudioData(byte[] audioData, string audioName) { List<byte[]> list = Plugin.SplitAudioData(audioData); totalSegments += list.Count; audioQueue.Enqueue(new AudioData(list, audioName)); if (!isSendingAudio) { totalAudioFiles = audioQueue.Count; processedAudioFiles = 0; ((MonoBehaviour)this).StartCoroutine(SendAudioDataQueue()); } } private IEnumerator SendAudioDataQueue() { isSendingAudio = true; totalSegments = 0; processedSegments = 0; lastThresholdIndex = -1; RequestSyncWithClients(); yield return (object)new WaitForSeconds(6f); isRequestingSync = false; DisplayStartingSyncMessageClientRpc(); yield return (object)new WaitForSeconds(2f); while (audioQueue.Count > 0) { AudioData audioData = audioQueue.Dequeue(); yield return ((MonoBehaviour)this).StartCoroutine(SendAudioDataCoroutine(audioData.Segments, audioData.FileName)); processedAudioFiles++; UpdateProgress(); } NotifyClientsQueueCompletedServerRpc(); isSendingAudio = false; } private void RequestSyncWithClients() { foreach (NetworkClient connectedClients in NetworkManager.Singleton.ConnectedClientsList) { RequestSyncClientRpc(connectedClients.ClientId); } } [ClientRpc] private void RequestSyncClientRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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(3186703908u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3186703908u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", $"Press {Plugin.AcceptSyncKey.Value} to accept the audio sync request.", isWarning: false); isRequestingSync = true; } } } [ServerRpc(RequireOwnership = false)] private void NotifyClientsQueueCompletedServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(152710787u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 152710787u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ProcessLastAudioFileClientRpc(); } } } public void ForceUnsync() { ForceUnsyncClientsClientRpc(); } [ClientRpc] private void ForceUnsyncClientsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3960362720u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3960362720u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).IsServer) { Debug.Log((object)"Forcing all clients to delete Temporary-Sync folder."); return; } Plugin.Instance.ShowCustomTip("CustomSounds Sync", "The CustomSounds sync has been reset by the host.\nTemporary files deleted and original sounds reloaded", isWarning: false); Plugin.Instance.DeleteTempFolder(); Plugin.Instance.RevertSounds(); Plugin.Instance.ReloadSounds(serverSync: false, isTemporarySync: false); } } [ClientRpc] private void ProcessLastAudioFileClientRpc() { //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(234624598u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 234624598u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && hasAcceptedSync) { hasAcceptedSync = false; ProcessLastAudioFile(); Debug.Log((object)"Reverting all sounds."); Plugin.Instance.RevertSounds(); Debug.Log((object)"All sounds reverted!"); Debug.Log((object)"Reloading all sounds."); Plugin.Instance.ReloadSounds(serverSync: false, isTemporarySync: true); Debug.Log((object)"All sounds reloaded!"); } } } private void ProcessLastAudioFile() { if (receivedAudioSegments.Count > 0 && !string.IsNullOrEmpty(audioFileName)) { byte[] byteArray = Plugin.CombineAudioSegments(receivedAudioSegments); Plugin.DeserializeBytesToWav(byteArray, audioFileName); receivedAudioSegments.Clear(); audioFileName = null; } } public void SendAudioData(byte[] audioData, string audioName) { List<byte[]> list = Plugin.SplitAudioData(audioData); audioFileName = audioName; SendAudioMetaDataToClientsServerRpc(list.Count, audioName); ((MonoBehaviour)this).StartCoroutine(SendAudioDataCoroutine(list, audioName)); } [ServerRpc] public void SendAudioMetaDataToClientsServerRpc(int totalSegments, string fileName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { 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(3991320206u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, totalSegments); bool flag = fileName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(fileName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3991320206u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Debug.Log((object)$"Sending metadata to clients: {totalSegments} segments, file name: {fileName}"); ReceiveAudioMetaDataClientRpc(totalSegments, fileName); } } private IEnumerator SendAudioDataCoroutine(List<byte[]> audioSegments, string audioName) { foreach (byte[] segment in audioSegments) { SendBytesToServerRpc(segment, audioName); processedSegments++; UpdateProgress(); yield return (object)new WaitForSeconds(0.2f); } } [ServerRpc] public void SendBytesToServerRpc(byte[] audioSegment, string audioName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_0119: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { 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(3131260794u, val, (RpcDelivery)0); bool flag = audioSegment != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(audioSegment, default(ForPrimitives)); } bool flag2 = audioName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(audioName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3131260794u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Debug.Log((object)("Sending segment to server: " + audioName)); ReceiveBytesClientRpc(audioSegment, audioName); } } [ClientRpc] public void ReceiveAudioMetaDataClientRpc(int totalSegments, string fileName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1027341762u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, totalSegments); bool flag = fileName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(fileName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1027341762u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Debug.Log((object)$"Received metadata on client: {totalSegments} segments expected, file name: {fileName}"); audioFileName = fileName; receivedAudioSegments.Clear(); } } [ClientRpc] public void ReceiveBytesClientRpc(byte[] audioSegment, string audioName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2945580654u, val, (RpcDelivery)0); bool flag = audioSegment != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(audioSegment, default(ForPrimitives)); } bool flag2 = audioName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(audioName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2945580654u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && hasAcceptedSync) { if (!string.IsNullOrEmpty(audioName) && audioFileName != audioName) { ProcessLastAudioFile(); audioFileName = audioName; } receivedAudioSegments.Add(audioSegment); } } [ClientRpc] private void DisplayStartingSyncMessageClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3964799390u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3964799390u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (hasAcceptedSync) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "Starting audio synchronization. Please wait...", isWarning: false); Plugin.Instance.DeleteTempFolder(); } else if (((NetworkBehaviour)this).IsServer) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "Initiating audio synchronization. Sending files to clients...", isWarning: false); } } } private void UpdateProgress() { float progress = (float)processedSegments / (float)totalSegments; int currentThresholdIndex = GetCurrentThresholdIndex(progress); if (currentThresholdIndex > lastThresholdIndex) { lastThresholdIndex = currentThresholdIndex; UpdateProgressClientRpc(progress); } } private int GetCurrentThresholdIndex(float progress) { for (int num = progressThresholds.Length - 1; num >= 0; num--) { if (progress >= progressThresholds[num]) { return num; } } return -1; } [ClientRpc] private void UpdateProgressClientRpc(float progress) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3902617409u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref progress, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3902617409u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || (!((NetworkBehaviour)this).IsServer && !hasAcceptedSync)) { return; } string text = GenerateProgressBar(progress); if (progress < 1f) { if (!((NetworkBehaviour)this).IsServer) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "Sounds transfer progression:\n" + text, isWarning: false); } } else if (((NetworkBehaviour)this).IsServer) { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "All sounds have been successfully sent!", isWarning: false); } else { Plugin.Instance.ShowCustomTip("CustomSounds Sync", "All sounds have been successfully received!", isWarning: false); } } private string GenerateProgressBar(float progress) { int num = 26; progress = Mathf.Clamp(progress, 0f, 1f); int num2 = (int)(progress * (float)num); return "[" + new string('#', num2) + new string('-', num - num2) + "] " + (int)(progress * 100f) + "%"; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_AudioNetworkHandler() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3186703908u, new RpcReceiveHandler(__rpc_handler_3186703908)); NetworkManager.__rpc_func_table.Add(152710787u, new RpcReceiveHandler(__rpc_handler_152710787)); NetworkManager.__rpc_func_table.Add(3960362720u, new RpcReceiveHandler(__rpc_handler_3960362720)); NetworkManager.__rpc_func_table.Add(234624598u, new RpcReceiveHandler(__rpc_handler_234624598)); NetworkManager.__rpc_func_table.Add(3991320206u, new RpcReceiveHandler(__rpc_handler_3991320206)); NetworkManager.__rpc_func_table.Add(3131260794u, new RpcReceiveHandler(__rpc_handler_3131260794)); NetworkManager.__rpc_func_table.Add(1027341762u, new RpcReceiveHandler(__rpc_handler_1027341762)); NetworkManager.__rpc_func_table.Add(2945580654u, new RpcReceiveHandler(__rpc_handler_2945580654)); NetworkManager.__rpc_func_table.Add(3964799390u, new RpcReceiveHandler(__rpc_handler_3964799390)); NetworkManager.__rpc_func_table.Add(3902617409u, new RpcReceiveHandler(__rpc_handler_3902617409)); } private static void __rpc_handler_3186703908(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)2; ((AudioNetworkHandler)(object)target).RequestSyncClientRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_152710787(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_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_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((AudioNetworkHandler)(object)target).NotifyClientsQueueCompletedServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3960362720(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; ((AudioNetworkHandler)(object)target).ForceUnsyncClientsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_234624598(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; ((AudioNetworkHandler)(object)target).ProcessLastAudioFileClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3991320206(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00bb: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string fileName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref fileName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((AudioNetworkHandler)(object)target).SendAudioMetaDataToClientsServerRpc(num, fileName); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_3131260794(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); byte[] audioSegment = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref audioSegment, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); string audioName = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref audioName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((AudioNetworkHandler)(object)target).SendBytesToServerRpc(audioSegment, audioName); target.__rpc_exec_stage = (__RpcExecStage)0; } private static void __rpc_handler_1027341762(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string fileName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref fileName, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((AudioNetworkHandler)(object)target).ReceiveAudioMetaDataClientRpc(num, fileName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2945580654(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); byte[] audioSegment = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref audioSegment, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); string audioName = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref audioName, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((AudioNetworkHandler)(object)target).ReceiveBytesClientRpc(audioSegment, audioName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3964799390(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; ((AudioNetworkHandler)(object)target).DisplayStartingSyncMessageClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3902617409(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float progress = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref progress, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((AudioNetworkHandler)(object)target).UpdateProgressClientRpc(progress); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AudioNetworkHandler"; } } }
BepInEX/plugins/Evaisa-LethalLib/LethalLib/LethalLib.dll
Decompiled 11 months agousing 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+60d42612d19dbe329175a80dfc41bc601a0ec3eb")] [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)] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LethalLib { [BepInPlugin("evaisa.lethallib", "LethalLib", "0.9.0")] public class Plugin : BaseUnityPlugin { public const string ModGUID = "evaisa.lethallib"; public const string ModName = "LethalLib"; public const string ModVersion = "0.9.0"; 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(); Weathers.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 string[] levelOverrides; 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown foreach (CustomDungeon dungeon in customDungeons) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = dungeon.LevelTypes.HasFlag(Levels.LevelTypes.All) || (dungeon.levelOverrides != null && dungeon.levelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())); if (Enum.IsDefined(typeof(Levels.LevelTypes), name) || flag) { Levels.LevelTypes levelTypes = (flag ? Levels.LevelTypes.All : ((Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name))); if ((flag || 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(DungeonDef dungeon, Levels.LevelTypes levelFlags, string[] levelOverrides) { AddDungeon(dungeon.dungeonFlow, dungeon.rarity, levelFlags, levelOverrides, 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 static void AddDungeon(DungeonFlow dungeon, int rarity, Levels.LevelTypes levelFlags, string[] levelOverrides = null, AudioClip firstTimeDungeonAudio = null) { customDungeons.Add(new CustomDungeon { dungeonFlow = dungeon, rarity = rarity, LevelTypes = levelFlags, firstTimeDungeonAudio = firstTimeDungeonAudio, levelOverrides = levelOverrides }); } } 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 string[] spawnLevelOverrides; public SpawnableEnemy(EnemyType enemy, int rarity, Levels.LevelTypes spawnLevels, SpawnType spawnType, string[] spawnLevelOverrides = null) { this.enemy = enemy; this.rarity = rarity; this.spawnLevels = spawnLevels; this.spawnType = spawnType; this.spawnLevelOverrides = spawnLevelOverrides; } } [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_0273: 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_0285: Unknown result type (might be due to invalid IL or missing references) //IL_029b: 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; } if (self.enemyFiles.Any((TerminalNode x) => x.creatureName == spawnableEnemy.terminalNode.creatureName)) { Plugin.logger.LogInfo((object)("Skipping " + spawnableEnemy.enemy.enemyName + " because it was already added")); continue; } TerminalKeyword keyword2 = (((Object)(object)spawnableEnemy.infoKeyword != (Object)null) ? spawnableEnemy.infoKeyword : TerminalUtils.CreateTerminalKeyword(spawnableEnemy.terminalNode.creatureName.ToLowerInvariant().Replace(" ", "-"), isVerb: false, null, null, val)); keyword2.defaultVerb = val; List<TerminalKeyword> list2 = self.terminalNodes.allKeywords.ToList(); if (!list2.Any((TerminalKeyword x) => x.word == keyword2.word)) { list2.Add(keyword2); self.terminalNodes.allKeywords = list2.ToArray(); } List<CompatibleNoun> list3 = val.compatibleNouns.ToList(); if (!list3.Any((CompatibleNoun x) => x.noun.word == keyword2.word)) { list3.Add(new CompatibleNoun { noun = keyword2, 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown orig.Invoke(self); foreach (SpawnableEnemy spawnableEnemy in spawnableEnemies) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = spawnableEnemy.spawnLevels.HasFlag(Levels.LevelTypes.All) || (spawnableEnemy.spawnLevelOverrides != null && spawnableEnemy.spawnLevelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())); if (!(Enum.IsDefined(typeof(Levels.LevelTypes), name) || flag)) { continue; } Levels.LevelTypes levelTypes = (flag ? Levels.LevelTypes.All : ((Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name))); if (!flag && !spawnableEnemy.spawnLevels.HasFlag(levelTypes)) { continue; } SpawnableEnemyWithRarity item2 = 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(item2); 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(item2); 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(item2); 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, SpawnType spawnType, string[] spawnLevelOverrides = null, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, spawnType, spawnLevelOverrides); 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 static void RegisterEnemy(EnemyType enemy, int rarity, Levels.LevelTypes levelFlags, string[] spawnLevelOverrides = null, TerminalNode infoNode = null, TerminalKeyword infoKeyword = null) { SpawnableEnemy spawnableEnemy = new SpawnableEnemy(enemy, rarity, levelFlags, enemy.isDaytimeEnemy ? SpawnType.Daytime : (enemy.isOutsideEnemy ? SpawnType.Outside : SpawnType.Default), spawnLevelOverrides); 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[] spawnLevelOverrides; public string modName; public ScrapItem(Item item, int rarity, Levels.LevelTypes spawnLevels = Levels.LevelTypes.None, string[] spawnLevelOverrides = null) { this.item = item; this.rarity = rarity; this.spawnLevels = spawnLevels; } } public class PlainItem { public Item item; public string modName; public PlainItem(Item item) { this.item = item; } } 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 List<PlainItem> plainItems = new List<PlainItem>(); 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_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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown orig.Invoke(self); foreach (ScrapItem scrapItem in scrapItems) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = scrapItem.spawnLevels.HasFlag(Levels.LevelTypes.All) || (scrapItem.spawnLevelOverrides != null && scrapItem.spawnLevelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())); if (!(Enum.IsDefined(typeof(Levels.LevelTypes), name) || flag)) { continue; } Levels.LevelTypes levelTypes = (flag ? Levels.LevelTypes.All : ((Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name))); if (flag || scrapItem.spawnLevels.HasFlag(levelTypes)) { SpawnableItemWithRarity item2 = 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(item2); } } } } 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); } } foreach (PlainItem plainItem in plainItems) { if (!self.allItemsList.itemsList.Contains(plainItem.item)) { Plugin.logger.LogInfo((object)(plainItem.modName + " registered item: " + plainItem.item.itemName)); self.allItemsList.itemsList.Add(plainItem.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 RegisterScrap(Item spawnableItem, int rarity, Levels.LevelTypes levelFlags = Levels.LevelTypes.None, string[] levelOverrides = null) { ScrapItem scrapItem = new ScrapItem(spawnableItem, rarity, levelFlags, levelOverrides); 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 static void RegisterItem(Item plainItem) { PlainItem plainItem2 = new PlainItem(plainItem); Assembly callingAssembly = Assembly.GetCallingAssembly(); string name = callingAssembly.GetName().Name; plainItem2.modName = name; plainItems.Add(plainItem2); } } public class Levels { [Flags] public enum LevelTypes { None = 1, ExperimentationLevel = 4, AssuranceLevel = 8, VowLevel = 0x10, OffenseLevel = 0x20, MarchLevel = 0x40, RendLevel = 0x80, DineLevel = 0x100, TitanLevel = 0x200, Vanilla = 0x3FC, All = -1 } } public class MapObjects { public class RegisteredMapObject { public SpawnableMapObject mapObject; public SpawnableOutsideObjectWithRarity outsideObject; public Levels.LevelTypes levels; public string[] spawnLevelOverrides; 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); foreach (RegisteredMapObject mapObject in mapObjects) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = mapObject.levels.HasFlag(Levels.LevelTypes.All) || (mapObject.spawnLevelOverrides != null && mapObject.spawnLevelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())); if (!(Enum.IsDefined(typeof(Levels.LevelTypes), name) || flag)) { continue; } Levels.LevelTypes levelTypes = (flag ? Levels.LevelTypes.All : ((Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name))); if (!flag && !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(SpawnableMapObjectDef mapObject, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] levelOverrides = null, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterMapObject(mapObject.spawnableMapObject, levels, levelOverrides, 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 RegisterMapObject(SpawnableMapObject mapObject, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] levelOverrides = null, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { mapObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction, spawnLevelOverrides = levelOverrides }); } public static void RegisterOutsideObject(SpawnableOutsideObjectDef mapObject, Levels.LevelTypes levels, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterOutsideObject(mapObject.spawnableMapObject, levels, spawnRateFunction); } public static void RegisterOutsideObject(SpawnableOutsideObjectDef mapObject, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] levelOverrides = null, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { RegisterOutsideObject(mapObject.spawnableMapObject, levels, levelOverrides, 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 static void RegisterOutsideObject(SpawnableOutsideObjectWithRarity mapObject, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] levelOverrides = null, Func<SelectableLevel, AnimationCurve> spawnRateFunction = null) { mapObjects.Add(new RegisteredMapObject { outsideObject = mapObject, levels = levels, spawnRateFunction = spawnRateFunction, spawnLevelOverrides = levelOverrides }); } } 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); } } public class Weathers { public class CustomWeather { public string name; public int weatherVariable1; public int weatherVariable2; public WeatherEffect weatherEffect; public Levels.LevelTypes levels; public string[] spawnLevelOverrides; public CustomWeather(string name, WeatherEffect weatherEffect, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] spawnLevelOverrides = null, int weatherVariable1 = 0, int weatherVariable2 = 0) { this.name = name; this.weatherVariable1 = weatherVariable1; this.weatherVariable2 = weatherVariable2; this.weatherEffect = weatherEffect; this.levels = levels; this.spawnLevelOverrides = spawnLevelOverrides; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__TimeOfDay_Awake; public static hook_Awake <1>__StartOfRound_Awake; } public static Dictionary<int, CustomWeather> customWeathers = new Dictionary<int, CustomWeather>(); public static int numCustomWeathers = 0; public static void Init() { //IL_002f: 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_0050: Expected O, but got Unknown //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_0071: Expected O, but got Unknown new Hook((MethodBase)typeof(Enum).GetMethod("ToString", new Type[0]), typeof(Weathers).GetMethod("ToStringHook")); object obj = <>O.<0>__TimeOfDay_Awake; if (obj == null) { hook_Awake val = TimeOfDay_Awake; <>O.<0>__TimeOfDay_Awake = val; obj = (object)val; } TimeOfDay.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__StartOfRound_Awake; if (obj2 == null) { hook_Awake val2 = StartOfRound_Awake; <>O.<1>__StartOfRound_Awake = val2; obj2 = (object)val2; } StartOfRound.Awake += (hook_Awake)obj2; } private static void StartOfRound_Awake(orig_Awake orig, StartOfRound self) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown foreach (KeyValuePair<int, CustomWeather> customWeather in customWeathers) { SelectableLevel[] levels = self.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = customWeather.Value.levels.HasFlag(Levels.LevelTypes.All) || (customWeather.Value.spawnLevelOverrides != null && customWeather.Value.spawnLevelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())); if (Enum.IsDefined(typeof(Levels.LevelTypes), name) || flag) { Levels.LevelTypes levelTypes = (flag ? Levels.LevelTypes.All : ((Levels.LevelTypes)Enum.Parse(typeof(Levels.LevelTypes), name))); List<RandomWeatherWithVariables> list = val.randomWeathers.ToList(); if (flag || customWeather.Value.levels.HasFlag(levelTypes)) { list.Add(new RandomWeatherWithVariables { weatherType = (LevelWeatherType)customWeather.Key, weatherVariable = customWeather.Value.weatherVariable1, weatherVariable2 = customWeather.Value.weatherVariable2 }); Plugin.logger.LogInfo((object)$"Added weather {customWeather.Value.name} to level {((Object)val).name} at weather index: {customWeather.Key}"); } val.randomWeathers = list.ToArray(); } } } orig.Invoke(self); } private static void TimeOfDay_Awake(orig_Awake orig, TimeOfDay self) { List<WeatherEffect> list = self.effects.ToList(); int num = 0; foreach (KeyValuePair<int, CustomWeather> customWeather in customWeathers) { if (customWeather.Key > num) { num = customWeather.Key; } } while (list.Count <= num) { list.Add(null); } foreach (KeyValuePair<int, CustomWeather> customWeather2 in customWeathers) { list[customWeather2.Key] = customWeather2.Value.weatherEffect; } self.effects = list.ToArray(); orig.Invoke(self); } public static string ToStringHook(Func<Enum, string> orig, Enum self) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected I4, but got Unknown if (self.GetType() == typeof(LevelWeatherType) && customWeathers.ContainsKey((int)(LevelWeatherType)(object)self)) { return customWeathers[(int)(LevelWeatherType)(object)self].name; } return orig(self); } public static void RegisterWeather(WeatherDef weather) { RegisterWeather(weather.weatherName, weather.weatherEffect, weather.levels, weather.levelOverrides, weather.weatherVariable1, weather.weatherVariable2); } public static void RegisterWeather(string name, WeatherEffect weatherEffect, Levels.LevelTypes levels = Levels.LevelTypes.None, int weatherVariable1 = 0, int weatherVariable2 = 0) { Array values = Enum.GetValues(typeof(LevelWeatherType)); int num = values.Length - 1; num += numCustomWeathers; numCustomWeathers++; Plugin.logger.LogInfo((object)$"Registering weather {name} at index {num - 1}"); customWeathers.Add(num, new CustomWeather(name, weatherEffect, levels, null, weatherVariable1, weatherVariable2)); } public static void RegisterWeather(string name, WeatherEffect weatherEffect, Levels.LevelTypes levels = Levels.LevelTypes.None, string[] spawnLevelOverrides = null, int weatherVariable1 = 0, int weatherVariable2 = 0) { Array values = Enum.GetValues(typeof(LevelWeatherType)); int num = values.Length - 1; num += numCustomWeathers; numCustomWeathers++; Plugin.logger.LogInfo((object)$"Registering weather {name} at index {num - 1}"); customWeathers.Add(num, new CustomWeather(name, weatherEffect, levels, spawnLevelOverrides, weatherVariable1, weatherVariable2)); } } } 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; } [CreateAssetMenu(menuName = "ScriptableObjects/WeatherDef")] public class WeatherDef : ScriptableObject { public string weatherName; public Levels.LevelTypes levels = Levels.LevelTypes.None; public string[] levelOverrides; public int weatherVariable1; public int weatherVariable2; public WeatherEffect weatherEffect; } }
BepInEX/plugins/FlipMods-BetterStamina/BetterStamina.dll
Decompiled 11 months agousing 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.Serialization.Formatters.Binary; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BetterStamina.Config; using GameNetcodeStuff; using HarmonyLib; using Unity.Collections; 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("BetterStamina")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BetterStamina")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1c42022e-b386-4342-baf0-67de1b7529e2")] [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 BetterStamina { [BepInPlugin("FlipMods.BetterStamina", "BetterStamina", "1.3.2")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; 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("BetterStamina"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"BetterStamina 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.BetterStamina"; public const string PLUGIN_NAME = "BetterStamina"; public const string PLUGIN_VERSION = "1.3.2"; } } namespace BetterStamina.Patches { [HarmonyPatch] public class PlayerPatcher { private static float currentSprintMeter; [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] public static void UpdateStaminaPrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void UpdateStaminaPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(currentSprintMeter + num * ConfigSync.instance.staminaConsumptionMultiplier, 0f); } else if (num > 0f) { __instance.sprintMeter = Mathf.Min(currentSprintMeter + num * ConfigSync.instance.staminaRegenMultiplier, 1f); } } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPrefix] public static void LateUpdatePrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyPostfix] public static void LateUpdateStaminaPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(currentSprintMeter + num * ConfigSync.instance.staminaConsumptionMultiplier, 0f); } else if (num > 0f) { __instance.sprintMeter = Mathf.Min(currentSprintMeter + num * ConfigSync.instance.staminaRegenMultiplier, 1f); } } } [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] [HarmonyPrefix] public static void JumpPerformedPrefix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { currentSprintMeter = __instance.sprintMeter; } } [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] [HarmonyPostfix] public static void JumpPerformedPostfix(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && __instance.isPlayerControlled) { float num = __instance.sprintMeter - currentSprintMeter; if (num < 0f) { __instance.sprintMeter = Mathf.Max(new float[1] { currentSprintMeter + num * ConfigSync.instance.jumpStaminaConsumptionMultiplier }); } } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SpoofWeightValuesUpdate(IEnumerable<CodeInstruction> instructions) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); FieldInfo field = typeof(PlayerControllerB).GetField("carryWeight", BindingFlags.Instance | BindingFlags.Public); MethodInfo method = typeof(PlayerPatcher).GetMethod("GetAdjustedWeight", BindingFlags.Static | BindingFlags.Public); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == field) { list[i] = new CodeInstruction(OpCodes.Call, (object)method); list.RemoveAt(i - 1); } } return list.AsEnumerable(); } [HarmonyPatch(typeof(PlayerControllerB), "LateUpdate")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> SpoofWeightValuesLateUpdate(IEnumerable<CodeInstruction> instructions) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); FieldInfo field = typeof(PlayerControllerB).GetField("carryWeight", BindingFlags.Instance | BindingFlags.Public); MethodInfo method = typeof(PlayerPatcher).GetMethod("GetAdjustedWeight", BindingFlags.Static | BindingFlags.Public); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == field) { list[i] = new CodeInstruction(OpCodes.Call, (object)method); list.RemoveAt(i - 1); } } return list.AsEnumerable(); } public static float GetAdjustedWeight() { return Mathf.Max(((Object)(object)StartOfRound.Instance.localPlayerController != (Object)null) ? (StartOfRound.Instance.localPlayerController.carryWeight * ConfigSync.instance.carryWeightPenaltyMultiplier) : 1f, 1f); } } } namespace BetterStamina.Config { [Serializable] public static class ConfigSettings { public static ConfigEntry<float> staminaRegenMultiplierConfig; public static ConfigEntry<float> staminaConsumptionMultiplierConfig; public static ConfigEntry<float> jumpStaminaConsumptionMultiplierConfig; public static ConfigEntry<float> carryWeightPenaltyMultiplierConfig; public static ConfigEntry<float> movementSpeedMultiplierConfig; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); staminaRegenMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "StaminaRegenMultiplier", 1.5f, "Multiplier for how fast your stamina regens."); staminaConsumptionMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "StaminaConsumptionMultiplier", 0.75f, "Multiplier for how much stamina drains while sprinting."); jumpStaminaConsumptionMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "JumpStaminaConsumptionMultiplier", 0.75f, "Multiplier for how much stamina jumping consumes."); carryWeightPenaltyMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "CarryWeightPenaltyMultiplier", 0.5f, "Multiplier for how much your speed/stamina consumption are affected by weight."); movementSpeedMultiplierConfig = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("BetterStamina", "MovementSpeedMultiplier", 1f, "Player movement speed multiplier."); } } [Serializable] [HarmonyPatch] public class ConfigSync { public static ConfigSync defaultConfig; public static ConfigSync instance; public static PlayerControllerB localPlayerController; public static bool isSynced = false; private static float defaultMovementSpeed = 4.6f; public float staminaRegenMultiplier = 1f; public float staminaConsumptionMultiplier = 1f; public float jumpStaminaConsumptionMultiplier = 1f; public float carryWeightPenaltyMultiplier = 1f; public float movementSpeedMultiplier = 1f; public static void BuildDefaultConfigSync() { instance = new ConfigSync(); } public static void BuildServerConfigSync() { if (defaultConfig == null) { defaultConfig = new ConfigSync(); defaultConfig.staminaRegenMultiplier = ConfigSettings.staminaRegenMultiplierConfig.Value; defaultConfig.staminaConsumptionMultiplier = ConfigSettings.staminaConsumptionMultiplierConfig.Value; defaultConfig.jumpStaminaConsumptionMultiplier = ConfigSettings.jumpStaminaConsumptionMultiplierConfig.Value; defaultConfig.carryWeightPenaltyMultiplier = ConfigSettings.carryWeightPenaltyMultiplierConfig.Value; defaultConfig.movementSpeedMultiplier = ConfigSettings.movementSpeedMultiplierConfig.Value; instance = defaultConfig; } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void InitializeLocalPlayer(PlayerControllerB __instance) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown localPlayerController = __instance; if (NetworkManager.Singleton.IsServer) { BuildServerConfigSync(); NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("BetterStamina-OnRequestConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSyncRequest)); OnLocalClientConfigSync(); } else { isSynced = false; BuildDefaultConfigSync(); NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("BetterStamina-OnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveConfigSync)); RequestConfigSync(); } } public static void RequestConfigSync() { //IL_0036: 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(4, (Allocator)2, -1); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("BetterStamina-OnRequestConfigSync", 0uL, val, (NetworkDelivery)3); } else { Plugin.LogError("Failed to send config sync request."); } } public static void OnReceiveConfigSyncRequest(ulong clientId, FastBufferReader reader) { //IL_0053: 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_007c: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { Plugin.Log("Receiving config sync request from client with id: " + clientId + ". Sending config sync to client."); byte[] array = SerializeConfigToByteArray(instance); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(array.Length + 4, (Allocator)2, -1); int num = array.Length; ((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessage("BetterStamina-OnReceiveConfigSync", clientId, val, (NetworkDelivery)3); } } public static void OnReceiveConfigSync(ulong clientId, FastBufferReader reader) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (((FastBufferReader)(ref reader)).TryBeginRead(4)) { int num = default(int); ((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives)); if (((FastBufferReader)(ref reader)).TryBeginRead(num)) { Plugin.Log("Receiving config sync from server."); byte[] data = new byte[num]; ((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0); instance = DeserializeFromByteArray(data); OnLocalClientConfigSync(); } else { Plugin.LogError("Error receiving sync from server."); } } else { Plugin.LogError("Error receiving bytes length."); } } public static void OnLocalClientConfigSync() { localPlayerController.movementSpeed = defaultMovementSpeed * instance.movementSpeedMultiplier; isSynced = true; } public static byte[] SerializeConfigToByteArray(ConfigSync config) { BinaryFormatter binaryFormatter = new BinaryFormatter(); MemoryStream memoryStream = new MemoryStream(); binaryFormatter.Serialize(memoryStream, config); return memoryStream.ToArray(); } public static ConfigSync DeserializeFromByteArray(byte[] data) { MemoryStream serializationStream = new MemoryStream(data); BinaryFormatter binaryFormatter = new BinaryFormatter(); return (ConfigSync)binaryFormatter.Deserialize(serializationStream); } } }
BepInEX/plugins/FlipMods-LetMeLookDown/LetMeLookDown.dll
Decompiled 11 months agousing System.Collections.Generic; using System.Diagnostics; 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 GameNetcodeStuff; using HarmonyLib; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("LetMeLookDown")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LetMeLookDown")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a9c88d54-8f01-44a7-be0d-bd61d38aadcb")] [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 LetMeLookDown { [BepInPlugin("FlipMods.LetMeLookDown", "LetMeLookDown", "1.0.1")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; private static Plugin instance; public static float maxAngle = 80f; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _harmony = new Harmony("LetMeLookDown"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"LetMeLookDown mod loaded"); instance = this; } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.LetMeLookDown"; public const string PLUGIN_NAME = "LetMeLookDown"; public const string PLUGIN_VERSION = "1.0.1"; } } namespace LetMeLookDown.Patches { [HarmonyPatch] internal class AdjustSmoothLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(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 == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } [HarmonyPatch] internal class AdjustNormalLookingPatcher { [HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")] private static IEnumerable<CodeInstruction> Transpiler(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 == 60f) { list[i].operand = Plugin.maxAngle; break; } } return list.AsEnumerable(); } } }
BepInEX/plugins/FlipMods-ObjectVolumeController/ObjectVolumeController.dll
Decompiled 11 months agousing System; 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 GameNetcodeStuff; using HarmonyLib; using TMPro; 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: AssemblyTitle("ObjectVolumeController")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ObjectVolumeController")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("49ff2710-6c88-48c4-989a-32b79f0ddd6a")] [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 ObjectVolumeController { [BepInPlugin("FlipMods.ObjectVolumeController", "ObjectVolumeController", "1.0.3")] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static Key volumeUpKey = (Key)14; public static Key volumeDownKey = (Key)13; public static string volumeHoverTip = "Volume up: [+]\nVolume down: [-]"; public static float volumeIncrement = 0.1f; public static float maxDisplayedVolume = 1.5f; public static float defaultVolume = 1f; private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown _harmony = new Harmony("ObjectVolumeController"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ObjectVolumeController loaded"); instance = this; } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "FlipMods.ObjectVolumeController"; public const string PLUGIN_NAME = "ObjectVolumeController"; public const string PLUGIN_VERSION = "1.0.3"; } } namespace ObjectVolumeController.Patcher { [HarmonyPatch] internal class ChangeVolumePatcher { private static AudioPlayerItemType boomboxItems = new AudioPlayerItemType("Boomboxes", "Grab boombox: [E]"); private static AudioPlayerPlaceableType recordPlayers = new AudioPlayerPlaceableType("Record players", "Record player: [E]"); private static AudioPlayerPlaceableType televisions = new AudioPlayerPlaceableType("Televisions", "Television: [E]"); [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] public static void GetObjectLookingAt(PlayerControllerB __instance) { boomboxItems.lookingAtDeviceType = false; recordPlayers.lookingAtDeviceType = false; televisions.lookingAtDeviceType = false; if (!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || __instance.inTerminalMenu || __instance.isTypingChat || __instance.isPlayerDead) { return; } InteractTrigger hoveringOverTrigger = __instance.hoveringOverTrigger; object obj; if (hoveringOverTrigger == null) { obj = null; } else { Transform parent = ((Component)hoveringOverTrigger).transform.parent; obj = ((parent != null) ? ((Component)parent).gameObject : null); } GameObject val = (GameObject)obj; if ((Object)(object)val != (Object)null) { if (((Object)val).name.Contains("RecordPlayer")) { recordPlayers.lookingAtDeviceType = true; } else if (((Object)val).name.Contains("Television")) { televisions.lookingAtDeviceType = true; } } if (!recordPlayers.lookingAtDeviceType && !televisions.lookingAtDeviceType) { if ((Object)(object)__instance.cursorTip != (Object)null && ((TMP_Text)__instance.cursorTip).text.Contains(boomboxItems.originalHoverTip)) { boomboxItems.lookingAtDeviceType = true; } else if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null && __instance.currentlyHeldObjectServer is BoomboxItem) { boomboxItems.lookingAtDeviceType = true; } } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void GetVolumeInput(PlayerControllerB __instance) { if (!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || __instance.inTerminalMenu || __instance.isTypingChat || __instance.isPlayerDead || (!boomboxItems.lookingAtDeviceType && !recordPlayers.lookingAtDeviceType && !televisions.lookingAtDeviceType)) { return; } float num = 0f; if (((ButtonControl)Keyboard.current.minusKey).wasPressedThisFrame) { num = 0f - Plugin.volumeIncrement; } if (((ButtonControl)Keyboard.current.equalsKey).wasPressedThisFrame) { num = Plugin.volumeIncrement; } if (num != 0f) { Plugin.Log("AdjustVolume: " + num); AudioPlayerTypeBase audioPlayerTypeBase = null; if (boomboxItems.lookingAtDeviceType) { audioPlayerTypeBase = boomboxItems; } else if (recordPlayers.lookingAtDeviceType) { audioPlayerTypeBase = recordPlayers; } else if (televisions.lookingAtDeviceType) { audioPlayerTypeBase = televisions; } if (audioPlayerTypeBase != null) { audioPlayerTypeBase.currentVolume = Mathf.Clamp(audioPlayerTypeBase.currentVolume + num, 0f, Plugin.maxDisplayedVolume); audioPlayerTypeBase.UpdateVolumes(); audioPlayerTypeBase.UpdateTooltips(); Plugin.Log($"[{audioPlayerTypeBase.name}] Updating volume to: {audioPlayerTypeBase.currentVolume}%"); } } } [HarmonyPatch(typeof(BoomboxItem), "Start")] [HarmonyPostfix] public static void SetBoomboxHoverTip(BoomboxItem __instance) { boomboxItems.audioSources.Add(__instance.boomboxAudio); boomboxItems.items.Add((GrabbableObject)(object)__instance); ((GrabbableObject)__instance).itemProperties.canBeGrabbedBeforeGameStart = true; if (boomboxItems.defaultVolume == 0f) { boomboxItems.defaultVolume = __instance.boomboxAudio.volume; Plugin.Log("Boombox volume: " + boomboxItems.defaultVolume); } if (boomboxItems.controlTooltips == null) { boomboxItems.controlTooltips = new List<string>(((GrabbableObject)__instance).itemProperties.toolTips); boomboxItems.controlTooltips.Add(""); } boomboxItems.UpdateTooltips(); boomboxItems.UpdateVolumes(); } [HarmonyPatch(typeof(AutoParentToShip), "Awake")] [HarmonyPostfix] public static void SetRecordPlayerHoverTip(AutoParentToShip __instance) { if (((Object)__instance).name.Contains("RecordPlayerContainer")) { AudioSource val = ((Component)__instance).GetComponentInChildren<AnimatedObjectTrigger>()?.thisAudioSource; if ((Object)(object)val != (Object)null) { recordPlayers.audioSources.Add(val); } InteractTrigger componentInChildren = ((Component)__instance).GetComponentInChildren<InteractTrigger>(); if (recordPlayers.defaultVolume == 0f) { recordPlayers.defaultVolume = val.volume; Plugin.Log("RecordPlayer Volume: " + recordPlayers.defaultVolume); } if ((Object)(object)componentInChildren == (Object)null) { Plugin.Log("Record player trigger missing!"); return; } recordPlayers.triggers.Add(componentInChildren); recordPlayers.UpdateTooltips(); recordPlayers.UpdateVolumes(); } } [HarmonyPatch(typeof(TVScript), "__initializeVariables")] [HarmonyPostfix] public static void SetTelevisionHoverTip(TVScript __instance) { televisions.audioSources.Add(__instance.tvSFX); Transform parent = ((Component)__instance).transform.parent; InteractTrigger val = ((parent != null) ? ((Component)parent).GetComponentInChildren<InteractTrigger>() : null); if (televisions.defaultVolume == 0f) { televisions.defaultVolume = __instance.tvSFX.volume; Plugin.Log("Television volume: " + televisions.defaultVolume); } if ((Object)(object)val == (Object)null) { Plugin.Log("Television trigger missing!"); return; } televisions.triggers.Add(val); televisions.UpdateTooltips(); televisions.UpdateVolumes(); } } internal abstract class AudioPlayerTypeBase { public string name; public List<AudioSource> audioSources; public string originalHoverTip; public float defaultVolume; public float currentVolume; public bool lookingAtDeviceType; public Type objectType; public AudioPlayerTypeBase(string name, string originalHoverTip = "", float defaultVolume = 0f) { this.name = name; audioSources = new List<AudioSource>(); this.originalHoverTip = originalHoverTip; this.defaultVolume = defaultVolume; currentVolume = Plugin.defaultVolume; lookingAtDeviceType = false; } public void UpdateVolumes() { for (int i = 0; i < audioSources.Count; i++) { if ((Object)(object)audioSources[i] != (Object)null) { audioSources[i].volume = currentVolume / Plugin.maxDisplayedVolume; } } } public abstract void UpdateTooltips(); } internal class AudioPlayerItemType : AudioPlayerTypeBase { public List<GrabbableObject> items; public List<string> controlTooltips; public AudioPlayerItemType(string name, string originalHoverTip = "", float defaultVolume = 0f) : base(name, originalHoverTip, defaultVolume) { items = new List<GrabbableObject>(); } public override void UpdateTooltips() { for (int i = 0; i < items.Count; i++) { if ((Object)(object)items[i] != (Object)null) { items[i].customGrabTooltip = $"{originalHoverTip}\n{Mathf.RoundToInt(currentVolume * 10f) * 10}% volume\n{Plugin.volumeHoverTip}"; controlTooltips[controlTooltips.Count - 1] = items[i].customGrabTooltip.Replace(originalHoverTip + "\n", ""); items[i].itemProperties.toolTips = controlTooltips.ToArray(); } } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && (Object)(object)localPlayerController.currentlyHeldObjectServer != (Object)null && items.Contains(localPlayerController.currentlyHeldObjectServer)) { localPlayerController.currentlyHeldObjectServer.EquipItem(); } } } internal class AudioPlayerPlaceableType : AudioPlayerTypeBase { public List<InteractTrigger> triggers; public AudioPlayerPlaceableType(string name, string originalHoverTip = "", float defaultVolume = 0f) : base(name, originalHoverTip, defaultVolume) { triggers = new List<InteractTrigger>(); } public override void UpdateTooltips() { for (int i = 0; i < triggers.Count; i++) { if ((Object)(object)triggers[i] != (Object)null) { triggers[i].hoverTip = $"{originalHoverTip}\n{Mathf.RoundToInt(currentVolume * 10f) * 10}% volume\n{Plugin.volumeHoverTip}"; } } } } }
BepInEX/plugins/FlipMods-ReservedFlashlightSlot/ReservedFlashlightSlot.dll
Decompiled 11 months agousing 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 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 Dictionary<string, ConfigEntryBase> currentConfigEntries = new Dictionary<string, ConfigEntryBase>(); public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateFlashlightKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedFlashlightSlot", "ActivateFlashlightKey", "<Keyboard>/f", "Activate flashlight keybind."); hideFlashlightMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedFlashlightSlot", "HideFlashlightOnShoulder", false, "Hides the flashlight mesh while on your shoulder. Only applies in scenarios where you can view your player in third person."); activateFlashlightDisplayName = GetDisplayName(activateFlashlightKey.Value); currentConfigEntries.Add(((ConfigEntryBase)activateFlashlightKey).Definition.Key, (ConfigEntryBase)(object)activateFlashlightKey); currentConfigEntries.Add(((ConfigEntryBase)hideFlashlightMeshShoulder).Definition.Key, (ConfigEntryBase)(object)hideFlashlightMeshShoulder); TryRemoveOldConfigSettings(); } 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"); } public static void TryRemoveOldConfigSettings() { HashSet<string> hashSet = new HashSet<string>(); HashSet<string> hashSet2 = new HashSet<string>(); foreach (ConfigEntryBase value in currentConfigEntries.Values) { hashSet.Add(value.Definition.Section); hashSet2.Add(value.Definition.Key); } try { Plugin.Log("Cleaning old config entries"); ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config; string configFilePath = config.ConfigFilePath; if (!File.Exists(configFilePath)) { return; } string text = File.ReadAllText(configFilePath); string[] array = File.ReadAllLines(configFilePath); string text2 = ""; for (int i = 0; i < array.Length; i++) { array[i] = array[i].Replace("\n", ""); if (array[i].Length <= 0) { continue; } if (array[i].StartsWith("[")) { if (text2 != "" && !hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num = text.IndexOf(text2); int num2 = text.IndexOf(array[i]); text = text.Remove(num, num2 - num); } text2 = array[i].Replace("[", "").Replace("]", "").Trim(); } else { if (!(text2 != "")) { continue; } if (i <= array.Length - 4 && array[i].StartsWith("##")) { int j; for (j = 1; i + j < array.Length && array[i + j].Length > 3; j++) { } if (hashSet.Contains(text2)) { int num3 = array[i + j - 1].IndexOf("="); string item = array[i + j - 1].Substring(0, num3 - 1); if (!hashSet2.Contains(item)) { int num4 = text.IndexOf(array[i]); int num5 = text.IndexOf(array[i + j - 1]) + array[i + j - 1].Length; text = text.Remove(num4, num5 - num4); } } i += j - 1; } else if (array[i].Length > 3) { text = text.Replace(array[i], ""); } } } if (!hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num6 = text.IndexOf(text2); text = text.Remove(num6, text.Length - num6); } while (text.Contains("\n\n\n")) { text = text.Replace("\n\n\n", "\n\n"); } File.WriteAllText(configFilePath, text); config.Reload(); } catch { } } } [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 = Patcher.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.5.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal 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); public static ReservedItemInfo laserPointerInfo = new ReservedItemInfo("Laser pointer", 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.5.2"; } } namespace ReservedFlashlightSlot.Patches { [HarmonyPatch] internal static class Patcher { private static Vector3 playerShoulderPositionOffset = new Vector3(0.2f, 0.25f, 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; } 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; } OnPocketFlashlight(__instance, stillUsingFlashlight); return true; } private static void OnPocketFlashlight(FlashlightItem flashlightItem, bool stillUsingFlashlight = false) { if (!((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)null)) { FlashlightItem currentlySelectedFlashlight = GetCurrentlySelectedFlashlight(((GrabbableObject)flashlightItem).playerHeldBy); FlashlightItem reservedFlashlight = GetReservedFlashlight(((GrabbableObject)flashlightItem).playerHeldBy); bool mainFlashlightActive = stillUsingFlashlight || ((Object)(object)currentlySelectedFlashlight != (Object)null && ((GrabbableObject)currentlySelectedFlashlight).isBeingUsed); if ((Object)(object)currentlySelectedFlashlight != (Object)null && ((GrabbableObject)currentlySelectedFlashlight).isBeingUsed) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = null; } else if (((GrabbableObject)flashlightItem).isBeingUsed) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)flashlightItem; } else if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight == (Object)null || !((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight.isBeingUsed)) { ((GrabbableObject)flashlightItem).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } if ((Object)(object)((GrabbableObject)flashlightItem).playerHeldBy == (Object)(object)localPlayerController) { ((Component)((Component)flashlightItem).GetComponentInChildren<Renderer>()).gameObject.layer = 23; } else { ((Component)((Component)flashlightItem).GetComponentInChildren<Renderer>()).gameObject.layer = 6; } if ((Object)(object)flashlightItem == (Object)(object)reservedFlashlight) { ((GrabbableObject)flashlightItem).parentObject = ((GrabbableObject)flashlightItem).playerHeldBy.playerGlobalHead.parent; } UpdateAllFlashlightStates(((GrabbableObject)flashlightItem).playerHeldBy, mainFlashlightActive); } } [HarmonyPatch(typeof(FlashlightItem), "EquipItem")] [HarmonyPostfix] public static void OnEquipFlashlight(FlashlightItem __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { bool mainFlashlightActive = ((Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight != (Object)null && ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight.isBeingUsed) || ((GrabbableObject)__instance).isBeingUsed; FlashlightItem reservedFlashlight = GetReservedFlashlight(((GrabbableObject)__instance).playerHeldBy); if (((GrabbableObject)__instance).isBeingUsed || (Object)(object)__instance == (Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight) { ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = null; } else if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight == (Object)null || !((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight.isBeingUsed)) { ((GrabbableObject)__instance).playerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 6; ((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder); UpdateAllFlashlightStates(((GrabbableObject)__instance).playerHeldBy, mainFlashlightActive); } } [HarmonyPatch(typeof(FlashlightItem), "DiscardItem")] [HarmonyPrefix] public static void ResetPocketedFlashlight(FlashlightItem __instance) { PlayerControllerB previousPlayerHeldBy = GetPreviousPlayerHeldBy(__instance); if (!((Object)(object)previousPlayerHeldBy == (Object)null)) { FlashlightItem reservedFlashlight = GetReservedFlashlight(previousPlayerHeldBy); if ((Object)(object)reservedFlashlight != (Object)null && ((Object)(object)__instance == (Object)(object)previousPlayerHeldBy.pocketedFlashlight || (Object)(object)previousPlayerHeldBy.pocketedFlashlight == (Object)null)) { previousPlayerHeldBy.pocketedFlashlight = (GrabbableObject)(object)reservedFlashlight; } ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 6; } } [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] public static void SetPositionOffset(GrabbableObject __instance) { //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_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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00ac: Unknown result type (might be due to invalid IL or missing references) if (__instance is FlashlightItem && (Object)(object)__instance.playerHeldBy != (Object)null && (Object)(object)__instance.parentObject != (Object)null && __instance.isPocketed && (Object)(object)__instance == (Object)(object)GetReservedFlashlight(__instance.playerHeldBy) && (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)GetReservedFlashlight(__instance.playerHeldBy) && !ConfigSettings.hideFlashlightMeshShoulder.Value) { 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; } } } }
BepInEX/plugins/FlipMods-ReservedItemSlotCore/ReservedItemSlotCore.dll
Decompiled 11 months agousing System; using System.Collections; 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 HarmonyLib; using ReservedItemSlotCore.Config; 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: InternalsVisibleTo("ReservedFlashlightSlot")] [assembly: InternalsVisibleTo("ReservedWalkieSlot")] [assembly: InternalsVisibleTo("ReservedBoomboxSlot")] [assembly: InternalsVisibleTo("ReservedSprayPaintSlot")] [assembly: InternalsVisibleTo("ReservedWeaponSlot")] [assembly: InternalsVisibleTo("ReservedUtilitySlot")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace ReservedItemSlotCore { internal class PlayerInstanceData { public int reservedIndexFlashlight = -1; public int reservedIndexWalkie = -1; public int reservedIndexWeapon = -1; public int reservedIndexSprayPaint = -1; public int numReservedSlots = 0; public ReservedItemInfo grabbingReservedItem = null; public int previousInventorySlot = -1; } [HarmonyPatch] internal static class HotbarSlotSync { public static PlayerControllerB localPlayerController; public static bool isSynced; [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("ReservedItemSlots-OnSwapHotbarClientRpc", new HandleNamedMessageDelegate(OnSwapHotbarClientRpc)); if (NetworkManager.Singleton.IsServer) { NetworkManager.Singleton.CustomMessagingManager.RegisterNamedMessageHandler("ReservedItemSlots-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("ReservedItemSlots-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("ReservedItemSlots-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; if (((CallbackContext)(ref context)).performed && ReservedItemPatcher.CanSwapToReservedHotbarSlot()) { 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 (((CallbackContext)(ref context)).canceled && ReservedItemPatcher.CanSwapToReservedHotbarSlot()) { ReservedItemPatcher.SetFocusReservedHotbarSlots(active: false); } } } } [BepInPlugin("FlipMods.ReservedItemSlotCore", "ReservedItemSlotCore", "1.7.1")] internal 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); } } internal 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 HashSet<string> acceptedItemNames; 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.reservedItemsStartIndex + 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 || this.hotbarSlotPriority > reservedItemInfo.hotbarSlotPriority) { break; } } reservedItemIndex = i; if (i == reservedItemSlotReps.Count || this.hotbarSlotPriority != reservedItemSlotReps[i].hotbarSlotPriority || reservedItemSlotReps[i].undefinedHotbarSlotPriority != undefinedHotbarSlotPriority) { acceptedItemNames = new HashSet<string> { itemName }; reservedItemSlotReps.Insert(i, this); { foreach (ReservedItemInfo reservedItems in reservedItemsList) { if (this != reservedItems && reservedItems.reservedItemIndex >= i) { reservedItems.reservedItemIndex++; } } return; } } acceptedItemNames = reservedItemSlotReps[i].acceptedItemNames; acceptedItemNames.Add(itemName); } 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.7.1"; } } namespace ReservedItemSlotCore.Config { public static class ConfigSettings { public static ConfigEntry<string> focusReservedHotbarHotkey; public static ConfigEntry<bool> preventReservedItemSlotFade; public static string focusReservedHotbarHotkeyDisplayName; public static Dictionary<string, ConfigEntryBase> currentConfigEntries = new Dictionary<string, ConfigEntryBase>(); 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."); preventReservedItemSlotFade = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "PreventReservedHotbarSlotFade", false, "If true, the reserved hotbar slots will not fade with the rest of the default slots."); focusReservedHotbarHotkeyDisplayName = GetDisplayName(focusReservedHotbarHotkey.Value); currentConfigEntries.Add(((ConfigEntryBase)focusReservedHotbarHotkey).Definition.Key, (ConfigEntryBase)(object)focusReservedHotbarHotkey); currentConfigEntries.Add(((ConfigEntryBase)preventReservedItemSlotFade).Definition.Key, (ConfigEntryBase)(object)preventReservedItemSlotFade); TryRemoveOldConfigSettings(); } 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"); } public static void TryRemoveOldConfigSettings() { HashSet<string> hashSet = new HashSet<string>(); HashSet<string> hashSet2 = new HashSet<string>(); foreach (ConfigEntryBase value in currentConfigEntries.Values) { hashSet.Add(value.Definition.Section); hashSet2.Add(value.Definition.Key); } try { Plugin.Log("Cleaning old config entries"); ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config; string configFilePath = config.ConfigFilePath; if (!File.Exists(configFilePath)) { return; } string text = File.ReadAllText(configFilePath); string[] array = File.ReadAllLines(configFilePath); string text2 = ""; for (int i = 0; i < array.Length; i++) { array[i] = array[i].Replace("\n", ""); if (array[i].Length <= 0) { continue; } if (array[i].StartsWith("[")) { if (text2 != "" && !hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num = text.IndexOf(text2); int num2 = text.IndexOf(array[i]); text = text.Remove(num, num2 - num); } text2 = array[i].Replace("[", "").Replace("]", "").Trim(); } else { if (!(text2 != "")) { continue; } if (i <= array.Length - 4 && array[i].StartsWith("##")) { int j; for (j = 1; i + j < array.Length && array[i + j].Length > 3; j++) { } if (hashSet.Contains(text2)) { int num3 = array[i + j - 1].IndexOf("="); string item = array[i + j - 1].Substring(0, num3 - 1); if (!hashSet2.Contains(item)) { int num4 = text.IndexOf(array[i]); int num5 = text.IndexOf(array[i + j - 1]) + array[i + j - 1].Length; text = text.Remove(num4, num5 - num4); } } i += j - 1; } else if (array[i].Length > 3) { text = text.Replace(array[i], ""); } } } if (!hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num6 = text.IndexOf(text2); text = text.Remove(num6, text.Length - num6); } while (text.Contains("\n\n\n")) { text = text.Replace("\n\n\n", "\n\n"); } File.WriteAllText(configFilePath, text); config.Reload(); } catch { } } } } 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; public static int startIndexReservedItemSlots; [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; } public static void AddNewHotbarSlotsHud() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: 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_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) if (PlayerPatcher.reservedHotbarSize > 0) { List<Image> list = new List<Image>(HUDManager.Instance.itemSlotIconFrames); List<Image> list2 = new List<Image>(HUDManager.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.reservedItemSlotReps.Count} Reserved item slots to the inventory HUD. Previous inventory HUD size: {PlayerPatcher.reservedItemsStartIndex}"); 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.reservedItemsStartIndex - 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 = ConfigSettings.preventReservedItemSlotFade.Value; 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.reservedItemsStartIndex]).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)HUDManager.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)}]"); } HUDManager.Instance.itemSlotIconFrames = list.ToArray(); HUDManager.Instance.itemSlotIcons = list2.ToArray(); Plugin.Log($"Finished adding {PlayerPatcher.reservedHotbarSize} Reserved Item slots in the inventory HUD."); } } public static void UpdateHUD() { //IL_001f: 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) for (int i = 0; i < PlayerPatcher.reservedHotbarSize; i++) { int num = PlayerPatcher.reservedItemsStartIndex + i; float num2 = ((Graphic)HUDManager.Instance.itemSlotIconFrames[0]).rectTransform.anchoredPosition.y + 1.125f * iconWidth * (float)i; ((Graphic)HUDManager.Instance.itemSlotIconFrames[num]).rectTransform.anchoredPosition = new Vector2(xPos, num2); } } } [HarmonyPatch] public static class ReservedItemPatcher { public static bool isReservedHotbarFocused = false; public static int indexUnfocusedReservedHotbar = 0; public static int indexFocusedReservedHotbar = 0; internal static Dictionary<PlayerControllerB, ReservedItemInfo> grabbingReservedItemInfoDict = new Dictionary<PlayerControllerB, ReservedItemInfo>(); internal static Dictionary<PlayerControllerB, int> previousInventoryIndexDict = new Dictionary<PlayerControllerB, int>(); private static GrabbableObject previouslyHeldObjectServer = null; public static PlayerControllerB localPlayerController => PlayerPatcher.localPlayerController; public static int reservedItemsStartIndex => PlayerPatcher.reservedItemsStartIndex; public static int reservedHotbarSize => Plugin.numReservedItemSlots; internal static ReservedItemInfo grabbingReservedItemInfoLocal { get { return ((Object)(object)localPlayerController != (Object)null) ? grabbingReservedItemInfoDict[localPlayerController] : null; } set { if (!((Object)(object)localPlayerController == (Object)null)) { grabbingReservedItemInfoDict[localPlayerController] = value; } } } internal static int previousInventoryIndexLocal { get { return ((Object)(object)localPlayerController != (Object)null) ? previousInventoryIndexDict[localPlayerController] : (-1); } set { if (!((Object)(object)localPlayerController == (Object)null)) { previousInventoryIndexDict[localPlayerController] = value; } } } [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] public static void InitSession(StartOfRound __instance) { grabbingReservedItemInfoDict.Clear(); previousInventoryIndexDict.Clear(); } [HarmonyPatch(typeof(PlayerControllerB), "Start")] [HarmonyPostfix] public static void InitPlayer(PlayerControllerB __instance) { grabbingReservedItemInfoDict[__instance] = null; previousInventoryIndexDict[__instance] = -1; } private static GrabbableObject GetCurrentlyGrabbingObject(PlayerControllerB playerController) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_001e: 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) 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 = Plugin.GetReservedItemInfo(((Component)((Component)((RaycastHit)(ref val2)).collider).transform).gameObject.GetComponent<GrabbableObject>()); } return true; } [HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")] [HarmonyPostfix] public static void GrabReservedItemPostfix(PlayerControllerB __instance) { if (grabbingReservedItemInfoLocal != null) { MethodInfo method = ((object)__instance).GetType().GetMethod("SetSpecialGrabAnimationBool", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(__instance, new object[2] { false, null }); } } [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] [HarmonyPrefix] public static void GrabReservedItemClientRpcPrefix(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB __instance) { if (!NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance)) { return; } NetworkObject val = default(NetworkObject); if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening && grabValidated && ((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)) { grabbingReservedItemInfoDict[__instance] = reservedItemInfo; previousInventoryIndexDict[__instance] = __instance.currentItemSlot; return; } } grabbingReservedItemInfoDict[__instance] = null; previousInventoryIndexDict[__instance] = -1; } [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] [HarmonyPostfix] public static void GrabReservedItemClientRpcPostfix(bool grabValidated, NetworkObjectReference grabbedObject, PlayerControllerB __instance) { Plugin.Log("NULL???? : " + (grabbingReservedItemInfoDict[__instance] == null)); if (!NetworkHelper.IsClientExecStage((NetworkBehaviour)(object)__instance) || grabbingReservedItemInfoDict[__instance] == null) { return; } if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsListening) { NetworkObject val = default(NetworkObject); if (grabValidated && ((NetworkObjectReference)(ref grabbedObject)).TryGet(ref val, (NetworkManager)null)) { GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>(); ReservedItemInfo reservedItemInfo = Plugin.GetReservedItemInfo(component); if (reservedItemInfo != null) { MethodInfo method = ((object)__instance).GetType().GetMethod("SetSpecialGrabAnimationBool", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(__instance, new object[2] { false, null }); __instance.currentlyHeldObjectServer = __instance.ItemSlots[__instance.currentItemSlot]; if ((Object)(object)__instance.currentlyHeldObjectServer != (Object)null) { __instance.twoHanded = __instance.currentlyHeldObjectServer.itemProperties.twoHanded; __instance.twoHandedAnimation = __instance.currentlyHeldObjectServer.itemProperties.twoHandedAnimation; } if ((Object)(object)__instance != (Object)(object)localPlayerController) { } Traverse.Create((object)component).Field("previousPlayerHeldBy").SetValue((object)__instance); if ((Object)(object)__instance != (Object)(object)localPlayerController) { Plugin.Log("Grab object completed on player: " + ((Object)__instance).name); MethodInfo method2 = ((object)__instance).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); method2.Invoke(__instance, new object[2] { previousInventoryIndexDict[__instance], null }); grabbingReservedItemInfoDict[__instance] = null; previousInventoryIndexDict[__instance] = -1; } return; } } 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; previousInventoryIndexDict[__instance] = -1; } [HarmonyPatch(typeof(PlayerControllerB), "SwitchToItemSlot")] [HarmonyPostfix] public static void OnSwitchToItemSlot(int slot, PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)localPlayerController && grabbingReservedItemInfoLocal != null) { ((Component)HUDManager.Instance.itemSlotIconFrames[grabbingReservedItemInfoLocal.indexInInventory]).GetComponent<Animator>().SetBool("selectedSlot", false); ((Component)HUDManager.Instance.itemSlotIconFrames[previousInventoryIndexLocal]).GetComponent<Animator>().SetBool("selectedSlot", true); ((Component)HUDManager.Instance.itemSlotIconFrames[grabbingReservedItemInfoLocal.indexInInventory]).GetComponent<Animator>().Play("PanelLines", 0, 1f); ((Component)HUDManager.Instance.itemSlotIconFrames[previousInventoryIndexLocal]).GetComponent<Animator>().Play("PanelEnlarge", 0, 1f); } } [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() { MethodInfo method = ((object)localPlayerController).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(localPlayerController, new object[2] { previousInventoryIndexLocal, null }); previouslyHeldObjectServer = null; grabbingReservedItemInfoLocal = null; previousInventoryIndexLocal = -1; } [HarmonyPatch(typeof(PlayerControllerB), "FirstEmptyItemSlot")] [HarmonyPostfix] public static void GetReservedItemSlotPlacementIndex(ref int __result, PlayerControllerB __instance) { ReservedItemInfo reservedItemInfo = grabbingReservedItemInfoDict[__instance]; if (reservedItemInfo != null) { if (IsItemSlotEmpty(reservedItemInfo)) { __result = reservedItemInfo.indexInInventory; return; } grabbingReservedItemInfoDict[__instance] = null; } if (__result < reservedItemsStartIndex || __result >= reservedItemsStartIndex + reservedHotbarSize) { return; } __result = -1; for (int i = 0; i < __instance.ItemSlots.Length; i++) { if ((i < reservedItemsStartIndex || i >= reservedItemsStartIndex + reservedHotbarSize) && (Object)(object)__instance.ItemSlots[i] == (Object)null) { __result = i; break; } } } [HarmonyPatch(typeof(PlayerControllerB), "NextItemSlot")] [HarmonyPostfix] public static void PreventScrollingOtherHotbar(ref int __result, bool forward, PlayerControllerB __instance) { if (reservedHotbarSize <= 0) { return; } bool flag = __result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize; bool flag2 = __instance.currentItemSlot >= reservedItemsStartIndex && __instance.currentItemSlot < reservedItemsStartIndex + reservedHotbarSize; if ((Object)(object)__instance != (Object)(object)localPlayerController && ((!flag && !flag2) || (flag && flag2 && (Object)(object)__instance.ItemSlots[__result] != (Object)null))) { return; } int num = (forward ? 1 : (-1)); __result = __instance.currentItemSlot; __result += num; if (!flag2) { if (__result < 0) { __result = __instance.ItemSlots.Length - 1; if (__result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize) { __result = reservedItemsStartIndex - 1; } } else if (__result >= reservedItemsStartIndex && __result < reservedItemsStartIndex + reservedHotbarSize) { __result = (forward ? (reservedItemsStartIndex + reservedHotbarSize) : (reservedItemsStartIndex - 1)); } if (__result >= __instance.ItemSlots.Length) { __result = 0; } return; } if (__result < reservedItemsStartIndex) { __result = reservedItemsStartIndex + reservedHotbarSize - 1; } else if (__result >= reservedItemsStartIndex + reservedHotbarSize) { __result = reservedItemsStartIndex; } int num2 = __result; while (__result != __instance.currentItemSlot && (Object)(object)__instance.ItemSlots[__result] == (Object)null) { __result += num; if (__result < reservedItemsStartIndex) { __result = reservedItemsStartIndex + reservedHotbarSize - 1; } else if (__result >= reservedItemsStartIndex + reservedHotbarSize) { __result = reservedItemsStartIndex; } } if (__result == __instance.currentItemSlot && (Object)(object)__instance.ItemSlots[__instance.currentItemSlot] == (Object)null) { __result = num2; } } [HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")] [HarmonyPrefix] public static bool FixScrollingDirectionReservedHotbar(CallbackContext context, PlayerControllerB __instance) { if (reservedHotbarSize <= 0 || !isReservedHotbarFocused || __instance.inTerminalMenu) { return true; } if (!CanSwapToReservedHotbarSlot()) { return true; } MethodInfo method = ((object)__instance).GetType().GetMethod("NextItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); int num = (int)method.Invoke(__instance, new object[1] { ((CallbackContext)(ref context)).ReadValue<float>() > 0f }); method = ((object)__instance).GetType().GetMethod("SwitchToItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(__instance, new object[2] { num, null }); 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.isGrabbingObjectAnimation || localPlayerController.quickMenuManager.isMenuOpen || localPlayerController.inSpecialInteractAnimation || flag) && !localPlayerController.isTypingChat && !localPlayerController.twoHanded && !localPlayerController.activatingItem && !localPlayerController.jetpackControls && !localPlayerController.disablingJetpackControls && !localPlayerController.inTerminalMenu && !localPlayerController.isPlayerDead; } [HarmonyPatch(typeof(PlayerControllerB), "UpdateSpecialAnimationValue")] [HarmonyPostfix] public static void OnSpecialAnimationUpdate(bool specialAnimation, PlayerControllerB __instance) { if (!((Object)(object)__instance != (Object)(object)localPlayerController) && !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 < reservedItemsStartIndex || num >= reservedItemsStartIndex + reservedHotbarSize)) { if (indexFocusedReservedHotbar == -1) { indexFocusedReservedHotbar = reservedItemsStartIndex; } indexUnfocusedReservedHotbar = num; num = Mathf.Clamp(indexFocusedReservedHotbar, reservedItemsStartIndex, reservedItemsStartIndex + reservedHotbarSize - 1); if ((Object)(object)localPlayerController.ItemSlots[num] == (Object)null) { for (int i = 0; i < reservedHotbarSize; i++) { int num2 = reservedItemsStartIndex + i; if ((Object)(object)localPlayerController.ItemSlots[num2] != (Object)null) { num = num2; break; } } } } else if (!isReservedHotbarFocused && num >= reservedItemsStartIndex && num < reservedItemsStartIndex + reservedHotbarSize) { indexFocusedReservedHotbar = num; if (indexUnfocusedReservedHotbar >= reservedItemsStartIndex && indexUnfocusedReservedHotbar < reservedItemsStartIndex + reservedHotbarSize) { indexUnfocusedReservedHotbar = 0; } num = indexUnfocusedReservedHotbar; } HotbarSlotSync.SwapHotbarSlot(num); } public static bool IsItemSlotEmpty(string itemName, PlayerControllerB playerController) { return IsItemSlotEmpty(Plugin.GetReservedItemInfo(itemName), playerController); } internal 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 reservedItemsStartIndex = 4; public static int oldHotbarSize = -1; public static int INTERACTABLE_OBJECT_MASK { get; private set; } public static int reservedHotbarSize => Plugin.numReservedItemSlots; public static int combinedHotbarSize => reservedItemsStartIndex + 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) { } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void CheckForIncreasedInventorySize(PlayerControllerB __instance) { if ((Object)(object)__instance != (Object)(object)localPlayerController || reservedHotbarSize == 0 || oldHotbarSize == __instance.ItemSlots.Length) { return; } for (int i = 0; i < HUDManager.Instance.itemSlotIconFrames.Length; i++) { if (((Object)HUDManager.Instance.itemSlotIconFrames[i]).name.ToLower().StartsWith("reserveditemslot")) { reservedItemsStartIndex = i; oldHotbarSize = __instance.ItemSlots.Length; HUDPatcher.UpdateHUD(); break; } } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] public static void OnLocalPlayerConnect(PlayerControllerB __instance) { localPlayerController = __instance; INTERACTABLE_OBJECT_MASK = (int)Traverse.Create((object)__instance).Field("interactableObjectsMask").GetValue(); ((MonoBehaviour)__instance).StartCoroutine(UpdateHotbarSlotsAfterSpawnAnimation()); } private static IEnumerator UpdateHotbarSlotsAfterSpawnAnimation() { yield return (object)new WaitForSeconds(3f); reservedItemsStartIndex = localPlayerController.ItemSlots.Length; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB playerController in allPlayerScripts) { playerController.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[playerController.ItemSlots.Length + reservedHotbarSize]; } HUDPatcher.AddNewHotbarSlotsHud(); } } }
BepInEX/plugins/FlipMods-ReservedWalkieSlot/ReservedWalkieSlot.dll
Decompiled 11 months agousing 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 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 ConfigEntry<bool> hideWalkieMeshShoulder; public static string activateWalkieDisplayName; public static Dictionary<string, ConfigEntryBase> currentConfigEntries = new Dictionary<string, ConfigEntryBase>(); public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateWalkieKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedWalkieSlot", "ActivateWalkieKey", "<Keyboard>/x", "Activate walkie keybind."); hideWalkieMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedWalkieSlot", "HideWalkieOnShoulder", false, "Hides the walkie mesh while on your shoulder. Only applies in scenarios where you can view your player in third person."); activateWalkieDisplayName = GetDisplayName(activateWalkieKey.Value); currentConfigEntries.Add(((ConfigEntryBase)activateWalkieKey).Definition.Key, (ConfigEntryBase)(object)activateWalkieKey); currentConfigEntries.Add(((ConfigEntryBase)hideWalkieMeshShoulder).Definition.Key, (ConfigEntryBase)(object)hideWalkieMeshShoulder); TryRemoveOldConfigSettings(); } 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"); } public static void TryRemoveOldConfigSettings() { HashSet<string> hashSet = new HashSet<string>(); HashSet<string> hashSet2 = new HashSet<string>(); foreach (ConfigEntryBase value in currentConfigEntries.Values) { hashSet.Add(value.Definition.Section); hashSet2.Add(value.Definition.Key); } try { Plugin.Log("Cleaning old config entries"); ConfigFile config = ((BaseUnityPlugin)Plugin.instance).Config; string configFilePath = config.ConfigFilePath; if (!File.Exists(configFilePath)) { return; } string text = File.ReadAllText(configFilePath); string[] array = File.ReadAllLines(configFilePath); string text2 = ""; for (int i = 0; i < array.Length; i++) { array[i] = array[i].Replace("\n", ""); if (array[i].Length <= 0) { continue; } if (array[i].StartsWith("[")) { if (text2 != "" && !hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num = text.IndexOf(text2); int num2 = text.IndexOf(array[i]); text = text.Remove(num, num2 - num); } text2 = array[i].Replace("[", "").Replace("]", "").Trim(); } else { if (!(text2 != "")) { continue; } if (i <= array.Length - 4 && array[i].StartsWith("##")) { int j; for (j = 1; i + j < array.Length && array[i + j].Length > 3; j++) { } if (hashSet.Contains(text2)) { int num3 = array[i + j - 1].IndexOf("="); string item = array[i + j - 1].Substring(0, num3 - 1); if (!hashSet2.Contains(item)) { int num4 = text.IndexOf(array[i]); int num5 = text.IndexOf(array[i + j - 1]) + array[i + j - 1].Length; text = text.Remove(num4, num5 - num4); } } i += j - 1; } else if (array[i].Length > 3) { text = text.Replace(array[i], ""); } } } if (!hashSet.Contains(text2)) { text2 = "[" + text2 + "]"; int num6 = text.IndexOf(text2); text = text.Remove(num6, text.Length - num6); } while (text.Contains("\n\n\n")) { text = text.Replace("\n\n\n", "\n\n"); } File.WriteAllText(configFilePath, text); config.Reload(); } catch { } } } [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.5.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal 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.5.1"; } } 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; } return true; } [HarmonyPatch(typeof(WalkieTalkie), "PocketItem")] [HarmonyPostfix] public static void OnPocketWalkie(WalkieTalkie __instance) { if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null)) { if ((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) { ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 23; } else { ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 6; } ((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)) { ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 6; ((GrabbableObject)__instance).parentObject = (((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)(object)localPlayerController) ? ((GrabbableObject)__instance).playerHeldBy.localItemHolder : ((GrabbableObject)__instance).playerHeldBy.serverItemHolder); } } [HarmonyPatch(typeof(WalkieTalkie), "DiscardItem")] [HarmonyPostfix] public static void OnDiscardWalkie(WalkieTalkie __instance) { ((Component)((Component)__instance).GetComponentInChildren<Renderer>()).gameObject.layer = 6; } [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] public static void SetPositionOffset(GrabbableObject __instance) { //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_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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00ac: Unknown result type (might be due to invalid IL or missing references) if (__instance is WalkieTalkie && (Object)(object)__instance.playerHeldBy != (Object)null && (Object)(object)__instance.parentObject != (Object)null && __instance.isPocketed && (Object)(object)__instance == (Object)(object)GetReservedWalkie(__instance.playerHeldBy) && (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)GetReservedWalkie(__instance.playerHeldBy) && !ConfigSettings.hideWalkieMeshShoulder.Value) { enable = true; } } } }
BepInEX/plugins/FutureSavior-Boombox_Sync_Fix/BoomboxSyncFix.dll
Decompiled 11 months agousing 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 BoomboxSyncFix.Patches; 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("BoomboxSyncFix")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A mod to fix the base game bug of the Boombox not being synced between users.")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+71645702ebc3ea437c29afaa8432d4398a219be3")] [assembly: AssemblyProduct("BoomboxSyncFix")] [assembly: AssemblyTitle("BoomboxSyncFix")] [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 BoomboxSyncFix { [BepInPlugin("BoomboxSyncFix", "BoomboxSyncFix", "1.1.0")] public class BoomboxSyncFixPlugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("BoomboxSyncFix"); public static BoomboxSyncFixPlugin Instance; internal ManualLogSource logger; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = Logger.CreateLogSource("BoomboxSyncFix"); logger.LogInfo((object)"Plugin BoomboxSyncFix has loaded!"); harmony.PatchAll(typeof(BoomboxSyncFixPlugin)); harmony.PatchAll(typeof(BoomboxItemStartMusicPatch)); } } public static class PluginInfo { public const string PLUGIN_GUID = "BoomboxSyncFix"; public const string PLUGIN_NAME = "BoomboxSyncFix"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace BoomboxSyncFix.Patches { [HarmonyPatch] internal class BoomboxItemStartMusicPatch { private static Dictionary<BoomboxItem, bool> seedSyncDictionary = new Dictionary<BoomboxItem, bool>(); private static FieldInfo playersManagerField = AccessTools.Field(typeof(BoomboxItem), "playersManager"); [HarmonyPatch(typeof(BoomboxItem), "StartMusic")] [HarmonyPrefix] public static void StartMusicPatch(BoomboxItem __instance) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown StartOfRound val = (StartOfRound)playersManagerField.GetValue(__instance); if ((!seedSyncDictionary.TryGetValue(__instance, out var value) || !value) && (Object)(object)val != (Object)null && val.randomMapSeed > 0) { int num = val.randomMapSeed - 10; __instance.musicRandomizer = new Random(num); BoomboxSyncFixPlugin.Instance.logger.LogInfo((object)$"Musicrandomizer variable has been synced with seed: {num}"); seedSyncDictionary[__instance] = true; } } [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyPrefix] public static void OnPlayerConnectedPatch(StartOfRound __instance) { BoomboxSyncFixPlugin.Instance.logger.LogInfo((object)"Another client joined -- forcing everyone to reintialize musicRandomizer."); forceReinitialize(seedSyncDictionary); } [HarmonyPatch(typeof(StartOfRound), "openingDoorsSequence")] [HarmonyPrefix] public static void openingDoorsSequencePatch(StartOfRound __instance) { BoomboxSyncFixPlugin.Instance.logger.LogInfo((object)"Round has loaded for all -- forcing everyone to reinitialize musicRandomizer."); forceReinitialize(seedSyncDictionary); } private static void forceReinitialize(Dictionary<BoomboxItem, bool> seedSyncDictionary) { foreach (BoomboxItem item in seedSyncDictionary.Keys.ToList()) { seedSyncDictionary[item] = false; } } } }
BepInEX/plugins/Giltong-LethalCompanyDRP/LethalCompanyDRP.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.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
BepInEX/plugins/Graze-ReservedShotGunSlot/ReservedShotGunSlot.dll
Decompiled 11 months agousing 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; using ReservedItemSlotCore; [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("ReservedShotGunSlot")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ReservedShotGunSlot")] [assembly: AssemblyTitle("ReservedShotGunSlot")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace ReservedShotGunSlot; public class HarmonyPatches { private static Harmony instance; public const string InstanceId = "com.graze.gorillatag.reservedshotgunslot"; public static bool IsPatched { get; private set; } internal static void ApplyHarmonyPatches() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (!IsPatched) { if (instance == null) { instance = new Harmony("com.graze.gorillatag.reservedshotgunslot"); } instance.PatchAll(Assembly.GetExecutingAssembly()); IsPatched = true; } } internal static void RemoveHarmonyPatches() { if (instance != null && IsPatched) { instance.UnpatchAll("com.graze.gorillatag.reservedshotgunslot"); IsPatched = false; } } } [BepInDependency("org.legoandmars.gorillatag.utilla", "1.5.0")] [BepInPlugin("com.graze.gorillatag.reservedshotgunslot", "ReservedShotGunSlot", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Plugin instance; public static ReservedItemInfo ShotgunInfo = new ReservedItemInfo("ShotGun", 77, true, true, true, true); private Plugin() { HarmonyPatches.ApplyHarmonyPatches(); ConfigSettings.BindConfigSettings(); } } public static class ConfigSettings { public static ConfigEntry<string> activateShotGunKey; public static ConfigEntry<bool> hideShotGunMeshShoulder; public static string activateShotGunDisplayName; public static void BindConfigSettings() { activateShotGunKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "ActivateShotGunKey", "<Keyboard>/x", "This doesnt work but im afraid to take it away."); hideShotGunMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "HideShotGunOnShoulder", true, "This also doesnt work i dont think.."); activateShotGunDisplayName = GetDisplayName(activateShotGunKey.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"); } } internal class PluginInfo { public const string GUID = "com.graze.gorillatag.reservedshotgunslot"; public const string Name = "ReservedShotGunSlot"; public const string Version = "1.0.0"; }
BepInEX/plugins/itsmeowdev-DoorFix/DoorFix.dll
Decompiled 11 months agousing 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"; } }
BepInEX/plugins/Luck-LuckReservedBoombox/ReservedBoomboxSlot.dll
Decompiled 11 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using ReservedItemSlotCore; [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("LerningReal")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LerningReal")] [assembly: AssemblyTitle("LerningReal")] [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 ReservedBoomBoxSlot { public static class ConfigSettings { public static ConfigEntry<string> activateBoomBoxKey; public static ConfigEntry<bool> hideBoomBoxMeshShoulder; public static string activateBoomBoxDisplayName; public static void BindConfigSettings() { Plugin.Log("BindingConfigs"); activateBoomBoxKey = ((BaseUnityPlugin)Plugin.instance).Config.Bind<string>("ReservedItemSlotCore", "ActivateBoomBoxKey", "<Keyboard>/x", "This doesnt work but im afraid to take it away."); hideBoomBoxMeshShoulder = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ReservedItemSlotCore", "HideBoomBoxOnShoulder", true, "This also doesnt work i dont think.."); activateBoomBoxDisplayName = GetDisplayName(activateBoomBoxKey.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"); } } [BepInPlugin("Luck.ReservedBoomBoxSlot", "ReservedBoomBoxSlot", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin instance; private Harmony _harmony; public static ReservedItemInfo BoomBoxInfo = new ReservedItemInfo("Boombox", 68, true, true, true, true); public static ReservedItemInfo AnotherBoomBoxInfo = new ReservedItemInfo("pbA AssholeBox", 68, true, true, true, true); public static ReservedItemInfo DKBoomBoxInfo = new ReservedItemInfo("pbB ChristmasSongs", 68, 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("ReservedBoomBoxSlot"); _harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ReservedBoomBox loaded"); } public static void Log(string message) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)message); } } }
BepInEX/plugins/MaxWasUnavailable-ScrollInverter/ScrollInverter.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; 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 BepInEx.Logging; using GameNetcodeStuff; 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("ScrollInverter")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Inverts the scroll wheel direction for the item bar.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ScrollInverter")] [assembly: AssemblyTitle("ScrollInverter")] [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 ScrollInverter { [BepInPlugin("ScrollInverter", "ScrollInverter", "1.0.0")] public class ScrollInverter : BaseUnityPlugin { private bool _isPatched; private Harmony Harmony { get; set; } internal static ManualLogSource Logger { get; set; } public static ScrollInverter Instance { get; private set; } private void Awake() { Instance = this; Logger = ((BaseUnityPlugin)this).Logger; PatchAll(); Logger.LogInfo((object)"Plugin ScrollInverter is loaded!"); } public void PatchAll() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (_isPatched) { Logger.LogWarning((object)"Already patched!"); return; } Logger.LogDebug((object)"Patching..."); Harmony = new Harmony("ScrollInverter"); Harmony.PatchAll(); _isPatched = true; Logger.LogDebug((object)"Patched!"); } public void UnpatchAll() { if (!_isPatched) { Logger.LogWarning((object)"Already unpatched!"); return; } Logger.LogDebug((object)"Unpatching..."); Harmony.UnpatchSelf(); _isPatched = false; Logger.LogDebug((object)"Unpatched!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "ScrollInverter"; public const string PLUGIN_NAME = "ScrollInverter"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace ScrollInverter.Patches { [HarmonyPatch(typeof(PlayerControllerB))] public class PlayerControllerBPatches { [HarmonyPatch("SwitchItem_performed")] [HarmonyTranspiler] public static IEnumerable<CodeInstruction> InvertControlsSwitchItemPerformed(IEnumerable<CodeInstruction> instructions) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CodeMatcher(instructions, (ILGenerator)null).SearchForward((Func<CodeInstruction, bool>)delegate(CodeInstruction instruction) { string? name = instruction.opcode.Name; OpCode ble_Un = OpCodes.Ble_Un; return name == ble_Un.Name; }).ThrowIfInvalid("Could not find branch instruction").SetOpcodeAndAdvance(OpCodes.Bge_Un_S) .InstructionEnumeration(); } } }
BepInEX/plugins/MegaPiggy-BuyableShotgun/BuyableShotgun.dll
Decompiled 11 months agousing 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); } } } }
BepInEX/plugins/MMHOOK/MMHOOK_AmazingAssets.TerrainToMesh.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.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
BepInEX/plugins/MMHOOK/MMHOOK_Assembly-CSharp.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
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
BepInEX/plugins/MMHOOK/MMHOOK_ClientNetworkTransform.dll
Decompiled 11 months agousing 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 { } }
BepInEX/plugins/MMHOOK/MMHOOK_DissonanceVoip.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
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)
BepInEX/plugins/MMHOOK/MMHOOK_Facepunch Transport for Netcode for GameObjects.dll
Decompiled 11 months agousing 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 { } }
BepInEX/plugins/MMHOOK/MMHOOK_Facepunch.Steamworks.Win64.dll
Decompiled 11 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.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
BepInEX/plugins/monkes_mods-JumpDelayPatch/JumpDelayPatch.dll
Decompiled 11 months agousing 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"; } }
BepInEX/plugins/Monkeytype-HideChat/HideChat.dll
Decompiled 11 months agousing 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); } } }
BepInEX/plugins/no00ob-LCSoundTool/LC_SoundTool.dll
Decompiled 11 months agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; 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 LCSoundTool.Networking; using LCSoundTool.Patches; using LCSoundTool.Resources; using LCSoundTool.Utilities; using LCSoundToolMod.Properties; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; 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("LC_SoundTool")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Various audio related functions. Mainly logs all sounds that are playing and what type of playback they're into the BepInEx console.")] [assembly: AssemblyFileVersion("1.4.0.0")] [assembly: AssemblyInformationalVersion("1.4.0")] [assembly: AssemblyProduct("LC_SoundTool")] [assembly: AssemblyTitle("LC_SoundTool")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/no00ob/LCSoundTool")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LCSoundToolMod { public static class PluginInfo { public const string PLUGIN_GUID = "LC_SoundTool"; public const string PLUGIN_NAME = "LC_SoundTool"; public const string PLUGIN_VERSION = "1.4.0"; } } namespace LCSoundToolMod.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("LCSoundToolMod.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] soundtool { get { object @object = ResourceManager.GetObject("soundtool", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace LCSoundTool { public class AudioSourceExtension : MonoBehaviour { public AudioSource audioSource; public bool playOnAwake = false; public bool loop = false; private bool updateHasBeenLogged = false; private bool hasPlayed = false; private void OnEnable() { if (!((Object)(object)audioSource == (Object)null) && !audioSource.isPlaying) { if (playOnAwake) { audioSource.Play(); } if (SoundTool.infoDebugging) { SoundTool.Instance.logger.LogDebug((object)$"(AudioSourceExtension) Started playback of {audioSource} with clip {audioSource.clip} in OnEnable function!"); } updateHasBeenLogged = false; hasPlayed = false; } } private void OnDisable() { if (!((Object)(object)audioSource == (Object)null) && audioSource.isPlaying) { if (playOnAwake) { audioSource.Stop(); } if (SoundTool.infoDebugging) { SoundTool.Instance.logger.LogDebug((object)$"(AudioSourceExtension) Stopped playback of {audioSource} with clip {audioSource.clip} in OnDisable function!"); } updateHasBeenLogged = false; hasPlayed = false; } } private void Update() { if ((Object)(object)audioSource == (Object)null) { return; } if ((Object)(object)audioSource.clip == (Object)null) { hasPlayed = false; } if (audioSource.isPlaying) { updateHasBeenLogged = false; } else if (!((Behaviour)audioSource).isActiveAndEnabled) { hasPlayed = false; } else { if (!playOnAwake) { return; } if ((Object)(object)audioSource.clip != (Object)null && !hasPlayed) { audioSource.Play(); if (SoundTool.infoDebugging) { SoundTool.Instance.logger.LogDebug((object)$"(AudioSourceExtension) Started playback of {audioSource} with clip {audioSource.clip} in Update function!"); } updateHasBeenLogged = false; hasPlayed = true; } else if (!updateHasBeenLogged) { updateHasBeenLogged = true; if (SoundTool.infoDebugging) { SoundTool.Instance.logger.LogDebug((object)$"(AudioSourceExtension) Can not start playback of {audioSource} with missing clip in Update function!"); } } } } } public class RandomAudioClip { public AudioClip clip; [Range(0f, 1f)] public float chance = 1f; public RandomAudioClip(AudioClip clip, float chance) { this.clip = clip; this.chance = chance; } } [BepInPlugin("LCSoundTool", "LC Sound Tool", "1.4.0")] public class SoundTool : BaseUnityPlugin { public enum AudioType { wav, ogg, mp3 } private const string PLUGIN_GUID = "LCSoundTool"; private const string PLUGIN_NAME = "LC Sound Tool"; private ConfigEntry<bool> configUseNetworking; private ConfigEntry<bool> configSyncRandomSeed; private ConfigEntry<float> configPlayOnAwakePatchRepeatDelay; private readonly Harmony harmony = new Harmony("LCSoundTool"); public static SoundTool Instance; internal ManualLogSource logger; public KeyboardShortcut toggleAudioSourceDebugLog; public KeyboardShortcut toggleIndepthDebugLog; public KeyboardShortcut toggleInformationalDebugLog; public bool wasKeyDown; public bool wasKeyDown2; public bool wasKeyDown3; public static bool debugAudioSources; public static bool indepthDebugging; public static bool infoDebugging; public static bool networkingInitialized { get; private set; } public static bool networkingAvailable { get; private set; } public static Dictionary<string, List<RandomAudioClip>> replacedClips { get; private set; } public static Dictionary<string, AudioClip> networkedClips => NetworkHandler.networkedAudioClips; public static Dictionary<string, AudioType> clipTypes { get; private set; } public static event Action ClientNetworkedAudioChanged { add { NetworkHandler.ClientNetworkedAudioChanged += value; } remove { NetworkHandler.ClientNetworkedAudioChanged -= value; } } public static event Action HostNetworkedAudioChanged { add { NetworkHandler.HostNetworkedAudioChanged += value; } remove { NetworkHandler.HostNetworkedAudioChanged -= value; } } public static bool IsDebuggingOn() { if (debugAudioSources || indepthDebugging || infoDebugging) { return true; } return false; } private void Awake() { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_016a: 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) networkingAvailable = true; if ((Object)(object)Instance == (Object)null) { Instance = this; } configUseNetworking = ((BaseUnityPlugin)this).Config.Bind<bool>("Experimental", "EnableNetworking", false, "Whether or not to use the networking built into this plugin. If set to true everyone in the lobby needs LCSoundTool installed and networking enabled to join."); configSyncRandomSeed = ((BaseUnityPlugin)this).Config.Bind<bool>("Experimental", "SyncUnityRandomSeed", false, "Whether or not to sync the default Unity randomization seed with all clients. For this feature, networking has to be set to true. Will send the UnityEngine.Random.seed from the host to all clients automatically upon loading a networked scene."); configPlayOnAwakePatchRepeatDelay = ((BaseUnityPlugin)this).Config.Bind<float>("Experimental", "NewPlayOnAwakePatchRepeatDelay", 90f, "How long to wait between checks for new playOnAwake AudioSources. Runs the same patching that is done when each scene is loaded with this delay between each run. DO NOT set too low or high. Anything below 10 or above 600 can cause issues. This time is in seconds. Set to 0 to disable rerunning the patch, but be warned that this might break runtime initialized playOnAwake AudioSources."); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } logger = Logger.CreateLogSource("LCSoundTool"); logger.LogInfo((object)"Plugin LCSoundTool is loaded!"); toggleAudioSourceDebugLog = new KeyboardShortcut((KeyCode)286, (KeyCode[])(object)new KeyCode[0]); toggleIndepthDebugLog = new KeyboardShortcut((KeyCode)286, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }); toggleInformationalDebugLog = new KeyboardShortcut((KeyCode)286, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }); debugAudioSources = false; indepthDebugging = false; infoDebugging = false; replacedClips = new Dictionary<string, List<RandomAudioClip>>(); clipTypes = new Dictionary<string, AudioType>(); } private void Start() { if (!configUseNetworking.Value) { networkingAvailable = false; Instance.logger.LogWarning((object)"Networking disabled. Mod in fully client side mode, but no networked actions can take place! You can safely ignore this if you want the mod to run fully client side."); } else { networkingAvailable = true; } if (configUseNetworking.Value) { logger.LogDebug((object)"Loading SoundTool AssetBundle..."); Assets.bundle = AssetBundle.LoadFromMemory(LCSoundToolMod.Properties.Resources.soundtool); if ((Object)(object)Assets.bundle == (Object)null) { logger.LogError((object)"Failed to load SoundTool AssetBundle!"); } else { logger.LogDebug((object)"Finished loading SoundTool AssetBundle!"); } } harmony.PatchAll(typeof(AudioSourcePatch)); if (configUseNetworking.Value) { harmony.PatchAll(typeof(GameNetworkManagerPatch)); harmony.PatchAll(typeof(StartOfRoundPatch)); } SceneManager.sceneLoaded += OnSceneLoaded; } private void Update() { if (configUseNetworking.Value) { if (!networkingInitialized) { if ((Object)(object)NetworkHandler.Instance != (Object)null) { networkingInitialized = true; } } else if ((Object)(object)NetworkHandler.Instance == (Object)null) { networkingInitialized = false; } } else { networkingInitialized = false; } if (((KeyboardShortcut)(ref toggleInformationalDebugLog)).IsDown() && !wasKeyDown3) { wasKeyDown3 = true; wasKeyDown2 = false; wasKeyDown = false; } if (((KeyboardShortcut)(ref toggleInformationalDebugLog)).IsUp() && wasKeyDown3) { wasKeyDown3 = false; wasKeyDown2 = false; wasKeyDown = false; infoDebugging = !infoDebugging; Instance.logger.LogDebug((object)$"Toggling informational debug logs {infoDebugging}!"); return; } if (((KeyboardShortcut)(ref toggleIndepthDebugLog)).IsDown() && !wasKeyDown2) { wasKeyDown2 = true; wasKeyDown = false; } if (((KeyboardShortcut)(ref toggleIndepthDebugLog)).IsUp() && wasKeyDown2) { wasKeyDown2 = false; wasKeyDown = false; debugAudioSources = !debugAudioSources; indepthDebugging = debugAudioSources; infoDebugging = debugAudioSources; Instance.logger.LogDebug((object)$"Toggling in-depth AudioSource debug logs {debugAudioSources}!"); return; } if (!wasKeyDown2 && !((KeyboardShortcut)(ref toggleIndepthDebugLog)).IsDown() && ((KeyboardShortcut)(ref toggleAudioSourceDebugLog)).IsDown() && !wasKeyDown) { wasKeyDown = true; wasKeyDown2 = false; } if (((KeyboardShortcut)(ref toggleAudioSourceDebugLog)).IsUp() && wasKeyDown) { wasKeyDown = false; wasKeyDown2 = false; debugAudioSources = !debugAudioSources; if (indepthDebugging && !debugAudioSources) { indepthDebugging = false; } Instance.logger.LogDebug((object)$"Toggling AudioSource debug logs {debugAudioSources}!"); } } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0013: 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) if (!((Object)(object)Instance == (Object)null)) { PatchPlayOnAwakeAudio(scene); OnSceneLoadedNetworking(); if (((Scene)(ref scene)).name.ToLower().Contains("level")) { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(PatchPlayOnAwakeDelayed(scene, 1f)); } } } private IEnumerator PatchPlayOnAwakeDelayed(Scene scene, float wait) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (infoDebugging) { logger.LogDebug((object)$"Started playOnAwake patch coroutine with delay of {wait} seconds"); } yield return (object)new WaitForSecondsRealtime(wait); if (infoDebugging) { logger.LogDebug((object)"Running playOnAwake patch coroutine!"); } PatchPlayOnAwakeAudio(scene); float repeatWait = configPlayOnAwakePatchRepeatDelay.Value; if (repeatWait != 0f) { if (repeatWait < 10f) { repeatWait = 10f; } if (repeatWait > 600f) { repeatWait = 600f; } ((MonoBehaviour)this).StartCoroutine(PatchPlayOnAwakeDelayed(scene, repeatWait)); } } private void PatchPlayOnAwakeAudio(Scene scene) { if (infoDebugging) { Instance.logger.LogDebug((object)("Grabbing all playOnAwake AudioSources for loaded scene " + ((Scene)(ref scene)).name)); } AudioSource[] allPlayOnAwakeAudioSources = GetAllPlayOnAwakeAudioSources(); if (infoDebugging) { Instance.logger.LogDebug((object)$"Found a total of {allPlayOnAwakeAudioSources.Length} playOnAwake AudioSource(s)!"); Instance.logger.LogDebug((object)$"Starting setup on {allPlayOnAwakeAudioSources.Length} playOnAwake AudioSource(s)..."); } AudioSource[] array = allPlayOnAwakeAudioSources; AudioSourceExtension audioSourceExtension = default(AudioSourceExtension); foreach (AudioSource val in array) { val.Stop(); if (((Component)((Component)val).transform).TryGetComponent<AudioSourceExtension>(ref audioSourceExtension)) { audioSourceExtension.audioSource = val; audioSourceExtension.playOnAwake = true; audioSourceExtension.loop = val.loop; val.playOnAwake = false; if (infoDebugging) { Instance.logger.LogDebug((object)$"-Set- {Array.IndexOf(allPlayOnAwakeAudioSources, val) + 1} {val} done!"); } continue; } AudioSourceExtension audioSourceExtension2 = ((Component)val).gameObject.AddComponent<AudioSourceExtension>(); audioSourceExtension2.audioSource = val; audioSourceExtension2.playOnAwake = true; audioSourceExtension2.loop = val.loop; val.playOnAwake = false; if (infoDebugging) { Instance.logger.LogDebug((object)$"-Add- {Array.IndexOf(allPlayOnAwakeAudioSources, val) + 1} {val} done!"); } } if (infoDebugging) { Instance.logger.LogDebug((object)$"Done setting up {allPlayOnAwakeAudioSources.Length} playOnAwake AudioSources!"); } } private void OnSceneLoadedNetworking() { if (networkingAvailable && networkingInitialized && configSyncRandomSeed.Value) { int num = (int)DateTime.Now.Ticks; Random.InitState(num); SendUnityRandomSeed(num); } } public AudioSource[] GetAllPlayOnAwakeAudioSources() { AudioSource[] array = Object.FindObjectsOfType<AudioSource>(true); List<AudioSource> list = new List<AudioSource>(); for (int i = 0; i < array.Length; i++) { if (array[i].playOnAwake) { list.Add(array[i]); } } return list.ToArray(); } public static void ReplaceAudioClip(string originalName, AudioClip newClip) { if (string.IsNullOrEmpty(originalName)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without original clip specified! This is not allowed."); return; } if ((Object)(object)newClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without new clip specified! This is not allowed."); return; } string name = newClip.GetName(); float num = 100f; if (name.Contains("-")) { string[] array = name.Split('-'); if (array.Length > 1) { string s = array[^1]; if (int.TryParse(s, out var result)) { num = (float)result * 0.01f; name = string.Join("-", array, 0, array.Length - 1); } } } if (replacedClips.ContainsKey(originalName) && num >= 100f) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip that already has been replaced with 100% chance of playback! This is not allowed."); return; } num = Mathf.Clamp01(num); if (replacedClips.ContainsKey(originalName)) { replacedClips[originalName].Add(new RandomAudioClip(newClip, num)); } else { replacedClips[originalName] = new List<RandomAudioClip> { new RandomAudioClip(newClip, num) }; } float num2 = 0f; for (int i = 0; i < replacedClips[originalName].Count(); i++) { num2 += replacedClips[originalName][i].chance; } if ((num2 < 1f || num2 > 1f) && replacedClips[originalName].Count() > 1) { Instance.logger.LogDebug((object)$"The current total combined chance for replaced {replacedClips[originalName].Count()} random audio clips for audio clip {originalName} does not equal 100% (at least yet?)"); } else if (num2 == 1f && replacedClips[originalName].Count() > 1) { Instance.logger.LogDebug((object)$"The current total combined chance for replaced {replacedClips[originalName].Count()} random audio clips for audio clip {originalName} is equal to 100%"); } } public static void ReplaceAudioClip(AudioClip originalClip, AudioClip newClip) { if ((Object)(object)originalClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without original clip specified! This is not allowed."); } else if ((Object)(object)newClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without new clip specified! This is not allowed."); } else { ReplaceAudioClip(originalClip.GetName(), newClip); } } public static void ReplaceAudioClip(string originalName, AudioClip newClip, float chance) { if (string.IsNullOrEmpty(originalName)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without original clip specified! This is not allowed."); return; } if ((Object)(object)newClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without new clip specified! This is not allowed."); return; } string name = newClip.GetName(); if (replacedClips.ContainsKey(originalName) && chance >= 100f) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip that already has been replaced with 100% chance of playback! This is not allowed."); return; } chance = Mathf.Clamp01(chance); if (replacedClips.ContainsKey(originalName)) { replacedClips[originalName].Add(new RandomAudioClip(newClip, chance)); } else { replacedClips[originalName] = new List<RandomAudioClip> { new RandomAudioClip(newClip, chance) }; } float num = 0f; for (int i = 0; i < replacedClips[originalName].Count(); i++) { num += replacedClips[originalName][i].chance; } if ((num < 1f || num > 1f) && replacedClips[originalName].Count() > 1) { Instance.logger.LogDebug((object)$"The current total combined chance for replaced {replacedClips[originalName].Count()} random audio clips for audio clip {originalName} does not equal 100% (at least yet?)"); } else if (num == 1f && replacedClips[originalName].Count() > 1) { Instance.logger.LogDebug((object)$"The current total combined chance for replaced {replacedClips[originalName].Count()} random audio clips for audio clip {originalName} is equal to 100%"); } } public static void ReplaceAudioClip(AudioClip originalClip, AudioClip newClip, float chance) { if ((Object)(object)originalClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without original clip specified! This is not allowed."); } else if ((Object)(object)newClip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to replace an audio clip without new clip specified! This is not allowed."); } else { ReplaceAudioClip(originalClip.GetName(), newClip, chance); } } public static void RemoveRandomAudioClip(string name, float chance) { if (string.IsNullOrEmpty(name)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to restore an audio clip without original clip specified! This is not allowed."); } else if (!replacedClips.ContainsKey(name)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to restore an audio clip that does not exist! This is not allowed."); } else { if (!(chance > 0f)) { return; } for (int i = 0; i < replacedClips[name].Count(); i++) { if (replacedClips[name][i].chance == chance) { replacedClips[name].RemoveAt(i); break; } } } } public static void RestoreAudioClip(string name) { if (string.IsNullOrEmpty(name)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to restore an audio clip without original clip specified! This is not allowed."); } else if (!replacedClips.ContainsKey(name)) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to restore an audio clip that does not exist! This is not allowed."); } else { replacedClips.Remove(name); } } public static void RestoreAudioClip(AudioClip clip) { if ((Object)(object)clip == (Object)null) { Instance.logger.LogWarning((object)"Plugin LCSoundTool is trying to restore an audio clip without original clip specified! This is not allowed."); } else { RestoreAudioClip(clip.GetName()); } } public static AudioClip GetAudioClip(string modFolder, string soundName) { return GetAudioClip(modFolder, string.Empty, soundName); } public static AudioClip GetAudioClip(string modFolder, string subFolder, string soundName) { AudioType audioType = AudioType.wav; bool flag = true; string text = " "; string text2 = Path.Combine(Paths.PluginPath, modFolder, subFolder, soundName); string text3 = Path.Combine(Paths.PluginPath, modFolder, soundName); string path = Path.Combine(Paths.PluginPath, modFolder, subFolder); string text4 = Path.Combine(Paths.PluginPath, subFolder, soundName); string path2 = Path.Combine(Paths.PluginPath, subFolder); if (!Directory.Exists(path)) { if (!string.IsNullOrEmpty(subFolder)) { Instance.logger.LogWarning((object)("Requested directory at BepInEx/Plugins/" + modFolder + "/" + subFolder + " does not exist!")); } else { Instance.logger.LogWarning((object)("Requested directory at BepInEx/Plugins/" + modFolder + " does not exist!")); if (!modFolder.Contains("-")) { Instance.logger.LogWarning((object)"This sound mod might not be compatable with mod managers. You should contact the sound mod's author."); } } flag = false; } if (!File.Exists(text2)) { Instance.logger.LogWarning((object)("Requested audio file does not exist at path " + text2 + "!")); flag = false; Instance.logger.LogDebug((object)("Looking for audio file from mod root instead at " + text3 + "...")); if (File.Exists(text3)) { Instance.logger.LogDebug((object)("Found audio file at path " + text3 + "!")); text2 = text3; flag = true; } else { Instance.logger.LogWarning((object)("Requested audio file does not exist at mod root path " + text3 + "!")); } } if (Directory.Exists(path2)) { if (!string.IsNullOrEmpty(subFolder)) { Instance.logger.LogWarning((object)("Legacy directory location at BepInEx/Plugins/" + subFolder + " found!")); } else if (!modFolder.Contains("-")) { Instance.logger.LogWarning((object)"Legacy directory location at BepInEx/Plugins found!"); } } if (File.Exists(text4)) { Instance.logger.LogWarning((object)("Legacy path contains the requested audio file at path " + text4 + "!")); text = " legacy "; text2 = text4; flag = true; } string[] array = soundName.Split('.'); if (array[^1].ToLower().Contains("ogg")) { audioType = AudioType.ogg; Instance.logger.LogDebug((object)"File detected as an Ogg Vorbis file!"); } else if (array[^1].ToLower().Contains("mp3")) { audioType = AudioType.mp3; Instance.logger.LogDebug((object)"File detected as a MPEG MP3 file!"); } AudioClip val = null; if (flag) { Instance.logger.LogDebug((object)("Loading AudioClip " + soundName + " from" + text + "path: " + text2)); switch (audioType) { case AudioType.wav: val = WavUtility.LoadFromDiskToAudioClip(text2); break; case AudioType.ogg: val = OggUtility.LoadFromDiskToAudioClip(text2); break; case AudioType.mp3: val = Mp3Utility.LoadFromDiskToAudioClip(text2); break; } Instance.logger.LogDebug((object)$"Finished loading AudioClip {soundName} with length of {val.length}!"); } else { Instance.logger.LogWarning((object)("Failed to load AudioClip " + soundName + " from invalid" + text + "path at " + text2 + "!")); } if (string.IsNullOrEmpty(val.GetName())) { string empty = string.Empty; string[] array2 = new string[0]; switch (audioType) { case AudioType.wav: empty = soundName.Replace(".wav", ""); array2 = empty.Split('/'); if (array2.Length <= 1) { array2 = empty.Split('\\'); } empty = array2[^1]; ((Object)val).name = empty; break; case AudioType.ogg: empty = soundName.Replace(".ogg", ""); array2 = empty.Split('/'); if (array2.Length <= 1) { array2 = empty.Split('\\'); } empty = array2[^1]; ((Object)val).name = empty; break; case AudioType.mp3: empty = soundName.Replace(".mp3", ""); array2 = empty.Split('/'); if (array2.Length <= 1) { array2 = empty.Split('\\'); } empty = array2[^1]; ((Object)val).name = empty; break; } } if ((Object)(object)val != (Object)null) { clipTypes.Add(val.GetName(), audioType); } return val; } public static AudioClip GetAudioClip(string modFolder, string soundName, AudioType audioType) { return GetAudioClip(modFolder, string.Empty, soundName, audioType); } public static AudioClip GetAudioClip(string modFolder, string subFolder, string soundName, AudioType audioType) { bool flag = true; string text = " "; string text2 = Path.Combine(Paths.PluginPath, modFolder, subFolder, soundName); string text3 = Path.Combine(Paths.PluginPath, modFolder, soundName); string path = Path.Combine(Paths.PluginPath, modFolder, subFolder); string text4 = Path.Combine(Paths.PluginPath, subFolder, soundName); string path2 = Path.Combine(Paths.PluginPath, subFolder); if (!Directory.Exists(path)) { if (!string.IsNullOrEmpty(subFolder)) { Instance.logger.LogWarning((object)("Requested directory at BepInEx/Plugins/" + modFolder + "/" + subFolder + " does not exist!")); } else { Instance.logger.LogWarning((object)("Requested directory at BepInEx/Plugins/" + modFolder + " does not exist!")); if (!modFolder.Contains("-")) { Instance.logger.LogWarning((object)"This sound mod might not be compatable with mod managers. You should contact the sound mod's author."); } } flag = false; } if (!File.Exists(text2)) { Instance.logger.LogWarning((object)("Requested audio file does not exist at path " + text2 + "!")); flag = false; Instance.logger.LogDebug((object)("Looking for audio file from mod root instead at " + text3 + "...")); if (File.Exists(text3)) { Instance.logger.LogDebug((object)("Found audio file at path " + text3 + "!")); text2 = text3; flag = true; } else { Instance.logger.LogWarning((object)("Requested audio file does not exist at mod root path " + text3 + "!")); } } if (Directory.Exists(path2)) { if (!string.IsNullOrEmpty(subFolder)) { Instance.logger.LogWarning((object)("Legacy directory location at BepInEx/Plugins/" + subFolder + " found!")); } else if (!modFolder.Contains("-")) { Instance.logger.LogWarning((object)"Legacy directory location at BepInEx/Plugins found!"); } } if (File.Exists(text4)) { Instance.logger.LogWarning((object)("Legacy path contains the requested audio file at path " + text4 + "!")); text = " legacy "; text2 = text4; flag = true; } switch (audioType) { case AudioType.wav: Instance.logger.LogDebug((object)"File defined as a WAV file!"); break; case AudioType.ogg: Instance.logger.LogDebug((object)"File defined as an Ogg Vorbis file!"); break; case AudioType.mp3: Instance.logger.LogDebug((object)"File defined as a MPEG MP3 file!"); break; } AudioClip val = null; if (flag) { Instance.logger.LogDebug((object)("Loading AudioClip " + soundName + " from" + text + "path: " + text2)); switch (audioType) { case AudioType.wav: val = WavUtility.LoadFromDiskToAudioClip(text2); break; case AudioType.ogg: val = OggUtility.LoadFromDiskToAudioClip(text2); break; case AudioType.mp3: val = Mp3Utility.LoadFromDiskToAudioClip(text2); break; } Instance.logger.LogDebug((object)$"Finished loading AudioClip {soundName} with length of {val.length}!"); } else { Instance.logger.LogWarning((object)("Failed to load AudioClip " + soundName + " from invalid" + text + "path at " + text2 + "!")); } if (string.IsNullOrEmpty(val.GetName())) { string empty = string.Empty; string[] array = new string[0]; switch (audioType) { case AudioType.wav: empty = soundName.Replace(".wav", ""); array = empty.Split('/'); if (array.Length <= 1) { array = empty.Split('\\'); } empty = array[^1]; ((Object)val).name = empty; break; case AudioType.ogg: empty = soundName.Replace(".ogg", ""); array = empty.Split('/'); if (array.Length <= 1) { array = empty.Split('\\'); } empty = array[^1]; ((Object)val).name = empty; break; case AudioType.mp3: empty = soundName.Replace(".mp3", ""); array = empty.Split('/'); if (array.Length <= 1) { array = empty.Split('\\'); } empty = array[^1]; ((Object)val).name = empty; break; } } if ((Object)(object)val != (Object)null) { clipTypes.Add(val.GetName(), audioType); } return val; } public static void SendNetworkedAudioClip(AudioClip audioClip) { if (!Instance.configUseNetworking.Value) { Instance.logger.LogWarning((object)$"Networking disabled! Failed to send {audioClip}!"); return; } if ((Object)(object)audioClip == (Object)null) { Instance.logger.LogWarning((object)$"audioClip variable of SendAudioClip not assigned! Failed to send {audioClip}!"); return; } if ((Object)(object)Instance == (Object)null || (Object)(object)GameNetworkManagerPatch.networkHandlerHost == (Object)null || (Object)(object)NetworkHandler.Instance == (Object)null) { Instance.logger.LogWarning((object)$"Instance of SoundTool not found or networking has not finished initializing. Failed to send {audioClip}! If you're sending things in Awake or in a scene such as the main menu it might be too early, please try some of the other built-in Unity methods and make sure your networked audio runs only after the player setups a networked connection!"); return; } string name = audioClip.GetName(); if (clipTypes.ContainsKey(name)) { if (clipTypes[name] == AudioType.ogg) { NetworkHandler.Instance.SendAudioClipServerRpc(name, OggUtility.AudioClipToByteArray(audioClip, out var _)); return; } if (clipTypes[name] == AudioType.mp3) { NetworkHandler.Instance.SendAudioClipServerRpc(name, Mp3Utility.AudioClipToByteArray(audioClip, out var _)); return; } } NetworkHandler.Instance.SendAudioClipServerRpc(name, WavUtility.AudioClipToByteArray(audioClip, out var _)); } public static void RemoveNetworkedAudioClip(AudioClip audioClip) { RemoveNetworkedAudioClip(audioClip.GetName()); } public static void RemoveNetworkedAudioClip(string audioClip) { if (!Instance.configUseNetworking.Value) { Instance.logger.LogWarning((object)("Networking disabled! Failed to remove " + audioClip + "!")); } else if (string.IsNullOrEmpty(audioClip)) { Instance.logger.LogWarning((object)("audioClip variable of RemoveAudioClip not assigned! Failed to remove " + audioClip + "!")); } else if ((Object)(object)Instance == (Object)null || (Object)(object)GameNetworkManagerPatch.networkHandlerHost == (Object)null || (Object)(object)NetworkHandler.Instance == (Object)null) { Instance.logger.LogWarning((object)("Instance of SoundTool not found or networking has not finished initializing. Failed to remove " + audioClip + "! If you're removing things in Awake or in a scene such as the main menu it might be too early, please try some of the other built-in Unity methods and make sure your networked audio runs only after the player setups a networked connection!")); } else { NetworkHandler.Instance.RemoveAudioClipServerRpc(audioClip); } } public static void SyncNetworkedAudioClips() { if (!Instance.configUseNetworking.Value) { Instance.logger.LogWarning((object)"Networking disabled! Failed to sync audio clips!"); } else if ((Object)(object)Instance == (Object)null || (Object)(object)GameNetworkManagerPatch.networkHandlerHost == (Object)null || (Object)(object)NetworkHandler.Instance == (Object)null) { Instance.logger.LogWarning((object)"Instance of SoundTool not found or networking has not finished initializing. Failed to sync networked audio! If you're syncing things in Awake or in a scene such as the main menu it might be too early, please try some of the other built-in Unity methods and make sure your networked audio runs only after the player setups a networked connection!"); } else { NetworkHandler.Instance.SyncAudioClipsServerRpc(); } } public static void SendUnityRandomSeed(int seed) { if (!Instance.configUseNetworking.Value) { Instance.logger.LogWarning((object)"Networking disabled! Failed to send Unity random seed!"); } else if ((Object)(object)Instance == (Object)null || (Object)(object)GameNetworkManagerPatch.networkHandlerHost == (Object)null || (Object)(object)NetworkHandler.Instance == (Object)null) { Instance.logger.LogWarning((object)"Instance of SoundTool not found or networking has not finished initializing. Failed to send Unity Random seed! If you're sending the seed in Awake or in a scene such as the main menu it might be too early, please try some of the other built-in Unity methods and make sure your networked methods run only after the player setups a networked connection!"); } else { NetworkHandler.Instance.SendSeedToClientsServerRpc(seed); } } } } namespace LCSoundTool.Utilities { public static class Mp3Utility { public static byte[] AudioClipToByteArray(AudioClip audioClip, out float[] samples) { samples = new float[audioClip.samples * audioClip.channels]; audioClip.GetData(samples, 0); byte[] array = new byte[samples.Length * 2]; int num = 32767; for (int i = 0; i < samples.Length; i++) { short value = (short)(samples[i] * (float)num); BitConverter.GetBytes(value).CopyTo(array, i * 2); } return array; } public static AudioClip ByteArrayToAudioClip(byte[] byteArray, string clipName) { int num = 16; int num2 = num / 8; AudioClip val = AudioClip.Create(clipName, byteArray.Length / num2, 1, 44100, false); val.SetData(ConvertByteArrayToFloatArray(byteArray), 0); return val; } private static float[] ConvertByteArrayToFloatArray(byte[] byteArray) { float[] array = new float[byteArray.Length / 2]; int num = 32767; for (int i = 0; i < array.Length; i++) { short num2 = BitConverter.ToInt16(byteArray, i * 2); array[i] = (float)num2 / (float)num; } return array; } public static AudioClip LoadFromDiskToAudioClip(string path) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 AudioClip result = null; UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)13); try { audioClip.SendWebRequest(); try { while (!audioClip.isDone) { } if ((int)audioClip.result != 1) { SoundTool.Instance.logger.LogError((object)("Failed to load MP3 AudioClip from path: " + path + " Full error: " + audioClip.error)); } else { result = DownloadHandlerAudioClip.GetContent(audioClip); } } catch (Exception ex) { SoundTool.Instance.logger.LogError((object)(ex.Message + ", " + ex.StackTrace)); } } finally { ((IDisposable)audioClip)?.Dispose(); } return result; } } public static class OggUtility { public static byte[] AudioClipToByteArray(AudioClip audioClip, out float[] samples) { samples = new float[audioClip.samples * audioClip.channels]; audioClip.GetData(samples, 0); byte[] array = new byte[samples.Length * 2]; int num = 32767; for (int i = 0; i < samples.Length; i++) { short value = (short)(samples[i] * (float)num); BitConverter.GetBytes(value).CopyTo(array, i * 2); } return array; } public static AudioClip ByteArrayToAudioClip(byte[] byteArray, string clipName) { int num = 16; int num2 = num / 8; AudioClip val = AudioClip.Create(clipName, byteArray.Length / num2, 1, 44100, false); val.SetData(ConvertByteArrayToFloatArray(byteArray), 0); return val; } private static float[] ConvertByteArrayToFloatArray(byte[] byteArray) { float[] array = new float[byteArray.Length / 2]; int num = 32767; for (int i = 0; i < array.Length; i++) { short num2 = BitConverter.ToInt16(byteArray, i * 2); array[i] = (float)num2 / (float)num; } return array; } public static AudioClip LoadFromDiskToAudioClip(string path) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 AudioClip result = null; UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)14); try { audioClip.SendWebRequest(); try { while (!audioClip.isDone) { } if ((int)audioClip.result != 1) { SoundTool.Instance.logger.LogError((object)("Failed to load OGGVORBIS AudioClip from path: " + path + " Full error: " + audioClip.error)); } else { result = DownloadHandlerAudioClip.GetContent(audioClip); } } catch (Exception ex) { SoundTool.Instance.logger.LogError((object)(ex.Message + ", " + ex.StackTrace)); } } finally { ((IDisposable)audioClip)?.Dispose(); } return result; } } public static class WavUtility { public static byte[] AudioClipToByteArray(AudioClip audioClip, out float[] samples) { samples = new float[audioClip.samples * audioClip.channels]; audioClip.GetData(samples, 0); byte[] array = new byte[samples.Length * 2]; int num = 32767; for (int i = 0; i < samples.Length; i++) { short value = (short)(samples[i] * (float)num); BitConverter.GetBytes(value).CopyTo(array, i * 2); } return array; } public static AudioClip ByteArrayToAudioClip(byte[] byteArray, string clipName) { int num = 16; int num2 = num / 8; AudioClip val = AudioClip.Create(clipName, byteArray.Length / num2, 1, 44100, false); val.SetData(ConvertByteArrayToFloatArray(byteArray), 0); return val; } private static float[] ConvertByteArrayToFloatArray(byte[] byteArray) { float[] array = new float[byteArray.Length / 2]; int num = 32767; for (int i = 0; i < array.Length; i++) { short num2 = BitConverter.ToInt16(byteArray, i * 2); array[i] = (float)num2 / (float)num; } return array; } public static AudioClip LoadFromDiskToAudioClip(string path) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 AudioClip result = null; UnityWebRequest audioClip = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)20); try { audioClip.SendWebRequest(); try { while (!audioClip.isDone) { } if ((int)audioClip.result != 1) { SoundTool.Instance.logger.LogError((object)("Failed to load WAV AudioClip from path: " + path + " Full error: " + audioClip.error)); } else { result = DownloadHandlerAudioClip.GetContent(audioClip); } } catch (Exception ex) { SoundTool.Instance.logger.LogError((object)(ex.Message + ", " + ex.StackTrace)); } } finally { ((IDisposable)audioClip)?.Dispose(); } return result; } } } namespace LCSoundTool.Patches { [HarmonyPatch(typeof(AudioSource))] internal class AudioSourcePatch { private static Dictionary<string, AudioClip> originalClips = new Dictionary<string, AudioClip>(); [HarmonyPatch("Play", new Type[] { })] [HarmonyPrefix] public static void Play_Patch(AudioSource __instance) { RunDynamicClipReplacement(__instance); DebugPlayMethod(__instance); } [HarmonyPatch("Play", new Type[] { typeof(ulong) })] [HarmonyPrefix] public static void Play_UlongPatch(AudioSource __instance) { RunDynamicClipReplacement(__instance); DebugPlayMethod(__instance); } [HarmonyPatch("Play", new Type[] { typeof(double) })] [HarmonyPrefix] public static void Play_DoublePatch(AudioSource __instance) { RunDynamicClipReplacement(__instance); DebugPlayMethod(__instance); } [HarmonyPatch("PlayDelayed", new Type[] { typeof(float) })] [HarmonyPrefix] public static void PlayDelayed_Patch(AudioSource __instance) { RunDynamicClipReplacement(__instance); DebugPlayDelayedMethod(__instance); } [HarmonyPatch("PlayClipAtPoint", new Type[] { typeof(AudioClip), typeof(Vector3), typeof(float) })] [HarmonyPrefix] public static bool PlayClipAtPoint_Patch(AudioClip clip, Vector3 position, float volume) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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) GameObject val = new GameObject("One shot audio"); val.transform.position = position; AudioSource val2 = val.AddComponent<AudioSource>(); val2.clip = clip; val2.spatialBlend = 1f; val2.volume = volume; RunDynamicClipReplacement(val2); val2.Play(); DebugPlayClipAtPointMethod(val2, position); Object.Destroy((Object)(object)val, clip.length * ((Time.timeScale < 0.01f) ? 0.01f : Time.timeScale)); return false; } [HarmonyPatch("PlayOneShotHelper", new Type[] { typeof(AudioSource), typeof(AudioClip), typeof(float) })] [HarmonyPrefix] public static void PlayOneShotHelper_Patch(AudioSource source, ref AudioClip clip, float volumeScale) { clip = ReplaceClipWithNew(clip); DebugPlayOneShotMethod(source, clip); } private static void DebugPlayMethod(AudioSource instance) { if ((Object)(object)instance == (Object)null) { return; } if (SoundTool.debugAudioSources && !SoundTool.indepthDebugging && (Object)(object)instance != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{instance} at {((Component)instance).transform.root} is playing {((Object)instance.clip).name}"); } else if (SoundTool.indepthDebugging && (Object)(object)instance != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{instance} is playing {((Object)instance.clip).name} at"); Transform val = ((Component)instance).transform; while ((Object)(object)val.parent != (Object)null || (Object)(object)val != (Object)(object)((Component)instance).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {val.parent}"); val = val.parent; } if ((Object)(object)val == (Object)(object)((Component)instance).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {((Component)instance).transform.root}"); } } } private static void DebugPlayDelayedMethod(AudioSource instance) { if ((Object)(object)instance == (Object)null) { return; } if (SoundTool.debugAudioSources && !SoundTool.indepthDebugging && (Object)(object)instance != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{instance} at {((Component)instance).transform.root} is playing {((Object)instance.clip).name} with delay"); } else if (SoundTool.indepthDebugging && (Object)(object)instance != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{instance} is playing {((Object)instance.clip).name} with delay at"); Transform val = ((Component)instance).transform; while ((Object)(object)val.parent != (Object)null || (Object)(object)val != (Object)(object)((Component)instance).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {val.parent}"); val = val.parent; } if ((Object)(object)val == (Object)(object)((Component)instance).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {((Component)instance).transform.root}"); } } } private static void DebugPlayClipAtPointMethod(AudioSource audioSource, Vector3 position) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)audioSource == (Object)null) { return; } if (SoundTool.debugAudioSources && !SoundTool.indepthDebugging && (Object)(object)audioSource != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{audioSource} at {((Component)audioSource).transform.root} is playing {((Object)audioSource.clip).name} at point {position}"); } else if (SoundTool.indepthDebugging && (Object)(object)audioSource != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{audioSource} is playing {((Object)audioSource.clip).name} located at point {position} within "); Transform val = ((Component)audioSource).transform; while ((Object)(object)val.parent != (Object)null || (Object)(object)val != (Object)(object)((Component)audioSource).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {val.parent}"); val = val.parent; } if ((Object)(object)val == (Object)(object)((Component)audioSource).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {((Component)audioSource).transform.root}"); } } } private static void DebugPlayOneShotMethod(AudioSource source, AudioClip clip) { if ((Object)(object)source == (Object)null || (Object)(object)clip == (Object)null) { return; } if (SoundTool.debugAudioSources && !SoundTool.indepthDebugging && (Object)(object)source != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{source} at {((Component)source).transform.root} is playing one shot {((Object)clip).name}"); } else if (SoundTool.indepthDebugging && (Object)(object)source != (Object)null) { SoundTool.Instance.logger.LogDebug((object)$"{source} is playing one shot {((Object)clip).name} at"); Transform val = ((Component)source).transform; while ((Object)(object)val.parent != (Object)null || (Object)(object)val != (Object)(object)((Component)source).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {val.parent}"); val = val.parent; } if ((Object)(object)val == (Object)(object)((Component)source).transform.root) { SoundTool.Instance.logger.LogDebug((object)$"--- {((Component)source).transform.root}"); } } } private static void RunDynamicClipReplacement(AudioSource instance) { if ((Object)(object)instance == (Object)null || (Object)(object)instance.clip == (Object)null) { return; } string name = instance.clip.GetName(); if (SoundTool.replacedClips.ContainsKey(name)) { if (!originalClips.ContainsKey(name)) { originalClips.Add(name, instance.clip); } List<RandomAudioClip> list = SoundTool.replacedClips[name]; float num = 0f; foreach (RandomAudioClip item in list) { num += item.chance; } float num2 = Random.Range(0f, num); { foreach (RandomAudioClip item2 in list) { if (num2 <= item2.chance) { instance.clip = item2.clip; break; } num2 -= item2.chance; } return; } } if (originalClips.ContainsKey(name)) { instance.clip = originalClips[name]; originalClips.Remove(name); } } private static AudioClip ReplaceClipWithNew(AudioClip original) { if ((Object)(object)original == (Object)null) { return original; } string name = original.GetName(); if (SoundTool.replacedClips.ContainsKey(name)) { if (!originalClips.ContainsKey(name)) { originalClips.Add(name, original); } List<RandomAudioClip> list = SoundTool.replacedClips[name]; float num = 0f; foreach (RandomAudioClip item in list) { num += item.chance; } float num2 = Random.Range(0f, num); foreach (RandomAudioClip item2 in list) { if (num2 <= item2.chance) { return item2.clip; } num2 -= item2.chance; } } else if (originalClips.ContainsKey(name)) { AudioClip result = originalClips[name]; originalClips.Remove(name); return result; } return original; } } [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { public static GameObject networkPrefab; public static GameObject networkHandlerHost; [HarmonyPatch("Start")] [HarmonyPrefix] public static void Start_Patch() { if (!((Object)(object)networkPrefab != (Object)null)) { SoundTool.Instance.logger.LogDebug((object)"Loading NetworkHandler prefab..."); networkPrefab = Assets.bundle.LoadAsset<GameObject>("SoundToolNetworkHandler.prefab"); if ((Object)(object)networkPrefab == (Object)null) { SoundTool.Instance.logger.LogError((object)"Failed to load NetworkHandler prefab!"); } if ((Object)(object)networkPrefab != (Object)null) { NetworkManager.Singleton.AddNetworkPrefab(networkPrefab); SoundTool.Instance.logger.LogDebug((object)"Registered NetworkHandler prefab!"); } else { SoundTool.Instance.logger.LogWarning((object)"Failed to registered NetworkHandler prefab! No networking can take place."); } } } [HarmonyPatch("StartDisconnect")] [HarmonyPostfix] private static void StartDisconnect_Patch() { try { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { SoundTool.Instance.logger.LogDebug((object)"Destroying NetworkHandler prefab!"); Object.Destroy((Object)(object)networkHandlerHost); networkHandlerHost = null; } } catch { SoundTool.Instance.logger.LogError((object)"Failed to destroy NetworkHandler prefab!"); } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void SpawnNetworkHandler() { //IL_003a: 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) try { if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { SoundTool.Instance.logger.LogDebug((object)"Spawning NetworkHandler prefab!"); GameNetworkManagerPatch.networkHandlerHost = Object.Instantiate<GameObject>(GameNetworkManagerPatch.networkPrefab, Vector3.zero, Quaternion.identity); GameNetworkManagerPatch.networkHandlerHost.GetComponent<NetworkObject>().Spawn(true); } } catch { SoundTool.Instance.logger.LogError((object)"Failed to spawn NetworkHandler prefab!"); } } } } namespace LCSoundTool.Networking { public class NetworkHandler : NetworkBehaviour { public static NetworkHandler Instance { get; private set; } public static Dictionary<string, AudioClip> networkedAudioClips { get; private set; } public static event Action ClientNetworkedAudioChanged; public static event Action HostNetworkedAudioChanged; public override void OnNetworkSpawn() { Debug.Log((object)"LCSoundTool - NetworkHandler created!"); NetworkHandler.ClientNetworkedAudioChanged = null; NetworkHandler.HostNetworkedAudioChanged = null; networkedAudioClips = new Dictionary<string, AudioClip>(); Instance = this; } [ClientRpc] public void ReceiveAudioClipClientRpc(string clipName, byte[] audioData) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2736638642u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } bool flag2 = audioData != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(audioData, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2736638642u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } if (!networkedAudioClips.ContainsKey(clipName)) { AudioClip val3 = null; if (SoundTool.clipTypes.ContainsKey(clipName)) { if (SoundTool.clipTypes[clipName] == SoundTool.AudioType.ogg) { val3 = OggUtility.ByteArrayToAudioClip(audioData, clipName); } else if (SoundTool.clipTypes[clipName] == SoundTool.AudioType.mp3) { val3 = Mp3Utility.ByteArrayToAudioClip(audioData, clipName); } } if ((Object)(object)val3 == (Object)null) { val3 = WavUtility.ByteArrayToAudioClip(audioData, clipName); } networkedAudioClips.Add(clipName, val3); NetworkHandler.ClientNetworkedAudioChanged?.Invoke(); } else { SoundTool.Instance.logger.LogDebug((object)("Sound " + clipName + " already exists for this client! Skipping addition of this sound for this client.")); } } [ClientRpc] public void RemoveAudioClipClientRpc(string clipName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1355469546u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1355469546u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && networkedAudioClips.ContainsKey(clipName)) { networkedAudioClips.Remove(clipName); NetworkHandler.ClientNetworkedAudioChanged?.Invoke(); } } [ClientRpc] public void SyncAudioClipsClientRpc(Strings clipNames) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3300200130u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<Strings>(ref clipNames, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3300200130u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } string[] myStrings = clipNames.MyStrings; for (int i = 0; i < myStrings.Length; i++) { if (!networkedAudioClips.ContainsKey(myStrings[i])) { SendExistingAudioClipServerRpc(myStrings[i]); } } } [ClientRpc] public void ReceiveSeedClientRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1556253924u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1556253924u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Random.InitState(seed); SoundTool.Instance.logger.LogDebug((object)$"Client received a new Unity Random seed of {seed}!"); } } } [ServerRpc(RequireOwnership = false)] public void SendAudioClipServerRpc(string clipName, byte[] audioData) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(867452943u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } bool flag2 = audioData != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(audioData, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 867452943u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReceiveAudioClipClientRpc(clipName, audioData); NetworkHandler.HostNetworkedAudioChanged?.Invoke(); } } [ServerRpc(RequireOwnership = false)] public void RemoveAudioClipServerRpc(string clipName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3103497155u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3103497155u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { RemoveAudioClipClientRpc(clipName); NetworkHandler.HostNetworkedAudioChanged?.Invoke(); } } [ServerRpc(RequireOwnership = false)] public void SyncAudioClipsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(178607916u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 178607916u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Strings clipNames = new Strings(networkedAudioClips.Keys.ToArray()); if (clipNames.MyStrings.Length < 1) { SoundTool.Instance.logger.LogDebug((object)"No sounds found in networkedClips. Syncing process cancelled!"); } else { SyncAudioClipsClientRpc(clipNames); } } } [ServerRpc(RequireOwnership = false)] public void SendExistingAudioClipServerRpc(string clipName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4006259189u, val, (RpcDelivery)0); bool flag = clipName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(clipName, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4006259189u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } if (networkedAudioClips.ContainsKey(clipName)) { byte[] array = null; if (SoundTool.clipTypes.ContainsKey(clipName)) { if (SoundTool.clipTypes[clipName] == SoundTool.AudioType.ogg) { array = OggUtility.AudioClipToByteArray(networkedAudioClips[clipName], out var _); } else if (SoundTool.clipTypes[clipName] == SoundTool.AudioType.mp3) { array = Mp3Utility.AudioClipToByteArray(networkedAudioClips[clipName], out var _); } } if (array == null) { array = WavUtility.AudioClipToByteArray(networkedAudioClips[clipName], out var _); } ReceiveAudioClipClientRpc(clipName, array); } else { SoundTool.Instance.logger.LogWarning((object)"Trying to obtain and sync a sound from the host that does not exist in the host's game!"); } } [ServerRpc(RequireOwnership = false)] public void SendSeedToClientsServerRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4286510828u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, seed); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4286510828u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ((NetworkBehaviour)this).IsHost) { ReceiveSeedClientRpc(seed); SoundTool.Instance.logger.LogDebug((object)$"Sending a new Unity random seed of {seed} to all clients..."); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_NetworkHandler() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2736638642u, new RpcReceiveHandler(__rpc_handler_2736638642)); NetworkManager.__rpc_func_table.Add(1355469546u, new RpcReceiveHandler(__rpc_handler_1355469546)); NetworkManager.__rpc_func_table.Add(3300200130u, new RpcReceiveHandler(__rpc_handler_3300200130)); NetworkManager.__rpc_func_table.Add(1556253924u, new RpcReceiveHandler(__rpc_handler_1556253924)); NetworkManager.__rpc_func_table.Add(867452943u, new RpcReceiveHandler(__rpc_handler_867452943)); NetworkManager.__rpc_func_table.Add(3103497155u, new RpcReceiveHandler(__rpc_handler_3103497155)); NetworkManager.__rpc_func_table.Add(178607916u, new RpcReceiveHandler(__rpc_handler_178607916)); NetworkManager.__rpc_func_table.Add(4006259189u, new RpcReceiveHandler(__rpc_handler_4006259189)); NetworkManager.__rpc_func_table.Add(4286510828u, new RpcReceiveHandler(__rpc_handler_4286510828)); } private static void __rpc_handler_2736638642(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_00a6: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); byte[] audioData = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref audioData, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)2; ((NetworkHandler)(object)target).ReceiveAudioClipClientRpc(clipName, audioData); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1355469546(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((NetworkHandler)(object)target).RemoveAudioClipClientRpc(clipName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3300200130(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Strings clipNames = default(Strings); ((FastBufferReader)(ref reader)).ReadValueSafe<Strings>(ref clipNames, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((NetworkHandler)(object)target).SyncAudioClipsClientRpc(clipNames); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1556253924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)2; ((NetworkHandler)(object)target).ReceiveSeedClientRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_867452943(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_00a6: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives)); byte[] audioData = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref audioData, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).SendAudioClipServerRpc(clipName, audioData); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3103497155(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).RemoveAudioClipServerRpc(clipName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_178607916(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; ((NetworkHandler)(object)target).SyncAudioClipsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4006259189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string clipName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref clipName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).SendExistingAudioClipServerRpc(clipName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4286510828(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).SendSeedToClientsServerRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NetworkHandler"; } } public struct Strings : INetworkSerializable { private string[] myStrings; public string[] MyStrings { get { return myStrings; } set { myStrings = value; } } public Strings(string[] myStrings) { this.myStrings = myStrings; } public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter { //IL_000f: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (serializer.IsWriter) { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); int num = myStrings.Length; ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe<int>(ref num, default(ForPrimitives)); for (int i = 0; i < myStrings.Length; i++) { ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(myStrings[i], false); } } if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); int num2 = default(int); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe<int>(ref num2, default(ForPrimitives)); myStrings = new string[num2]; for (int j = 0; j < num2; j++) { ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref myStrings[j], false); } } } } } namespace LCSoundTool.Resources { public static class Assets { internal static AssetBundle bundle; } }
BepInEX/plugins/NotAtomicBomb-TerminalApi/TerminalApi.dll
Decompiled 11 months agousing 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 }); } } }
BepInEX/plugins/Ozone-BepInUtils/NicholaScott.BepInEx.Utils.dll
Decompiled 11 months agousing 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.1")] 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 CachedItem<TItem> { public delegate TItem InstanceLocator(); public delegate bool ItemNotNull(TItem item); private InstanceLocator locatorMethod; private ItemNotNull notNullMethod; private bool valueAssigned = false; private TItem value; public TItem Value { get { if (valueAssigned && (notNullMethod == null || notNullMethod(value))) { return value; } value = locatorMethod(); valueAssigned = notNullMethod == null || notNullMethod(value); return value; } } public CachedItem(InstanceLocator locator, ItemNotNull notNull = null) { locatorMethod = locator; notNullMethod = notNull; } public void ClearCache() { valueAssigned = false; } public static implicit operator TItem(CachedItem<TItem> item) { return item.Value; } } 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; } } }
BepInEX/plugins/Renegades-FlashlightToggle/FlashlightToggle.dll
Decompiled 11 months agousing 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 GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using Microsoft.CodeAnalysis; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Control")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+f52c854f4eaa270088fff99ac87504ddad49aa16")] [assembly: AssemblyProduct("Control")] [assembly: AssemblyTitle("Control")] [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 Control { public static class PluginInfo { public const string PLUGIN_GUID = "Control"; public const string PLUGIN_NAME = "Control"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace Flashlight { public class FlashButton : LcInputActions { [InputAction("<Keyboard>/f", Name = "Flashlight")] public InputAction FlashKey { get; set; } } [BepInPlugin("rr.Flashlight", "Flashlight", "1.5.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource logSource; internal static FlashButton InputActionInstance = new FlashButton(); private Harmony _harmony = new Harmony("Flashlight"); private void Awake() { _harmony.PatchAll(typeof(Plugin)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"------Flashlight done.------"); logSource = ((BaseUnityPlugin)this).Logger; } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] [HarmonyPostfix] public static void ClearFlashlight(PlayerControllerB __instance) { __instance.pocketedFlashlight = null; } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] public static void ReadInput(PlayerControllerB __instance) { if (((!((NetworkBehaviour)__instance).IsOwner || !__instance.isPlayerControlled || (((NetworkBehaviour)__instance).IsServer && !__instance.isHostPlayerObject)) && !__instance.isTestingPlayer) || __instance.inTerminalMenu || __instance.isTypingChat || !Application.isFocused) { return; } if (__instance.currentlyHeldObjectServer is FlashlightItem && (Object)(object)__instance.currentlyHeldObjectServer != (Object)(object)__instance.pocketedFlashlight) { __instance.pocketedFlashlight = __instance.currentlyHeldObjectServer; } if ((Object)(object)__instance.pocketedFlashlight == (Object)null || !InputActionInstance.FlashKey.triggered || !(__instance.pocketedFlashlight is FlashlightItem) || !__instance.pocketedFlashlight.isHeld) { return; } try { __instance.pocketedFlashlight.UseItemOnClient(true); if (!(__instance.currentlyHeldObjectServer is FlashlightItem)) { GrabbableObject pocketedFlashlight = __instance.pocketedFlashlight; ((Behaviour)((FlashlightItem)((pocketedFlashlight is FlashlightItem) ? pocketedFlashlight : null)).flashlightBulbGlow).enabled = false; GrabbableObject pocketedFlashlight2 = __instance.pocketedFlashlight; ((Behaviour)((FlashlightItem)((pocketedFlashlight2 is FlashlightItem) ? pocketedFlashlight2 : null)).flashlightBulb).enabled = false; GrabbableObject pocketedFlashlight3 = __instance.pocketedFlashlight; if (((pocketedFlashlight3 is FlashlightItem) ? pocketedFlashlight3 : null).isBeingUsed) { ((Behaviour)__instance.helmetLight).enabled = true; GrabbableObject pocketedFlashlight4 = __instance.pocketedFlashlight; ((FlashlightItem)((pocketedFlashlight4 is FlashlightItem) ? pocketedFlashlight4 : null)).usingPlayerHelmetLight = true; GrabbableObject pocketedFlashlight5 = __instance.pocketedFlashlight; ((FlashlightItem)((pocketedFlashlight5 is FlashlightItem) ? pocketedFlashlight5 : null)).PocketFlashlightServerRpc(true); } else { ((Behaviour)__instance.helmetLight).enabled = false; GrabbableObject pocketedFlashlight6 = __instance.pocketedFlashlight; ((FlashlightItem)((pocketedFlashlight6 is FlashlightItem) ? pocketedFlashlight6 : null)).usingPlayerHelmetLight = false; GrabbableObject pocketedFlashlight7 = __instance.pocketedFlashlight; ((FlashlightItem)((pocketedFlashlight7 is FlashlightItem) ? pocketedFlashlight7 : null)).PocketFlashlightServerRpc(false); } } } catch { } } } }
BepInEX/plugins/RickArg-Helmet_Cameras/HelmetCamera.dll
Decompiled 11 months agousing 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(); } } }
BepInEX/plugins/Rozebud-FOV_Adjust/FovAdjust.dll
Decompiled 11 months agousing 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; } }
BepInEX/plugins/RugbugRedfern-Skinwalkers/SkinwalkerMod.dll
Decompiled 11 months agousing System; using System.Collections; 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 BepInEx.Logging; using Dissonance.Config; using HarmonyLib; using Unity.Netcode; using UnityEngine; using UnityEngine.Networking; 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("SkinwalkerMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SkinwalkerMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("fd4979a2-cef0-46af-8bf8-97e630b11475")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<float>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<float>(); } } namespace SkinwalkerMod; [BepInPlugin("RugbugRedfern.SkinwalkerMod", "Skinwalker Mod", "1.0.8")] internal class PluginLoader : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("RugbugRedfern.SkinwalkerMod"); private const string modGUID = "RugbugRedfern.SkinwalkerMod"; private const string modVersion = "1.0.8"; private static bool initialized; public static PluginLoader Instance { get; private set; } private void Awake() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown if (initialized) { return; } initialized = true; Instance = this; harmony.PatchAll(Assembly.GetExecutingAssembly()); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } SkinwalkerLogger.Initialize("RugbugRedfern.SkinwalkerMod"); SkinwalkerLogger.Log("SKINWALKER MOD STARTING UP 1.0.8"); SkinwalkerConfig.InitConfig(); SceneManager.sceneLoaded += SkinwalkerNetworkManagerHandler.ClientConnectInitializer; GameObject val = new GameObject("Skinwalker Mod"); val.AddComponent<SkinwalkerModPersistent>(); ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)val); } public void BindConfig<T>(ref ConfigEntry<T> config, string section, string key, T defaultValue, string description = "") { config = ((BaseUnityPlugin)this).Config.Bind<T>(section, key, defaultValue, description); } } internal class SkinwalkerBehaviour : MonoBehaviour { private AudioSource audioSource; public const float PLAY_INTERVAL_MIN = 15f; public const float PLAY_INTERVAL_MAX = 40f; private const float MAX_DIST = 100f; private float nextTimeToPlayAudio; private EnemyAI ai; public void Initialize(EnemyAI ai) { this.ai = ai; audioSource = ai.creatureVoice; SetNextTime(); } private void Update() { //IL_0077: 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) if (!(Time.time > nextTimeToPlayAudio)) { return; } SetNextTime(); float num = -1f; if (Object.op_Implicit((Object)(object)ai) && !ai.isEnemyDead) { if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position)) < 100f) { AudioClip sample = SkinwalkerModPersistent.Instance.GetSample(); if (Object.op_Implicit((Object)(object)sample)) { SkinwalkerLogger.Log(((Object)this).name + " played voice line 1"); audioSource.PlayOneShot(sample); } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line 0"); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (too far away) " + num); } } else { SkinwalkerLogger.Log(((Object)this).name + " played voice line no (dead) EnemyAI: " + (object)ai); } } private void SetNextTime() { if (SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value <= 0f) { nextTimeToPlayAudio = Time.time + 100000000f; } else { nextTimeToPlayAudio = Time.time + Random.Range(15f, 40f) / SkinwalkerNetworkManager.Instance.VoiceLineFrequency.Value; } } private T CopyComponent<T>(T original, GameObject destination) where T : Component { Type type = ((object)original).GetType(); Component val = destination.AddComponent(type); FieldInfo[] fields = type.GetFields(); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { fieldInfo.SetValue(val, fieldInfo.GetValue(original)); } return (T)(object)((val is T) ? val : null); } } internal class SkinwalkerConfig { public static ConfigEntry<bool> VoiceEnabled_BaboonHawk; public static ConfigEntry<bool> VoiceEnabled_Bracken; public static ConfigEntry<bool> VoiceEnabled_BunkerSpider; public static ConfigEntry<bool> VoiceEnabled_Centipede; public static ConfigEntry<bool> VoiceEnabled_CoilHead; public static ConfigEntry<bool> VoiceEnabled_EyelessDog; public static ConfigEntry<bool> VoiceEnabled_ForestGiant; public static ConfigEntry<bool> VoiceEnabled_GhostGirl; public static ConfigEntry<bool> VoiceEnabled_GiantWorm; public static ConfigEntry<bool> VoiceEnabled_HoardingBug; public static ConfigEntry<bool> VoiceEnabled_Hygrodere; public static ConfigEntry<bool> VoiceEnabled_Jester; public static ConfigEntry<bool> VoiceEnabled_Masked; public static ConfigEntry<bool> VoiceEnabled_Nutcracker; public static ConfigEntry<bool> VoiceEnabled_SporeLizard; public static ConfigEntry<bool> VoiceEnabled_Thumper; public static ConfigEntry<float> VoiceLineFrequency; public static void InitConfig() { PluginLoader.Instance.BindConfig(ref VoiceLineFrequency, "Voice Settings", "VoiceLineFrequency", 1f, "1 is the default, and voice lines will occur every " + 15f.ToString("0") + " to " + 40f.ToString("0") + " seconds per enemy. Setting this to 2 means they will occur twice as often, 0.5 means half as often, etc."); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BaboonHawk, "Monster Voices", "Baboon Hawk", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Bracken, "Monster Voices", "Bracken", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_BunkerSpider, "Monster Voices", "Bunker Spider", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Centipede, "Monster Voices", "Centipede", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_CoilHead, "Monster Voices", "Coil Head", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_EyelessDog, "Monster Voices", "Eyeless Dog", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_ForestGiant, "Monster Voices", "Forest Giant", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GhostGirl, "Monster Voices", "Ghost Girl", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_GiantWorm, "Monster Voices", "Giant Worm", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_HoardingBug, "Monster Voices", "Hoarding Bug", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Hygrodere, "Monster Voices", "Hygrodere", defaultValue: false); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Jester, "Monster Voices", "Jester", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Masked, "Monster Voices", "Masked", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Nutcracker, "Monster Voices", "Nutcracker", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_SporeLizard, "Monster Voices", "Spore Lizard", defaultValue: true); PluginLoader.Instance.BindConfig(ref VoiceEnabled_Thumper, "Monster Voices", "Thumper", defaultValue: true); SkinwalkerLogger.Log("VoiceEnabled_BaboonHawk" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BaboonHawk.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Bracken" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Bracken.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_BunkerSpider" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_BunkerSpider.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Centipede" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Centipede.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_CoilHead" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_CoilHead.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_EyelessDog" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_EyelessDog.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_ForestGiant" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_ForestGiant.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GhostGirl" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GhostGirl.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_GiantWorm" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_GiantWorm.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_HoardingBug" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_HoardingBug.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Hygrodere" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Hygrodere.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Jester" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Jester.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Masked" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Masked.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Nutcracker" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Nutcracker.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_SporeLizard" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_SporeLizard.Value}]"); SkinwalkerLogger.Log("VoiceEnabled_Thumper" + $" VALUE LOADED FROM CONFIG: [{VoiceEnabled_Thumper.Value}]"); SkinwalkerLogger.Log("VoiceLineFrequency" + $" VALUE LOADED FROM CONFIG: [{VoiceLineFrequency.Value}]"); } } internal static class SkinwalkerLogger { internal static ManualLogSource logSource; public static void Initialize(string modGUID) { logSource = Logger.CreateLogSource(modGUID); } public static void Log(object message) { logSource.LogInfo(message); } public static void LogError(object message) { logSource.LogError(message); } public static void LogWarning(object message) { logSource.LogWarning(message); } } public class SkinwalkerModPersistent : MonoBehaviour { private string audioFolder; private List<AudioClip> cachedAudio = new List<AudioClip>(); private float nextTimeToCheckFolder = 30f; private float nextTimeToCheckEnemies = 30f; private const float folderScanInterval = 8f; private const float enemyScanInterval = 5f; public static SkinwalkerModPersistent Instance { get; private set; } private void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) Instance = this; ((Component)this).transform.position = Vector3.zero; SkinwalkerLogger.Log("Skinwalker Mod Object Initialized"); audioFolder = Path.Combine(Application.dataPath, "..", "Dissonance_Diagnostics"); EnableRecording(); if (!Directory.Exists(audioFolder)) { Directory.CreateDirectory(audioFolder); } } private void Start() { try { if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } catch (Exception message) { SkinwalkerLogger.Log(message); } } private void OnApplicationQuit() { DisableRecording(); } private void EnableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = true; DebugSettings.Instance.RecordFinalAudio = true; } private void Update() { if (Time.realtimeSinceStartup > nextTimeToCheckFolder) { nextTimeToCheckFolder = Time.realtimeSinceStartup + 8f; if (!Directory.Exists(audioFolder)) { SkinwalkerLogger.Log("Audio folder not present. Don't worry about it, it will be created automatically when you play with friends. (" + audioFolder + ")"); return; } string[] files = Directory.GetFiles(audioFolder); SkinwalkerLogger.Log($"Got audio file paths ({files.Length})"); string[] array = files; foreach (string path in array) { ((MonoBehaviour)this).StartCoroutine(LoadWavFile(path, delegate(AudioClip audioClip) { cachedAudio.Add(audioClip); })); } } if (!(Time.realtimeSinceStartup > nextTimeToCheckEnemies)) { return; } nextTimeToCheckEnemies = Time.realtimeSinceStartup + 5f; EnemyAI[] array2 = Object.FindObjectsOfType<EnemyAI>(true); EnemyAI[] array3 = array2; SkinwalkerBehaviour skinwalkerBehaviour = default(SkinwalkerBehaviour); foreach (EnemyAI val in array3) { SkinwalkerLogger.Log("IsEnemyEnabled " + ((Object)val).name + " " + IsEnemyEnabled(val)); if (IsEnemyEnabled(val) && !((Component)val).TryGetComponent<SkinwalkerBehaviour>(ref skinwalkerBehaviour)) { ((Component)val).gameObject.AddComponent<SkinwalkerBehaviour>().Initialize(val); } } } private bool IsEnemyEnabled(EnemyAI enemy) { if ((Object)(object)enemy == (Object)null) { return false; } return ((Object)((Component)enemy).gameObject).name switch { "MaskedPlayerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Masked.Value, "NutcrackerEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Nutcracker.Value, "BaboonHawkEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BaboonHawk.Value, "Flowerman(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Bracken.Value, "SandSpider(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_BunkerSpider.Value, "RedLocustBees(Clone)" => false, "Centipede(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Centipede.Value, "SpringMan(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_CoilHead.Value, "MouthDog(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_EyelessDog.Value, "ForestGiant(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_ForestGiant.Value, "DressGirl(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GhostGirl.Value, "SandWorm(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_GiantWorm.Value, "HoarderBug(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_HoardingBug.Value, "Blob(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Hygrodere.Value, "JesterEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Jester.Value, "PufferEnemy(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_SporeLizard.Value, "Crawler(Clone)" => SkinwalkerNetworkManager.Instance.VoiceEnabled_Thumper.Value, "DocileLocustBees(Clone)" => false, "DoublewingedBird(Clone)" => false, _ => true, }; } internal IEnumerator LoadWavFile(string path, Action<AudioClip> callback) { UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip(path, (AudioType)20); try { yield return www.SendWebRequest(); if ((int)www.result == 1) { SkinwalkerLogger.Log("Loaded clip from path " + path); AudioClip audioClip = DownloadHandlerAudioClip.GetContent(www); if (audioClip.length > 0.9f) { callback(audioClip); } try { File.Delete(path); } catch (Exception e) { SkinwalkerLogger.LogWarning(e); } } } finally { ((IDisposable)www)?.Dispose(); } } private void DisableRecording() { DebugSettings.Instance.EnablePlaybackDiagnostics = false; DebugSettings.Instance.RecordFinalAudio = false; if (Directory.Exists(audioFolder)) { Directory.Delete(audioFolder, recursive: true); } } public AudioClip GetSample() { if (cachedAudio.Count > 0) { int index = Random.Range(0, cachedAudio.Count - 1); AudioClip result = cachedAudio[index]; cachedAudio.RemoveAt(index); return result; } while (cachedAudio.Count > 200) { cachedAudio.RemoveAt(0); } return null; } public void ClearCache() { cachedAudio.Clear(); } } internal static class SkinwalkerNetworkManagerHandler { internal static void ClientConnectInitializer(Scene sceneName, LoadSceneMode sceneEnum) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (((Scene)(ref sceneName)).name == "SampleSceneRelay") { GameObject val = new GameObject("SkinwalkerNetworkManager"); val.AddComponent<NetworkObject>(); val.AddComponent<SkinwalkerNetworkManager>(); Debug.Log((object)"Initialized SkinwalkerNetworkManager"); } } } internal class SkinwalkerNetworkManager : NetworkBehaviour { public NetworkVariable<bool> VoiceEnabled_BaboonHawk = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Bracken = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_BunkerSpider = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Centipede = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_CoilHead = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_EyelessDog = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_ForestGiant = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GhostGirl = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_GiantWorm = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_HoardingBug = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Hygrodere = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Jester = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Masked = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Nutcracker = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_SporeLizard = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<bool> VoiceEnabled_Thumper = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable<float> VoiceLineFrequency = new NetworkVariable<float>(1f, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static SkinwalkerNetworkManager Instance { get; private set; } private void Awake() { Instance = this; if (GameNetworkManager.Instance.isHostingGame) { VoiceEnabled_BaboonHawk.Value = SkinwalkerConfig.VoiceEnabled_BaboonHawk.Value; VoiceEnabled_Bracken.Value = SkinwalkerConfig.VoiceEnabled_Bracken.Value; VoiceEnabled_BunkerSpider.Value = SkinwalkerConfig.VoiceEnabled_BunkerSpider.Value; VoiceEnabled_Centipede.Value = SkinwalkerConfig.VoiceEnabled_Centipede.Value; VoiceEnabled_CoilHead.Value = SkinwalkerConfig.VoiceEnabled_CoilHead.Value; VoiceEnabled_EyelessDog.Value = SkinwalkerConfig.VoiceEnabled_EyelessDog.Value; VoiceEnabled_ForestGiant.Value = SkinwalkerConfig.VoiceEnabled_ForestGiant.Value; VoiceEnabled_GhostGirl.Value = SkinwalkerConfig.VoiceEnabled_GhostGirl.Value; VoiceEnabled_GiantWorm.Value = SkinwalkerConfig.VoiceEnabled_GiantWorm.Value; VoiceEnabled_HoardingBug.Value = SkinwalkerConfig.VoiceEnabled_HoardingBug.Value; VoiceEnabled_Hygrodere.Value = SkinwalkerConfig.VoiceEnabled_Hygrodere.Value; VoiceEnabled_Jester.Value = SkinwalkerConfig.VoiceEnabled_Jester.Value; VoiceEnabled_Masked.Value = SkinwalkerConfig.VoiceEnabled_Masked.Value; VoiceEnabled_Nutcracker.Value = SkinwalkerConfig.VoiceEnabled_Nutcracker.Value; VoiceEnabled_SporeLizard.Value = SkinwalkerConfig.VoiceEnabled_SporeLizard.Value; VoiceEnabled_Thumper.Value = SkinwalkerConfig.VoiceEnabled_Thumper.Value; VoiceLineFrequency.Value = SkinwalkerConfig.VoiceLineFrequency.Value; SkinwalkerLogger.Log("HOST SENDING CONFIG TO CLIENTS"); } SkinwalkerLogger.Log("SkinwalkerNetworkManager Awake"); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); SkinwalkerLogger.Log("SkinwalkerNetworkManager OnDestroy"); SkinwalkerModPersistent.Instance?.ClearCache(); } protected override void __initializeVariables() { if (VoiceEnabled_BaboonHawk == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BaboonHawk cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BaboonHawk).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk, "VoiceEnabled_BaboonHawk"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BaboonHawk); if (VoiceEnabled_Bracken == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Bracken cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Bracken).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Bracken, "VoiceEnabled_Bracken"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Bracken); if (VoiceEnabled_BunkerSpider == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_BunkerSpider cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_BunkerSpider).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider, "VoiceEnabled_BunkerSpider"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_BunkerSpider); if (VoiceEnabled_Centipede == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Centipede cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Centipede).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Centipede, "VoiceEnabled_Centipede"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Centipede); if (VoiceEnabled_CoilHead == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_CoilHead cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_CoilHead).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_CoilHead, "VoiceEnabled_CoilHead"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_CoilHead); if (VoiceEnabled_EyelessDog == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_EyelessDog cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_EyelessDog).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_EyelessDog, "VoiceEnabled_EyelessDog"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_EyelessDog); if (VoiceEnabled_ForestGiant == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_ForestGiant cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_ForestGiant).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_ForestGiant, "VoiceEnabled_ForestGiant"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_ForestGiant); if (VoiceEnabled_GhostGirl == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GhostGirl cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GhostGirl).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GhostGirl, "VoiceEnabled_GhostGirl"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GhostGirl); if (VoiceEnabled_GiantWorm == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_GiantWorm cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_GiantWorm).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_GiantWorm, "VoiceEnabled_GiantWorm"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_GiantWorm); if (VoiceEnabled_HoardingBug == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_HoardingBug cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_HoardingBug).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_HoardingBug, "VoiceEnabled_HoardingBug"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_HoardingBug); if (VoiceEnabled_Hygrodere == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Hygrodere cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Hygrodere).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Hygrodere, "VoiceEnabled_Hygrodere"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Hygrodere); if (VoiceEnabled_Jester == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Jester cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Jester).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Jester, "VoiceEnabled_Jester"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Jester); if (VoiceEnabled_Masked == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Masked cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Masked).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Masked, "VoiceEnabled_Masked"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Masked); if (VoiceEnabled_Nutcracker == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Nutcracker cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Nutcracker).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Nutcracker, "VoiceEnabled_Nutcracker"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Nutcracker); if (VoiceEnabled_SporeLizard == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_SporeLizard cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_SporeLizard).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_SporeLizard, "VoiceEnabled_SporeLizard"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_SporeLizard); if (VoiceEnabled_Thumper == null) { throw new Exception("SkinwalkerNetworkManager.VoiceEnabled_Thumper cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceEnabled_Thumper).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceEnabled_Thumper, "VoiceEnabled_Thumper"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceEnabled_Thumper); if (VoiceLineFrequency == null) { throw new Exception("SkinwalkerNetworkManager.VoiceLineFrequency cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)VoiceLineFrequency).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)VoiceLineFrequency, "VoiceLineFrequency"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)VoiceLineFrequency); ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "SkinwalkerNetworkManager"; } }
BepInEX/plugins/Rune580-LethalCompany_InputUtils/LethalCompanyInputUtils.dll
Decompiled 11 months agousing 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.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalCompanyInputUtils.Data; using LethalCompanyInputUtils.Utils; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using TMPro; using UnityEngine; using UnityEngine.InputSystem; 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("LethalCompanyInputUtils")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9e95a88c49ab86635dbebf33cfb26802052a8769")] [assembly: AssemblyProduct("LethalCompanyInputUtils")] [assembly: AssemblyTitle("LethalCompanyInputUtils")] [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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LethalCompanyInputUtils { public static class LcInputActionApi { private static readonly Dictionary<string, LcInputActions> InputActionsMap = new Dictionary<string, LcInputActions>(); private static IReadOnlyCollection<LcInputActions> InputActions => InputActionsMap.Values; internal static void LoadIntoUI(KepRemapPanel panel) { //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_0094: 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_00a3: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown UpdateFontScaling(panel); AdjustSizeAndPos(panel); LayoutElement val = EnsureLayoutElement(panel); val.minHeight = 0f; List<RemappableKey> remappableKeys = panel.remappableKeys; int num = remappableKeys.Count((RemappableKey key) => !key.gamepadOnly); foreach (LcInputActions inputAction in InputActions) { if (inputAction.Loaded) { continue; } foreach (InputActionReference actionRef in inputAction.ActionRefs) { InputBinding val2 = ((IEnumerable<InputBinding>)(object)actionRef.action.bindings).First(); string name = ((InputBinding)(ref val2)).name; RemappableKey item = new RemappableKey { ControlName = name, currentInput = actionRef, gamepadOnly = false }; remappableKeys.Insert(num++, item); RemappableKey item2 = new RemappableKey { ControlName = name, currentInput = actionRef, rebindingIndex = 1, gamepadOnly = true }; remappableKeys.Add(item2); } inputAction.Loaded = true; } float horizontalOffset = panel.horizontalOffset; Rect rect = ((Component)((Transform)panel.keyRemapContainer).parent).GetComponent<RectTransform>().rect; float num2 = Mathf.Floor(((Rect)(ref rect)).width / horizontalOffset); panel.maxVertical = (float)num / num2; val.minHeight += (panel.maxVertical + 1f) * panel.verticalOffset; } private static void UpdateFontScaling(KepRemapPanel panel) { TextMeshProUGUI component = ((Component)panel.keyRemapSlotPrefab.transform.Find("Text (1)")).GetComponent<TextMeshProUGUI>(); if (!((TMP_Text)component).enableAutoSizing) { ((TMP_Text)component).fontSizeMax = ((TMP_Text)component).fontSize; ((TMP_Text)component).fontSizeMin = ((TMP_Text)component).fontSize - 4f; ((TMP_Text)component).enableAutoSizing = true; } } private static void AdjustSizeAndPos(KepRemapPanel panel) { GameObject gameObject = ((Component)((Transform)panel.keyRemapContainer).parent).gameObject; if (gameObject.GetComponent<ContentSizeFitter>() == null) { panel.keyRemapContainer.SetPivotY(1f); panel.keyRemapContainer.SetAnchorMinY(1f); panel.keyRemapContainer.SetAnchorMaxY(1f); panel.keyRemapContainer.SetAnchoredPosY(0f); panel.keyRemapContainer.SetLocalPosY(0f); ContentSizeFitter obj = gameObject.AddComponent<ContentSizeFitter>(); obj.horizontalFit = (FitMode)0; obj.verticalFit = (FitMode)1; } } private static LayoutElement EnsureLayoutElement(KepRemapPanel panel) { GameObject gameObject = ((Component)((Transform)panel.keyRemapContainer).parent).gameObject; LayoutElement component = gameObject.GetComponent<LayoutElement>(); if (component != null) { return component; } return gameObject.AddComponent<LayoutElement>(); } internal static void CalculateVerticalMaxForGamepad(KepRemapPanel panel) { //IL_0042: 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) int num = panel.remappableKeys.Count((RemappableKey key) => key.gamepadOnly); float horizontalOffset = panel.horizontalOffset; Rect rect = ((Component)((Transform)panel.keyRemapContainer).parent).GetComponent<RectTransform>().rect; float num2 = Mathf.Floor(((Rect)(ref rect)).width / horizontalOffset); panel.maxVertical = (float)num / num2; LayoutElement obj = EnsureLayoutElement(panel); obj.minHeight += (panel.maxVertical + 3f) * panel.verticalOffset; } internal static void ResetLoadedInputActions() { foreach (LcInputActions inputAction in InputActions) { inputAction.Loaded = false; } } internal static void RegisterInputActions(LcInputActions lcInputActions, InputActionMapBuilder builder) { if (!InputActionsMap.TryAdd(lcInputActions.Id, lcInputActions)) { Logging.Logger.LogWarning((object)("The mod [" + lcInputActions.Plugin.GUID + "] instantiated an Actions class [" + lcInputActions.GetType().Name + "] more than once!\n\t These classes should be treated as singletons!, do not instantiate more than once!")); } else { lcInputActions.CreateInputActions(in builder); InputActionSetupExtensions.AddActionMap(lcInputActions.GetAsset(), builder.Build()); lcInputActions.GetAsset().Enable(); lcInputActions.OnAssetLoaded(); lcInputActions.Load(); lcInputActions.BuildActionRefs(); } } internal static void DisableForRebind() { foreach (LcInputActions inputAction in InputActions) { if (inputAction.Enabled) { inputAction.Disable(); } } } internal static void ReEnableFromRebind() { foreach (LcInputActions inputAction in InputActions) { if (inputAction.WasEnabled) { inputAction.Enable(); } } } internal static void SaveOverrides() { foreach (LcInputActions inputAction in InputActions) { inputAction.Save(); } } } [BepInPlugin("com.rune580.LethalCompanyInputUtils", "Lethal Company Input Utils", "0.4.4")] public class LethalCompanyInputUtilsPlugin : BaseUnityPlugin { public const string ModId = "com.rune580.LethalCompanyInputUtils"; public const string ModName = "Lethal Company Input Utils"; public const string ModVersion = "0.4.4"; private Harmony? _harmony; private void Awake() { Logging.SetLogSource(((BaseUnityPlugin)this).Logger); _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.rune580.LethalCompanyInputUtils"); SceneManager.activeSceneChanged += OnSceneChanged; FsUtils.EnsureControlsDir(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin com.rune580.LethalCompanyInputUtils is loaded!"); } private static void OnSceneChanged(Scene current, Scene next) { LcInputActionApi.ResetLoadedInputActions(); } } } namespace LethalCompanyInputUtils.Utils { internal static class AssemblyUtils { public static BepInPlugin? GetBepInPlugin(this Assembly assembly) { foreach (Type validType in assembly.GetValidTypes()) { BepInPlugin customAttribute = ((MemberInfo)validType).GetCustomAttribute<BepInPlugin>(); if (customAttribute != null) { return customAttribute; } } return null; } public static IEnumerable<Type> GetValidTypes(this Assembly assembly) { try { return assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { return ex.Types.Where((Type type) => (object)type != null); } } } internal static class FsUtils { public static string SaveDir { get; } = GetSaveDir(); public static string Pre041ControlsDir { get; } = Path.Combine(Paths.BepInExRootPath, "controls"); public static string ControlsDir { get; } = Path.Combine(Paths.ConfigPath, "controls"); private static string GetSaveDir() { string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); return Path.Combine(folderPath, "AppData", "LocalLow", "ZeekerssRBLX", "Lethal Company"); } public static void EnsureControlsDir() { if (!Directory.Exists(ControlsDir)) { Directory.CreateDirectory(ControlsDir); } } } internal static class Logging { private static ManualLogSource? _logSource; internal static ManualLogSource Logger { get; } = _logSource; internal static void SetLogSource(ManualLogSource logSource) { _logSource = logSource; } } internal static class RuntimeHelper { public static void SetLocalPosY(this RectTransform rectTransform, float y) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) Vector3 localPosition = ((Transform)rectTransform).localPosition; ((Transform)rectTransform).localPosition = new Vector3(localPosition.x, y, localPosition.z); } public static void SetPivotY(this RectTransform rectTransform, float y) { //IL_0002: 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) rectTransform.pivot = new Vector2(rectTransform.pivot.x, y); } public static void SetAnchorMinY(this RectTransform rectTransform, float y) { //IL_0002: 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) rectTransform.anchorMin = new Vector2(rectTransform.anchorMin.x, y); } public static void SetAnchorMaxY(this RectTransform rectTransform, float y) { //IL_0002: 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) rectTransform.anchorMax = new Vector2(rectTransform.anchorMax.x, y); } public static void SetAnchoredPosY(this RectTransform rectTransform, float y) { //IL_0002: 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) rectTransform.anchoredPosition = new Vector2(rectTransform.anchoredPosition.x, y); } } } namespace LethalCompanyInputUtils.Patches { public static class InputControlPathPatches { [HarmonyPatch] public static class ToHumanReadableStringPatch { public static IEnumerable<MethodBase> TargetMethods() { return from method in AccessTools.GetDeclaredMethods(typeof(InputControlPath)) where method.Name == "ToHumanReadableString" && method.ReturnType == typeof(string) select method; } public static void Postfix(ref string __result) { string text = __result; if ((text == "<InputUtils-Gamepad-Not-Bound>" || text == "<InputUtils-Kbm-Not-Bound>") ? true : false) { __result = ""; } } } } public static class KeyRemapPanelPatches { [HarmonyPatch(typeof(KepRemapPanel), "LoadKeybindsUI")] public static class LoadKeybindsUIPatch { public static void Prefix(KepRemapPanel __instance) { LcInputActionApi.DisableForRebind(); LcInputActionApi.LoadIntoUI(__instance); } public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); FieldInfo maxVerticalField = AccessTools.Field(typeof(KepRemapPanel), "maxVertical"); val.MatchForward(true, (CodeMatch[])(object)new CodeMatch[6] { new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => CodeInstructionExtensions.IsLdarg(code, (int?)0)), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => CodeInstructionExtensions.LoadsField(code, maxVerticalField, false)), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => code.opcode == OpCodes.Ldc_R4 && (float)code.operand == 2f), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => code.opcode == OpCodes.Add), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => code.opcode == OpCodes.Conv_I4), (string)null), new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction code) => CodeInstructionExtensions.IsStloc(code, (LocalBuilder)null)), (string)null) }); val.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Ldarg_0, (object)null) }).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1] { new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LcInputActionApi), "CalculateVerticalMaxForGamepad", new Type[1] { typeof(KepRemapPanel) }, (Type[])null)) }); return val.InstructionEnumeration(); } } [HarmonyPatch(typeof(KepRemapPanel), "UnloadKeybindsUI")] public static class UnloadKeybindsUIPatch { public static void Prefix() { LcInputActionApi.SaveOverrides(); LcInputActionApi.ReEnableFromRebind(); } } } } namespace LethalCompanyInputUtils.Data { [Serializable] public struct BindingOverride { public string? action; public string? origPath; public string? path; } [Serializable] public class BindingOverrides { public List<BindingOverride> overrides; private BindingOverrides() { overrides = new List<BindingOverride>(); } public BindingOverrides(IEnumerable<InputBinding> bindings) { //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) overrides = new List<BindingOverride>(); foreach (InputBinding binding in bindings) { InputBinding current = binding; if (((InputBinding)(ref current)).hasOverrides) { BindingOverride item = new BindingOverride { action = ((InputBinding)(ref current)).action, origPath = ((InputBinding)(ref current)).path, path = ((InputBinding)(ref current)).overridePath }; overrides.Add(item); } } } public void LoadInto(InputActionAsset asset) { foreach (BindingOverride @override in overrides) { InputAction obj = asset.FindAction(@override.action, false); if (obj != null) { InputActionRebindingExtensions.ApplyBindingOverride(obj, @override.path, (string)null, @override.origPath); } } } public static BindingOverrides FromJson(string json) { BindingOverrides bindingOverrides = new BindingOverrides(); JToken value = JsonConvert.DeserializeObject<JObject>(json).GetValue("overrides"); bindingOverrides.overrides = value.ToObject<List<BindingOverride>>(); return bindingOverrides; } } } namespace LethalCompanyInputUtils.Api { [AttributeUsage(AttributeTargets.Property)] public class InputActionAttribute : Attribute { public readonly string KbmPath; public string? ActionId { get; set; } public string? GamepadPath { get; set; } public InputActionType ActionType { get; set; } = (InputActionType)1; public string? KbmInteractions { get; set; } public string? GamepadInteractions { get; set; } public string? Name { get; set; } [Obsolete("Prefer using the named optional params instead.")] public InputActionAttribute(string action, string kbmPath, string gamepadPath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ActionId = action; KbmPath = kbmPath; GamepadPath = gamepadPath; } public InputActionAttribute(string kbmPath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) KbmPath = kbmPath; } } public class InputActionBindingBuilder { private readonly InputActionMapBuilder _mapBuilder; private string? _actionId; private string? _kbmPath; private string? _gamepadPath; private string? _kbmInteractions; private string? _gamepadInteractions; private InputActionType _actionType; private string? _name; internal InputActionBindingBuilder(InputActionMapBuilder mapBuilder) { _mapBuilder = mapBuilder; } public InputActionBindingBuilder WithActionId(string actionId) { _actionId = actionId; return this; } public InputActionBindingBuilder WithKbmPath(string kbmPath) { _kbmPath = kbmPath; return this; } public InputActionBindingBuilder WithGamepadPath(string gamepadPath) { _gamepadPath = gamepadPath; return this; } public InputActionBindingBuilder WithKbmInteractions(string? kbmInteractions) { _kbmInteractions = kbmInteractions; return this; } public InputActionBindingBuilder WithGamepadInteractions(string? gamepadInteractions) { _gamepadInteractions = gamepadInteractions; return this; } public InputActionBindingBuilder WithActionType(InputActionType actionType) { //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) _actionType = actionType; return this; } public InputActionBindingBuilder WithBindingName(string? name) { _name = name; return this; } public InputAction Finish() { //IL_001b: 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_002a: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (_name == null) { _name = _actionId; } InputAction val = new InputAction(_actionId, _actionType, (string)null, (string)null, (string)null, (string)null); _mapBuilder.WithAction(val); if (_kbmPath != null) { _mapBuilder.WithBinding(new InputBinding(_kbmPath, _actionId, (string)null, (string)null, _kbmInteractions, _name)); } if (_gamepadPath != null) { _mapBuilder.WithBinding(new InputBinding(_gamepadPath, _actionId, (string)null, (string)null, _gamepadInteractions, _name)); } return val; } } public class InputActionMapBuilder { private readonly InputActionMap _actionMap = new InputActionMap(mapName); public InputActionMapBuilder(string mapName) { }//IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown public InputActionMapBuilder WithAction(InputAction action) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) InputActionSetupExtensions.AddAction(_actionMap, action.name, action.type, (string)null, (string)null, (string)null, (string)null, (string)null); return this; } public InputActionMapBuilder WithBinding(InputBinding binding) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) InputActionSetupExtensions.AddBinding(_actionMap, binding); return this; } public InputActionBindingBuilder NewActionBinding() { return new InputActionBindingBuilder(this); } internal InputActionMap Build() { return _actionMap; } } public abstract class LcInputActions { public const string UnboundKeyboardAndMouseIdentifier = "<InputUtils-Kbm-Not-Bound>"; public const string UnboundGamepadIdentifier = "<InputUtils-Gamepad-Not-Bound>"; private readonly string _jsonPath; private readonly List<InputActionReference> _actionRefs = new List<InputActionReference>(); internal bool Loaded; private readonly Dictionary<PropertyInfo, InputActionAttribute> _inputProps; public InputActionAsset Asset { get; } internal bool WasEnabled { get; private set; } public bool Enabled => Asset.enabled; internal IReadOnlyCollection<InputActionReference> ActionRefs => _actionRefs; internal string Id => Plugin.GUID + "." + MapName; public BepInPlugin Plugin { get; } protected virtual string MapName => GetType().Name; internal InputActionAsset GetAsset() { return Asset; } protected LcInputActions() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) Asset = ScriptableObject.CreateInstance<InputActionAsset>(); Plugin = Assembly.GetCallingAssembly().GetBepInPlugin() ?? throw new InvalidOperationException(); _jsonPath = Path.Combine(FsUtils.ControlsDir, Id + ".json"); InputActionMapBuilder inputActionMapBuilder = new InputActionMapBuilder(Id); PropertyInfo[] properties = GetType().GetProperties(); _inputProps = new Dictionary<PropertyInfo, InputActionAttribute>(); PropertyInfo[] array = properties; foreach (PropertyInfo propertyInfo in array) { InputActionAttribute customAttribute = propertyInfo.GetCustomAttribute<InputActionAttribute>(); if (customAttribute != null && !(propertyInfo.PropertyType != typeof(InputAction))) { InputActionAttribute inputActionAttribute = customAttribute; if (inputActionAttribute.ActionId == null) { string text = (inputActionAttribute.ActionId = propertyInfo.Name); } inputActionAttribute = customAttribute; if (inputActionAttribute.GamepadPath == null) { string text = (inputActionAttribute.GamepadPath = "<InputUtils-Gamepad-Not-Bound>"); } string kbmPath = (string.IsNullOrEmpty(customAttribute.KbmPath) ? "<InputUtils-Kbm-Not-Bound>" : customAttribute.KbmPath); inputActionMapBuilder.NewActionBinding().WithActionId(customAttribute.ActionId).WithActionType(customAttribute.ActionType) .WithBindingName(customAttribute.Name) .WithKbmPath(kbmPath) .WithGamepadPath(customAttribute.GamepadPath) .WithKbmInteractions(customAttribute.KbmInteractions) .WithGamepadInteractions(customAttribute.GamepadInteractions) .Finish(); _inputProps[propertyInfo] = customAttribute; } } LcInputActionApi.RegisterInputActions(this, inputActionMapBuilder); } public virtual void CreateInputActions(in InputActionMapBuilder builder) { } public virtual void OnAssetLoaded() { } internal void BuildActionRefs() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<PropertyInfo, InputActionAttribute> inputProp in _inputProps) { inputProp.Deconstruct(out var key, out var value); PropertyInfo propertyInfo = key; InputActionAttribute inputActionAttribute = value; InputAction value2 = Asset.FindAction(inputActionAttribute.ActionId, false); propertyInfo.SetValue(this, value2); } IEnumerable<InputActionReference> collection = ((IEnumerable<InputActionMap>)(object)Asset.actionMaps).SelectMany((InputActionMap map) => (IEnumerable<InputAction>)(object)map.actions).Select((Func<InputAction, InputActionReference>)InputActionReference.Create); _actionRefs.AddRange(collection); } public void Enable() { WasEnabled = Asset.enabled; Asset.Enable(); } public void Disable() { WasEnabled = Asset.enabled; Asset.Disable(); } internal void Save() { BindingOverrides bindingOverrides = new BindingOverrides(Asset.bindings); File.WriteAllText(_jsonPath, JsonConvert.SerializeObject((object)bindingOverrides)); } internal void Load() { try { ApplyMigrations(); } catch (Exception ex) { Logging.Logger.LogError((object)"Got error when applying migrations, skipping..."); Logging.Logger.LogError((object)ex); } if (!File.Exists(_jsonPath)) { return; } try { BindingOverrides.FromJson(File.ReadAllText(_jsonPath)).LoadInto(Asset); } catch (Exception ex2) { Logging.Logger.LogError((object)ex2); } } private void ApplyMigrations() { string text = Path.Combine(FsUtils.Pre041ControlsDir, Id + ".json"); if (File.Exists(text) && !File.Exists(_jsonPath)) { File.Move(text, _jsonPath); } if (!File.Exists(_jsonPath) || !File.ReadAllText(_jsonPath).Replace(" ", "").Contains("\"origPath\":\"\"")) { return; } BindingOverrides bindingOverrides = BindingOverrides.FromJson(File.ReadAllText(_jsonPath)); for (int i = 0; i < bindingOverrides.overrides.Count; i++) { BindingOverride value = bindingOverrides.overrides[i]; if (string.IsNullOrEmpty(value.origPath) && value.path != null) { if (value.path.StartsWith("<Keyboard>") || value.path.StartsWith("<Mouse>")) { value.origPath = "<InputUtils-Kbm-Not-Bound>"; } else { value.origPath = "<InputUtils-Gamepad-Not-Bound>"; } bindingOverrides.overrides[i] = value; } } File.WriteAllText(_jsonPath, JsonConvert.SerializeObject((object)bindingOverrides)); } } }
BepInEX/plugins/Sligili-HDLethalCompany/HDLethalCompany.dll
Decompiled 11 months agousing 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.6")] 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.6"; } } 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)) { ((VolumeParameter<int>)(object)((VolumeComponentWithQuality)val2).quality).Override(3); switch (m_setFogQuality) { case -1: val2.volumetricFogBudget = 0.05f; val2.resolutionDepthRatio = 0.5f; break; case 0: val2.volumetricFogBudget = 0.05f; val2.resolutionDepthRatio = 0.5f; break; case 2: val2.volumetricFogBudget = 0.333f; val2.resolutionDepthRatio = 0.666f; break; case 3: val2.volumetricFogBudget = 0.666f; 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; } } } } }
BepInEX/plugins/Sligili-More_Emotes/MoreEmotes1.2.2.dll
Decompiled 11 months agousing System; using System.Collections; 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.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; 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.2")] 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 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[9]; config_KeyWheel = ((BaseUnityPlugin)this).Config.Bind<string>("EMOTE WHEEL", "Key", "v", (ConfigDescription)null); 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", (ConfigDescription)null); EmotePatch.keybinds[2] = config_KeyEmote3.Value.Replace(" ", ""); config_KeyEmote4 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "The Griddy", "6", (ConfigDescription)null); EmotePatch.keybinds[5] = config_KeyEmote4.Value.Replace(" ", ""); config_KeyEmote5 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Shy", "5", (ConfigDescription)null); EmotePatch.keybinds[4] = config_KeyEmote5.Value.Replace(" ", ""); config_KeyEmote6 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Clap", "4", (ConfigDescription)null); EmotePatch.keybinds[3] = config_KeyEmote6.Value.Replace(" ", ""); config_KeyEmote7 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Twerk", "7", (ConfigDescription)null); EmotePatch.keybinds[6] = config_KeyEmote7.Value.Replace(" ", ""); config_KeyEmote8 = ((BaseUnityPlugin)this).Config.Bind<string>("QUICK EMOTES", "Salute", "8", (ConfigDescription)null); EmotePatch.keybinds[7] = config_KeyEmote8.Value.Replace(" ", ""); } } public static class PluginInfo { public const string Guid = "MoreEmotes"; public const string Name = "MoreEmotes-Sligili"; public const string Ver = "1.2.2"; } } namespace MoreEmotes.Patch { internal class EmotePatch { public static AssetBundle animationsBundle; public static AssetBundle animatorBundle; 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; public static GameObject rebindmenu; public static GameObject btn; private static SelectionWheel selectionWheel; [HarmonyPatch(typeof(MenuManager), "Start")] [HarmonyPostfix] private static void MenuStart(MenuManager __instance) { GameObject val = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesPanel.prefab"); GameObject val2 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesButton.prefab"); GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject; GameObject gameObject2 = ((Component)((Component)gameObject.transform.Find("MenuContainer")).transform.Find("SettingsPanel")).gameObject; if ((Object)(object)btn != (Object)null) { Object.Destroy((Object)(object)btn.gameObject); } btn = Object.Instantiate<GameObject>(val2, gameObject2.transform); btn.transform.SetSiblingIndex(7); if ((Object)(object)rebindmenu != (Object)null) { Object.Destroy((Object)(object)rebindmenu.gameObject); } rebindmenu = Object.Instantiate<GameObject>(val, gameObject2.transform); RebindBtn.defaultKeys = keybinds; BasicToggle.configValueInv = InvCheck; if ((Object)(object)gameObject2.GetComponent<SetupEverything>() == (Object)null) { gameObject2.AddComponent<SetupEverything>(); } SetupEverything.configValue = InvCheck; } [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; GameObject val2 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesPanel.prefab"); GameObject val3 = animationsBundle.LoadAsset<GameObject>("Assets/MoreEmotes/Resources/MoreEmotesButton.prefab"); GameObject gameObject3 = ((Component)((Component)gameObject2.transform.Find("QuickMenu")).transform.Find("SettingsPanel")).gameObject; if ((Object)(object)btn != (Object)null) { Object.Destroy((Object)(object)btn.gameObject); } btn = Object.Instantiate<GameObject>(val3, gameObject3.transform); btn.transform.SetSiblingIndex(7); if ((Object)(object)rebindmenu != (Object)null) { Object.Destroy((Object)(object)rebindmenu.gameObject); } rebindmenu = Object.Instantiate<GameObject>(val2, gameObject3.transform); RebindBtn.defaultKeys = keybinds; BasicToggle.configValueInv = InvCheck; 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; if ((Object)(object)gameObject3.GetComponent<SetupEverything>() == (Object)null) { gameObject3.AddComponent<SetupEverything>(); } SetupEverything.configValue = InvCheck; } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] private static void UpdatePostfix(PlayerControllerB __instance) { //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) 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 (!PlayerPrefs.HasKey("InvCheck")) { PlayerPrefs.SetInt("InvCheck", InvCheck ? 1 : 0); } else { InvCheck = PlayerPrefs.GetInt("InvCheck") == 1; } if (!PlayerPrefs.HasKey("Emote_Wheel")) { PlayerPrefs.SetString("Emote_Wheel", wheelKeybind); } if (InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[PlayerPrefs.GetString("Emote_Wheel")], 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)[PlayerPrefs.GetString("Emote_Wheel")], 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 (!emoteWheelIsOpened && !__instance.quickMenuManager.isMenuOpen) { EmoteInput(keybinds[2], needsEmptyHands: false, 3, __instance); EmoteInput(keybinds[3], needsEmptyHands: true, 4, __instance); EmoteInput(keybinds[4], needsEmptyHands: true, 5, __instance); EmoteInput(keybinds[5], needsEmptyHands: false, 6, __instance); EmoteInput(keybinds[6], needsEmptyHands: true, 7, __instance); EmoteInput(keybinds[7], needsEmptyHands: true, 8, __instance); } } private static void EmoteInput(string keyBind, bool needsEmptyHands, int emoteID, PlayerControllerB player) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) bool flag = PlayerPrefs.GetInt("InvCheck") == 1; Emotes emotes = (Emotes)emoteID; string text = emotes.ToString(); if (PlayerPrefs.HasKey(text)) { keyBind = PlayerPrefs.GetString(text); } else { PlayerPrefs.SetString(text, keyBind); } if (!keyBind.Equals(string.Empty) && InputControlExtensions.IsPressed(((InputControl)Keyboard.current)[keyBind], 0f) && (!player.isHoldingObject || !needsEmptyHands || !flag) && (!player.performingEmote || currentEmoteID != emoteID)) { Debug.Log((object)text); 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, 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; if (!PlayerPrefs.HasKey(text2.Replace(" ", "_"))) { PlayerPrefs.SetString(text2.Replace(" ", "_"), (selectedEmoteID > emotes_Keybinds.Length) ? "" : emotes_Keybinds[selectedEmoteID - 1]); } else { text = PlayerPrefs.GetString(text2.Replace(" ", "_")); } emoteInformation.text = text2 + "\n[" + text.ToUpper() + "]"; } } public class RebindBtn : MonoBehaviour { public string defaultKey; public static string[] defaultKeys; public string playerPrefs; public GameObject waitingForInput; public Text keyInfo; public Text description; private void Start() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown string text = ((Component)((Component)this).gameObject.transform.Find("Description")).GetComponent<Text>().text; try { int num = (int)(Emotes)Enum.Parse(typeof(Emotes), text.Replace(" ", "_")); defaultKey = defaultKeys[num - 1]; } catch { defaultKey = "V"; } playerPrefs = ((Component)((Component)this).gameObject.transform.Find("Description")).GetComponent<Text>().text.Replace(" ", "_"); ((Component)((Component)((Component)this).transform.parent).transform.Find("Delete")).gameObject.AddComponent<DeleteBtn>(); keyInfo = ((Component)((Component)this).transform.Find("InputText")).GetComponent<Text>(); waitingForInput = ((Component)((Component)this).transform.Find("wait")).gameObject; ((UnityEvent)((Component)this).GetComponent<Button>().onClick).AddListener(new UnityAction(GetKey)); if (!PlayerPrefs.HasKey(playerPrefs)) { PlayerPrefs.SetString(playerPrefs, defaultKey); } SetKeybind(PlayerPrefs.GetString(playerPrefs)); } public void SetKeybind(string key) { PlayerPrefs.SetString(playerPrefs, key); keyInfo.text = key; ((MonoBehaviour)this).StopAllCoroutines(); waitingForInput.SetActive(false); } public void GetKey() { waitingForInput.SetActive(true); ((MonoBehaviour)this).StartCoroutine(WaitForKey(delegate(string key) { SetKeybind(key); })); } private IEnumerator WaitForKey(Action<string> callback) { while (!((ButtonControl)Keyboard.current.anyKey).wasPressedThisFrame) { yield return (object)new WaitForEndOfFrame(); Observable.CallOnce<InputControl>(InputSystem.onAnyButtonPress, (Action<InputControl>)delegate(InputControl ctrl) { callback((ctrl.device == Keyboard.current) ? ctrl.name : defaultKey); }); } } } public class DeleteBtn : MonoBehaviour { private RebindBtn rebindBtn; private void Start() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown rebindBtn = ((Component)((Component)((Component)this).transform.parent).transform.Find("Button")).GetComponent<RebindBtn>(); Button component = ((Component)this).GetComponent<Button>(); ((UnityEvent)component.onClick).AddListener(new UnityAction(deleteKey)); } public void deleteKey() { rebindBtn.SetKeybind(string.Empty); } } public class BasicToggle : MonoBehaviour { private Toggle tog; public static bool configValueInv; public string playerPrefs; private void Start() { tog = ((Component)this).GetComponent<Toggle>(); ((UnityEvent<bool>)(object)tog.onValueChanged).AddListener((UnityAction<bool>)SetNewValue); if (!PlayerPrefs.HasKey(playerPrefs)) { PlayerPrefs.SetInt(playerPrefs, configValueInv ? 1 : 0); } } public void SetNewValue(bool arg) { PlayerPrefs.SetInt(playerPrefs, tog.isOn ? 1 : 0); } } public class ButtonBasic : MonoBehaviour { public GameObject[] alternateActive = (GameObject[])(object)new GameObject[1]; private void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((UnityEvent)((Component)this).GetComponent<Button>().onClick).AddListener(new UnityAction(onButtonTrigger)); if (((Object)((Component)this).gameObject).name.Equals("BackButton")) { alternateActive[0] = ((Component)((Component)this).transform.parent).gameObject; } if (((Object)((Component)this).gameObject).name.Equals("MoreEmotesButton(Clone)")) { alternateActive[0] = ((Component)((Component)((Component)this).transform.parent).gameObject.transform.Find("MoreEmotesPanel(Clone)")).gameObject; } } public void onButtonTrigger() { GameObject[] array = alternateActive; foreach (GameObject val in array) { val.SetActive((!val.activeInHierarchy) ? true : false); } } } public class SetupEverything : MonoBehaviour { private GameObject panel; public static bool configValue; private void Start() { panel = ((Component)((Component)this).transform.Find("MoreEmotesPanel(Clone)")).gameObject; ((Component)panel.transform.Find("Version")).GetComponent<Text>().text = "Sligili - 1.2.2"; if (!PlayerPrefs.HasKey("InvCheck")) { PlayerPrefs.SetInt("InvCheck", configValue ? 1 : 0); } SetupMenuButton(); BackButton(); KeybindButtons(); Others(); } private void SetupMenuButton() { GameObject gameObject = ((Component)((Component)this).transform.Find("MoreEmotesButton(Clone)")).gameObject; gameObject.AddComponent<ButtonBasic>(); } private void BackButton() { GameObject gameObject = ((Component)panel.transform.Find("BackButton")).gameObject; gameObject.AddComponent<ButtonBasic>(); } private void KeybindButtons() { GameObject gameObject = ((Component)panel.transform.Find("KeybindButtons")).gameObject; GameObject[] array = (GameObject[])(object)new GameObject[gameObject.transform.childCount]; for (int i = 0; i < gameObject.transform.childCount; i++) { array[i] = ((Component)gameObject.transform.GetChild(i)).gameObject; } GameObject[] array2 = array; foreach (GameObject val in array2) { ((Component)val.transform.Find("Button")).gameObject.AddComponent<RebindBtn>(); } } private void Others() { GameObject gameObject = ((Component)panel.transform.Find("Inv")).gameObject; gameObject.AddComponent<BasicToggle>(); BasicToggle basicToggle = gameObject.AddComponent<BasicToggle>(); basicToggle.playerPrefs = "InvCheck"; } } }
BepInEX/plugins/SlushyRH-FreeeeeeMoooooons/FreeMoons.dll
Decompiled 11 months agousing 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; [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("FreeMoons")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FreeMoons")] [assembly: AssemblyTitle("FreeMoons")] [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 SRH.Mods.LC { [BepInPlugin("SlushyRH.LethalCompany.FreeMoons", "FreeMoons", "1.0.1")] public class FreeMoonsPlugin : BaseUnityPlugin { private const string GUID = "SlushyRH.LethalCompany.FreeMoons"; private const string NAME = "FreeMoons"; private const string VERSION = "1.0.1"; private readonly Harmony harmony = new Harmony("SlushyRH.LethalCompany.FreeMoons"); public static FreeMoonsPlugin Instance { get; private set; } public ManualLogSource Log { get; private set; } private void Awake() { Log = Logger.CreateLogSource("SlushyRH.LethalCompany.FreeMoons"); if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(typeof(MoonPricePatch)); } } [HarmonyPatch(typeof(Terminal))] internal class MoonPricePatch { private static Terminal terminal = null; private static int totalCostOfItems = -5; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void FindTerminal() { FreeMoonsPlugin.Instance.Log.LogInfo((object)"Finding terminal object!"); terminal = Object.FindObjectOfType<Terminal>(); if ((Object)(object)terminal == (Object)null) { FreeMoonsPlugin.Instance.Log.LogError((object)"Failed to find terminal object!"); } else { FreeMoonsPlugin.Instance.Log.LogInfo((object)"Found terminal object!"); } } [HarmonyPatch("LoadNewNode")] [HarmonyPrefix] private static void LoadNewNodePatchBefore(ref TerminalNode node) { if ((!((Object)(object)terminal == (Object)null) || !((Object)(object)node == (Object)null)) && node.buyRerouteToMoon == -2) { Traverse val = Traverse.Create((object)terminal).Field("totalCostOfItems"); totalCostOfItems = (int)val.GetValue(); val.SetValue((object)0); } } [HarmonyPatch("LoadNewNode")] [HarmonyPostfix] private static void LoadNewNodePatchAfter(ref TerminalNode node) { if ((!((Object)(object)terminal == (Object)null) || !((Object)(object)node == (Object)null)) && totalCostOfItems != -5) { Traverse val = Traverse.Create((object)terminal).Field("totalCostOfItems"); val.SetValue((object)0); totalCostOfItems = -5; } } [HarmonyPatch("LoadNewNodeIfAffordable")] [HarmonyPrefix] private static void LoadNewNodeIfAffordablePatch(ref TerminalNode node) { if (!((Object)(object)node == (Object)null) && node.buyRerouteToMoon != -1) { node.itemCost = 0; } } } }
BepInEX/plugins/SpyPlayer-DoomShotgun/DoomShotgun.dll
Decompiled 11 months agousing System; 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.Configuration; using HarmonyLib; using LCSoundTool; 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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DoomShotgun")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Adds Doom music while holding the shotgun")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("DoomShotgun")] [assembly: AssemblyTitle("DoomShotgun")] [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 LethalCompanyTemplate { [BepInPlugin("DoomShotgun", "DoomShotgun", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static AudioClip doomMusic; public static ConfigEntry<float> volumeC; public static float volume; public void Awake() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown doomMusic = SoundTool.GetAudioClip("SpyPlayer-DoomShotgun", "doom.wav"); volumeC = ((BaseUnityPlugin)this).Config.Bind<float>("General", "volume", 1f, "Set the volume of the music"); volume = volumeC.Value; if (volume > 1f) { volume = 1f; } else if (volume < 0f) { volume = 0f; } Harmony val = new Harmony("DoomShotgun"); val.PatchAll(); } } [HarmonyPatch(typeof(ShotgunItem), "Start")] public static class ShotgunPatch { public static void Postfix(ShotgunItem __instance) { AudioSource val = ((Component)__instance).gameObject.AddComponent<AudioSource>(); val.clip = Plugin.doomMusic; val.loop = true; val.volume = Plugin.volume; } } [HarmonyPatch(typeof(ShotgunItem), "EquipItem")] public static class ShotgunEquipPatch { public static void Postfix(ShotgunItem __instance) { AudioSource val = ((Component)__instance).gameObject.GetComponents<AudioSource>().First((AudioSource x) => (Object)(object)x.clip == (Object)(object)Plugin.doomMusic); val.Play(); } } [HarmonyPatch(typeof(ShotgunItem), "StopUsingGun")] public static class ShotgunStopPatch { public static void Postfix(ShotgunItem __instance) { AudioSource val = ((Component)__instance).gameObject.GetComponents<AudioSource>().First((AudioSource x) => (Object)(object)x.clip == (Object)(object)Plugin.doomMusic); val.Stop(); } } public static class PluginInfo { public const string PLUGIN_GUID = "DoomShotgun"; public const string PLUGIN_NAME = "DoomShotgun"; public const string PLUGIN_VERSION = "1.0.0"; } }
BepInEX/plugins/stefan750-LCUltrawide/LCUltrawide.dll
Decompiled 11 months agousing 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 UnityEngine; 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("stefan750")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that allows changing of the resolution and aspect ratio of the game and UI elements")] [assembly: AssemblyFileVersion("1.1.1.0")] [assembly: AssemblyInformationalVersion("1.1.1+516a65c96fe17ba1154e9435a986f5bce37b2daf")] [assembly: AssemblyProduct("LCUltrawide")] [assembly: AssemblyTitle("LCUltrawide")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.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 LCUltrawide { [BepInPlugin("LCUltrawide", "LCUltrawide", "1.1.1")] public class Plugin : BaseUnityPlugin { private static ConfigEntry<int> configResW; private static ConfigEntry<int> configResH; private static ConfigEntry<float> configUIScale; private static ConfigEntry<float> configUIAspect; private static float aspectUpdateTime = 1f; private static bool aspectAutoDetect = false; private static float prevAspect = 0f; private static float prevTime = 0f; private static float fDefaultHelmetWidth = 0.3628f; private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin LCUltrawide is loaded!"); configResW = ((BaseUnityPlugin)this).Config.Bind<int>("Resolution Override", "Width", 0, "Horizontal rendering resolution override.\nIf set to 0, the resolution will be automatically adjusted to fit your monitors aspect ratio.\nGame default value: 860"); configResH = ((BaseUnityPlugin)this).Config.Bind<int>("Resolution Override", "Height", 0, "Vertical rendering resolution override.\nIf set to 0, the original resolution will be used.\nGame default value: 520"); configUIScale = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "Scale", 1f, "Changes the size of UI elements on the screen."); configUIAspect = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "AspectRatio", 0f, "Changes the aspect ratio of the ingame HUD, a higher number makes the HUD wider.\n(0 = auto, 1.33 = 4:3, 1.77 = 16:9, 2.33 = 21:9, 3.55 = 32:9)"); aspectAutoDetect = configResW.Value <= 0; Harmony.CreateAndPatchAll(typeof(Plugin), (string)null); } public static void ChangeAspectRatio(float newAspect) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_0293: 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_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) HUDManager instance = HUDManager.Instance; Texture texture = instance.playerScreenTexture.texture; RenderTexture val = (RenderTexture)(object)((texture is RenderTexture) ? texture : null); val.Release(); ((Texture)val).height = ((configResH.Value > 0) ? configResH.Value : ((Texture)val).height); ((Texture)val).width = ((configResW.Value > 0) ? configResW.Value : Convert.ToInt32((float)((Texture)val).height * newAspect)); GameObject val2 = GameObject.Find("TerminalScript"); Terminal val3 = default(Terminal); if ((Object)(object)val2 != (Object)null && val2.TryGetComponent<Terminal>(ref val3)) { RenderTexture playerScreenTexHighRes = val3.playerScreenTexHighRes; playerScreenTexHighRes.Release(); ((Texture)playerScreenTexHighRes).height = ((configResH.Value > 0) ? configResH.Value : ((Texture)playerScreenTexHighRes).height); ((Texture)playerScreenTexHighRes).width = ((configResW.Value > 0) ? configResW.Value : Convert.ToInt32((float)((Texture)playerScreenTexHighRes).height * newAspect)); } if ((Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { GameNetworkManager.Instance.localPlayerController.gameplayCamera.ResetAspect(); } GameObject val4 = GameObject.Find("Systems/UI/Canvas/Panel"); AspectRatioFitter val5 = default(AspectRatioFitter); if ((Object)(object)val4 != (Object)null && val4.TryGetComponent<AspectRatioFitter>(ref val5)) { val5.aspectRatio = newAspect; } GameObject val6 = GameObject.Find("Systems/UI/Canvas"); CanvasScaler val7 = default(CanvasScaler); if ((Object)(object)val6 != (Object)null && val6.TryGetComponent<CanvasScaler>(ref val7)) { float num = 500f / configUIScale.Value; float num2 = num * newAspect; val7.referenceResolution = new Vector2(num2, num); } GameObject hUDContainer = instance.HUDContainer; AspectRatioFitter val8 = default(AspectRatioFitter); if ((Object)(object)hUDContainer != (Object)null && hUDContainer.TryGetComponent<AspectRatioFitter>(ref val8)) { val8.aspectRatio = ((configUIAspect.Value > 0f) ? configUIAspect.Value : newAspect); } GameObject val9 = GameObject.Find("Systems/UI/UICamera"); Camera val10 = default(Camera); if ((Object)(object)val9 != (Object)null && val9.TryGetComponent<Camera>(ref val10)) { val10.fieldOfView = Math.Min(106f / ((configUIAspect.Value > 0f) ? configUIAspect.Value : newAspect), 60f); } GameObject gameObject = ((Component)instance.Inventory.canvasGroup).gameObject; RectTransform val11 = default(RectTransform); if ((Object)(object)gameObject != (Object)null && gameObject.TryGetComponent<RectTransform>(ref val11)) { val11.anchoredPosition = Vector2.zero; val11.anchorMax = new Vector2(0.5f, 0f); val11.anchorMin = new Vector2(0.5f, 0.5f); val11.pivot = new Vector2(0.5f, 0f); } GameObject val12 = GameObject.Find("PlayerHUDHelmetModel"); Transform val13 = default(Transform); if ((Object)(object)val12 != (Object)null && val12.TryGetComponent<Transform>(ref val13)) { Vector3 localScale = val13.localScale; localScale.x = fDefaultHelmetWidth * Math.Max(newAspect / 2.3f, 1f); val13.localScale = localScale; } } [HarmonyPatch(typeof(HUDManager), "Start")] [HarmonyPostfix] private static void HUDManagerStart(HUDManager __instance) { if (!aspectAutoDetect) { ChangeAspectRatio(1.77f); } prevAspect = 0f; prevTime = 0f; } [HarmonyPatch(typeof(HUDManager), "Update")] [HarmonyPostfix] private static void HUDManagerUpdate(HUDManager __instance) { //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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (aspectAutoDetect && Time.time > prevTime + aspectUpdateTime) { Vector2 renderingDisplaySize = ((Graphic)__instance.playerScreenTexture).canvas.renderingDisplaySize; float num = renderingDisplaySize.x / renderingDisplaySize.y; if (!Mathf.Approximately(num, prevAspect)) { ChangeAspectRatio(num); prevAspect = num; Debug.Log((object)("New Aspect Ratio: " + num)); } prevTime = Time.time; } } [HarmonyPatch(typeof(HUDManager), "UpdateScanNodes")] [HarmonyPostfix] private static void HUDManagerUpdateScanNodes(PlayerControllerB playerScript, HUDManager __instance, Dictionary<RectTransform, ScanNodeProperties> ___scanNodes) { //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) RectTransform[] scanElements = __instance.scanElements; RectTransform val = default(RectTransform); if (!((Component)__instance.playerScreenTexture).gameObject.TryGetComponent<RectTransform>(ref val)) { return; } Rect rect = val.rect; for (int i = 0; i < scanElements.Length; i++) { if (___scanNodes.TryGetValue(scanElements[i], out var value)) { Vector3 val2 = playerScript.gameplayCamera.WorldToViewportPoint(((Component)value).transform.position); scanElements[i].anchoredPosition = new Vector2(((Rect)(ref rect)).xMin + ((Rect)(ref rect)).width * val2.x, ((Rect)(ref rect)).yMin + ((Rect)(ref rect)).height * val2.y); } } } } public static class PluginInfo { public const string PLUGIN_GUID = "LCUltrawide"; public const string PLUGIN_NAME = "LCUltrawide"; public const string PLUGIN_VERSION = "1.1.1"; } }
BepInEX/plugins/Suskitech-AlwaysHearActiveWalkies/AlwaysHearWalkie.dll
Decompiled 11 months agousing 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.Logging; using GameNetcodeStuff; using HarmonyLib; using LCAlwaysHearWalkieMod.Patches; 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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AlwaysHearWalkie")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.4.3.0")] [assembly: AssemblyInformationalVersion("1.4.3+b44d9dd67954bb9cf96dd2ba0e84393e7774a6a0")] [assembly: AssemblyProduct("Always Hear Active Walkies")] [assembly: AssemblyTitle("AlwaysHearWalkie")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.3.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 BepInEx5.PluginTemplate { [BepInPlugin("suskitech.LCAlwaysHearActiveWalkie", "LC Always Hear Active Walkies", "1.4.3")] public class LCAlwaysHearWalkieMod : BaseUnityPlugin { public static ManualLogSource Log; private const string modGUID = "suskitech.LCAlwaysHearActiveWalkie"; private const string modName = "LC Always Hear Active Walkies"; private const string modVersion = "1.4.3"; private readonly Harmony harmony = new Harmony("suskitech.LCAlwaysHearActiveWalkie"); private static LCAlwaysHearWalkieMod Instance; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } Log = Logger.CreateLogSource("suskitech.LCAlwaysHearActiveWalkie"); Log.LogInfo((object)"\\ /"); Log.LogInfo((object)"/|\\"); Log.LogInfo((object)" |----|"); Log.LogInfo((object)" |[__]| Always Hear Active Walkies"); Log.LogInfo((object)" |. .| Version 1.4.3 Loaded"); Log.LogInfo((object)" |____|"); harmony.PatchAll(typeof(LCAlwaysHearWalkieMod)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(WalkieTalkiePatch)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "AlwaysHearWalkie"; public const string PLUGIN_NAME = "Always Hear Active Walkies"; public const string PLUGIN_VERSION = "1.4.3"; } } namespace LCAlwaysHearWalkieMod.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static float AudibleDistance = 20f; private static float throttleInterval = 0.35f; private static float throttle = 0f; private static float AverageDistanceToHeldWalkie = 2f; private static float WalkieRecordingRange = 20f; private static float PlayerToPlayerSpatialHearingRange = 20f; [HarmonyPatch("Update")] [HarmonyPostfix] private static void alwaysHearWalkieTalkiesPatch(ref bool ___holdingWalkieTalkie, ref PlayerControllerB __instance) { //IL_00d5: 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_0293: 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_02f8: 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_034d: 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) throttle += Time.deltaTime; if (throttle < throttleInterval) { return; } throttle = 0f; if ((Object)(object)__instance == (Object)null || (Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } if (!GameNetworkManager.Instance.localPlayerController.isPlayerDead) { List<WalkieTalkie> list = new List<WalkieTalkie>(); List<WalkieTalkie> list2 = new List<WalkieTalkie>(); for (int i = 0; i < WalkieTalkie.allWalkieTalkies.Count; i++) { float num = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[i]).transform.position, ((Component)__instance).transform.position); if (num <= AudibleDistance) { if (((GrabbableObject)WalkieTalkie.allWalkieTalkies[i]).isBeingUsed) { list.Add(WalkieTalkie.allWalkieTalkies[i]); } } else { list2.Add(WalkieTalkie.allWalkieTalkies[i]); } } bool flag = list.Count > 0; if (flag != __instance.holdingWalkieTalkie) { ___holdingWalkieTalkie = flag; for (int j = 0; j < list2.Count; j++) { if (j < list.Count) { list2[j].thisAudio.Stop(); } } } if (!flag) { return; } } PlayerControllerB val = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead || !((Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript != (Object)null)) ? GameNetworkManager.Instance.localPlayerController : GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript); for (int k = 0; k < StartOfRound.Instance.allPlayerScripts.Length; k++) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[k]; if ((!val2.isPlayerControlled && !val2.isPlayerDead) || (Object)(object)val2 == (Object)(object)GameNetworkManager.Instance.localPlayerController || val2.isPlayerDead || !val2.holdingWalkieTalkie) { continue; } float num2 = Vector3.Distance(((Component)val).transform.position, ((Component)val2).transform.position); float num3 = float.MaxValue; float num4 = float.MaxValue; for (int l = 0; l < WalkieTalkie.allWalkieTalkies.Count; l++) { if (!((GrabbableObject)WalkieTalkie.allWalkieTalkies[l]).isBeingUsed) { continue; } float num5 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l].target).transform.position, ((Component)val).transform.position); if (num5 < num4) { num4 = num5; } if (!WalkieTalkie.allWalkieTalkies[l].speakingIntoWalkieTalkie) { float num6 = Vector3.Distance(((Component)WalkieTalkie.allWalkieTalkies[l]).transform.position, ((Component)val2).transform.position); if (num6 < num3) { num3 = num6; } } } float num7 = Mathf.Min(1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num3), 1f - Mathf.InverseLerp(AverageDistanceToHeldWalkie, WalkieRecordingRange, num4)); float num8 = 1f - Mathf.InverseLerp(0f, PlayerToPlayerSpatialHearingRange, num2); val2.voicePlayerState.Volume = Mathf.Max(num7, num8); if (val2.speakingToWalkieTalkie && num7 > num8) { makePlayerSoundWalkieTalkie(val2); } else { makePlayerSoundSpatial(val2); } } } private static void makePlayerSoundWalkieTalkie(PlayerControllerB playerController) { AudioSource currentVoiceChatAudioSource = playerController.currentVoiceChatAudioSource; AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); AudioHighPassFilter component2 = ((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>(); OccludeAudio component3 = ((Component)currentVoiceChatAudioSource).GetComponent<OccludeAudio>(); ((Behaviour)component2).enabled = true; ((Behaviour)component).enabled = true; component3.overridingLowPass = true; currentVoiceChatAudioSource.spatialBlend = 0f; playerController.currentVoiceChatIngameSettings.set2D = true; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[playerController.playerClientId]; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.panStereo = (GameNetworkManager.Instance.localPlayerController.isPlayerDead ? 0f : 0.4f); component3.lowPassOverride = 4000f; component.lowpassResonanceQ = 3f; } private static void makePlayerSoundSpatial(PlayerControllerB playerController) { AudioSource currentVoiceChatAudioSource = playerController.currentVoiceChatAudioSource; AudioLowPassFilter component = ((Component)currentVoiceChatAudioSource).GetComponent<AudioLowPassFilter>(); AudioHighPassFilter component2 = ((Component)currentVoiceChatAudioSource).GetComponent<AudioHighPassFilter>(); OccludeAudio component3 = ((Component)currentVoiceChatAudioSource).GetComponent<OccludeAudio>(); ((Behaviour)component2).enabled = false; ((Behaviour)component).enabled = true; component3.overridingLowPass = playerController.voiceMuffledByEnemy; currentVoiceChatAudioSource.spatialBlend = 1f; playerController.currentVoiceChatIngameSettings.set2D = false; currentVoiceChatAudioSource.bypassListenerEffects = false; currentVoiceChatAudioSource.bypassEffects = false; currentVoiceChatAudioSource.outputAudioMixerGroup = SoundManager.Instance.playerVoiceMixers[playerController.playerClientId]; component.lowpassResonanceQ = 1f; } } [HarmonyPatch(typeof(WalkieTalkie))] internal class WalkieTalkiePatch { [HarmonyPatch("EnableWalkieTalkieListening")] [HarmonyPrefix] private static bool alwaysHearWalkieTalkiesEnableWalkieTalkieListeningPatch(bool enable) { if (!enable) { return false; } return true; } } }
BepInEX/plugins/Sv_Matt-HideModList/HideModList.dll
Decompiled 11 months agousing 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"; } }
BepInEX/plugins/tinyhoot-ShipLobby/ShipLobby/ShipLobby.dll
Decompiled 11 months agousing System; using System.Collections; 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 BepInEx; using BepInEx.Logging; using HarmonyLib; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("ShipLobby")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("ShipLobby")] [assembly: AssemblyCopyright("Copyright © tinyhoot 2023")] [assembly: ComVisible(false)] [assembly: AssemblyFileVersion("1.0.2")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.2.0")] [module: UnverifiableCode] namespace ShipLobby { [BepInPlugin("com.github.tinyhoot.ShipLobby", "ShipLobby", "1.0.2")] internal class ShipLobby : BaseUnityPlugin { public const string GUID = "com.github.tinyhoot.ShipLobby"; public const string NAME = "ShipLobby"; public const string VERSION = "1.0.2"; 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.ShipLobby").PatchAll(Assembly.GetExecutingAssembly()); } } } namespace ShipLobby.Patches { [HarmonyPatch] internal class GameNetworkManagerPatcher { private static QuickMenuManager _quickMenuManager; [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Singleton_OnClientConnectedCallback")] private static void LogConnect() { ShipLobby.Log.LogDebug((object)"Player connected."); } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Singleton_OnClientDisconnectCallback")] private static void LogDisconnect() { ShipLobby.Log.LogDebug((object)"Player disconnected."); } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "ConnectionApproval")] private static void FixConnectionApproval(GameNetworkManager __instance, ConnectionApprovalResponse response) { if (!response.Approved && !(response.Reason != "Game has already started!") && __instance.gameHasStarted && StartOfRound.Instance.inShipPhase) { ShipLobby.Log.LogDebug((object)"Approving incoming late connection."); response.Reason = ""; response.Approved = true; } } [HarmonyPostfix] [HarmonyPatch(typeof(QuickMenuManager), "InviteFriendsButton")] private static void FixFriendInviteButton() { if (GameNetworkManager.Instance.gameHasStarted && StartOfRound.Instance.inShipPhase) { GameNetworkManager.Instance.InviteFriendsUI(); } } [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "LeaveLobbyAtGameStart")] private static bool PreventSteamLobbyLeaving(GameNetworkManager __instance) { ShipLobby.Log.LogDebug((object)"Preventing the closing of Steam lobby."); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "StartGame")] private static void CloseSteamLobby(StartOfRound __instance) { if (((NetworkBehaviour)__instance).IsServer && __instance.inShipPhase) { ShipLobby.Log.LogDebug((object)"Setting lobby to not joinable."); GameNetworkManager.Instance.SetLobbyJoinable(false); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "EndOfGame")] private static IEnumerator ReopenSteamLobby(IEnumerator coroutine, StartOfRound __instance) { while (coroutine.MoveNext()) { yield return coroutine.Current; } if (!((NetworkBehaviour)__instance).IsServer) { yield break; } yield return (object)new WaitForSeconds(0.5f); yield return (object)new WaitUntil((Func<bool>)(() => !__instance.firingPlayersCutsceneRunning)); ShipLobby.Log.LogDebug((object)"Reopening lobby, setting to joinable."); GameNetworkManager instance = GameNetworkManager.Instance; if (instance.currentLobby.HasValue) { instance.SetLobbyJoinable(true); if ((Object)(object)_quickMenuManager == (Object)null) { _quickMenuManager = Object.FindObjectOfType<QuickMenuManager>(); } _quickMenuManager.inviteFriendsTextAlpha.alpha = 1f; } } } }
BepInEX/plugins/tinyhoot-ShipLoot/ShipLoot/ShipLoot.dll
Decompiled 11 months agousing 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>(); } } }
BepInEX/plugins/wallen-ChangeName/ChangeName.dll
Decompiled 11 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LC_API.ServerAPI; 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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ChangeName")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Change in-game name")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9ad07e918fa6011a98cef2e1281a0a7577b70a07")] [assembly: AssemblyProduct("ChangeName")] [assembly: AssemblyTitle("ChangeName")] [assembly: AssemblyVersion("1.0.0.0")] namespace ChangeName { [BepInPlugin("me.wallen.changename", "Change Player Names", "1.0.0")] public class ChangeNamePlugin : BaseUnityPlugin { private const string GUID = "me.wallen.changename"; private const string NAME = "Change Player Names"; private const string VERSION = "1.0.0"; private static ChangeNamePlugin Instance; private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Instance = this; LogInfo("Loading..."); Harmony val = new Harmony("me.wallen.changename"); val.PatchAll(); Networking.GetString = (Action<string, string>)Delegate.Combine(Networking.GetString, new Action<string, string>(NameDatabase.NDNetGetString)); LogInfo("Loading Complete!"); } internal static void LogDebug(string message) { Instance.Log(message, (LogLevel)32); } internal static void LogInfo(string message) { Instance.Log(message, (LogLevel)16); } internal static void LogWarning(string message) { Instance.Log(message, (LogLevel)4); } internal static void LogError(string message) { Instance.Log(message, (LogLevel)2); } internal static void LogError(Exception ex) { Instance.Log(ex.Message + "\n" + ex.StackTrace, (LogLevel)2); } private void Log(string message, LogLevel logLevel) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((BaseUnityPlugin)this).Logger.Log(logLevel, (object)message); } } internal static class NameDatabase { internal static bool shouldUpdateNames = false; internal static bool shouldSendNames = false; public const string SIG_BEGIN_UPDATE_NAMES = "CHANGE_NAME_BEGIN_UPDATE_NAMES"; public const string SIG_UPDATE_NAME = "CHANGE_NAME_UPDATE_NAME"; public const string SIG_END_UPDATE_NAMES = "CHANGE_NAME_END_UPDATE_NAMES"; public const string SIG_PLAYER_JOIN = "CHANGE_NAME_PLAYER_JOIN"; public const string SIG_NEW_LEVEL = "CHANGE_NAME_NEW_LEVEL"; private const string SIG_NEW_ROUND = "CHANGE_NAME_NEW_ROUND"; private static Dictionary<ulong, string> names = new Dictionary<ulong, string>(); internal static string GetName(ulong id) { if (!names.ContainsKey(id)) { ChangeNamePlugin.LogWarning("[NameDatabase.GetName] Failed to get name"); return ""; } return names[id]; } internal static void SetName(ulong id, string name) { if (!names.ContainsKey(id)) { names.Add(id, name); } else { names[id] = name; } } internal static bool HasName(string name) { return names.ContainsValue(name); } internal static bool HasId(ulong id) { return names.ContainsKey(id); } internal static ulong GetUsableIdFromPlayer(PlayerControllerB player) { if (!GameNetworkManager.Instance.disableSteam) { return player.playerSteamId; } return player.playerClientId; } internal static void UpdateName(string oldName, string newName) { if (!names.ContainsValue(oldName)) { ChangeNamePlugin.LogWarning("[NameDatabase.UpdateName] Tried to update name " + oldName + " but it does not exist"); ChangeNamePlugin.LogWarning(names.ToString()); } else { ulong key = names.FirstOrDefault((KeyValuePair<ulong, string> x) => x.Value == oldName).Key; names[key] = newName; } shouldUpdateNames = true; } internal static int NumberOfNames() { return names.Count; } internal static void NDNetGetString(string data, string signature) { switch (signature) { case "CHANGE_NAME_PLAYER_JOIN": case "CHANGE_NAME_NEW_ROUND": if (((NetworkBehaviour)StartOfRound.Instance).IsHost) { shouldSendNames = true; } break; case "CHANGE_NAME_BEGIN_UPDATE_NAMES": ChangeNamePlugin.LogInfo("[NameDatabase] Beginning name update process."); break; case "CHANGE_NAME_UPDATE_NAME": { KeyValuePair<ulong, string>? keyValuePair = DecodeName(data); if (keyValuePair.HasValue) { KeyValuePair<ulong, string> value = keyValuePair.Value; ChangeNamePlugin.LogInfo("[NameDatabase] New name received: " + value.Key + " : " + value.Value); names[value.Key] = value.Value; } break; } case "CHANGE_NAME_END_UPDATE_NAMES": ChangeNamePlugin.LogInfo("[NameDatabase] End of name update process."); shouldUpdateNames = true; break; } } internal static void NDNetSendNames() { Networking.Broadcast(string.Empty, "CHANGE_NAME_BEGIN_UPDATE_NAMES"); foreach (KeyValuePair<ulong, string> name in names) { string text = EncodeName(name); Networking.Broadcast(text, "CHANGE_NAME_UPDATE_NAME"); } Networking.Broadcast(string.Empty, "CHANGE_NAME_END_UPDATE_NAMES"); } private static string EncodeName(KeyValuePair<ulong, string> namePair) { return $"{namePair.Key}:{namePair.Value}"; } private static KeyValuePair<ulong, string>? DecodeName(string encoded) { string[] array = encoded.Split(':'); if (array.Length == 2 && ulong.TryParse(array[0], out var result)) { return new KeyValuePair<ulong, string>(result, array[1]); } return null; } private static string EncodeNames(Dictionary<ulong, string> names) { StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair<ulong, string> name in names) { stringBuilder.Append($"{name.Key}:{name.Value};"); } return stringBuilder.ToString(); } private static Dictionary<ulong, string> DecodeNames(string encoded) { string[] array = encoded.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); Dictionary<ulong, string> dictionary = new Dictionary<ulong, string>(); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(':'); dictionary[ulong.Parse(array3[0])] = array3[1]; } return dictionary; } private static string DictionaryToString(Dictionary<ulong, string> dictionary) { StringBuilder stringBuilder = new StringBuilder(); foreach (KeyValuePair<ulong, string> item in dictionary) { stringBuilder.AppendLine($"Key: {item.Key}, Value: {item.Value}"); } return stringBuilder.ToString(); } } } namespace ChangeName.Patches { [HarmonyPatch(typeof(HUDManager), "AddChatMessage")] internal class HUDManager_AddChatMessage { private static string lastChatMessage = ""; private static void Postfix(HUDManager __instance, string chatMessage, string nameOfUserWhoTyped) { if (lastChatMessage == chatMessage) { return; } lastChatMessage = chatMessage; ChangeNamePlugin.LogDebug(chatMessage); if (chatMessage.Contains("!name")) { string text = chatMessage.Substring(chatMessage.IndexOf("!name") + "!name".Length).Trim(); if (NameDatabase.HasName(text)) { __instance.AddTextToChatOnServer("Duplicate names are not allowed!", -1); } else if (((NetworkBehaviour)__instance.playersManager).IsHost) { NameDatabase.UpdateName(nameOfUserWhoTyped, text); NameDatabase.shouldSendNames = true; NameDatabase.shouldUpdateNames = true; } } } } [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] internal class PlayerControllerB_ConnectClientToPlayerObject { private static void Postfix(PlayerControllerB __instance) { ChangeNamePlugin.LogDebug("Steam Disabled: " + GameNetworkManager.Instance.disableSteam); ChangeNamePlugin.LogDebug("Is Host: " + ((NetworkBehaviour)__instance).IsHost); ChangeNamePlugin.LogDebug("Player steam ID: " + __instance.playerSteamId); ChangeNamePlugin.LogDebug("Player client ID: " + __instance.playerClientId); ChangeNamePlugin.LogDebug("Actual client ID: " + __instance.actualClientId); ChangeNamePlugin.LogDebug("Player Username: " + __instance.playerUsername); Networking.Broadcast("", "CHANGE_NAME_PLAYER_JOIN"); } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] internal class PlayerControllerB_Update { private static float lastUpdateTime; private static void Postfix(PlayerControllerB __instance) { if (!(lastUpdateTime + 2f < Time.time)) { return; } if (((NetworkBehaviour)__instance).IsHost) { PlayerControllerB[] allPlayerScripts = __instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!NameDatabase.HasId(NameDatabase.GetUsableIdFromPlayer(val))) { NameDatabase.SetName(NameDatabase.GetUsableIdFromPlayer(val), val.playerUsername); } } if (NameDatabase.shouldSendNames) { NameDatabase.NDNetSendNames(); NameDatabase.shouldSendNames = false; } } if (NameDatabase.shouldUpdateNames) { PlayerControllerB[] allPlayerScripts2 = __instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts2) { string name = NameDatabase.GetName(NameDatabase.GetUsableIdFromPlayer(val2)); foreach (TransformAndName radarTarget in StartOfRound.Instance.mapScreen.radarTargets) { Transform transform = radarTarget.transform; if (radarTarget.name == val2.playerUsername) { StartOfRound.Instance.mapScreen.ChangeNameOfTargetTransform(transform, name); } } val2.playerUsername = name; ((TMP_Text)val2.usernameBillboardText).text = name; } NameDatabase.shouldUpdateNames = false; } lastUpdateTime = Time.time; } } [HarmonyPatch(typeof(StartOfRound), "ArriveAtLevel")] internal class StartOfRound_ArriveAtLevel { private static void Postfix(StartOfRound __instance) { } } }
BepInEX/plugins/x753-Mimics/Mimics.dll
Decompiled 11 months agousing System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DunGen; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyMimics.Properties; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("Mimics")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A mod that adds mimics to Lethal Company")] [assembly: AssemblyFileVersion("2.3.0.0")] [assembly: AssemblyInformationalVersion("2.3.0")] [assembly: AssemblyProduct("Mimics")] [assembly: AssemblyTitle("Mimics")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.0.0")] [module: UnverifiableCode] internal class <Module> { static <Module>() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>(); } } namespace LethalCompanyMimics.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { ResourceManager resourceManager = new ResourceManager("LethalCompanyMimics.Properties.Resources", typeof(Resources).Assembly); resourceMan = resourceManager; } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] mimicdoor { get { object @object = ResourceManager.GetObject("mimicdoor", resourceCulture); return (byte[])@object; } } internal Resources() { } } } namespace Mimics { [BepInPlugin("x753.Mimics", "Mimics", "2.3.0")] public class Mimics : BaseUnityPlugin { [HarmonyPatch(typeof(GameNetworkManager))] internal class GameNetworkManagerPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch() { ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().AddNetworkPrefab(MimicNetworkerPrefab); } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(ref StartOfRound __instance) { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_0157: Expected O, but got Unknown if (((NetworkBehaviour)__instance).IsServer && (Object)(object)MimicNetworker.Instance == (Object)null) { GameObject val = Object.Instantiate<GameObject>(MimicNetworkerPrefab); val.GetComponent<NetworkObject>().Spawn(true); MimicNetworker.SpawnWeight0.Value = SpawnRates[0]; MimicNetworker.SpawnWeight1.Value = SpawnRates[1]; MimicNetworker.SpawnWeight2.Value = SpawnRates[2]; MimicNetworker.SpawnWeight3.Value = SpawnRates[3]; MimicNetworker.SpawnWeight4.Value = SpawnRates[4]; MimicNetworker.SpawnWeightMax.Value = SpawnRates[5]; MimicNetworker.SpawnRateDynamic.Value = DynamicSpawnRate; Terminal val2 = Object.FindObjectOfType<Terminal>(); MimicCreatureID = val2.enemyFiles.Count; MimicFile.creatureFileID = MimicCreatureID; val2.enemyFiles.Add(MimicFile); TerminalKeyword val3 = val2.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "info"); TerminalKeyword val4 = new TerminalKeyword { word = "mimics", isVerb = false, defaultVerb = val3 }; List<CompatibleNoun> list = val3.compatibleNouns.ToList(); list.Add(new CompatibleNoun { noun = val4, result = MimicFile }); val3.compatibleNouns = list.ToArray(); List<TerminalKeyword> list2 = val2.terminalNodes.allKeywords.ToList(); list2.Add(val4); val2.terminalNodes.allKeywords = list2.ToArray(); } } } [HarmonyPatch(typeof(RoundManager))] internal class RoundManagerPatch { [HarmonyPatch("SetExitIDs")] [HarmonyPostfix] private static void SetExitIDsPatch(ref RoundManager __instance, Vector3 mainEntrancePosition) { //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: 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_0233: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_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_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: 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_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Expected O, but got Unknown //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) MimicDoor.allMimics = new List<MimicDoor>(); int num = 0; Dungeon currentDungeon = __instance.dungeonGenerator.Generator.CurrentDungeon; if (!((Object)currentDungeon.DungeonFlow).name.StartsWith("Level1") && !((Object)currentDungeon.DungeonFlow).name.StartsWith("Level2")) { return; } int num2 = 0; int[] array = new int[6] { MimicNetworker.SpawnWeight0.Value, MimicNetworker.SpawnWeight1.Value, MimicNetworker.SpawnWeight2.Value, MimicNetworker.SpawnWeight3.Value, MimicNetworker.SpawnWeight4.Value, MimicNetworker.SpawnWeightMax.Value }; int num3 = 0; int[] array2 = array; foreach (int num4 in array2) { num3 += num4; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 753); int num5 = random.Next(0, num3); int num6 = 0; for (int j = 0; j < array.Length; j++) { if (num5 < array[j] + num6) { num2 = j; break; } num6 += array[j]; } if (num2 == 5) { num2 = 999; } EntranceTeleport[] array3 = Object.FindObjectsOfType<EntranceTeleport>(false); int num7 = (array3.Length - 2) / 2; if (MimicNetworker.SpawnRateDynamic.Value && num2 < num7 && num7 > 1) { num2 += random.Next(0, 2); } if (MimicNetworker.SpawnRateDynamic.Value && currentDungeon.AllTiles.Count > 100) { num2 += random.Next(0, 2); } List<Doorway> list = new List<Doorway>(); Bounds val2 = default(Bounds); foreach (Tile allTile in currentDungeon.AllTiles) { foreach (Doorway unusedDoorway in allTile.UnusedDoorways) { if (unusedDoorway.HasDoorPrefabInstance || (Object)(object)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true) == (Object)null) { continue; } GameObject gameObject = ((Component)((Component)((Component)unusedDoorway).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; if (!((Object)gameObject).name.StartsWith("AlleyExitDoorContainer") || gameObject.activeSelf) { continue; } bool flag = false; Matrix4x4 val = Matrix4x4.TRS(((Component)unusedDoorway).transform.position, ((Component)unusedDoorway).transform.rotation, new Vector3(1f, 1f, 1f)); ((Bounds)(ref val2))..ctor(new Vector3(0f, 1.5f, 5.5f), new Vector3(2f, 6f, 8f)); ((Bounds)(ref val2)).center = ((Matrix4x4)(ref val)).MultiplyPoint3x4(((Bounds)(ref val2)).center); Collider[] array4 = Physics.OverlapBox(((Bounds)(ref val2)).center, ((Bounds)(ref val2)).extents, ((Component)unusedDoorway).transform.rotation, LayerMask.GetMask(new string[3] { "Room", "Railing", "MapHazards" })); Collider[] array5 = array4; int num8 = 0; if (num8 < array5.Length) { Collider val3 = array5[num8]; flag = true; } if (flag) { continue; } foreach (Tile allTile2 in currentDungeon.AllTiles) { if (!((Object)(object)allTile == (Object)(object)allTile2)) { Vector3 origin = ((Component)unusedDoorway).transform.position + 5f * ((Component)unusedDoorway).transform.forward; Bounds val4 = UnityUtil.CalculateProxyBounds(((Component)allTile2).gameObject, true, Vector3.up); Ray val5 = default(Ray); ((Ray)(ref val5)).origin = origin; ((Ray)(ref val5)).direction = Vector3.up; if (((Bounds)(ref val4)).IntersectRay(val5) && (((Object)allTile2).name.Contains("Catwalk") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || (((Object)allTile2).name.Contains("StartRoom") && !((Object)allTile2).name.Contains("Manor")))) { flag = true; } val5 = default(Ray); ((Ray)(ref val5)).origin = origin; ((Ray)(ref val5)).direction = Vector3.down; if (((Bounds)(ref val4)).IntersectRay(val5) && (((Object)allTile2).name.Contains("MediumRoomHallway1B") || ((Object)allTile2).name.Contains("LargeForkTile") || ((Object)allTile2).name.Contains("4x4BigStair") || ((Object)allTile2).name.Contains("ElevatorConnector") || ((Object)allTile2).name.Contains("StartRoom"))) { flag = true; } } } if (!flag) { list.Add(unusedDoorway); } } } Shuffle(list, StartOfRound.Instance.randomMapSeed); List<Vector3> list2 = new List<Vector3>(); foreach (Doorway item in list) { if (num >= num2) { break; } bool flag2 = false; Vector3 val6 = ((Component)item).transform.position + 5f * ((Component)item).transform.forward; foreach (Vector3 item2 in list2) { if (Vector3.Distance(val6, item2) < 4f) { flag2 = true; break; } } if (flag2) { continue; } list2.Add(val6); GameObject gameObject2 = ((Component)((Component)((Component)item).GetComponentInChildren<SpawnSyncedObject>(true)).transform.parent).gameObject; GameObject val7 = Object.Instantiate<GameObject>(MimicPrefab, ((Component)item).transform); val7.transform.position = gameObject2.transform.position; MimicDoor component = val7.GetComponent<MimicDoor>(); component.scanNode.creatureScanID = MimicCreatureID; AudioSource[] componentsInChildren = val7.GetComponentsInChildren<AudioSource>(true); foreach (AudioSource val8 in componentsInChildren) { val8.volume = MimicVolume / 100f; val8.outputAudioMixerGroup = StartOfRound.Instance.ship3DAudio.outputAudioMixerGroup; } if (SpawnRates[5] == 9753 && num == 0) { val7.transform.position = new Vector3(-7f, 0f, -10f); } MimicDoor.allMimics.Add(component); component.mimicIndex = num; num++; GameObject gameObject3 = ((Component)((Component)item).transform.GetChild(0)).gameObject; gameObject3.SetActive(false); Bounds bounds = ((Collider)component.frameBox).bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = ((Collider)component.frameBox).bounds; Collider[] array6 = Physics.OverlapBox(center, ((Bounds)(ref bounds)).extents, Quaternion.identity); foreach (Collider val9 in array6) { if (((Object)((Component)val9).gameObject).name.Contains("Shelf")) { ((Component)val9).gameObject.SetActive(false); } } Light componentInChildren = gameObject2.GetComponentInChildren<Light>(true); ((Component)componentInChildren).transform.parent.SetParent(val7.transform); MeshRenderer[] componentsInChildren2 = val7.GetComponentsInChildren<MeshRenderer>(); MeshRenderer[] array7 = componentsInChildren2; foreach (MeshRenderer val10 in array7) { Material[] materials = ((Renderer)val10).materials; foreach (Material val11 in materials) { val11.shader = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.shader; val11.renderQueue = ((Renderer)gameObject3.GetComponentInChildren<MeshRenderer>(true)).material.renderQueue; } } component.interactTrigger.onInteract = new InteractEvent(); ((UnityEvent<PlayerControllerB>)(object)component.interactTrigger.onInteract).AddListener((UnityAction<PlayerControllerB>)component.TouchMimic); if (MimicPerfection) { continue; } component.interactTrigger.timeToHold = 0.9f; if (!ColorBlindMode) { if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.490566f, 0.1226415f, 0.1302275f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.4339623f, 0.1043965f, 0.1150277f); componentInChildren.colorTemperature = 1250f; } else { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.5f, 0.1580188f, 0.1657038f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(43f / 106f, 0.1358579f, 0.1393619f); componentInChildren.colorTemperature = 1300f; } } else if ((StartOfRound.Instance.randomMapSeed + num) % 2 == 0) { component.interactTrigger.timeToHold = 1.1f; } else { component.interactTrigger.timeToHold = 1f; } if (!EasyMode) { continue; } Random random2 = new Random(StartOfRound.Instance.randomMapSeed + num); switch (random2.Next(0, 4)) { case 0: if (!ColorBlindMode) { ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[0]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); ((Renderer)val7.GetComponentsInChildren<MeshRenderer>()[1]).material.color = new Color(0.489f, 0.2415526f, 0.1479868f); } else { component.interactTrigger.timeToHold = 1.5f; } break; case 1: component.interactTrigger.hoverTip = "Feed : [LMB]"; component.interactTrigger.holdTip = "Feed : [LMB]"; break; case 2: component.interactTrigger.hoverIcon = component.LostFingersIcon; break; case 3: component.interactTrigger.holdTip = "DIE : [LMB]"; component.interactTrigger.timeToHold = 0.5f; break; default: component.interactTrigger.hoverTip = "BUG, REPORT TO DEVELOPER"; break; } } } } [HarmonyPatch(typeof(SprayPaintItem))] internal class SprayPaintItemPatch { private static FieldInfo SprayHit = typeof(SprayPaintItem).GetField("sprayHit", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch("SprayPaintClientRpc")] [HarmonyPostfix] private static void SprayPaintClientRpcPatch(SprayPaintItem __instance, Vector3 sprayPos, Vector3 sprayRot) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = (RaycastHit)SprayHit.GetValue(__instance); if ((Object)(object)((RaycastHit)(ref val)).collider != (Object)null && ((Object)((RaycastHit)(ref val)).collider).name == "MimicSprayCollider") { MimicDoor component = ((Component)((Component)((RaycastHit)(ref val)).collider).transform.parent.parent).GetComponent<MimicDoor>(); component.sprayCount++; if (component.sprayCount > 9) { MimicNetworker.Instance.MimicAddAnger(1, component.mimicIndex); } } } } [HarmonyPatch(typeof(LockPicker))] internal class LockPickerPatch { private static FieldInfo RayHit = typeof(LockPicker).GetField("hit", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch("ItemActivate")] [HarmonyPostfix] private static void ItemActivatePatch(LockPicker __instance, bool used, bool buttonDown = true) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_002a: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = (RaycastHit)RayHit.GetValue(__instance); if (!((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null) && !((object)(RaycastHit)(ref val)).Equals((object)default(RaycastHit)) && !((Object)(object)((RaycastHit)(ref val)).transform.parent == (Object)null)) { Transform parent = ((RaycastHit)(ref val)).transform.parent; if (((Object)parent).name.StartsWith("MimicDoor")) { MimicNetworker.Instance.MimicLockPick(__instance, ((Component)parent).GetComponent<MimicDoor>().mimicIndex); } } } } private const string modGUID = "x753.Mimics"; private const string modName = "Mimics"; private const string modVersion = "2.3.0"; private readonly Harmony harmony = new Harmony("x753.Mimics"); private static Mimics Instance; public static GameObject MimicPrefab; public static GameObject MimicNetworkerPrefab; public static TerminalNode MimicFile; public static int MimicCreatureID; public static int[] SpawnRates; public static bool MimicPerfection; public static bool EasyMode; public static bool ColorBlindMode; public static float MimicVolume; public static bool DynamicSpawnRate; private void Awake() { AssetBundle val = AssetBundle.LoadFromMemory(Resources.mimicdoor); MimicPrefab = val.LoadAsset<GameObject>("Assets/MimicDoor.prefab"); MimicNetworkerPrefab = val.LoadAsset<GameObject>("Assets/MimicNetworker.prefab"); MimicFile = val.LoadAsset<TerminalNode>("Assets/MimicFile.asset"); if ((Object)(object)Instance == (Object)null) { Instance = this; } harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Mimics is loaded!"); SpawnRates = new int[6] { ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Zero Mimics", 23, "Weight of zero mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "One Mimic", 69, "Weight of one mimic spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Two Mimics", 7, "Weight of two mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Three Mimics", 1, "Weight of three mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Four Mimics", 0, "Weight of four mimics spawning").Value, ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Maximum Mimics", 0, "Weight of maximum mimics spawning").Value }; DynamicSpawnRate = ((BaseUnityPlugin)this).Config.Bind<bool>("Spawn Rate", "Dynamic Spawn Rate", true, "Increases mimic spawn rate based on dungeon size and the number of instances of the real thing.").Value; MimicPerfection = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Perfect Mimics", false, "Select this if you want mimics to be the exact same color as the real thing. Overrides all difficulty settings.").Value; EasyMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Easy Mode", false, "Each mimic will have one of several possible imperfections to help you tell if it's a mimic.").Value; ColorBlindMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "Color Blind Mode", false, "Replaces all color differences with another way to differentiate mimics.").Value; MimicVolume = ((BaseUnityPlugin)this).Config.Bind<int>("General", "SFX Volume", 100, "Volume of the mimic's SFX (0-100)").Value; if (MimicVolume < 0f) { MimicVolume = 0f; } if (MimicVolume > 100f) { MimicVolume = 100f; } ((BaseUnityPlugin)this).Config.Bind<int>("Difficulty", "Difficulty Level", 0, "This is an old setting, ignore it."); ((BaseUnityPlugin)this).Config.Remove(((BaseUnityPlugin)this).Config["Difficulty", "Difficulty Level"].Definition); ((BaseUnityPlugin)this).Config.Bind<int>("Spawn Rate", "Five Mimics", 0, "This is an old setting, ignore it."); ((BaseUnityPlugin)this).Config.Remove(((BaseUnityPlugin)this).Config["Spawn Rate", "Five Mimics"].Definition); ((BaseUnityPlugin)this).Config.Save(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public static void Shuffle<T>(IList<T> list, int seed) { Random random = new Random(seed); int num = list.Count; while (num > 1) { num--; int index = random.Next(num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } } public class MimicNetworker : NetworkBehaviour { public static MimicNetworker Instance; public static NetworkVariable<int> SpawnWeight0 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight1 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight2 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight3 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeight4 = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<int> SpawnWeightMax = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public static NetworkVariable<bool> SpawnRateDynamic = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private void Awake() { Instance = this; } public void MimicAttack(int playerId, int mimicIndex, bool ownerOnly = false) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } else if (!ownerOnly) { Instance.MimicAttackServerRpc(playerId, mimicIndex); } } [ClientRpc] public void MimicAttackClientRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2885019175u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2885019175u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].Attack(playerId)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAttackServerRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1024971481u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1024971481u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAttackClientRpc(playerId, mimicIndex); } } } public void MimicAddAnger(int amount, int mimicIndex) { if (((NetworkBehaviour)this).IsOwner) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } else { Instance.MimicAddAngerServerRpc(amount, mimicIndex); } } [ClientRpc] public void MimicAddAngerClientRpc(int amount, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1137632670u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1137632670u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].AddAnger(amount)); } } } [ServerRpc(RequireOwnership = false)] public void MimicAddAngerServerRpc(int amount, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(669208889u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, amount); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 669208889u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicAddAngerClientRpc(amount, mimicIndex); } } } public void MimicLockPick(LockPicker lockPicker, int mimicIndex, bool ownerOnly = false) { int playerId = (int)((GrabbableObject)lockPicker).playerHeldBy.playerClientId; if (((NetworkBehaviour)this).IsOwner) { Instance.MimicLockPickClientRpc(playerId, mimicIndex); } else if (!ownerOnly) { Instance.MimicLockPickServerRpc(playerId, mimicIndex); } } [ClientRpc] public void MimicLockPickClientRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3716888238u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3716888238u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ((MonoBehaviour)this).StartCoroutine(MimicDoor.allMimics[mimicIndex].MimicLockPick(playerId)); } } } [ServerRpc(RequireOwnership = false)] public void MimicLockPickServerRpc(int playerId, int mimicIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1897916243u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, mimicIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1897916243u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Instance.MimicLockPickClientRpc(playerId, mimicIndex); } } } protected override void __initializeVariables() { if (SpawnWeight0 == null) { throw new Exception("MimicNetworker.SpawnWeight0 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight0).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight0, "SpawnWeight0"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight0); if (SpawnWeight1 == null) { throw new Exception("MimicNetworker.SpawnWeight1 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight1).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight1, "SpawnWeight1"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight1); if (SpawnWeight2 == null) { throw new Exception("MimicNetworker.SpawnWeight2 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight2).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight2, "SpawnWeight2"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight2); if (SpawnWeight3 == null) { throw new Exception("MimicNetworker.SpawnWeight3 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight3).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight3, "SpawnWeight3"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight3); if (SpawnWeight4 == null) { throw new Exception("MimicNetworker.SpawnWeight4 cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeight4).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeight4, "SpawnWeight4"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeight4); if (SpawnWeightMax == null) { throw new Exception("MimicNetworker.SpawnWeightMax cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnWeightMax).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnWeightMax, "SpawnWeightMax"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnWeightMax); if (SpawnRateDynamic == null) { throw new Exception("MimicNetworker.SpawnRateDynamic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)SpawnRateDynamic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)SpawnRateDynamic, "SpawnRateDynamic"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)SpawnRateDynamic); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_MimicNetworker() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2885019175u, new RpcReceiveHandler(__rpc_handler_2885019175)); NetworkManager.__rpc_func_table.Add(1024971481u, new RpcReceiveHandler(__rpc_handler_1024971481)); NetworkManager.__rpc_func_table.Add(1137632670u, new RpcReceiveHandler(__rpc_handler_1137632670)); NetworkManager.__rpc_func_table.Add(669208889u, new RpcReceiveHandler(__rpc_handler_669208889)); NetworkManager.__rpc_func_table.Add(3716888238u, new RpcReceiveHandler(__rpc_handler_3716888238)); NetworkManager.__rpc_func_table.Add(1897916243u, new RpcReceiveHandler(__rpc_handler_1897916243)); } private static void __rpc_handler_2885019175(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAttackClientRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1024971481(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAttackServerRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1137632670(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicAddAngerClientRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_669208889(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicAddAngerServerRpc(amount, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3716888238(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((MimicNetworker)(object)target).MimicLockPickClientRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1897916243(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int mimicIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((MimicNetworker)(object)target).MimicLockPickServerRpc(playerId, mimicIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MimicNetworker"; } } public class MimicDoor : MonoBehaviour { public GameObject playerTarget; public BoxCollider frameBox; public Sprite LostFingersIcon; public Animator mimicAnimator; public GameObject grabPoint; public InteractTrigger interactTrigger; public ScanNodeProperties scanNode; public int anger; public bool angering; public int sprayCount; private bool attacking; public static List<MimicDoor> allMimics; public int mimicIndex; private static MethodInfo RetractClaws = typeof(LockPicker).GetMethod("RetractClaws", BindingFlags.Instance | BindingFlags.NonPublic); public void TouchMimic(PlayerControllerB player) { if (!attacking) { MimicNetworker.Instance.MimicAttack((int)player.playerClientId, mimicIndex); } } public IEnumerator Attack(int playerId) { attacking = true; interactTrigger.interactable = false; PlayerControllerB player = StartOfRound.Instance.allPlayerScripts[playerId]; mimicAnimator.SetTrigger("Attack"); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); playerTarget.transform.position = ((Component)player).transform.position; yield return (object)new WaitForSeconds(0.1f); float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)frameBox).transform.position); if (num < 8f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } yield return (object)new WaitForSeconds(0.2f); if (((NetworkBehaviour)player).IsOwner && Vector3.Distance(((Component)player).transform.position, ((Component)this).transform.position) < 8.75f) { player.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)player.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f)); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = grabPoint.transform; player.deadBody.attachedLimb = player.deadBody.bodyParts[5]; player.deadBody.matchPositionExactly = true; for (int i = 0; i < player.deadBody.bodyParts.Length; i++) { ((Component)player.deadBody.bodyParts[i]).GetComponent<Collider>().excludeLayers = LayerMask.op_Implicit(-1); } } yield return (object)new WaitForSeconds(2f); if ((Object)(object)player.deadBody != (Object)null) { player.deadBody.attachedTo = null; player.deadBody.attachedLimb = null; player.deadBody.matchPositionExactly = false; ((Component)((Component)player.deadBody).transform.GetChild(0)).gameObject.SetActive(false); player.deadBody = null; } yield return (object)new WaitForSeconds(4.5f); attacking = false; interactTrigger.interactable = true; } public IEnumerator MimicLockPick(int playerId) { if (angering || attacking) { yield break; } LockPicker lockPicker = default(LockPicker); ref LockPicker reference = ref lockPicker; GrabbableObject currentlyHeldObjectServer = StartOfRound.Instance.allPlayerScripts[playerId].currentlyHeldObjectServer; reference = (LockPicker)(object)((currentlyHeldObjectServer is LockPicker) ? currentlyHeldObjectServer : null); if ((Object)(object)lockPicker == (Object)null) { yield break; } attacking = true; interactTrigger.interactable = false; AudioSource component = ((Component)lockPicker).GetComponent<AudioSource>(); component.PlayOneShot(lockPicker.placeLockPickerClips[Random.Range(0, lockPicker.placeLockPickerClips.Length)]); lockPicker.armsAnimator.SetBool("mounted", true); lockPicker.armsAnimator.SetBool("picking", true); component.Play(); component.pitch = Random.Range(0.94f, 1.06f); lockPicker.isOnDoor = true; lockPicker.isPickingLock = true; ((GrabbableObject)lockPicker).grabbable = false; if (((NetworkBehaviour)lockPicker).IsOwner) { ((GrabbableObject)lockPicker).playerHeldBy.DiscardHeldObject(true, ((NetworkBehaviour)MimicNetworker.Instance).NetworkObject, ((Component)this).transform.position + ((Component)this).transform.up * 1.5f - ((Component)this).transform.forward * 1.15f, true); } float startTime = Time.timeSinceLevelLoad; yield return (object)new WaitUntil((Func<bool>)(() => !((GrabbableObject)lockPicker).isHeld || Time.timeSinceLevelLoad - startTime > 10f)); ((Component)lockPicker).transform.localEulerAngles = new Vector3(((Component)this).transform.eulerAngles.x, ((Component)this).transform.eulerAngles.y + 90f, ((Component)this).transform.eulerAngles.z); yield return (object)new WaitForSeconds(5f); RetractClaws.Invoke(lockPicker, null); ((Component)lockPicker).transform.SetParent((Transform)null); ((GrabbableObject)lockPicker).startFallingPosition = ((Component)lockPicker).transform.position; ((GrabbableObject)lockPicker).FallToGround(false); ((GrabbableObject)lockPicker).grabbable = true; yield return (object)new WaitForSeconds(1f); anger = 3; attacking = false; interactTrigger.interactable = false; PlayerControllerB val = null; float num = 9999f; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if ((Object)(object)val != (Object)null) { MimicNetworker.Instance.MimicAttackClientRpc((int)val.playerClientId, mimicIndex); } else { interactTrigger.interactable = true; } } public IEnumerator AddAnger(int amount) { if (angering || attacking) { yield break; } angering = true; anger += amount; if (anger == 1) { Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger == 2) { interactTrigger.holdTip = "DIE : [LMB]"; interactTrigger.timeToHold = 0.25f; Sprite oldIcon2 = interactTrigger.hoverIcon; interactTrigger.hoverIcon = LostFingersIcon; mimicAnimator.SetTrigger("Growl"); yield return (object)new WaitForSeconds(2.75f); interactTrigger.hoverIcon = oldIcon2; sprayCount = 0; angering = false; yield break; } if (anger > 2) { PlayerControllerB val = null; float num = 9999f; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if ((Object)(object)val != (Object)null) { MimicNetworker.Instance.MimicAttackClientRpc((int)val.playerClientId, mimicIndex); } } sprayCount = 0; angering = false; } } public class MimicCollider : MonoBehaviour, IHittable { public MimicDoor mimic; void IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { MimicNetworker.Instance.MimicAddAnger(force, mimic.mimicIndex); } } public class MimicListener : MonoBehaviour, INoiseListener { public MimicDoor mimic; private int tolerance = 100; void INoiseListener.DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot, int noiseID) { //IL_0014: 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) if ((noiseLoudness >= 0.9f || noiseID == 101158) && Vector3.Distance(noisePosition, ((Component)mimic).transform.position) < 5f) { switch (noiseID) { case 75: tolerance--; break; case 5: tolerance -= 15; break; case 101158: tolerance -= 35; break; default: tolerance -= 30; break; } if (tolerance <= 0) { tolerance = 100; MimicNetworker.Instance.MimicAddAnger(1, mimic.mimicIndex); } } } } }
BepInEX/plugins/zatrit-MouseBind/MouseBind.dll
Decompiled 11 months agousing 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 BepInEx; using HarmonyLib; using Microsoft.CodeAnalysis; using MouseBind.Patches; 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("MouseBind")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Allows to bind voice chat on mouse buttons")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MouseBind")] [assembly: AssemblyTitle("MouseBind")] [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 MouseBind { [BepInPlugin("MouseBind", "MouseBind", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new Harmony("MouseBind").PatchAll(typeof(AllowMouseBindings)); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "MouseBind"; public const string PLUGIN_NAME = "MouseBind"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace MouseBind.Patches { [HarmonyPatch(typeof(IngamePlayerSettings), "RebindKey")] public class AllowMouseBindings { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codes) { return codes.Where(delegate(CodeInstruction code) { bool num = code.opcode == OpCodes.Ldstr && CodeInstructionExtensions.OperandIs(code, (object)"Mouse"); bool flag = CodeInstructionExtensions.Calls(code, typeof(RebindingOperation).GetMethod("WithControlsExcluding")); return !num && !flag; }); } } }